ZwGetNotificationResourceManager function (wdm.h)
The ZwGetNotificationResourceManager routine retrieves the next transaction notification from a specified resource manager's notification queue.
Syntax
NTSYSCALLAPI NTSTATUS ZwGetNotificationResourceManager(
[in] HANDLE ResourceManagerHandle,
[out] PTRANSACTION_NOTIFICATION TransactionNotification,
[in] ULONG NotificationLength,
[in] PLARGE_INTEGER Timeout,
[out, optional] PULONG ReturnLength,
[in] ULONG Asynchronous,
[in, optional] ULONG_PTR AsynchronousContext
);
Parameters
[in] ResourceManagerHandle
A handle to a resource manager object that was obtained by a previous call to ZwCreateResourceManager or ZwOpenResourceManager. The handle must have RESOURCEMANAGER_GET_NOTIFICATION access to the object.
[out] TransactionNotification
A pointer to a caller-allocated buffer that receives information about the retrieved notification. The buffer must be large enough to contain a TRANSACTION_NOTIFICATION structure plus additional notification-specific arguments.
[in] NotificationLength
The length, in bytes, of the buffer that the TransactionNotification parameter points to.
[in] Timeout
A pointer to a value that specifies a relative or absolute time, in units of 100 nanoseconds. This pointer is optional and can be NULL.
If the pointer is NULL, ZwGetNotificationResourceManager does not return until a transaction notification is available. If a time value is specified, ZwGetNotificationResourceManager returns when a notification is available or after the specified time elapses, whichever comes first.
A negative value specifies a time that is relative to the current system time. For example, a relative time value of five seconds causes ZwGetNotificationResourceManager to time out five seconds after it is called.
A positive value specifies an absolute time, which is actually relative to 00:00, January 1, 1601. If an absolute time value is specified, the operating system adds the absolute time value to the time value that represents 00:00, January 1, 1601.
If the caller specifies a zero value (instead of a NULL pointer), ZwGetNotificationResourceManager returns immediately, whether a notification is available or not.
[out, optional] ReturnLength
An optional pointer to a variable. If this pointer is not NULL, and if the NotificationLength parameter's value is too small, ZwGetNotificationResourceManager supplies the required length in the variable and returns STATUS_BUFFER_TOO_SMALL.
[in] Asynchronous
A ULONG value that must be zero. ZwGetNotificationResourceManager does not support asynchronous notifications. Use TmEnableCallbacks to enable asynchronous notifications.
[in, optional] AsynchronousContext
A pointer to a ULONG value. This pointer must be NULL.
Return value
ZwGetNotificationResourceManager returns STATUS_SUCCESS if the operation succeeds and a notification is available. Otherwise, this routine might return one of the following values:
Return code | Description |
---|---|
|
The time-out interval that Timeout specifies elapsed before a notification became available. |
|
The specified handle is not a handle to a resource manager object. |
|
The object handle is invalid. |
|
The caller does not have appropriate access to the resource manager object. |
|
The NotificationLength parameter's value is too small. |
The routine might return other NTSTATUS values.
Remarks
Use the ZwGetNotificationResourceManager routine to obtain notifications synchronously. Use the TmEnableCallbacks routine to enable asynchronous notifications.
The received TRANSACTION_NOTIFICATION structure contains the enlistment key that the resource manager specified when it called ZwCreateEnlistment. You can use the enlistment key to identify the enlistment that the notification applies to.
For more information about the ZwGetNotificationResourceManager routine, see Creating a Resource Manager.
NtGetNotificationResourceManager and ZwGetNotificationResourceManager are two versions of the same Windows Native System Services routine.
For calls from kernel-mode drivers, the NtXxx and ZwXxx versions of a Windows Native System Services routine can behave differently in the way that they handle and interpret input parameters. For more information about the relationship between the NtXxx and ZwXxx versions of a routine, see Using Nt and Zw Versions of the Native System Services Routines.
Requirements
Requirement | Value |
---|---|
Minimum supported client | Available in Windows Vista and later operating system versions. |
Target Platform | Universal |
Header | wdm.h (include Wdm.h, Ntifs.h) |
Library | NtosKrnl.lib |
DLL | NtosKrnl.exe |
IRQL | = PASSIVE_LEVEL |
DDI compliance rules | HwStorPortProhibitedDDIs(storport), PowerIrpDDis(wdm) |
See also
Using Nt and Zw Versions of the Native System Services Routines