Expand Minimize

IoRegisterFsRegistrationChangeMountAware routine

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

DriverObject [in]

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

SynchronizeWithMounts [in]

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 codeDescription
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

Target platform

Universal

Version

The IoRegisterFsRegistrationChangeMountAware routine is available in Windows 7 and later versions of Windows.

Header

Ntifs.h (include FltKernel.h or Ntifs.h)

Library

Ntoskrnl.lib

IRQL

< DISPATCH_LEVEL

See also

IoRegisterFileSystem
IoRegisterFsRegistrationChange
IoRegisterFsRegistrationChangeEx
IoUnregisterFileSystem
IoUnregisterFsRegistrationChange

 

 

Send comments about this topic to Microsoft

Show:
© 2015 Microsoft