We have a driver that appeared to be corrupting NTs device object data structures,
when just opening and closing objects, yielding BSODs, or what
amounts to a “object not found” error on later opens
(IoGetDeviceObjectPointer() call).
This driver had used the “Baker” method from (The Windows NT Device
Driver Book):
IoGetDeviceObjectPointer( &UnicodeName, FILE_ALL_ACCESS, &pFileObject, &pDeviceObject );
ObReferenceObjectByPointer( &pDeviceObject, FILE_ALL_ACCESS, NULL, KernelMode );
ObDereferenceObject( pFileObject );
when finally done,
ObDereferenceObject(pDeviceObject)
When we changed it to use the more standard DDK version:
IoGetDeviceObjectPointer( &UnicodeName, FILE_ALL_ACCESS, &pFileObject, &pDeviceObject );
when finally done:
ObDereferenceObject( pFileObject );
and the problem appeared to go away. So the question is whether there is something wrong with
the “Baker” method, or whether we have just moved the footprint of the bug around.
-DH
Dave Harvey, System Software Solutions, Inc.
617-964-7039, FAX 208-361-9395, xxxxx@syssoftsol.com, http://www.syssoftsol.com
Specialists in fault tolerance, SMP, clusters, and Windows/NT.