#ifndef _NTTMAPI_H
NTSYSCALLAPI
NTSTATUS
NTAPI
NtQueryInformationResourceManager(
_In_ HANDLE ResourceManagerHandle,
_In_ RESOURCEMANAGER_INFORMATION_CLASS ResourceManagerInformationClass,
_Out_writes_bytes_(ResourceManagerInformationLength) PVOID ResourceManagerInformation,
_In_ ULONG ResourceManagerInformationLength,
_Out_opt_ PULONG ReturnLength
);
View code on GitHub#ifndef _NTZWAPI_H
NTSYSCALLAPI
NTSTATUS
NTAPI
ZwQueryInformationResourceManager(
_In_ HANDLE ResourceManagerHandle,
_In_ RESOURCEMANAGER_INFORMATION_CLASS ResourceManagerInformationClass,
_Out_writes_bytes_(ResourceManagerInformationLength) PVOID ResourceManagerInformation,
_In_ ULONG ResourceManagerInformationLength,
_Out_opt_ PULONG ReturnLength
);
View code on GitHub// wdm.h
__kernel_entry NTSYSCALLAPI NTSTATUS NtQueryInformationResourceManager(
[in] HANDLE ResourceManagerHandle,
[in] RESOURCEMANAGER_INFORMATION_CLASS ResourceManagerInformationClass,
[out] PVOID ResourceManagerInformation,
[in] ULONG ResourceManagerInformationLength,
[out, optional] PULONG ReturnLength
);
View the official Windows Driver Kit DDI reference// wdm.h
NTSYSCALLAPI NTSTATUS ZwQueryInformationResourceManager(
[in] HANDLE ResourceManagerHandle,
[in] RESOURCEMANAGER_INFORMATION_CLASS ResourceManagerInformationClass,
[out] PVOID ResourceManagerInformation,
[in] ULONG ResourceManagerInformationLength,
[out, optional] PULONG ReturnLength
);
View the official Windows Driver Kit DDI referenceThe ZwQueryInformationResourceManager routine retrieves information about a specified resource manager object.
ResourceManagerHandle [in]A handle to a resource manager object that was obtained by a previous call to ZwCreateResourceManager or ZwOpenResourceManager. The handle must have RESOURCEMANAGER_QUERY_INFORMATION access to the object.
ResourceManagerInformationClass [in]A RESOURCEMANAGER_INFORMATION_CLASS-typed value that specifies the information to retrieve. This value must be ResourceManagerBasicInformation.
ResourceManagerInformation [out]A pointer to a caller-allocated RESOURCEMANAGER_BASIC_INFORMATION structure that receives information from ZwQueryInformationResourceManager.
ResourceManagerInformationLength [in]The length, in bytes, of the buffer that the ResourceManagerInformation parameter points to.
ReturnLength [out, optional]A pointer to a caller-allocated variable that receives the length, in bytes, of the information that KTM writes to the ResourceManagerInformation buffer. This parameter is optional and can be NULL.
ZwQueryInformationResourceManager returns STATUS_SUCCESS if the operation succeeds. Otherwise, this routine might return one of the following values:
| Return code | Description |
|---|---|
| STATUS_OBJECT_TYPE_MISMATCH | The specified handle is not a handle to a resource manager object. |
| STATUS_INVALID_HANDLE | An object handle is invalid. |
| STATUS_INVALID_INFO_CLASS | The ResourceManagerInformationClass parameter's value is invalid. |
| STATUS_BUFFER_TOO_SMALL | The buffer size that the ResourceManagerInformationLength parameter specifies is smaller than the RESOURCEMANAGER_BASIC_INFORMATION structure. |
| STATUS_BUFFER_OVERFLOW | The buffer size that the ResourceManagerInformationLength parameter specifies is too small to receive all the variable-length information that is available. |
| STATUS_ACCESS_DENIED | The caller does not have appropriate access to the resource manager object. |
The routine might return other NTSTATUS values.
For more information about the ZwQueryInformationResourceManager routine, see Creating a Resource Manager.
NtQueryInformationResourceManager and ZwQueryInformationResourceManager are two versions of the same Windows Native System Services routine.
For calls from kernel-mode drivers, the Nt*Xxx* and Zw*Xxx* 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 Nt*Xxx* and Zw*Xxx* versions of a routine, see Using Nt and Zw Versions of the Native System Services Routines.
RESOURCEMANAGER_BASIC_INFORMATION
RESOURCEMANAGER_INFORMATION_CLASS
Using Nt and Zw Versions of the Native System Services Routines
ZwSetInformationResourceManager
The ZwQueryInformationResourceManager routine retrieves information about a specified resource manager object.
ResourceManagerHandle [in]A handle to a resource manager object that was obtained by a previous call to ZwCreateResourceManager or ZwOpenResourceManager. The handle must have RESOURCEMANAGER_QUERY_INFORMATION access to the object.
ResourceManagerInformationClass [in]A RESOURCEMANAGER_INFORMATION_CLASS-typed value that specifies the information to retrieve. This value must be ResourceManagerBasicInformation.
ResourceManagerInformation [out]A pointer to a caller-allocated RESOURCEMANAGER_BASIC_INFORMATION structure that receives information from ZwQueryInformationResourceManager.
ResourceManagerInformationLength [in]The length, in bytes, of the buffer that the ResourceManagerInformation parameter points to.
ReturnLength [out, optional]A pointer to a caller-allocated variable that receives the length, in bytes, of the information that KTM writes to the ResourceManagerInformation buffer. This parameter is optional and can be NULL.
ZwQueryInformationResourceManager returns STATUS_SUCCESS if the operation succeeds. Otherwise, this routine might return one of the following values:
| Return code | Description |
|---|---|
| STATUS_OBJECT_TYPE_MISMATCH | The specified handle is not a handle to a resource manager object. |
| STATUS_INVALID_HANDLE | An object handle is invalid. |
| STATUS_INVALID_INFO_CLASS | The ResourceManagerInformationClass parameter's value is invalid. |
| STATUS_BUFFER_TOO_SMALL | The buffer size that the ResourceManagerInformationLength parameter specifies is smaller than the RESOURCEMANAGER_BASIC_INFORMATION structure. |
| STATUS_BUFFER_OVERFLOW | The buffer size that the ResourceManagerInformationLength parameter specifies is too small to receive all the variable-length information that is available. |
| STATUS_ACCESS_DENIED | The caller does not have appropriate access to the resource manager object. |
The routine might return other NTSTATUS values.
For more information about the ZwQueryInformationResourceManager routine, see Creating a Resource Manager.
NtQueryInformationResourceManager and ZwQueryInformationResourceManager are two versions of the same Windows Native System Services routine.
For calls from kernel-mode drivers, the Nt*Xxx* and Zw*Xxx* 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 Nt*Xxx* and Zw*Xxx* versions of a routine, see Using Nt and Zw Versions of the Native System Services Routines.
RESOURCEMANAGER_BASIC_INFORMATION
RESOURCEMANAGER_INFORMATION_CLASS
Using Nt and Zw Versions of the Native System Services Routines
ZwSetInformationResourceManager