Windows System Software -- Consulting, Training, Development -- Unique Expertise, Guaranteed Results

Home NTDEV

Before Posting...

Please check out the Community Guidelines in the Announcements and Administration Category.

More Info on Driver Writing and Debugging


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/


Terminating a thread !!!!

OSR_Community_UserOSR_Community_User Member Posts: 110,217
Hi All,
Can anybody please tell me is there anyway by which I can terminate a thread
from another thread, assuming that the other thread has the handle of the
thread I want to terminate.

Thanks in advance,
regards,
Shivas

> ----------
> From: Shweta Dubey
> Reply To: NT Developers Interest List
> Sent: Thursday, May 11, 2000 11:33 PM
> To: NT Developers Interest List
> Cc: [email protected]
> Subject: [ntdev] RE: Which EntryPoint to use ?
>
> May be I do not understand exactly what you need, and also have never
> worked
> on W2K, but here is my idea. I would start a driver thread
> PsCreateSystemThread(), and let it do all the stuff. Now there is no need
> to
> "trigger" any thing. You may also consider creating more than one thread,
> and blah blah...
>
> Shweta.
>
> Hello,
>
> To test my Win2K Bus Driver, I need my dummy Function Driver (based on the
> DDK Toaster Function Driver sample) to continuously write some known
> values
> to the memory-mapped Register Space of each of the "toaster" devices
> periodically (maybe after a few milli-seconds interval or so). I want the
> Function Driver to keep doing this indefinitely i.e. until it is
> unloaded.
>
> Which entry-point or routine can I do this in, since there is nothing to
> trigger this (i.e. no user application or anything) ?
>
> Any ideas how things like these are accomplished ?
>
> Thanks much in advance!
>
> Puja
>
> ---
> You are currently subscribed to ntdev as: [email protected]
> To unsubscribe send a blank email to $subst('Email.Unsub')
>
> ______________________________________________
> FREE Personalized Email at Mail.com
> Sign up at http://www.mail.com/?sr=signup
>
>
> ---
> You are currently subscribed to ntdev as: [email protected]
> To unsubscribe send a blank email to $subst('Email.Unsub')
>

Comments

  • OSR_Community_UserOSR_Community_User Member Posts: 110,217
    Hello,

    You can use TerminateThread function. However use of
    this should be avoided as far as possible, since it
    does not give DLL notifications, does not clean up the
    initial stack etc.

    If the thread your are trying to terminate enters
    altertable wait state periodically then you may try
    the QueueUserAPC function. Your APC function can then
    call ExitThread function.

    -Prasad

    --- Shiva_Shankar <[email protected]> wrote:
    > Hi All,
    > Can anybody please tell me is there anyway by which
    > I can terminate a thread
    > from another thread, assuming that the other thread
    > has the handle of the
    > thread I want to terminate.
    >
    > Thanks in advance,
    > regards,
    > Shivas
    >
    > > ----------
    > > From: Shweta Dubey
    > > Reply To: NT Developers Interest List
    > > Sent: Thursday, May 11, 2000 11:33 PM
    > > To: NT Developers Interest List
    > > Cc: [email protected]
    > > Subject: [ntdev] RE: Which EntryPoint to use ?
    > >
    > > May be I do not understand exactly what you need,
    > and also have never
    > > worked
    > > on W2K, but here is my idea. I would start a
    > driver thread
    > > PsCreateSystemThread(), and let it do all the
    > stuff. Now there is no need
    > > to
    > > "trigger" any thing. You may also consider
    > creating more than one thread,
    > > and blah blah...
    > >
    > > Shweta.
    > >
    > > Hello,
    > >
    > > To test my Win2K Bus Driver, I need my dummy
    > Function Driver (based on the
    > > DDK Toaster Function Driver sample) to
    > continuously write some known
    > > values
    > > to the memory-mapped Register Space of each of the
    > "toaster" devices
    > > periodically (maybe after a few milli-seconds
    > interval or so). I want the
    > > Function Driver to keep doing this indefinitely
    > i.e. until it is
    > > unloaded.
    > >
    > > Which entry-point or routine can I do this in,
    > since there is nothing to
    > > trigger this (i.e. no user application or
    > anything) ?
    > >
    > > Any ideas how things like these are accomplished ?
    > >
    > > Thanks much in advance!
    > >
    > > Puja
    > >
    > > ---
    > > You are currently subscribed to ntdev as:
    > [email protected]
    > > To unsubscribe send a blank email to
    > $subst('Email.Unsub')
    > >
    > > ______________________________________________
    > > FREE Personalized Email at Mail.com
    > > Sign up at http://www.mail.com/?sr=signup
    > >
    > >
    > > ---
    > > You are currently subscribed to ntdev as:
    > [email protected]
    > > To unsubscribe send a blank email to
    > $subst('Email.Unsub')
    > >
    >


    =====
    Prasad S. Dabak
    Director of Engineering, Windows NT/2000 Division
    Cybermedia Software Private Limited
    http://www.cybermedia.co.in
    Co-author of the book "Undocumented Windows NT"
    ISBN 0764545698

    __________________________________________________
    Do You Yahoo!?
    Send instant messages & get email alerts with Yahoo! Messenger.
    http://im.yahoo.com/
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. Sign in or register to get started.

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!
Kernel Debugging 13-17 May 2024 Live, Online
Developing Minifilters 1-5 Apr 2024 Live, Online
Internals & Software Drivers 11-15 Mar 2024 Live, Online
Writing WDF Drivers 20-24 May 2024 Live, Online