IoRegisterFsRegistrationChange

Hello,

I have the following problem with “IoRegisterFsRegistrationChange”:

I call this routine in a driver, that starts late (manual startup). That
works ok under Win2k. But the driver is *dead* under WinNT4. I’ve debugged
and my DriverEntry-routine gets executed normally:
IoRegisterFsRegistrationChange returns successfully. But the driver doesn’t
accept any DeviceIoControl-calls from user space afterwards. It hangs!

Any hints? Do I have to create a DeviceObject of particular type
(FILE_DEVICE_DISK_FILE_SYSTEM) in DriverEntry?

Thanks in advance
Frank

> IoRegisterFsRegistrationChange returns successfully. But the driver
doesn’t

accept any DeviceIoControl-calls from user space afterwards. It hangs!

Any hints? Do I have to create a DeviceObject of particular type
(FILE_DEVICE_DISK_FILE_SYSTEM) in DriverEntry?

Welcome to undocumented stuff of the kernel :slight_smile:

The solution to your problem is below - the comment from my FSD/filter
driver.

// NOTE: NT4 has a bug - IoRegisterFsRegistrationChange increments the
// DeviceObject->ReferenceCount field on the first device object hanging
off this driver
// to prevent the driver from unload while the FS registration callback is
not revoked
// a) BSOD if no device objects at all yet
// b) if this device object is exclusive - it will be never opened
// (IopParseDevice fails CREATE for exclusive device objects with
ReferenceCount != 0 )

Max