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/


Free field in IrpStack

OSR_Community_UserOSR_Community_User Member Posts: 110,217
I need to store data specific to an Irp. Is there a field in the IrpStack
that I can write to that only my driver will access?

Daniel

Comments

  • OSR_Community_UserOSR_Community_User Member Posts: 110,217
    If your not using StartIO and managing your own queues, you can use
    Irp.Tail.Overlay.Drivercontext.

    -----Original Message-----
    From: Nemiroff, Daniel [mailto:[email protected]]
    Sent: Friday, June 02, 2000 1:12 PM
    To: NT Developers Interest List
    Subject: [ntdev] Free field in IrpStack

    I need to store data specific to an Irp. Is there a field
    in the IrpStack
    that I can write to that only my driver will access?

    Daniel


    ---
    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
    Unfortunately, I am managing my own queues.

    Any other place?

    Daniel

    -----Original Message-----
    From: Gary Little [mailto:[email protected]]
    Sent: Friday, June 02, 2000 1:15 PM
    To: NT Developers Interest List
    Subject: [ntdev] RE: Free field in IrpStack


    If your not using StartIO and managing your own queues, you can use
    Irp.Tail.Overlay.Drivercontext.

    -----Original Message-----
    From: Nemiroff, Daniel [mailto:[email protected]]
    Sent: Friday, June 02, 2000 1:12 PM
    To: NT Developers Interest List
    Subject: [ntdev] Free field in IrpStack

    I need to store data specific to an Irp. Is there a field
    in the IrpStack
    that I can write to that only my driver will access?

    Daniel


    ---
    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')
  • OSR_Community_UserOSR_Community_User Member Posts: 110,217
    If your not using StartIO, then those 4 DWORDs should be available to you
    -----Original Message-----
    From: Nemiroff, Daniel [mailto:[email protected]]
    Sent: Friday, June 02, 2000 1:23 PM
    To: NT Developers Interest List
    Subject: [ntdev] RE: Free field in IrpStack

    Unfortunately, I am managing my own queues.

    Any other place?

    Daniel

    -----Original Message-----
    From: Gary Little [mailto:[email protected]]
    Sent: Friday, June 02, 2000 1:15 PM
    To: NT Developers Interest List
    Subject: [ntdev] RE: Free field in IrpStack


    If your not using StartIO and managing your own queues, you
    can use
    Irp.Tail.Overlay.Drivercontext.

    -----Original Message-----
    From: Nemiroff, Daniel
    [mailto:[email protected]]
    Sent: Friday, June 02, 2000 1:12 PM
    To: NT Developers Interest List
    Subject: [ntdev] Free field in
    IrpStack

    I need to store data specific to an Irp. Is
    there a field
    in the IrpStack
    that I can write to that only my driver will
    access?

    Daniel


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



    ---
    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
    From: "Nemiroff, Daniel" <[email protected]>
    Sent: Friday, June 02, 2000 4:11 PM


    > I need to store data specific to an Irp. Is there a field in the IrpStack
    > that I can write to that only my driver will access?

    While your driver owns a non-queued IRP, it can store whatever it wants in
    the IRP's 'Tail.Overlay.DriverContext' member. Indeed, that's what it's
    for.

    By "non-queued", I mean while the IRP's 'Tail.Overlay.DeviceQueueEntry'
    member isn't in use (the IRP isn't contained in any queue), which of course
    overlays 'DriverContext'.

    Note that the system implicitly makes use of 'DeviceQueueEntry' whenever
    your driver uses the standard StartIO() method of IRP handling.

    If on other hand you're performing your own queuing, only *you* can know
    when 'DriverContext' is available (that is, when/if your driver isn't making
    custom use of 'DeviceQueueEntry', etc.). If your driver doesn't use
    'DeviceQueueEntry' (or just doesn't do any queuing at all), then you can use
    'DriverContext' any time your driver is in possession of the IRP.

    One caveat to watch for: If you pass the IRP on to another driver and then
    later capture it a completion routine, don't assume that the contents of
    'DriverContext' will remain intact (the other driver(s) may have queued the
    IRP using the standard method, made custom use of 'DeviceQueueEntry', or
    even used 'DriverContext' themselves while handling the IRP).

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