Page 1 of 1

Static variables in non paged pool

PostPosted: Sun Jun 04, 2006 1:23 pm
by Guest
I need to allocate synch objects in non paged pool, create them on driver load and delete them during unload. What is the best way to do it?

PostPosted: Sun Jun 04, 2006 1:23 pm
by Guest
Use Device Extension

From DDK:

For most intermediate and lowest-level drivers, the device extension is the most important data structure associated with a device object. Its internal structure is driver-defined, and it is typically used to:

— Maintain device state information.
— Provide storage for any kernel-defined objects or other system resources, such as spin locks, used by the driver.
— Hold any data the driver must have resident and in system space to carry out its I/O operations.