Device Object NULL in completion routine

Discussion in 'Windows Vista Drivers' started by Farooque Khan, Jan 9, 2004.

  1. Hi,

    In my FSD filter, I am building up my own IRP to send to the
    lower driver so that I can get some info (QueryDirectory)
    about a directory. The problem is that when my completion
    routine is called, it contains proper data, but the device object
    I get is NULL (is this normal?). Also my stack location seems to be wrong
    since it no longer contains the parameters (minor/major functions say),
    that I setup.

    Any clues?

    TIA,
     
    Farooque Khan, Jan 9, 2004
    #1
    1. Advertisements

  2. Thanks Mark,

    yes, this makes perfect sense. I just saw, the FileSpy
    sample also mentions that the DeviceObject
    would be NULL because I am the originator
    of the IRP (I don't know why this is so).

    I am building a DIRECTORY_CONTROL (Query directory)
    IRP to get contents of a particular directory. I was
    using the Flags etc. in the stack location. But I guess
    I will have to use the context for all such purposes.

    Thanks again,

    --

    -Farooque Khan
    http://farooque.150m.com
     
    Farooque Khan, Jan 9, 2004
    #2
    1. Advertisements

  3. routine is called, it contains proper data, but the device object
    This is normal.

    For DeviceObject to be non-NULL, allocate 1 more stack location in the IRP,
    then call IoSetNextIrpStackLocation, then call
    IoGetCurrentIrpStackLocation(Irp)->DeviceObject = YourDeviceObject.
     
    Maxim S. Shatskih, Jan 9, 2004
    #3
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.