Accessing MTP vendor extended properties through WPD
Asked Answered
M

1

0

I am using Windows Portable Device API to access some MTP devices. I want to read the vendor extended properties from the device, it should look something like this:

"microsoft.com/WPDNA" or "microsoft.com/MTPZ"

It seems like this should be a quite simple task but I cannot figure it out.

I have been able to enumerate objects on a device and transfer files and so on, this was included in the WpdApiSample Application.

I also found this article that I think is what I want to do. But I don't understand how to create those queries.

Moyer answered 10/3, 2016 at 13:14 Comment(0)
W
0

Without getting into code, the short answer is to scan a range of PIDs for a given FormatID to see what kinds of data are in there. This is a debugging exercise, just for discovery purposes. I basically just write a loop: for example if I want to scan for the first 16 PIDs under the basic extended properties you'd use the WPD_PROPERTIES_MTP_VENDOR_EXTENDED_DEVICE_PROPS as FormatID and then for PID change it on each iteration and scan values 0xD101 through 0xD10F. You can usually tell from the output what may be contained in that PID location.

Once you know the PIDs for the pieces of data you want, you can write that into your code as part of your enumeration routine.

Watchtower answered 21/4, 2016 at 22:7 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.