terminating a system thread

Hi,
I create a system thread using PsCreateSystemThread() system call. This
thread is continuously processing some data and can not wait for any other
event. But based on some other even in my driver, I want to kill this thread
from some other function/thread. The system call PsTerminateSystemThread()
won’t help as it can be called from within the thread which need to be
terminated.

How can I terminate such a thread from another thread or function in my
driver?

Also why doesn’t Ndis provide any such mechanism of creating/terminating
system threads?

thanks
Raj


Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.


You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com

BOOLEAN bTerminateThread = FALSE ;

Inside Thread :
while ( !bTerminateThread )
{
Do Anything…
}

In Other function :
bTerminateThread = TRUE ; // If u want to terminate thread at any time.

Follow like normal Win32 API thread methods only.

Regards,
Satish K.S

Hi,
I create a system thread using PsCreateSystemThread() system call. This
thread is continuously processing some data and can not wait for any other
event. But based on some other even in my driver, I want to kill this
thread
from some other function/thread. The system call PsTerminateSystemThread()
won’t help as it can be called from within the thread which need to be
terminated.

How can I terminate such a thread from another thread or function in my
driver?

Also why doesn’t Ndis provide any such mechanism of creating/terminating
system threads?

thanks
Raj


Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.


You are currently subscribed to ntdev as: xxxxx@aalayance.com
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com


You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com

You can’t terminate any thread made in kernel mode from another thread.
So the only option is to implement some logic like Satish has pointed out.

Warm Regards
Jeseem
mailto:xxxxx@hotmail.com

“Some people think, Others think they think, Most of them don’t even think
of thinking.”

----- Original Message -----
From: “Satish”
To: “NT Developers Interest List”
Sent: Thursday, May 17, 2001 10:47 AM
Subject: [ntdev] Re: terminating a system thread

>
> BOOLEAN bTerminateThread = FALSE ;
>
> Inside Thread :
> while ( !bTerminateThread )
> {
> Do Anything…
> }
>
>
> In Other function :
> bTerminateThread = TRUE ; // If u want to terminate thread at any time.
>
> Follow like normal Win32 API thread methods only.
>
> Regards,
> Satish K.S
>
>
> > Hi,
> > I create a system thread using PsCreateSystemThread() system call. This
> > thread is continuously processing some data and can not wait for any
other
> > event. But based on some other even in my driver, I want to kill this
> thread
> > from some other function/thread. The system call
PsTerminateSystemThread()
> > won’t help as it can be called from within the thread which need to be
> > terminated.
> >
> > How can I terminate such a thread from another thread or function in my
> > driver?
> >
> > Also why doesn’t Ndis provide any such mechanism of creating/terminating
> > system threads?
> >
> > thanks
> > Raj
> >
_________________________________________________________________________
> > Get Your Private, Free E-mail from MSN Hotmail at
http://www.hotmail.com.
> >
> >
> > —
> > You are currently subscribed to ntdev as: xxxxx@aalayance.com
> > To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com
>
>
> —
> You are currently subscribed to ntdev as: xxxxx@hotmail.com
> To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com
>


You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com

You aren’t right. It is generally possible to kill a thread from some
other
thread. The only thing you have to do is to force the thread to call the
PsTerminateSystemThread. And I think there is a mechanism especially
for doing a call to your routine in the context of some concrete thread

  • APC.

I have this implemented using two undocumented routines:
KeInitializeApc and KeInsertQueueApc.

Paul

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com]On Behalf Of Jeseem S
Sent: Thursday, May 17, 2001 11:59 AM
To: NT Developers Interest List
Subject: [ntdev] Re: terminating a system thread

You can’t terminate any thread made in kernel mode from another thread.
So the only option is to implement some logic like Satish has pointed
out.

Warm Regards
Jeseem
mailto:xxxxx@hotmail.com

“Some people think, Others think they think, Most of them don’t even
think
of thinking.”

----- Original Message -----
From: “Satish”
To: “NT Developers Interest List”
Sent: Thursday, May 17, 2001 10:47 AM
Subject: [ntdev] Re: terminating a system thread

