waitforsingleobject on thread object..

Hi,

I have a w2k driver where i am waiting for a system
thread to terminate. Hence i am performing
KeWaitForSingleObject over thread object which i have
got from ObReferenceObjectByHandle and thread handle.
This wait call is in driver unload function.
The glitch is if i create a thread while driver is
getting loaded (i.e. from DriverEntry) everything
works fine; but if i create this thread from
DispatchFunction (by making a DeviceIoControl from
user space), the wait doesnt come out.
Does this have to do with the process context that the
thread acquires from where it is created?
How do i capture thread termination at driver unload,
when thread is created by making a DeviceIoControl
call?

thanks
Uday


Send free SMS using the Yahoo! Messenger. Go to http://in.mobile.yahoo.com/new/pc/

After Debugging the code, found out that there was bug
in the my code becuase I was getting the thread object
after the thread would have terminated.
So, please ignore the earlier mail.

Thanks
Uday

— Uday wrote: >
Hi,
>
> I have a w2k driver where i am waiting for a system
> thread to terminate. Hence i am performing
> KeWaitForSingleObject over thread object which i
> have
> got from ObReferenceObjectByHandle and thread
> handle.
> This wait call is in driver unload function.
> The glitch is if i create a thread while driver is
> getting loaded (i.e. from DriverEntry) everything
> works fine; but if i create this thread from
> DispatchFunction (by making a DeviceIoControl from
> user space), the wait doesnt come out.
> Does this have to do with the process context that
> the
> thread acquires from where it is created?
> How do i capture thread termination at driver
> unload,
> when thread is created by making a DeviceIoControl
> call?
>
> thanks
> Uday
>
>
>
>

> Send free SMS using the Yahoo! Messenger. Go to
> http://in.mobile.yahoo.com/new/pc/
>
>
> —
> You are currently subscribed to ntdev as:
> xxxxx@yahoo.co.in
> To unsubscribe send a blank email to
xxxxx@lists.osr.com


Send free SMS using the Yahoo! Messenger. Go to http://in.mobile.yahoo.com/new/pc/