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

Before Posting...
Please check out the Community Guidelines in the Announcements and Administration Category.

Question to MS: official rules on MN_REMOVE_DEVICE

Maxim_S._ShatskihMaxim_S._Shatskih Member Posts: 10,396
Is there an official requirement that, in MN_REMOVE_DEVICE path, IoDeleteDevice of your own DO must be called only after IoCallDriver the IRP down?

In other words, must IoDeleteDevice be called in PostRemove or it is OK to do this in PreRemove?

In other words, if the driver calls IoDeleteDevice before passing MN_REMOVE_DEVICE down, is it a bug?

--
Maxim S. Shatskih
Microsoft MVP on File System And Storage
xxxxx@storagecraft.com
http://www.storagecraft.com

Comments

  • Doron_HolanDoron_Holan Member - All Emails Posts: 10,428
    The docs clearly state you must do it after sending the request down the stack

    https://msdn.microsoft.com/en-us/library/windows/hardware/ff561056(v=vs.85).aspx

    d


    -----Original Message-----
    From: xxxxx@lists.osr.com [mailto:xxxxx@lists.osr.com] On Behalf Of Maxim S. Shatskih
    Sent: Thursday, May 14, 2015 11:36 AM
    To: Windows System Software Devs Interest List
    Subject: [ntdev] Question to MS: official rules on MN_REMOVE_DEVICE

    Is there an official requirement that, in MN_REMOVE_DEVICE path, IoDeleteDevice of your own DO must be called only after IoCallDriver the IRP down?

    In other words, must IoDeleteDevice be called in PostRemove or it is OK to do this in PreRemove?

    In other words, if the driver calls IoDeleteDevice before passing MN_REMOVE_DEVICE down, is it a bug?

    --
    Maxim S. Shatskih
    Microsoft MVP on File System And Storage xxxxx@storagecraft.com http://www.storagecraft.com


    ---
    NTDEV is sponsored by OSR

    Visit the list at: http://www.osronline.com/showlists.cfm?list=ntdev

    OSR is HIRING!! See http://www.osr.com/careers

    For our schedule of WDF, WDM, debugging and other seminars visit:
    http://www.osr.com/seminars

    To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer
    d
  • Alex_GrigAlex_Grig Member Posts: 3,238
    I remember in some version of WDK docs the sequence was: IoDetachDevice/IoDeleteDevice first, then forward the IRP down. I could not understand why it was that.
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
Writing WDF Drivers 25 Feb 2019 OSR Seminar Space
Developing Minifilters 8 April 2019 OSR Seminar Space