通过WPD访问MTP供应商扩展属性 [英] Accessing MTP vendor extended properties through WPD

查看:154
本文介绍了通过WPD访问MTP供应商扩展属性的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用Windows便携式设备API访问某些MTP设备.我想从设备读取供应商扩展的属性,它看起来应该像这样:

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"或"microsoft.com/MTPZ"

"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.

推荐答案

不需编写代码,简单的答案是扫描给定FormatID的一系列PID,以查看其中包含哪些类型的数据.这是一个调试练习,仅用于发现目的.我基本上只是编写一个循环:例如,如果我想扫描基本扩展属性下的前16个PID,则可以使用WPD_PROPERTIES_MTP_VENDOR_EXTENDED_DEVICE_PROPS作为FormatID,然后对于PID在每次迭代中更改它,并扫描值0xD101 0xD10F.通常,您可以从输出中得知该PID位置中可能包含什么.

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.

一旦知道所需数据的PID,就可以将其作为枚举例程的一部分写入代码中.

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.

这篇关于通过WPD访问MTP供应商扩展属性的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