We are writing a NDIS - USB driver (for NDIS 5.1) for windows XP using
KMDF architecture. we are facing the problem at
"WdfUsbTargetDeviceCreate" function as it is returning error code
0xC0000001 (STATUS_UNSUCCESSFUL). I have gone through this newsgroup
and got info how to get logs of kmdf driver when there is an error (as
mentioned by Eliyas. Thanks to Eliyas for his valuable information).
>From that, we tried to get log information at the time of
WdfUsbTargetDeviceCreate failure. The following is the log information
we got from WinDBG.
Trace searchpath is:
Trace format prefix is: %7!u!: %!FUNC! -
TMF file used for formatting IFR log is: C:\WinDDK\6000\tools\tracing
\i386\wdf01005.tmf
Log at 89119000
Gather log: Please wait, this may take a moment (reading 4032 bytes).
% read so far ... 100
There are 2 log entries
--- start of log ---
1: FxUsbDevice::InitDevice - Query Interface for bus returned error,
0xc0000120(STATUS_CANCELLED)
1: FxUsbDevice::InitDevice - Query Interface for bus returned error,
0xc0000120(STATUS_CANCELLED)
---- end of log ----
The NIC_INTERFACE_TYPE that are tried in NdisMSetAttributesEx() are
NdisInterfacePNPBus / NdisInterfaceUSB. But i dont think this is
causing the problem.
I feel that the WDFDEVICE argument in the function
WdfUsbTargetDeviceCreate may be an issue, but i am not sure.
Can anyone please suggest me some solution to this problem.
Thanks & Regards
Sudheer
-Eliyas
"sudheer" <sudheer...@gmail.com> wrote in message
news:1190183380.6...@v29g2000prd.googlegroups.com...
Thanks for your reply
Now, we have tried just compiling the USBSAMP sample code that comes
with microsoft's WDK 6000 and loaded the same when the usb device is
connected (by changing the VID and PID in the inf file).
The same error is coming at WdfUsbTargetDeviceCreate function. The
following is the log:
Trace searchpath is:
Trace format prefix is: %7!u!: %!FUNC! -
TMF file used for formatting IFR log is: C:\WinDDK\6000\tools\tracing
\i386\wdf01005.tmf
Log at 86532000
Gather log: Please wait, this may take a moment (reading 4032 bytes).
% read so far ... 10, 20, 30, 40, 100
There are 54 log entries
--- start of log ---
1: FxPoolInitialize - Initializing Pool 0x896207D0, Tracking 1
2: FxDriver::AddDevice - Enter AddDevice PDO 894253F8
3: FxPkgIo::FxPkgIo - Constructed FxPkgIo 0x867BFBA8
4: FxVerifierLock::InitializeLockOrder - Object Type 0x1036 does not
have a lock order defined in fx\inc\FxVerifierLock.hpp
5: FxVerifierLock::InitializeLockOrder - Object Type 0x1036 does not
have a lock order defined in fx\inc\FxVerifierLock.hpp
6: FxPkgPnp::AddChildList - Adding FxChildList 89433AC8, WDFCHILDLIST
76BCC530
7: FxIoQueue::Initialize - EvtIoDefault 0x00000000, EvtIoRead
0x00000000, EvtIoWrite 0x00000000, EvtIoDeviceControl 0x00000000 for
WDFQUEUE 0x76B971E8
8: FxPkgPnp::PnpEnterNewState - WDFDEVICE 0x79AA1D40 !devobj
0x894C2C90 entering PnP State WdfDevStatePnpInit from
WdfDevStatePnpObjectCreated
9: FxIoQueue::Initialize - EvtIoDefault 0x00000000, EvtIoRead
0xF7844FF0, EvtIoWrite 0xF7844FF0, EvtIoDeviceControl 0xF7844E70 for
WDFQUEUE 0x79AA2FB0
10: imp_WdfIoQueueCreate - Created WDFQUEUE 0x79AA2FB0
11: FxDriver::AddDevice - Exit, status STATUS_SUCCESS
12: FxPkgPnp::Dispatch - WDFDEVICE 0x79AA1D40 !devobj 0x894C2C90,
IRP_MJ_PNP, !0x18! IRP 0x8A1580E8
13: FxPkgPnp::Dispatch - WDFDEVICE 0x79AA1D40 !devobj 0x894C2C90,
IRP_MJ_PNP, 0x0000000b(IRP_MN_QUERY_RESOURCE_REQUIREMENTS) IRP
0x8A1580E8
14: FxPkgPnp::Dispatch - WDFDEVICE 0x79AA1D40 !devobj 0x894C2C90,
IRP_MJ_PNP, 0x0000000d(IRP_MN_FILTER_RESOURCE_REQUIREMENTS) IRP
0x8A1580E8
15: FxPkgFdo::PnpFilterResourceRequirements - Entering
FilterResourceRequirements handler
16: FxPkgFdo::PnpFilterResourceRequirements - Exiting
FilterResourceRequirements handler, 0xc00000bb(STATUS_NOT_SUPPORTED)
17: FxPkgPnp::Dispatch - WDFDEVICE 0x79AA1D40 !devobj 0x894C2C90,
IRP_MJ_PNP, 0x00000000(IRP_MN_START_DEVICE) IRP 0x8A1580E8
18: FxPkgPnp::PnpEnterNewState - WDFDEVICE 0x79AA1D40 !devobj
0x894C2C90 entering PnP State WdfDevStatePnpInitStarting from
WdfDevStatePnpInit
19: FxWmiIrpHandler::Dispatch - WDFDEVICE 0x79AA1D40 !devobj
0x894C2C90 IRP_MJ_SYSTEM_CONTROL, 0x0000000b(IRP_MN_REGINFO_EX) IRP
0x865D3BB8
20: FxPkgPnp::PnpEnterNewState - WDFDEVICE 0x79AA1D40 !devobj
0x894C2C90 entering PnP State WdfDevStatePnpHardwareAvailable from
WdfDevStatePnpInitStarting
21: FxPkgPnp::PnpMatchResources - Entering PnpMatchResources
22: FxPkgPnp::PnpMatchResources - Exiting PnpMatchResources
STATUS_SUCCESS
23: FxIoTarget::SubmitSync - WDFIOTARGET 799D3410, WDFREQUEST F78EEAB0
24: FxIoTarget::SubmitSync - action 0x11
25: FxIoTarget::SubmitSync - Sending WDFREQUEST F78EEAB0, Irp 89488008
26: FxIoTarget::RequestCompletionRoutine - WDFREQUEST F78EEAB0
27: FxIoTarget::RemoveCompletedRequestLocked - WDFIOTARGET 799D3410,
WDFREQUEST F78EEAB0
28: FxIoTarget::RequestCompletionRoutine - WDFREQUEST F78EEAB0
completed in completion routine
29: FxIoTarget::SubmitSync - WDFIOTARGET 799D3410, WDFREQUEST F78EEAB0
30: FxIoTarget::SubmitSync - action 0x11
31: FxIoTarget::SubmitSync - Sending WDFREQUEST F78EEAB0, Irp 89488008
32: FxIoTarget::RequestCompletionRoutine - WDFREQUEST F78EEAB0
33: FxIoTarget::RemoveCompletedRequestLocked - WDFIOTARGET 799D3410,
WDFREQUEST F78EEAB0
34: FxIoTarget::RequestCompletionRoutine - WDFREQUEST F78EEAB0
completed in completion routine
35: FxIoTarget::SubmitSync - WDFIOTARGET 799D3410, WDFREQUEST F78EEAB0
36: FxIoTarget::SubmitSync - action 0x11
37: FxIoTarget::SubmitSync - Sending WDFREQUEST F78EEAB0, Irp 89488008
38: FxIoTarget::RequestCompletionRoutine - WDFREQUEST F78EEAB0
39: FxIoTarget::RemoveCompletedRequestLocked - WDFIOTARGET 799D3410,
WDFREQUEST F78EEAB0
40: FxIoTarget::RequestCompletionRoutine - WDFREQUEST F78EEAB0
completed in completion routine
41: FxIoTarget::SubmitSync - WDFIOTARGET 799D3410, WDFREQUEST F78EEAB0
42: FxIoTarget::SubmitSync - action 0x11
43: FxIoTarget::SubmitSync - Sending WDFREQUEST F78EEAB0, Irp 89488008
44: FxRequestBase::Cancel - Request F78EEAB0
45: FxRequestBase::Cancel - Request F78EEAB0, PIRP 89488008, cancel
result 1
46: FxIoTarget::RequestCompletionRoutine - WDFREQUEST F78EEAB0
47: FxIoTarget::RemoveCompletedRequestLocked - WDFIOTARGET 799D3410,
WDFREQUEST F78EEAB0
48: FxIoTarget::RequestCompletionRoutine - WDFREQUEST F78EEAB0
completed in completion routine
49: FxIoTarget::SubmitSync - WDFIOTARGET 799D3410, WDFREQUEST F78EEAB0
50: FxIoTarget::SubmitSync - action 0x0
51: FxIoTarget::SubmitSync - WDFIOTARGET 799D3410, WDFREQUEST F78EEAB0
52: FxIoTarget::SubmitSync - action 0x0
53: FxUsbDevice::InitDevice - Query Interface for bus returned error,
0xc0000120(STATUS_CANCELLED)
54: FxSyncRequest::SelfDestruct - SyncRequest F78EEAB0, signaling
event F78EEB28 on SelfDestruct
---- end of log ----
Can you please give your suggestions to solve this issue.
Thanks & Regards
Sudheer
On Sep 20, 1:38 am, "Eliyas Yakub [MSFT]"
<eliy...@online.microsoft.com> wrote:
> Have you applied the latest on service pack (sp2) on XP? The framework is
> getting an error status from the usb stack when it queries for
> USB_BUS_INTERFACE_USBDI_GUID and as a result it failing
> WdfUsbTargetDeviceCreate call. The strange thing is that the error status is
> STATUS_CANCELLED. Unless you try to find out why the underlying driver
> returns an error to this query, there is nothing we can do about it.
>
> -Eliyas
>
> "sudheer" <sudheer.papo...@gmail.com> wrote in message
> > Sudheer- Hide quoted text -
>
> - Show quoted text -
> We are writing a NDIS - USB driver (for NDIS 5.1) for windows XP using
> KMDF architecture. we are facing the problem at
> "WdfUsbTargetDeviceCreate" function as it is returning error code
> 0xC0000001 (STATUS_UNSUCCESSFUL).
Does your USB device actually work correctly?
WdfUsbTargetDeviceCreate() will pull descriptors from your device, if
it is not responding correctly or in time then the URB might be
cancelled by KMDF (which someone else posted later in the thread).
I would check the wire with a protocol analyzer for any enumeration
issues...
Here is another easy way to find that out:
Set a bp on the usbhub pnp dispatch handler (usbhub!USBH_HubDispatch -
!drvobj usbhub 2 will give you the list) right before you call
WdfUsbTargetDeviceCreate. When you hit that, from the stack trace, get the
address of the IRP and set a break on access on the Irp->IoStatus.Status
address and see who is setting the status value to STATUS_CANCELLED. If the
routine happens to be a cancel routine in the hub or port driver then the
next step is to find out who is cancelling the IRP. For this, you just
repeat the above step, but this time set a breakpoint on Irp->Cancel
address. With that, we will be able to at least find out what is happeneing
on the software side.
-Eliyas
Thanks for your reply
The USB device is working properly.
We have already tested with a host side usb driver (based on WDM
architecture) and we are able to read and write with that driver.
Thanks & Regards
Sudheer
Thank you very much.
As you told that its not of client driver / framework problem. Its the
device side problem.
We verified with USB protocol analyzer and we are getting an error
with Get_Status () request from the device.
We fixed that issue and now my initialization part is done.
Previously, in USB driver (WDM based) we dont call Get_Status request
from the host, so it was working with that driver.
But here the WdfUsbTargetDeviceCreate () configures internally and
calls Get_Status () request which is failing.
Thanks for your valuable suggestions and kind support
Thanks & Regards
Sudheer
On Sep 21, 5:28 am, "Eliyas Yakub [MSFT]"