>
> BOOLEAN bTerminateThread = FALSE ;
>
> Inside Thread :
> while ( !bTerminateThread )
> {
> Do Anything…
> }
>
>
> In Other function :
> bTerminateThread = TRUE ; // If u want to terminate thread at any
time.
>
> Follow like normal Win32 API thread methods only.
>
> Regards,
> Satish K.S
>
>
> > Hi,
> > I create a system thread using PsCreateSystemThread() system call.
This
> > thread is continuously processing some data and can not wait for any
other
> > event. But based on some other even in my driver, I want to kill
this
> thread
> > from some other function/thread. The system call
PsTerminateSystemThread()
> > won’t help as it can be called from within the thread which need to
be
> > terminated.
> >
> > How can I terminate such a thread from another thread or function in
my
> > driver?
> >
> > Also why doesn’t Ndis provide any such mechanism of
creating/terminating
> > system threads?
> >
> > thanks
> > Raj
> >
________________________________________________________________________
_
> > Get Your Private, Free E-mail from MSN Hotmail at
http://www.hotmail.com.
> >
> >
> > —
> > You are currently subscribed to ntdev as: xxxxx@aalayance.com
> > To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com
>
>
> —
> You are currently subscribed to ntdev as: xxxxx@hotmail.com
> To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com
>


You are currently subscribed to ntdev as: xxxxx@compelson.com
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com


You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com

RE: [ntdev] Re: terminating a system threadHmm…
Good idea I never thought about this.
However their is one flaw.
PsTerminateSystemThread can only be executed at passive level and not at APC level.

Regards
Jeseem
mailto:xxxxx@hotmail.com

----- Original Message -----
From: Hrdina Pavel
To: NT Developers Interest List
Sent: Thursday, May 17, 2001 5:15 PM
Subject: [ntdev] Re: terminating a system thread

You aren’t right. It is generally possible to kill a thread from some other
thread. The only thing you have to do is to force the thread to call the
PsTerminateSystemThread. And I think there is a mechanism especially
for doing a call to your routine in the context of some concrete thread - APC.

I have this implemented using two undocumented routines:
KeInitializeApc and KeInsertQueueApc.

Paul

-----Original Message-----
From: xxxxx@lists.osr.com [mailto:xxxxx@lists.osr.com]On Behalf Of Jeseem S
Sent: Thursday, May 17, 2001 11:59 AM
To: NT Developers Interest List
Subject: [ntdev] Re: terminating a system thread

You can’t terminate any thread made in kernel mode from another thread.
So the only option is to implement some logic like Satish has pointed out.

Warm Regards
Jeseem
mailto:xxxxx@hotmail.com

“Some people think, Others think they think, Most of them don’t even think
of thinking.”

----- Original Message -----
From: “Satish”
To: “NT Developers Interest List”
Sent: Thursday, May 17, 2001 10:47 AM
Subject: [ntdev] Re: terminating a system thread

>
> BOOLEAN bTerminateThread = FALSE ;
>
> Inside Thread :
> while ( !bTerminateThread )
> {
> Do Anything…
> }
>
>
> In Other function :
> bTerminateThread = TRUE ; // If u want to terminate thread at any time.
>
> Follow like normal Win32 API thread methods only.
>
> Regards,
> Satish K.S
>
>
> > Hi,
> > I create a system thread using PsCreateSystemThread() system call. This
> > thread is continuously processing some data and can not wait for any
other
> > event. But based on some other even in my driver, I want to kill this
> thread
> > from some other function/thread. The system call
PsTerminateSystemThread()
> > won’t help as it can be called from within the thread which need to be
> > terminated.
> >
> > How can I terminate such a thread from another thread or function in my
> > driver?
> >
> > Also why doesn’t Ndis provide any such mechanism of creating/terminating
> > system threads?
> >
> > thanks
> > Raj
> >
_________________________________________________________________________
> > Get Your Private, Free E-mail from MSN Hotmail at
http://www.hotmail.com.
> >
> >
> > —
> > You are currently subscribed to ntdev as: xxxxx@aalayance.com
> > To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com
>
>
> —
> You are currently subscribed to ntdev as: xxxxx@hotmail.com
> To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com
>


You are currently subscribed to ntdev as: xxxxx@compelson.com
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com


You are currently subscribed to ntdev as: xxxxx@hotmail.com
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com


You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com

Do not forget a ‘volatile’ for BOOLEAN bTerminateThread else the
compiler may optimize your code to run the thread forever.


