questions about wpdusb.sys in vista

Dear Sir,
I am developing an applicatiion communicating with some portable devices through wpdusb.sys driver. My application is based on a sample called mtphost(or mtplib) in Mtppk12(Media transport protocol porting kit 12). And I met some questions now.
1.The same application work well in windows xp, but doesn’t work in vista. Why? Does the mothods, used to communicate with wpdusb.sys betwean vista and xp, differ? What differences?(It is my first time to develop an application communicate with drivers in vista.)
2. Does the mothods, used to communicate with drivers betwean vista and xp, differ? What differences?
3. It is a more detailed question. In my application of vista, createfile failed.(But it succeed in xp.) I think the reason is invalid filename. so I try some other filenames, found in regedit, such as AUTO and symbolic link. And then createfile succeeded. However, anohter problem exists. When I send a ioctl command to the driver using DeviceIoControl, the returned value promt me failure, with error codes such as “invalid parameters”(in the case of filename “AUTO”) and “the device doesn’t work”(in the case of symbolic link).Why?
4.The version of wpdusb.sys between vista and xp is different. Except some mtp extension, what differences betwean them?

Thank you for your reading and answering.

I asked the WPD devs about your problem and here is what they said


The simple answer is that programming directly to wpdusb.sys is inadvisable at best. I was written to be used as the WPD MTP USB transport driver in our own driver. Even if they get it (whatever “it” is) working between Vista and XP, it can cease to work in the future because wpdusb.sys will probably not be there in a future OS rlease. If they are talking to devices that cause wpdusb.sys to be loaded, they should be using WPD.

Hth
d

-----Original Message-----
From: xxxxx@lists.osr.com [mailto:xxxxx@lists.osr.com] On Behalf Of xxxxx@gmail.com
Sent: Thursday, May 08, 2008 2:11 PM
To: Windows System Software Devs Interest List
Subject: [ntdev] questions about wpdusb.sys in vista

Dear Sir,
I am developing an applicatiion communicating with some portable devices through wpdusb.sys driver. My application is based on a sample called mtphost(or mtplib) in Mtppk12(Media transport protocol porting kit 12). And I met some questions now.
1.The same application work well in windows xp, but doesn’t work in vista. Why? Does the mothods, used to communicate with wpdusb.sys betwean vista and xp, differ? What differences?(It is my first time to develop an application communicate with drivers in vista.)
2. Does the mothods, used to communicate with drivers betwean vista and xp, differ? What differences?
3. It is a more detailed question. In my application of vista, createfile failed.(But it succeed in xp.) I think the reason is invalid filename. so I try some other filenames, found in regedit, such as AUTO and symbolic link. And then createfile succeeded. However, anohter problem exists. When I send a ioctl command to the driver using DeviceIoControl, the returned value promt me failure, with error codes such as “invalid parameters”(in the case of filename “AUTO”) and “the device doesn’t work”(in the case of symbolic link).Why?
4.The version of wpdusb.sys between vista and xp is different. Except some mtp extension, what differences betwean them?

Thank you for your reading and answering.


NTDEV is sponsored by OSR

For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars

To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer

Thank Doron Holan very much.

>If they are talking to devices that cause wpdusb.sys to be
>loaded, they should be using WPD.
I agree with this opinion.
A week ago, I tried WPD in Vista and it works. But I met two problems here.
1.Developing environment.
WPD is included in vista sdk and its sample is based on visual studio 2005. But I have to develop my project in visual studio 2003. So I have to use WPD in vs2003 and met various problems, because it is said by vista sdk that “This release of the Windows SDK supports the RTM release of Microsoft ? Visual Studio ?2005”.(Maybe Wpd doesn’t work in visual studio 2003, I think.)
How can I solve it?
(I am glad to use WPD, because it is so convenient. )

2.If I cannot solve the first problem, I have to write my application to communicate with wpdusb.sys driver, not using WPD. And then, the sample called mtphost with mtplib in MTPPK12 are the best referrence. But this sample only works in windows xp, but doesn’t work in vista. I wanna to solve it, but have no idea now. Can you give me some hint?

Thank you for your reading and answering.

  1. I think you can get vs2003 to use the WPD headers, it should not be too hard. If not, VS Express C++ 2005 (and I think 2008 this past week) is free.

  2. like was mentioned earlier, this is not the right approach. Wpdusb’s interface is not public and is subject to change and removal. Fix #1.

d

-----Original Message-----
From: xxxxx@lists.osr.com [mailto:xxxxx@lists.osr.com] On Behalf Of xxxxx@gmail.com
Sent: Thursday, May 08, 2008 7:49 PM
To: Windows System Software Devs Interest List
Subject: RE:[ntdev] questions about wpdusb.sys in vista

Thank Doron Holan very much.

>If they are talking to devices that cause wpdusb.sys to be
>loaded, they should be using WPD.
I agree with this opinion.
A week ago, I tried WPD in Vista and it works. But I met two problems here.
1.Developing environment.
WPD is included in vista sdk and its sample is based on visual studio 2005. But I have to develop my project in visual studio 2003. So I have to use WPD in vs2003 and met various problems, because it is said by vista sdk that “This release of the Windows SDK supports the RTM release of Microsoft ? Visual Studio ?2005”.(Maybe Wpd doesn’t work in visual studio 2003, I think.)
How can I solve it?
(I am glad to use WPD, because it is so convenient. )

2.If I cannot solve the first problem, I have to write my application to communicate with wpdusb.sys driver, not using WPD. And then, the sample called mtphost with mtplib in MTPPK12 are the best referrence. But this sample only works in windows xp, but doesn’t work in vista. I wanna to solve it, but have no idea now. Can you give me some hint?

Thank you for your reading and answering.


NTDEV is sponsored by OSR

For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars

To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer