The free OSR Learning Library has more than 50 articles on a wide variety of topics about writing and debugging device drivers and Minifilters. From introductory level to advanced. All the articles have been recently reviewed and updated, and are written using the clear and definitive style you've come to expect from OSR over the years.
Check out The OSR Learning Library at: https://www.osr.com/osr-learning-library/
I am try to enable and disable one particular USB interface on USB composite device from device manager. The interface has function driver(driver1) and lower filter driver(driver2). Issue is device manager getting hanged indefinitely, using notmyfault crashed system to get dump, corresponding to drivers two threads are in blocked state. Thread-1 from driver1, synchronously sending vendor request to device which goes through lower filter driver, lower filter driver2 receives on EvtIoWrite this request is again framed and sent to lower level, lower level is waiting on "KeWaitForSingleObject" indefinitely , even though timeout value is set.
I am trying to see arguments passed to KeWaitForSingleObject function, since timeout value is 5th argument, I want to make sure timeout is set. I am assuming 5th argument is pushed to stack.
when checked value it is showing "zero", this issue I am checking on windows 10 x64, quite difficult to get assured value. kindly please let me know how to debug this issue.
1) why request is not completed even though timeout value is set?
2) how to view 5th argument in case of x64( value stored on stack is assured?).
73496000 fffff8026f1c908d : ffff8801
9f744180 00000004fffffffe ffff8801
ffffffff 0000000000000001 : nt!KiSwapContext+0x76
73496140 fffff8026f1c7f14 : ffffc704
bb549040 0000000000000000 ffffde80
00000000 ffffde8000000000 : nt!KiSwapThread+0xbfd
734961e0 fffff8026f1c76b5 : 00000000
00000000 fffff80200000000 ffffdd07
73498000 0000000000000000 : nt!KiCommitThreadWait+0x144
73496280 fffff8026fa2f9f4 : ffffdd07
73496430 0000000000000000 00000000
00000000 0000000000000000 : nt!KeWaitForSingleObject+0x255
73496360 fffff8026fa2ee6e : ffffdd07
73496430 0000000000000102 ffffdd07
73496470 000000000000001d : nt!ViKeWaitForSingleObjectCommon+0x98
4: kd> dqs ffffdd07`73496360
73496380 0000000000000000----> is it 5th argument timeout value for "KeWaitForSingleObject" ?
Thread -1 sent synchronous request which is not getting completed, Thread-2( PNP remove) waiting on Thread-1 handle to get terminate. That's why device manager is not hanged.
WDF_WRITE_REQUEST_TIMEOUT 1 WDF_REQUEST_SEND_OPTIONS_INIT(&options,WDF_REQUEST_SEND_OPTION_TIMEOUT | WDF_REQUEST_SEND_OPTION_SYNCHRONOUS); WDF_REQUEST_SEND_OPTIONS_SET_TIMEOUT(&options,WDF_ABS_TIMEOUT_IN_SEC(WDF_WRITE_REQUEST_TIMEOUT) WdfRequestSend(wdfRequest, deviceContext->UsbDeviceIoTargets, &options);
SEND_ENCAP_REQ_TIMEOUT 1 WDF_REQUEST_SEND_OPTIONS_INIT(&requestSendOptions, WDF_REQUEST_SEND_OPTION_TIMEOUT); WDF_REQUEST_SEND_OPTIONS_SET_TIMEOUT(&requestSendOptions, WDF_REL_TIMEOUT_IN_SEC(SEND_ENCAP_REQ_TIMEOUT)); WdfUsbTargetDeviceSendControlTransferSynchronously( pDeviceContext->UsbContext.UsbDevice,WDF_NO_HANDLE, &requestSendOptions,&usbControlSetupPacket,&memoryDescriptor,&numberOfBytesTransferred);
thread-1 and thread-2 stacks are attached.
|Upcoming OSR Seminars|
|OSR has suspended in-person seminars due to the Covid-19 outbreak. But, don't miss your training! Attend via the internet instead!|
|Internals & Software Drivers||30 Nov 2020||LIVE ONLINE|
|Writing WDF Drivers||7 Dec 2020||LIVE ONLINE|
|Developing Minifilters||Early 2021||LIVE ONLINE|