| Norbert Kawulski | mailto:xxxxx@stollmann.de |
| Stollmann T.P.GmbH, Development | http://www.stollmann.de |
–If it’s ISDN or Bluetooth, make sure it’s driven by Stollmann–

“The greatest productive force is human selfishness. - Robert A
Heinlein”

BOOLEAN bTerminateThread = FALSE ;

Inside Thread :
while ( !bTerminateThread )
{
Do Anything…
}

In Other function :
bTerminateThread = TRUE ; // If u want to terminate thread at any time.

Follow like normal Win32 API thread methods only.

Regards,
Satish K.S

> Hi,
> I create a system thread using PsCreateSystemThread() system call. This
> thread is continuously processing some data and can not wait for any other
> event. But based on some other even in my driver, I want to kill this
thread
> from some other function/thread. The system call PsTerminateSystemThread()
> won’t help as it can be called from within the thread which need to be
> terminated.
>
> How can I terminate such a thread from another thread or function in my
> driver?
>
> Also why doesn’t Ndis provide any such mechanism of creating/terminating
> system threads?
>
> thanks
> Raj
> _________________________________________________________________________
> Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.
>
>
> —
> You are currently subscribed to ntdev as: xxxxx@aalayance.com
> To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com


You are currently subscribed to ntdev as: xxxxx@stollmann.de
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com


You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com

When you use Normal Kenrel APC everything is OK,
because it’s Normal Routine is always executed at PASSIVE_LEVEL.
Another advantage of this approach is that the thread is
not destroyed until executes at higher than PASSIVE_LEVEL or
until is in critical region.
?
But you can executute that routine even at APC_LEVEL, I have it tested.
?
Paul
?
-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com]On Behalf Of Jeseem S
Sent: Thursday, May 17, 2001 2:05 PM
To: NT Developers Interest List
Subject: [ntdev] Re: terminating a system thread

Hmm…
Good idea I never thought about this.
However their is one flaw.
PsTerminateSystemThread can only be executed at passive level and not at
APC level.
?
Regards
Jeseem
mailto:xxxxx@hotmail.com
?

----- Original Message -----
From: Hrdina Pavel
To: NT Developers Interest List
Sent: Thursday, May 17, 2001 5:15 PM
Subject: [ntdev] Re: terminating a system thread

You aren’t right. It is generally possible to kill a thread from some
other
thread. The only thing you have to do is to force the thread to call the

PsTerminateSystemThread. And I think there is a mechanism especially
for doing a call to your routine in the context of some concrete thread

  • APC.

I have this implemented using two undocumented routines:
KeInitializeApc and KeInsertQueueApc.

Paul

-----Original Message-----
From: xxxxx@lists.osr.com [
mailto:xxxxx@lists.osr.com]On Behalf Of Jeseem S
Sent: Thursday, May 17, 2001 11:59 AM
To: NT Developers Interest List
Subject: [ntdev] Re: terminating a system thread

You can’t terminate any thread made in kernel mode from another thread.
So the only option is to implement some logic like Satish has pointed
out.

Warm Regards
Jeseem
mailto:xxxxx@hotmail.com

“Some people think, Others think they think, Most of them don’t even
think
of thinking.”

----- Original Message -----
From: “Satish”
To: “NT Developers Interest List”
Sent: Thursday, May 17, 2001 10:47 AM
Subject: [ntdev] Re: terminating a system thread

>
> BOOLEAN bTerminateThread = FALSE ;
>
> Inside Thread :
> while ( !bTerminateThread )
> {
>??? Do Anything…
> }
>
>
> In Other function :
> bTerminateThread = TRUE ; // If u want to terminate thread at any
time.
>
> Follow like normal Win32 API thread methods only.
>
> Regards,
> Satish K.S
>
>
> > Hi,
> > I create a system thread using PsCreateSystemThread() system call.
This
> > thread is continuously processing some data and can not wait for any

other
> > event. But based on some other even in my driver, I want to kill
this
> thread
> > from some other function/thread. The system call
PsTerminateSystemThread()
> > won’t help as it can be called from within the thread which need to
be
> > terminated.
> >
> > How can I terminate such a thread from another thread or function in
my
> > driver?
> >
> > Also why doesn’t Ndis provide any such mechanism of
creating/terminating
> > system threads?
> >
> > thanks
> > Raj
> >
________________________________________________________________________
_
> > Get Your Private, Free E-mail from MSN Hotmail at
http://www.hotmail.com.
> >
> >
> > —
> > You are currently subscribed to ntdev as: xxxxx@aalayance.com
> > To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com

