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

Home NTDEV

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/


Before Posting...

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

RE: [Q] What does DRVO_LEGACY_DRIVER mean?

OSR_Community_UserOSR_Community_User Member Posts: 110,217
From: "Jamey Kirby" <[email protected]>
Sent: Friday, April 07, 2000 7:44 PM


> Do you create device objects in DriverEntry()? Just currious.

No, just during AddDevice().

To be specific, I actually create two device objects, one is the "real" FDO
layered directly (from my perspective) atop of the PDO. The other is an
"extra" device layered on top of my FDO -- creating a three (at least)
device stack, two of which belong to my driver.

Do you think my driver's extra device makes any difference? The Plug and
Play Manager doesn't care what happens during AddDevice() does it? -- so
long as the PDO's stack is working properly as a whole, right?

As I say, I am only "worried" about the DRVO_LEGACY_DRIVER flag -- it
doesn't actually seem to be causing my driver to act strangely, except...

My driver is for a USB device and if I yank the cord so it receives
IRP_MN_SURPRISE_REMOVAL, the device stack shuts down correctly, but Windows
does not unload my driver. If I use the icon on the Taskbar to tell Windows
beforehand that I'm going to remove my device, it sends IRP_MJ_REMOVE_DEVICE
and unloads my driver completely. Is not unloading normal in the case of
surprise removal?

When my driver is left in memory after surprise removal, there doesn't seem
to be anything referencing my driver except the Service Manager (the devices
are all gone and the DRIVER_OBJECT still has 3 references, yet "net stop" is
successful).

- 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!
Internals & Software Drivers 15 November 2021 Live, Online
Writing WDF Drivers 24 January 2022 Live, Online
Developing Minifilters 7 February 2022 Live, Online
Kernel Debugging 21 March 2022 Live, Online