IoRegisterFsRegistrationChangeEx function

The IoRegisterFsRegistrationChangeEx 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 IoRegisterFsRegistrationChangeEx(
  PDRIVER_OBJECT          DriverObject,
  PDRIVER_FS_NOTIFICATION DriverNotificationRoutine
);

Parameters

DriverObject

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

DriverNotificationRoutine

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

Return Value

IoRegisterFsRegistrationChangeEx returns one of the following values:

Return code Description
STATUS_SUCCESS
The notification routine was successfully registered.
STATUS_INSUFFICIENT_RESOURCES
A notification packet could not be allocated for the notification routine.

Remarks

The effect of IoRegisterFsRegistrationChangeEx is identical to that of IoRegisterFsRegistrationChange on Windows XP and later.

IoRegisterFsRegistrationChangeEx 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.

When a file system filter driver calls IoRegisterFsRegistrationChangeEx, 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 IoRegisterFsRegistrationChangeEx returns, a filter driver should not call this routine until after it has created any data structures that it needs to process these notifications.

IoRegisterFsRegistrationChangeEx 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.

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

If a file system filter driver calls IoRegisterFsRegistrationChangeEx twice in succession (without calling IoUnregisterFsRegistrationChange in between), passing the same values for the DriverObject and DriverNotificationRoutine parameters that it registered in the previous call to IoRegisterFsRegistrationChangeEx, and no other filter drivers have registered since the first call, IoRegisterFsRegistrationChangeEx returns STATUS_DEVICE_ALREADY_ATTACHED.

Requirements

   
Minimum supported client This routine is only available on the Update Rollup for Windows 2000 Service Pack 4 (SP4) operating system.
Target Platform Desktop
Header ntifs.h (include Ntifs.h)
IRQL "<= APC_LEVEL"

See Also

IoRegisterFileSystem

IoRegisterFsRegistrationChange

IoUnregisterFileSystem

IoUnregisterFsRegistrationChange