Hi All,
I’m having an issue in one of my USB device drivers on 2K SP4 where on
transition to power state D3 The driver hangs.
I’m shutting down a reader thread from the main thread by setting an event
and then wait for the thread to finish by using ObReferenceObjectByHandle,
and KeWaitForSingleObject. When stepping through it in the debugger, The
reader thread sees that the event to end was set, cleans itself up (cancels
any pending IRPs and aborts any USB pipes) then calls
PsTerminateSystemThread(STATUS_SUCCESS).
At this point the driver is hung forever waiting for the
KeWaitForSingleObject to finish.
This exact same binary works perfectly fine in XP SP2.
Strangely this seems to have popped up after installing the latest security
updates from Microsoft. As during development, there was never a problem
shutting down the computer!
Does anyone have any clue as to what might be going on here?
Thanks!
-Jeff Lange
Microsoft strongly recommends do not block while handling the Power Irp.
See DDK\General Driver information\Design Guide\PnP\Power Management\Passing
Power Irp
“Jeff Lange” wrote in message
news:xxxxx@ntdev…
> Hi All,
>
> I’m having an issue in one of my USB device drivers on 2K SP4 where on
> transition to power state D3 The driver hangs.
>
> I’m shutting down a reader thread from the main thread by setting an event
> and then wait for the thread to finish by using ObReferenceObjectByHandle,
> and KeWaitForSingleObject. When stepping through it in the debugger, The
> reader thread sees that the event to end was set, cleans itself up
> (cancels any pending IRPs and aborts any USB pipes) then calls
> PsTerminateSystemThread(STATUS_SUCCESS).
>
> At this point the driver is hung forever waiting for the
> KeWaitForSingleObject to finish.
>
> This exact same binary works perfectly fine in XP SP2.
>
> Strangely this seems to have popped up after installing the latest
> security updates from Microsoft. As during development, there was never a
> problem shutting down the computer!
>
> Does anyone have any clue as to what might be going on here?
>
> Thanks!
>
> -Jeff Lange
>
>
>
Slava,
Thanks for pointing that out, that solved the problem!
-Jeff
“Slava Imameyev” wrote in message news:xxxxx@ntdev…
> Microsoft strongly recommends do not block while handling the Power Irp.
> See DDK\General Driver information\Design Guide\PnP\Power
> Management\Passing Power Irp
>
> “Jeff Lange” wrote in message
> news:xxxxx@ntdev…
>> Hi All,
>>
>> I’m having an issue in one of my USB device drivers on 2K SP4 where on
>> transition to power state D3 The driver hangs.
>>
>> I’m shutting down a reader thread from the main thread by setting an
>> event and then wait for the thread to finish by using
>> ObReferenceObjectByHandle, and KeWaitForSingleObject. When stepping
>> through it in the debugger, The reader thread sees that the event to end
>> was set, cleans itself up (cancels any pending IRPs and aborts any USB
>> pipes) then calls PsTerminateSystemThread(STATUS_SUCCESS).
>>
>> At this point the driver is hung forever waiting for the
>> KeWaitForSingleObject to finish.
>>
>> This exact same binary works perfectly fine in XP SP2.
>>
>> Strangely this seems to have popped up after installing the latest
>> security updates from Microsoft. As during development, there was never a
>> problem shutting down the computer!
>>
>> Does anyone have any clue as to what might be going on here?
>>
>> Thanks!
>>
>> -Jeff Lange
>>
>>
>>
>
>
>