IO_SESSION_STATE_NOTIFICATION structure (wdm.h)
The IO_SESSION_STATE_NOTIFICATION structure contains information that a kernel-mode driver supplies to the IoRegisterContainerNotification routine when the driver registers to receive notifications of session events.
Syntax
typedef struct _IO_SESSION_STATE_NOTIFICATION {
ULONG Size;
ULONG Flags;
PVOID IoObject;
ULONG EventMask;
PVOID Context;
} IO_SESSION_STATE_NOTIFICATION, *PIO_SESSION_STATE_NOTIFICATION;
Members
Size
The size, in bytes, of the IO_SESSION_STATE_NOTIFICATION structure.
Flags
No flags are currently defined for this member. Set to zero.
IoObject
A pointer to an I/O object owned by the driver. This member can point to a DEVICE_OBJECT, DRIVER_OBJECT, or FILE_OBJECT structure. The I/O object must remain valid for the lifetime of the registration. Before you delete a registered device object, unload a registered driver, or close a registered file object, call the IoUnregisterContainerNotification routine to cancel the registration. A driver can maintain simultaneous registrations for more than one I/O object, but it cannot create more than one active registration for the same I/O object.
EventMask
Mask bits for session events. These mask bits indicate the events for which the driver requests notifications.
To register to receive notifications of session events, a kernel-mode driver calls the IoRegisterContainerNotification routine. To specify the session events for which the driver wants to receive notifications, the driver sets this structure's EventMask member to the bitwise OR of one or more IO_SESSION_STATE_XXX constants.
Set this member to the bitwise OR of one or more of the following IO_SESSION_STATE_XXX constants:
Context
A pointer to a context buffer in which the driver can store its private data for a particular session notification registration. The I/O manager passes this pointer to the driver's notification callback routine (specified by the IoRegisterContainerNotification routine's CallbackFunction parameter). The I/O manager does not try to validate the Context pointer or to access the buffer that it points to. This member can be NULL if the driver does not require a context buffer.
Remarks
This structure is used by the IoRegisterContainerNotification routine. A driver that calls IoRegisterContainerNotification uses this structure to specify the session event notifications that it is registering for.
A per-session device object represents a device that can be accessed only by a particular user session. If a driver sets the IoObject member to point to a device object that is a per-session device object, IoRegisterContainerNotification registers the driver to receive only notifications of events that occur in the session that is represented by the device object. If IoObject points to a device object that is not a per-session device object, or if IoObject points to an object that is not a device object, IoRegisterContainerNotification registers the driver to receive notifications of events that occur in all sessions on the computer.
To determine whether a device object is a per-session device object, a driver can call the IoGetDevicePropertyData routine to query the DEVPKEY_Device_SessionId property key in the property store of the device object. If the DEVPKEY_Device_SessionId property exists and the value of the property is set to a nonzero Terminal Services session identifier, the device object is a per-session device object. For more information, see DEVPKEY_Device_SessionId.
Requirements
Requirement | Value |
---|---|
Minimum supported client | Supported in Windows 7 and later versions of the Windows operating system. |
Header | wdm.h (include Wdm.h, Ntddk.h, Ntifs.h, Fltkernel.h) |