>
>
> —
> You are currently subscribed to ntdev as: xxxxx@hotmail.com
> To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com
>


You are currently subscribed to ntdev as: xxxxx@compelson.com
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com


You are currently subscribed to ntdev as: xxxxx@hotmail.com
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com


You are currently subscribed to ntdev as: xxxxx@compelson.com
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com


You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com

> Hi,

I create a system thread using PsCreateSystemThread() system call. This
thread is continuously processing some data and can not wait for any other
event. But based on some other even in my driver, I want to kill this
thread
from some other function/thread. The system call PsTerminateSystemThread()
won’t help as it can be called from within the thread which need to be
terminated.

How can I terminate such a thread from another thread or function in my
driver?

Create some flag in your code.
Terminating a thread:

  • set the flag to TRUE
  • set the event
    The thread itself
  • KeWaitForSingleObject
  • if the flag is TRUE - bail out
  • otherwise, do the processing

Max


You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com

RE: [ntdev] Re: terminating a system threadAlso such thread termination can leave the memory allocations by this thread as orphaned.

Thread running in the kernel cannot be abruptly terminated. It can be terminated only if:
a) it returns to user mode
OR
b) it wants to terminate itself.
Otherwise, you will have kernel memory leaks.

Max

----- Original Message -----
From: Jeseem S
To: NT Developers Interest List
Sent: Thursday, May 17, 2001 4:05 PM
Subject: [ntdev] Re: terminating a system thread

Hmm…
Good idea I never thought about this.
However their is one flaw.
PsTerminateSystemThread can only be executed at passive level and not at APC level.

Regards
Jeseem
mailto:xxxxx@hotmail.com

----- Original Message -----
From: Hrdina Pavel
To: NT Developers Interest List
Sent: Thursday, May 17, 2001 5:15 PM
Subject: [ntdev] Re: terminating a system thread

You aren’t right. It is generally possible to kill a thread from some other
thread. The only thing you have to do is to force the thread to call the
PsTerminateSystemThread. And I think there is a mechanism especially
for doing a call to your routine in the context of some concrete thread - APC.

I have this implemented using two undocumented routines:
KeInitializeApc and KeInsertQueueApc.

Paul

-----Original Message-----
From: xxxxx@lists.osr.com [mailto:xxxxx@lists.osr.com]On Behalf Of Jeseem S
Sent: Thursday, May 17, 2001 11:59 AM
To: NT Developers Interest List
Subject: [ntdev] Re: terminating a system thread

You can’t terminate any thread made in kernel mode from another thread.
So the only option is to implement some logic like Satish has pointed out.

Warm Regards
Jeseem
mailto:xxxxx@hotmail.com

“Some people think, Others think they think, Most of them don’t even think
of thinking.”

----- Original Message -----
From: “Satish”
To: “NT Developers Interest List”
Sent: Thursday, May 17, 2001 10:47 AM
Subject: [ntdev] Re: terminating a system thread

>
> BOOLEAN bTerminateThread = FALSE ;
>
> Inside Thread :
> while ( !bTerminateThread )
> {
> Do Anything…
> }
>
>
> In Other function :
> bTerminateThread = TRUE ; // If u want to terminate thread at any time.
>
> Follow like normal Win32 API thread methods only.
>
> Regards,
> Satish K.S
>
>
> > Hi,
> > I create a system thread using PsCreateSystemThread() system call. This
> > thread is continuously processing some data and can not wait for any
other
> > event. But based on some other even in my driver, I want to kill this
> thread
> > from some other function/thread. The system call
PsTerminateSystemThread()
> > won’t help as it can be called from within the thread which need to be
> > terminated.
> >
> > How can I terminate such a thread from another thread or function in my
> > driver?
> >
> > Also why doesn’t Ndis provide any such mechanism of creating/terminating
> > system threads?
> >
> > thanks
> > Raj
> >
_________________________________________________________________________
> > Get Your Private, Free E-mail from MSN Hotmail at
http://www.hotmail.com.
> >
> >
> > —
> > You are currently subscribed to ntdev as: xxxxx@aalayance.com
> > To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com
>
>
> —
> You are currently subscribed to ntdev as: xxxxx@hotmail.com
> To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com
>


