Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

WPD can not work on Windows XP

76 views
Skip to first unread message

Kimi

unread,
Aug 6, 2009, 1:40:01 AM8/6/09
to
I am writing the codes using WPD to detect my cell phone.
On Vista and Windows 7, it's OK.
But when I using it under Windows XP, the WPD can not find any device.
I try installing the WMP 11 Player and WMP11 Format SDK runtime, but the
problem is still there.
However, the WMP 11 Player can detect my cell phone.
I also try the Wdpapi sample in the Windows SDK. it also can not find the
cell phone.

Do anyone know what is the problem?

--
Thinking&Coding

aceman

unread,
Oct 2, 2009, 8:14:59 AM10/2/09
to
Hy. I have exactly the same problem, did you find any solutions? Can
anybody help with this plese? I am getting frustrated :(

pcbbc

unread,
Feb 15, 2011, 5:47:48 AM2/15/11
to
> Thinking&Coding
>
Microsoft claim that WPD and MTP are supported on XP with WMP11 installed, and
indeed this is the case!

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:WindowsSystem32ptpusb.dll
* C:WindowsSystem32ptpusd.dll

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.

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

However the detail there seem somewhat incomplete, and there is further
information to be had about the sections required in the comments of
C:WindowsInfWpdMtp.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
;;

;;******************************************************************************

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, USBVID_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"

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.

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

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

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:WindowsSystem32wpdusb.dll
* C:WindowsSystem32wudfrd.dll

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.

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.

0 new messages