Export (0) Print
Expand All
Expand Minimize

IoRegisterFsRegistrationChange routine

The IoRegisterFsRegistrationChange routine registers a file system filter driver's notification routine to be called whenever a file system registers or unregisters itself as an active file system.

Syntax


NTSTATUS IoRegisterFsRegistrationChange(
  _In_  PDRIVER_OBJECT DriverObject,
  _In_  PDRIVER_FS_NOTIFICATION DriverNotificationRoutine
);

Parameters

DriverObject [in]

Pointer to the driver object for the file system filter driver.

DriverNotificationRoutine [in]

A pointer to the PDRIVER_FS_NOTIFICATION routine, which the file system calls when it registers or unregisters itself.

Return value

Return codeDescription
STATUS_SUCCESS

The notification routine was successfully registered.

STATUS_INSUFFICIENT_RESOURCES

A notification packet could not be allocated for the notification routine.

 

Remarks

IoRegisterFsRegistrationChange registers a file system filter driver to be notified whenever a file system calls IoRegisterFileSystem or IoUnregisterFileSystem.

To stop receiving such notifications, the filter driver should call IoUnregisterFsRegistrationChange.

Note   In Microsoft Windows XP and later, when a file system filter driver calls IoRegisterFsRegistrationChange, its notification routine is also called immediately for all currently registered file systems (that is, file systems that have already called IoRegisterFileSystem but have not yet called IoUnregisterFileSystem).

Because the caller's notification routine can be called even before IoRegisterFsRegistrationChange returns, a filter driver should not call this routine until after it has created any data structures that it needs in order to process these notifications.

Additionally, in Windows XP and later, IoRegisterFsRegistrationChange ignores RAW devices. For information about attaching to the RAW file system by name, see Attaching the Filter Device Object to the Target Device Object.

IoRegisterFsRegistrationChange increments the reference count on the filter driver's driver object.

Note   In Update Rollup for Windows 2000 Service Pack 4 (SP4), Windows XP Service Pack 2 (SP2), and Microsoft Windows Server 2003 SP1 and later, if a file system filter driver calls IoRegisterFsRegistrationChange twice in succession (without calling IoUnregisterFsRegistrationChange in between), passing the same values for the DriverObject and DriverNotificationRoutine that it registered in the previous call to IoRegisterFsRegistrationChange, and no other filter drivers have registered since the first call, IoRegisterFsRegistrationChange returns STATUS_DEVICE_ALREADY_ATTACHED.

In Update Rollup for Windows 2000 SP4, file system filter drivers can call IoRegisterFsRegistrationChangeEx instead of IoRegisterFsRegistrationChange. The effect of IoRegisterFsRegistrationChangeEx is identical to that of IoRegisterFsRegistrationChange on Windows XP and later.

Requirements

Header

Ntifs.h (include Ntifs.h)

Library

Ntoskrnl.lib

IRQL

< DISPATCH_LEVEL

See also

IoRegisterFileSystem
IoRegisterFsRegistrationChangeEx
IoUnregisterFileSystem
IoUnregisterFsRegistrationChange

 

 

Send comments about this topic to Microsoft

Show:
© 2014 Microsoft