Question on IoRegisterFsRegistrationChange

Hi,

The Windows 2000 IFS Kit documentation says:
“IoRegisterFsRegistrationChange registers the specified driver’s
notification routine…
and increments the device object’s reference count.”

while the XP documentation state:
“… and increments the reference count on the filter driver’s driver
object.”

I have not seen the ReferenceCount field in the DRIVER_OBJECT structure,
so this routine probably references the DEVICE_OBJECT. Am I right?

What if the driver does not have a device object when calling this routine?
What if it has more than one device object? Which one will be referenced?

Thanks in advance for your answers.

Regards,
Leonid.

>The Windows 2000 IFS Kit documentation says:

“IoRegisterFsRegistrationChange registers the specified driver’s
notification routine…
and increments the device object’s reference count.”

while the XP documentation state:
“… and increments the reference count on the filter driver’s driver
object.”

I have not seen the ReferenceCount field in the DRIVER_OBJECT structure,
so this routine probably references the DEVICE_OBJECT. Am I right?

No, every object in NT including DRIVER_OBJECT has assosiated reference
count. As far as I know IoRegisterFsRegistrationChange increments
reference count of DRIVER_OBJECT.

Alexei.

> The Windows 2000 IFS Kit documentation says:

“IoRegisterFsRegistrationChange registers the specified driver’s
notification routine…
and increments the device object’s reference count.”

Yes. The reference count on the first device object created by this
driver
is used.
IoRegisterFsRegistrationChange will BSOD if you have no device objects
created by your driver before calling it.

Max