替代WPD / WIA在Windows XP? [英] Alternatives to WPD/WIA on Windows XP?

查看:573
本文介绍了替代WPD / WIA在Windows XP?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

WPD 不能在Windows XP中正常工作(SP1如果事项),即使微软指出它确实

WPD does not work correctly on Windows XP (SP1 if that matters), even if Microsoft states it does.

的问题与WPD:

IPortableDeviceManager .GetDevices 电话不会找到Win XP的任何设备,同时发现在Windows 7上连接的所有摄像头。

IPortableDeviceManager.GetDevices call does not find any devices on Win XP while it finds all connected cameras on Windows 7.

其他几个人有同样的不工作的XP WPD问题,无解:
1
2

A few other people had this same problem with WPD not working on XP, no solution: 1 2

我已经决定使用WIA重新实现的功能。

问题的WIA自动化/ WIA接口:

Problem with WIA automation/WIA interfaces:


  • WIA自动化用相机进行交互时,只提供愚蠢的对话 - 我需要从代码,而做到这一点

  • WIA接口编程是建议实现与WIA较低水平的任务。我没有发现任何样本如何使用WIA接口从C#(也发现了一些迹象表明这是不可能的全部或至少的很难做到

  • WIA automation offers only silly dialogs when interacting with the camera - I need to rather do this from code
  • Programming against WIA interfaces is recommended to achieve lower level tasks with WIA. I have not found any samples how to use WIA interfaces from C# (also found some indication that this is not possible at all or at least very hard to do)

因此,我已经看过WIA 2.0(约wiaaut.dll包装):


  • 我收到HRESULT 0x80210006(WIA_ERROR_BUSY)为在第一时间,然后HRESULT E_FAIL所有在Win XP,而在Windows 7中相同的代码工作没有问题的时间。

我失控的选择这里... 您能推荐替代提供下列功能用于连接到Windows XP上的工作电脑摄像头?

I am getting out of options here... Can you recommend an alternative to provide the following features for cameras connected to the computer that works on Windows XP?


  • 发送一个拍摄照片的通知

  • 允许从相机中下载最新拍摄的照片

推荐答案

微软声称WPD和MTP支持XP上安装WMP11和类这确实是如此!

Microsoft claim that WPD and MTP are supported on XP with WMP11 installed, and indeed this is the case!

不过默认情况下,XP的相机设备将最有可能加载PTP驱动程序堆栈来代替。

However by default on XP a camera device will most likely load the PTP driver stack instead. You can check this by looking at the Driver Details page from Device Manager, Properties, Driver tab, where you should see:


  • C::您可以通过从设备管理器,属性,驱动程序选项卡,在驱动程序详细信息页面,在这里你会看到检查该\\ \\Windows\System32\ptpusb.dll

  • C:\Windows\System32\ptpusd.dll

也就是说,除非你的相机厂商都若有所思提供定制WPD兼容的INF文件为您的设备上的XP。大多数都没有,可能是由于的依赖WMP10 / 11。

That is, unless your camera vendor has thoughtfully supplied a custom WPD compatible INF file for your device on XP. Most haven't, probably due to the reliance on WMP10/11.

然而,它是相对容易地创建自己的自定义INF,使中期计划,并为此细节媒体传输协议的移植工具包在给定的根据第提供自定义INF文件MTP设备的mtpdev.chm帮助文件。

However it is relatively easy to create your own custom INF to enable MTP, and details for this are given in the Microsoft Media Transfer Protocol Porting Kit in the mtpdev.chm help file under section "Providing a Custom INF File for an MTP Device".

但细节有似乎有点不完整的,有进一步的消息是有关于C的意见所需的部分:

However the detail there seem somewhat incomplete, and there is further information to be had about the sections required in the comments of C:\Windows\Inf\WpdMtp.inf installed with Windows Media Player 11:

;;******************************************************************************
;; The following are to be used in vendor specific "Includes" and "Needs" sections.
;; Specifically, the INF should contain:
;;
;; [DDInstall]
;; Include = wpdmtp.inf
;; Needs   = WPD.MTP
;;
;; [DDInstall.hw]
;; Include = wpdmtp.inf
;; Needs   = WPD.MTP.Registration       <- includes all default legacy API and autoplay registration for the device
;;  - OR - 
;; Needs   = WPD.MTP.RegistrationBasic  <- only do minimum registration, no legacy API or autoplay
;;
;; [DDInstall.Services]
;; Include = wpdmtp.inf
;; Needs   = WPD.MTP.Services
;;
;; [DDInstall.CoInstallers]
;; Include = wpdmtp.inf
;; Needs = WPD.MTP.CoInstallers
;;
;; [DDInstall.Wdf]
;; Include = wpdmtp.inf
;; Needs = WPD.MTP.Wdf
;; UmdfServiceOrder=WpdMtpDriver
;;
;;******************************************************************************