You are currently subscribed to ntdev as: xxxxx@compelson.com
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com


You are currently subscribed to ntdev as: xxxxx@hotmail.com
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com

You are currently subscribed to ntdev as: xxxxx@storagecraft.com
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com


You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com

check _PspTerminateThreadByPointer . It can provide you a bit of insight on
using DPCs.

----- Original Message -----
From: “Jeseem S”
To: “NT Developers Interest List”
Sent: Thursday, May 17, 2001 12:59 PM
Subject: [ntdev] Re: terminating a system thread

> You can’t terminate any thread made in kernel mode from another thread.
> So the only option is to implement some logic like Satish has pointed out.
>
> Warm Regards
> Jeseem
> mailto:xxxxx@hotmail.com
>
> “Some people think, Others think they think, Most of them don’t even think
> of thinking.”
>
> ----- Original Message -----
> From: “Satish”
> To: “NT Developers Interest List”
> Sent: Thursday, May 17, 2001 10:47 AM
> Subject: [ntdev] Re: terminating a system thread
>
>
> >
> > BOOLEAN bTerminateThread = FALSE ;
> >
> > Inside Thread :
> > while ( !bTerminateThread )
> > {
> > Do Anything…
> > }
> >
> >
> > In Other function :
> > bTerminateThread = TRUE ; // If u want to terminate thread at any time.
> >
> > Follow like normal Win32 API thread methods only.
> >
> > Regards,
> > Satish K.S
> >
> >
> > > Hi,
> > > I create a system thread using PsCreateSystemThread() system call.
This
> > > thread is continuously processing some data and can not wait for any
> other
> > > event. But based on some other even in my driver, I want to kill this
> > thread
> > > from some other function/thread. The system call
> PsTerminateSystemThread()
> > > won’t help as it can be called from within the thread which need to be
> > > terminated.
> > >
> > > How can I terminate such a thread from another thread or function in
my
> > > driver?
> > >
> > > Also why doesn’t Ndis provide any such mechanism of
creating/terminating
> > > system threads?
> > >
> > > thanks
> > > Raj
> > >
> _________________________________________________________________________
> > > Get Your Private, Free E-mail from MSN Hotmail at
> http://www.hotmail.com.
> > >
> > >
> > > —
> > > You are currently subscribed to ntdev as: xxxxx@aalayance.com
> > > To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com
> >
> >
> > —
> > You are currently subscribed to ntdev as: xxxxx@hotmail.com
> > To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com
> >
>
> —
> You are currently subscribed to ntdev as: danp@jb.rdsor.ro
> To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com
>


You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com

Thanks to all for the response. I had implemented it exactly the way Satish
suggested, but was not sure of an alternate way.

By the way, do I need to protect this boolean variable for simultaneous
read/write by the thread and other function.
thanks again.
Raj

BOOLEAN bTerminateThread = FALSE ;

Inside Thread :
while ( !bTerminateThread )
{
Do Anything…
}

In Other function :
bTerminateThread = TRUE ; // If u want to terminate thread at any time.

Follow like normal Win32 API thread methods only.

Regards,
Satish K.S

> Hi,
> I create a system thread using PsCreateSystemThread() system call. This
> thread is continuously processing some data and can not wait for any
other
> event. But based on some other even in my driver, I want to kill this
thread
> from some other function/thread. The system call
PsTerminateSystemThread()
> won’t help as it can be called from within the thread which need to be
> terminated.
>
> How can I terminate such a thread from another thread or function in my
> driver?
>
> Also why doesn’t Ndis provide any such mechanism of creating/terminating
> system threads?
>
> thanks
> Raj
>


> Get Your Private, Free E-mail from MSN Hotmail at
http://www.hotmail.com.
>
>
> —
> You are currently subscribed to ntdev as: xxxxx@aalayance.com
> To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com


You are currently subscribed to ntdev as: xxxxx@hotmail.com
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com


Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.


You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com

> Thanks to all for the response. I had implemented it exactly the way
Satish

suggested, but was not sure of an alternate way.

By the way, do I need to protect this boolean variable for simultaneous
read/write by the thread and other function.

If u are Writing to that variable from more then one Places. Better to
protect that variable.

Regards,
Satish K.S


You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com