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

Home NTFSD
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/


IoAttachDeviceToDeviceStack

OSR_Community_UserOSR_Community_User Member Posts: 110,217
Every once in a while (at some far distant customer site). The call to
IoAttachDeviceToDeviceStack fails. It is usually on the C: when the filter
driver is loading. (It is set to automatic). IoAttachDeviceToDeviceStack
does not return an error, only a NULL or device object if successful. Can
anyone tell me why this happens and how I can prevent it.

Ken
Kenneth J. Galipeau
Legato Systems, Inc.
http://www.legato.com

Comments

  • OSR_Community_UserOSR_Community_User Member Posts: 110,217
    >driver is loading. (It is set to automatic). IoAttachDeviceToDeviceStack
    >does not return an error, only a NULL or device object if successful. Can

    According to the assembly code, this can occur in 2 cases only:
    - current top-of-stack DO has DO_DEVICE_INITIALIZING flag set
    - current top-of-stack DO has DO_UNLOAD_PENDING flag set.

    Max
  • OSR_Community_UserOSR_Community_User Member Posts: 110,217
    1. Check DO_DEVICE_INITIALIZING bit (DeviceObject->Flag) in device object
    you want to attach to (last device objct in attached device objects chain).
    You cannot attach to the device object with this bit set.
    2. I also check DO_UNLOAD_PENDING bit in DeviceObject->Flag, but I'm not
    sure if it is correct.

    best regards
    mari


    -----Original Message-----
    From: Kenneth J Galipeau [mailto:[email protected]]
    Sent: Friday, April 07, 2000 11:12 PM
    To: File Systems Developers
    Subject: [ntfsd] IoAttachDeviceToDeviceStack


    Every once in a while (at some far distant customer site). The call to
    IoAttachDeviceToDeviceStack fails. It is usually on the C: when the filter
    driver is loading. (It is set to automatic). IoAttachDeviceToDeviceStack
    does not return an error, only a NULL or device object if successful. Can
    anyone tell me why this happens and how I can prevent it.

    Ken

    Kenneth J. Galipeau
    Legato Systems, Inc.
    http://www.legato.com
  • OSR_Community_UserOSR_Community_User Member Posts: 110,217
    I got the responses about the DO_DEVICE_INITIALIZING or DO_UNLOAD_PENDING.
    Thanks, that tells me how it happens. My problem is why is the C: drive
    (system drive usually) "initializing/unloading" late in the boot sequence?
    What can I do so I can get attached to the drive?

    According to the assembly code, this can occur in 2 cases only:
    - current top-of-stack DO has DO_DEVICE_INITIALIZING flag set
    - current top-of-stack DO has DO_UNLOAD_PENDING flag set.

    -----Original Message-----
    From: Kenneth J Galipeau [mailto:[email protected]]
    Sent: Friday, April 07, 2000 5:12 PM
    To: NTFSD
    Subject: IoAttachDeviceToDeviceStack


    Every once in a while (at some far distant customer site). The call to
    IoAttachDeviceToDeviceStack fails. It is usually on the C: when the filter
    driver is loading. (It is set to automatic). IoAttachDeviceToDeviceStack
    does not return an error, only a NULL or device object if successful. Can
    anyone tell me why this happens and how I can prevent it.

    Ken
    Kenneth J. Galipeau
    Legato Systems, Inc.
    http://www.legato.com
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

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!
Writing WDF Drivers 7 Dec 2020 LIVE ONLINE
Internals & Software Drivers 25 Jan 2021 LIVE ONLINE
Developing Minifilters Early 2021 LIVE ONLINE