Unable to start UMDF driver for USB device [Solved]
-
I'm exploring the UMDF framework as I try to develop a UMDF driver for a USB device. I've used the UMDF sample "usb/fx2_driver" final step as starting point, comparing various steps in the sample and removed things specific to the fx2 device that I don't need, such as the read/write queue functionality and 7-segment handling. My driver is supposed to use the control endpoint only so the user application will use
::DeviceIoControl
calls for communicating with the driver, thus no::ReadFile
or::WriteFile
calls will be made. I've managed to set up the debugging environment in a way that I'm able to break into the driver when it loads using WinDbg and attach to the WudfHost process. My problem is that my driver fails to start, error code 10. When I try to debug it everything according to my knowledge (which is limited in this area...) looks fine until I hit a breakpoint inCMyDevice::OnReleaseHardware
. The call stack prior to my code looks like this:007ffd98 1a9208c6 WUDFx!WdfPnpHardwareCallback::ReleaseHardware+0x26
007ffda0 1a91e887 WUDFx!CWudfPnp::PnpEventFailedOwnHardware+0x10
007ffdbc 1a91ed8a WUDFx!CWudfPnp::PnpEnterNewState+0x8e
007ffde8 1a91ee7a WUDFx!CWudfPnp::ProcessEvent+0x2a2
007ffdfc 1a90d65b WUDFx!CWudfPnp::OnStartComplete+0x27
007ffe18 1a90d790 WUDFx!CWdfDevice::ProcessPnPCompletion+0x3cI haven't got a clue why
PnpEventFailedOwnHardware
is called. Most likely I've failed to do something that I was supposed to, but what steps should I take in order to figure out what? I don't know whether this is relevant or not but!umirps
tells me that I have one pending IRP at 0x9f008 and!umirp 0x9f008
gives me this:Error in reading UM IRP at 0x0009f008
UM IRP: 0x0009f008 UniqueId: 0x0 Kernel Irp: 0x0x89b9b698
Type: ÿÿ
ClientProcessId: 0x0
Device Stack: 0x000930c8
IoStatus
hrStatus: 0xd0000001
Information: 0x0
Total number of stack locations: 2
CurrentStackLocation: StackLocation[ 1 ]
StackLocation[ 0 ]
DISCARDEDStackLocation[ 1 ]
Completion:
Callback: 0x00000000
Context: 0x00000000I haven't found any information on the net that I've found to be helpful in overcoming this problem. The documentation for UMDF is rather limited, to say the least... Thoughts and/or ideas anyone? At this point I'll run for every ball tossed in my direction....
-
I'm exploring the UMDF framework as I try to develop a UMDF driver for a USB device. I've used the UMDF sample "usb/fx2_driver" final step as starting point, comparing various steps in the sample and removed things specific to the fx2 device that I don't need, such as the read/write queue functionality and 7-segment handling. My driver is supposed to use the control endpoint only so the user application will use
::DeviceIoControl
calls for communicating with the driver, thus no::ReadFile
or::WriteFile
calls will be made. I've managed to set up the debugging environment in a way that I'm able to break into the driver when it loads using WinDbg and attach to the WudfHost process. My problem is that my driver fails to start, error code 10. When I try to debug it everything according to my knowledge (which is limited in this area...) looks fine until I hit a breakpoint inCMyDevice::OnReleaseHardware
. The call stack prior to my code looks like this:007ffd98 1a9208c6 WUDFx!WdfPnpHardwareCallback::ReleaseHardware+0x26
007ffda0 1a91e887 WUDFx!CWudfPnp::PnpEventFailedOwnHardware+0x10
007ffdbc 1a91ed8a WUDFx!CWudfPnp::PnpEnterNewState+0x8e
007ffde8 1a91ee7a WUDFx!CWudfPnp::ProcessEvent+0x2a2
007ffdfc 1a90d65b WUDFx!CWudfPnp::OnStartComplete+0x27
007ffe18 1a90d790 WUDFx!CWdfDevice::ProcessPnPCompletion+0x3cI haven't got a clue why
PnpEventFailedOwnHardware
is called. Most likely I've failed to do something that I was supposed to, but what steps should I take in order to figure out what? I don't know whether this is relevant or not but!umirps
tells me that I have one pending IRP at 0x9f008 and!umirp 0x9f008
gives me this:Error in reading UM IRP at 0x0009f008
UM IRP: 0x0009f008 UniqueId: 0x0 Kernel Irp: 0x0x89b9b698
Type: ÿÿ
ClientProcessId: 0x0
Device Stack: 0x000930c8
IoStatus
hrStatus: 0xd0000001
Information: 0x0
Total number of stack locations: 2
CurrentStackLocation: StackLocation[ 1 ]
StackLocation[ 0 ]
DISCARDEDStackLocation[ 1 ]
Completion:
Callback: 0x00000000
Context: 0x00000000I haven't found any information on the net that I've found to be helpful in overcoming this problem. The documentation for UMDF is rather limited, to say the least... Thoughts and/or ideas anyone? At this point I'll run for every ball tossed in my direction....
Due to my lack of experience from WinDbg, I didn't realize that
CMyDevice::OnPrepareHardware
returned an error. I used the mouse to hover above the localHRESULT
variable and I was told that the value was 0x00. When I checked the register (EDI) that is used for the return value I found it to be something else (0xd0000001). After I corrected this the driver starts up nicely."It's supposed to be hard, otherwise anybody could do it!" - selfquote
"High speed never compensates for wrong direction!" - unknown -
I'm exploring the UMDF framework as I try to develop a UMDF driver for a USB device. I've used the UMDF sample "usb/fx2_driver" final step as starting point, comparing various steps in the sample and removed things specific to the fx2 device that I don't need, such as the read/write queue functionality and 7-segment handling. My driver is supposed to use the control endpoint only so the user application will use
::DeviceIoControl
calls for communicating with the driver, thus no::ReadFile
or::WriteFile
calls will be made. I've managed to set up the debugging environment in a way that I'm able to break into the driver when it loads using WinDbg and attach to the WudfHost process. My problem is that my driver fails to start, error code 10. When I try to debug it everything according to my knowledge (which is limited in this area...) looks fine until I hit a breakpoint inCMyDevice::OnReleaseHardware
. The call stack prior to my code looks like this:007ffd98 1a9208c6 WUDFx!WdfPnpHardwareCallback::ReleaseHardware+0x26
007ffda0 1a91e887 WUDFx!CWudfPnp::PnpEventFailedOwnHardware+0x10
007ffdbc 1a91ed8a WUDFx!CWudfPnp::PnpEnterNewState+0x8e
007ffde8 1a91ee7a WUDFx!CWudfPnp::ProcessEvent+0x2a2
007ffdfc 1a90d65b WUDFx!CWudfPnp::OnStartComplete+0x27
007ffe18 1a90d790 WUDFx!CWdfDevice::ProcessPnPCompletion+0x3cI haven't got a clue why
PnpEventFailedOwnHardware
is called. Most likely I've failed to do something that I was supposed to, but what steps should I take in order to figure out what? I don't know whether this is relevant or not but!umirps
tells me that I have one pending IRP at 0x9f008 and!umirp 0x9f008
gives me this:Error in reading UM IRP at 0x0009f008
UM IRP: 0x0009f008 UniqueId: 0x0 Kernel Irp: 0x0x89b9b698
Type: ÿÿ
ClientProcessId: 0x0
Device Stack: 0x000930c8
IoStatus
hrStatus: 0xd0000001
Information: 0x0
Total number of stack locations: 2
CurrentStackLocation: StackLocation[ 1 ]
StackLocation[ 0 ]
DISCARDEDStackLocation[ 1 ]
Completion:
Callback: 0x00000000
Context: 0x00000000I haven't found any information on the net that I've found to be helpful in overcoming this problem. The documentation for UMDF is rather limited, to say the least... Thoughts and/or ideas anyone? At this point I'll run for every ball tossed in my direction....
Thanks for taking the time to modify your post to "resolved" AND posting the solution. If only everyone did that :)
Cheers, Sebastian -- "If it was two men, the non-driver would have challenged the driver to simply crash through the gates. The macho image thing, you know." - Marc Clifton
-
Thanks for taking the time to modify your post to "resolved" AND posting the solution. If only everyone did that :)
Cheers, Sebastian -- "If it was two men, the non-driver would have challenged the driver to simply crash through the gates. The macho image thing, you know." - Marc Clifton
Well, thank you for noticing! ;) As this is a searchable forum, this is how I think it should be done. Otherwise there wouldn't be any benefit for others. Just following my own guidelines... :-\
"It's supposed to be hard, otherwise anybody could do it!" - selfquote
"High speed never compensates for wrong direction!" - unknown