Globals and driver extension RRS feed

  • Question

  • I've been reading this old article on OSR online and encountered the following statement regarding globals storing:

    "There is a wonderful thing called the driver extension which will happily store all "global objects" for you"..."you can store all your global objects in your driver extension and allocate them with your new operator in the driver entry".

    As far as I know the driver extension is an OS-defined structure that shouldn't be touched: Can anyone explain how these 2 statements can coexist?

    Wednesday, August 21, 2013 7:29 PM


All replies

  • As far as I know you cannot store anything with Driver Extension, all the documentation since it has been created indicates that the only field you can touch is AddDevice.  I believe this is a mistake by the author of the OSR article that probably got missed by OSR before publication.  I suspect the author confused DeviceExtension and DriverExtension.

    Don Burn Windows Filesystem and Driver Consulting Website: Blog:

    Wednesday, August 21, 2013 7:43 PM
  • There is IoAllocateDriverObjectExtension and IoGetDriverObjectExtension, and .  In other words, no direct field access, but you can get at them. Typically these are used between a port and miniport driver. Declaring a global in code is much simpler and more easily accessbile than indirecting with these two APIs.

    d -- This posting is provided "AS IS" with no warranties, and confers no rights.

    Wednesday, August 21, 2013 8:18 PM