IoRegisterFsRegistrationChangeMountAware function (ntifs.h)

The IoRegisterFsRegistrationChangeMountAware routine registers a file system filter driver's notification routine. This notification routine is called whenever a file system registers or unregisters itself as an active file system.

Syntax

NTSTATUS IoRegisterFsRegistrationChangeMountAware(
  [in] PDRIVER_OBJECT          DriverObject,
  [in] PDRIVER_FS_NOTIFICATION DriverNotificationRoutine,
  [in] BOOLEAN                 SynchronizeWithMounts
);

Parameters

[in] DriverObject

A pointer to the driver object for the file system filter driver.

[in] DriverNotificationRoutine

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

[in] SynchronizeWithMounts

If set to TRUE, this routine ensures no mount operations are in progress when making notification callbacks. If set to FALSE, the routine does not attempt to avoid conflicts with mount operations.

Return value

Returns one of the following NTSTATUS 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.
STATUS_DEVICE_ALREADY_ATTACHED
This driver object has already been registered with this notification.

Remarks

IoRegisterFsRegistrationChangeMountAware 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 SynchronizeWithMounts is specified as TRUE, IoRegisterFsRegistrationChangeMountAware waits for any current mount operations to complete and does not allow new mount operations to begin until IoRegisterFsRegistrationChangeMountAware is finished.

Note   When a file system filter driver calls IoRegisterFsRegistrationChangeMountAware, its notification routine is also called immediately for all file systems that are currently registered, 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 IoRegisterFsRegistrationChangeMountAware returns, a filter driver should not call this routine until after it has created data structures it needs to process these notifications.

Additionally, IoRegisterFsRegistrationChangeMountAware ignores RAW devices. For information about how to attach to the RAW file system by name, see Attaching the Filter Device Object to the Target Device Object.

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

Requirements

Requirement Value
Minimum supported client The IoRegisterFsRegistrationChangeMountAware routine is Windows 7
Target Platform Universal
Header ntifs.h (include FltKernel.h, Ntifs.h)
Library NtosKrnl.lib
DLL NtosKrnl.exe
IRQL < DISPATCH_LEVEL

See also

IoRegisterFileSystem

IoRegisterFsRegistrationChange

IoRegisterFsRegistrationChangeEx

IoUnregisterFileSystem

IoUnregisterFsRegistrationChange