DRIVER_FS_NOTIFICATION回调函数 (ntifs.h)

当文件系统使用 IoRegisterFileSystem 或 IoUnregisterFileSystem 注册或注销自身时,操作系统会调用PDRIVER_FS_NOTIFICATION类型的例程。

语法

DRIVER_FS_NOTIFICATION DriverFsNotification;

void DriverFsNotification(
  [in] _DEVICE_OBJECT *DeviceObject,
  [in] BOOLEAN FsActive
)
{...}

参数

[in] DeviceObject

指向为其调用通知的文件系统设备对象的指针。

[in] FsActive

一个布尔值,指示文件系统是已注册 (TRUE) 还是未注册 (FALSE,) 自身作为活动文件系统。

返回值

备注

必须使用 DRIVER_FS_NOTIFICATION 类型声明回调函数。 有关详细信息,请参阅以下示例部分。

示例

若要定义名为 MyDriverNotificationDriverFSNotificationRoutine 回调例程,必须先提供静态驱动程序验证 (SDV) 和其他验证工具所需的函数声明,如下所示:

DRIVER_FS_NOTIFICATION MyDriverFSNotification;

然后实现回调例程,如下所示:

VOID
MyDriverFSNotification (
    __in struct _DEVICE_OBJECT *DeviceObject,
    __in BOOLEAN FsActive
)
{ . . . }

请注意,回调类型在 Ntifs.h 中声明,如下所示:

typedef
VOID
DRIVER_FS_NOTIFICATION (
  __in struct _DEVICE_OBJECT *DeviceObject,
  __in BOOLEAN FsActive
  );
typedef DRIVER_FS_NOTIFICATION *PDRIVER_FS_NOTIFICATION;

要求

要求
最低受支持的客户端 Windows 2000
目标平台 桌面
标头 ntifs.h (包括 FltKernel.h、Ntifs.h)
IRQL PASSIVE_LEVEL

另请参阅

IoRegisterFsRegistrationChange

IoRegisterFsRegistrationChangeEx

IoRegisterFsRegistrationChangeMountAware

IoUnregisterFsRegistrationChange