Do anyone know what is the problem?
--
Thinking&Coding
;;******************************************************************************
;; 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.