Discussion:
WPD can not work on Windows XP
(too old to reply)
Kimi
2009-08-06 05:40:01 UTC
Permalink
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
2009-10-02 12:14:59 UTC
Permalink
Hy. I have exactly the same problem, did you find any solutions? Can
anybody help with this plese? I am getting frustrated :(
pcbbc
2011-02-15 10:47:48 UTC
Permalink
Kimi wrote on 08/06/2009 01:40 ET
Post by Kimi
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 th
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 th
cell phone
Do anyone know what is the problem
Thinking&Codin
Microsoft claim that WPD and MTP are supported on XP with WMP11 installed, an
indeed this is the case

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

* C:WindowsSystem32ptpusb.dl
* C:WindowsSystem32ptpusd.dl

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

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

However the detail there seem somewhat incomplete, and there is furthe
information to be had about the sections required in the comments o
C:WindowsInfWpdMtp.inf installed with Windows Media Player 11


;;*****************************************************************************
;; The following are to be used in vendor specific "Includes" an
"Needs" sections
;; Specifically, the INF should contain
;
;; [DDInstall
;; Include = wpdmtp.in
;; Needs = WPD.MT
;
;; [DDInstall.hw
;; Include = wpdmtp.in
;; Needs = WPD.MTP.Registration <- includes all default legacy AP
and autoplay registration for the devic
;; - OR
;; Needs = WPD.MTP.RegistrationBasic <- only do minimum registration, n
legacy API or autopla
;
;; [DDInstall.Services
;; Include = wpdmtp.in
;; Needs = WPD.MTP.Service
;
;; [DDInstall.CoInstallers
;; Include = wpdmtp.in
;; Needs = WPD.MTP.CoInstaller
;
;; [DDInstall.Wdf
;; Include = wpdmtp.in
;; Needs = WPD.MTP.Wd
;; UmdfServiceOrder=WpdMtpDrive
;

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

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

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

[Manufacturer
%MfgName%=Niko

[Nikon
%Nikon.DeviceDesc%=Nikon_MTP, USBVID_04B0&PID_042

[Nikon_MTP
Include = wpdmtp.in
Needs = WPD.MT

[Nikon_MTP.hw
Include = wpdmtp.in
Needs = WPD.MTP.RegistrationBasi

[Nikon_MTP.Services
Include = wpdmtp.in
Needs = WPD.MTP.Service

[Nikon_MTP.CoInstallers
Include = wpdmtp.in
Needs = WPD.MTP.CoInstaller

[Nikon_MTP.Wdf
Include = wpdmtp.in
Needs = WPD.MTP.Wd
UmdfServiceOrder=WpdMtpDrive

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

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

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

* In Windows Device Manager right click the camera device and "Updat
Driver"
* Select "No, not this time" when Windows asks to search Window
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.
Loading...