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/


PsCreateSystemThread Question

OSR_Community_UserOSR_Community_User Member Posts: 110,217
Hello,

Can I call PsCreateSystemThread in my AddDevice() routine instead of
DriverEntry() ? (DDK seems to say that threads are created during Driver
Initialization)

The reason I need to do this is because I need to pass the FDO_DevExtn to
the thread_func as the argument (i.e. "StartContext" argument to
PsCreateSystemThread). And the FDO_DevExtn is created only in AddDevice()
[it doesn't exist in DriverEntry()].

Thanks in advance for your help.

Puja

Comments

  • OSR_Community_User-35OSR_Community_User-35 Member Posts: 154
    Sure you can delay creating the thread. But there are other ways you
    can pass structures to a thread after it is already running. The
    simplest would be to have it wait on an event until you signal an
    event indicating you've placed the relevant data in some shared
    memory location.

    -----------------------------------------------------------------------
    Dave Cox
    Hewlett-Packard Co.
    HPSO/SSMO (Santa Barbara)
    https://ecardfile.com/id/Dave+Cox


    -----Original Message-----
    From: [email protected] [mailto:[email protected]]
    Sent: Thursday, April 20, 2000 1:18 PM
    To: NT Developers Interest List
    Subject: [ntdev] PsCreateSystemThread Question


    Hello,

    Can I call PsCreateSystemThread in my AddDevice() routine instead of
    DriverEntry() ? (DDK seems to say that threads are created during Driver
    Initialization)

    The reason I need to do this is because I need to pass the FDO_DevExtn to
    the thread_func as the argument (i.e. "StartContext" argument to
    PsCreateSystemThread). And the FDO_DevExtn is created only in AddDevice()
    [it doesn't exist in DriverEntry()].

    Thanks in advance for your help.

    Puja

    ---
    You are currently subscribed to ntdev as: [email protected]
    To unsubscribe send a blank email to $subst('Email.Unsub')
  • OSR_Community_UserOSR_Community_User Member Posts: 110,217
    you can create a system thread any time you like as long as you are at
    passive level.

    > -----Original Message-----
    > From: [email protected]
    > [mailto:[email protected]]On Behalf Of [email protected]
    > Sent: Thursday, April 20, 2000 8:18 PM
    > To: NT Developers Interest List
    > Subject: [ntdev] PsCreateSystemThread Question
    >
    >
    > Hello,
    >
    > Can I call PsCreateSystemThread in my AddDevice() routine instead of
    > DriverEntry() ? (DDK seems to say that threads are created during Driver
    > Initialization)
    >
    > The reason I need to do this is because I need to pass the FDO_DevExtn to
    > the thread_func as the argument (i.e. "StartContext" argument to
    > PsCreateSystemThread). And the FDO_DevExtn is created only in AddDevice()
    > [it doesn't exist in DriverEntry()].
    >
    > Thanks in advance for your help.
    >
    > Puja
    >
    > ---
    > You are currently subscribed to ntdev as: [email protected]
    > To unsubscribe send a blank email to $subst('Email.Unsub')
    >
  • OSR_Community_UserOSR_Community_User Member Posts: 110,217
    hi puja,
    You have not told the system information in detail (95/98/NT) and what is the type of driver that you are involved into.???

    Ajitabh

    Ajitabh Prakash
    Sr.Software Engineer
    Future Software
    480/481 Nandnam,Chennai

    -----Original Message-----
    From: [email protected] [SMTP:[email protected]]
    Sent: Friday, April 21, 2000 1:48 AM
    To: NT Developers Interest List
    Subject: [ntdev] PsCreateSystemThread Question

    Hello,

    Can I call PsCreateSystemThread in my AddDevice() routine instead of
    DriverEntry() ? (DDK seems to say that threads are created during Driver
    Initialization)

    The reason I need to do this is because I need to pass the FDO_DevExtn to
    the thread_func as the argument (i.e. "StartContext" argument to
    PsCreateSystemThread). And the FDO_DevExtn is created only in AddDevice()
    [it doesn't exist in DriverEntry()].

    Thanks in advance for your help.

    Puja

    ---
    You are currently subscribed to ntdev as: [email protected]
    To unsubscribe send a blank email to $subst('Email.Unsub')
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