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/


deferring completion processing

OSR_Community_User-35OSR_Community_User-35 Member Posts: 154
In the Win2000 DDK, the topic:

Setup, Plug & Play, Power Management
2.3 Postponing PnP IRP Processing Until Lower Drivers Finish
Figure 2.3

indicates that if a completion routine returns MORE_PROCESSING_REQ'D,
then the original thread, in which the IRP was sent to the dispatch
routine, can perform some additional processing and then call
IoCompleteRequest() a second time for the same IRP.

My question: does this deferred processing have to happen in the
original dispatch thread; or in my completion routine can I queue a
work item to an arbitrary system thread and complete the IRP a second
time there (having returned pending from the dispatch routine)?

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

Comments

  • OSR_Community_UserOSR_Community_User Member Posts: 110,217
    It depends on what type of post processing you are doing and the thread
    context. For example, if you defer a read request and intend on accessing
    the the buffer and the method is METHOD_NIETHER, you may attempt to access a
    buffer located in a process other than the current process (system process
    in a system process owned worker thread).

    It realy depends on the call and what you intend to do in the completion
    routine.

    But, yes, you can do what you are indicating. We have written drivers where
    the request may be posted off to 3 different worker threads and go though 4
    completion routines before the request finally gets completed.


    Jamey

    > -----Original Message-----
    > From: [email protected]
    > [mailto:[email protected]]On Behalf Of COX,DAVID
    > (HP-Roseville,ex1)
    > Sent: Wednesday, May 10, 2000 3:57 PM
    > To: NT Developers Interest List
    > Subject: [ntdev] deferring completion processing
    >
    >
    > In the Win2000 DDK, the topic:
    >
    > Setup, Plug & Play, Power Management
    > 2.3 Postponing PnP IRP Processing Until Lower Drivers Finish
    > Figure 2.3
    >
    > indicates that if a completion routine returns MORE_PROCESSING_REQ'D,
    > then the original thread, in which the IRP was sent to the dispatch
    > routine, can perform some additional processing and then call
    > IoCompleteRequest() a second time for the same IRP.
    >
    > My question: does this deferred processing have to happen in the
    > original dispatch thread; or in my completion routine can I queue a
    > work item to an arbitrary system thread and complete the IRP a second
    > time there (having returned pending from the dispatch routine)?
    >
    > -----------------------------------------------------------------------
    > Dave Cox
    > Hewlett-Packard Co.
    > HPSO/SSMO (Santa Barbara)
    > https://ecardfile.com/id/Dave+Cox
    >
    > ---
    > 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
    > But, yes, you can do what you are indicating. We have written drivers
    where
    > the request may be posted off to 3 different worker threads and go though
    4
    > completion routines before the request finally gets completed.

    ...and IIRC one of these threads allocated about 32MB of memory in the
    _userspace part of the System process_ and used it to complete the
    request.

    Max
  • OSR_Community_User-35OSR_Community_User-35 Member Posts: 154
    Great. Thanks.

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


    -----Original Message-----
    From: Jamey Kirby [mailto:[email protected]]
    Sent: Wednesday, May 10, 2000 4:39 PM
    To: NT Developers Interest List
    Subject: [ntdev] RE: deferring completion processing



    It depends on what type of post processing you are doing and the thread
    context. For example, if you defer a read request and intend on accessing
    the the buffer and the method is METHOD_NIETHER, you may attempt to access a
    buffer located in a process other than the current process (system process
    in a system process owned worker thread).

    It realy depends on the call and what you intend to do in the completion
    routine.

    But, yes, you can do what you are indicating. We have written drivers where
    the request may be posted off to 3 different worker threads and go though 4
    completion routines before the request finally gets completed.


    Jamey

    > -----Original Message-----
    > From: [email protected]
    > [mailto:[email protected]]On Behalf Of COX,DAVID
    > (HP-Roseville,ex1)
    > Sent: Wednesday, May 10, 2000 3:57 PM
    > To: NT Developers Interest List
    > Subject: [ntdev] deferring completion processing
    >
    >
    > In the Win2000 DDK, the topic:
    >
    > Setup, Plug & Play, Power Management
    > 2.3 Postponing PnP IRP Processing Until Lower Drivers Finish
    > Figure 2.3
    >
    > indicates that if a completion routine returns MORE_PROCESSING_REQ'D,
    > then the original thread, in which the IRP was sent to the dispatch
    > routine, can perform some additional processing and then call
    > IoCompleteRequest() a second time for the same IRP.
    >
    > My question: does this deferred processing have to happen in the
    > original dispatch thread; or in my completion routine can I queue a
    > work item to an arbitrary system thread and complete the IRP a second
    > time there (having returned pending from the dispatch routine)?
    >
    > -----------------------------------------------------------------------
    > Dave Cox
    > Hewlett-Packard Co.
    > HPSO/SSMO (Santa Barbara)
    > https://ecardfile.com/id/Dave+Cox
    >
    > ---
    > You are currently subscribed to ntdev as: [email protected]
    > To unsubscribe send a blank email to $subst('Email.Unsub')
    >


    ---
    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