Accessing MTP vendor extended properties through WPD

做~自己de王妃 提交于 2019-12-12 01:15:10

问题


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.


回答1:


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.



来源:https://stackoverflow.com/questions/35917595/accessing-mtp-vendor-extended-properties-through-wpd

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!