例如,对于尼康D90,可以创建以下INF文件:

For example, for a Nikon D90, the following INF file can be created:

[Version]
Signature="$WINDOWS NT$"
Class=WPD
ClassGUID={EEC5AD98-8080-425f-922A-DABF3DE3F69A}
Provider=%Provider%
DriverVer=02/22/2006,5.2.5326.4762

[Manufacturer]
%MfgName%=Nikon

[Nikon]
%Nikon.DeviceDesc%=Nikon_MTP, USB\VID_04B0&PID_0421

[Nikon_MTP]
Include = wpdmtp.inf
Needs   = WPD.MTP

[Nikon_MTP.hw]
Include = wpdmtp.inf
Needs   = WPD.MTP.RegistrationBasic

[Nikon_MTP.Services]
Include = wpdmtp.inf
Needs   = WPD.MTP.Services

[Nikon_MTP.CoInstallers]
Include = wpdmtp.inf
Needs   = WPD.MTP.CoInstallers

[Nikon_MTP.Wdf]
Include = wpdmtp.inf
Needs   = WPD.MTP.Wdf
UmdfServiceOrder=WpdMtpDriver

[Strings]
Nikon.DeviceDesc       = "Nikon D90 MTP Device"
MfgName                 = "Nikon"
Provider                = "Nikon"

要支持不同的设备更改或添加其他项目,在[尼康]部分为您的设备的正确PID和VID。您可以从下拉菜单中选择Hadrware IDS找到这些详细信息选项卡上的设备管理器。你可能也想改变所有引用到尼康如果你的相机是从不同的制造商。

To support different devices change, or add additional items, under the [Nikon] section with the correct PID and VID for your device. You can find these in Device Manager on the Details tab by selecting "Hadrware Ids" from the drop down. You'll probably also want to change all the references to "Nikon" if your camera is from a different manufacturer.

一旦你创建在记事本中的INF文件,保存下一个合适的名称,例如NikonD90.INF。然后:

Once you have created your INF file in notepad, save under an appropriate name, for example NikonD90.INF. Then:


  • 在Windows设备管理器中右键单击摄像装置和更新驱动程序

  • 选择否,暂时不,当Windows询问要搜索的Windows Update。

  • 选择从列表或指定位置安装(高级)。

  • 选择不要搜索,我要自己选择驱动器安装。

  • 单击从磁盘安装。

  • 单击浏览器并导航到保存上面创建的INF文件的文件夹。

  • 选择INF文件,它应该安装MTP驱动程序。

  • In Windows Device Manager right click the camera device and "Update Driver".
  • Select "No, not this time" when Windows asks to search Windows Update.
  • Select "Install from a list or specific location (Advanced)".
  • Select "Don't search, I will choose the drive to install".
  • Click "Have Disk".
  • Click "Browser" and navigate to the folder where you saved the INF file created above.
  • Select the INF file and it should install the MTP drivers.

现在在设备管理器,你应该看到,摄像头装置已经从影像设备感动,现在将在便携设备,而不是显示。同样在驱动程序的细节,你应该看到下面的文件表明正在使用的通用WPD MTP类驱动程序(而不是PTP以前):

Now in Device manager you should see that the camera device has moved from "Imaging Devices" and is now displayed under "Portable Devices" instead. Also on the driver details you should see the following files indicating that the generic WPD MTP class drivers are being used (instead of PTP previously):


  • C:\Windows\System32\wpdusb.dll

  • C:\Windows\System32\wudfrd.dll

您现在应该能够使用IPortableDeviceManager.GetDevices成功枚举您的MTP装置和使用所有其他API函数来发送自定义MTP命令。通过dimeby8 了解详细信息,请参见 MSDN的帖子。

You should now be able to successfully enumerate your MTP device using IPortableDeviceManager.GetDevices and use all of the other API functions to send custom MTP commands. See the MSDN posts by dimeby8 for details.

上述解决方案,允许您构建一个通用的API,在Windows XP中通过Windows 7在32位或64位,没有更改代码运行的应用程序。

The above solution allows you to build applications with a common API that work on Windows XP through Windows 7 in either 32 or 64 bit with no code changes.

这篇关于替代WPD / WIA在Windows XP?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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