NtAllocateReserveObject - NtDoc

Native API online documentation, based on the System Informer (formerly Process Hacker) phnt headers
#ifndef _NTPSAPI_H
//
// Reserve objects
//
#if (PHNT_MODE != PHNT_MODE_KERNEL)

/**
 * Allocates a typed reserve that can back a user APC or a reusable completion packet.
 * MemoryReserveIoCompletion is used with NtSetIoCompletionEx, not with the
 * NtAssociateWaitCompletionPacket family.
 *
 * \param[out] MemoryReserveHandle Receives a caller-owned handle; close with NtClose.
 * On x64, the inserted handle requests access 0x000F0003.
 * \param[in, optional] ObjectAttributes Optional name and object attributes. NULL
 * creates an unnamed reserve; it is a supported input on native x64 and WoW64.
 * \param[in] Type MemoryReserveUserApc (0) or MemoryReserveIoCompletion (1).
 * Other selectors return STATUS_INVALID_PARAMETER.
 * \return NTSTATUS describing allocation, not an APC or completion's eventual status.
 * \remarks A completion reserve can be in use for only one outstanding packet.
 * Removing that packet releases the in-use state for reuse. It is not a raw buffer
 * returned to user mode, and the APC and completion reserve types are not interchangeable.
 */
_Kernel_entry_
NTSYSCALLAPI
NTSTATUS
NTAPI
NtAllocateReserveObject(
    _Out_ PHANDLE MemoryReserveHandle,
    _In_opt_ PCOBJECT_ATTRIBUTES ObjectAttributes,
    _In_ MEMORY_RESERVE_TYPE Type
    );

#endif
#endif

View code on GitHub
#ifndef _NTZWAPI_H

_Kernel_entry_
NTSYSCALLAPI
NTSTATUS
NTAPI
ZwAllocateReserveObject(
    _Out_ PHANDLE MemoryReserveHandle,
    _In_opt_ PCOBJECT_ATTRIBUTES ObjectAttributes,
    _In_ MEMORY_RESERVE_TYPE Type
    );

#endif

View code on GitHub

NtDoc

No description available.