NtOpenPartition
Opens an existing memory partition object by name and returns a handle for management or process attachment.
Prototype
NTSTATUS NtOpenPartition( PHANDLE PartitionHandle, ACCESS_MASK DesiredAccess, POBJECT_ATTRIBUTES ObjectAttributes );
Arguments
| Name | Type | Dir | Description |
|---|---|---|---|
| PartitionHandle | PHANDLE | out | Receives the handle to the opened partition object. |
| DesiredAccess | ACCESS_MASK | in | Requested access mask; e.g. MEMORY_PARTITION_QUERY_ACCESS (0x0001) or MEMORY_PARTITION_MODIFY_ACCESS (0x0002). |
| ObjectAttributes | POBJECT_ATTRIBUTES | in | Object-manager path of the partition, e.g. \KernelObjects\Sandbox1. |
Syscall IDs by Windows version
| Windows version | Syscall ID | Build |
|---|---|---|
| Win10 1507 | 0x112 | win10-1507 |
| Win10 1607 | 0x117 | win10-1607 |
| Win10 1703 | 0x11B | win10-1703 |
| Win10 1709 | 0x11D | win10-1709 |
| Win10 1803 | 0x11F | win10-1803 |
| Win10 1809 | 0x120 | win10-1809 |
| Win10 1903 | 0x121 | win10-1903 |
| Win10 1909 | 0x121 | win10-1909 |
| Win10 2004 | 0x126 | win10-2004 |
| Win10 20H2 | 0x126 | win10-20h2 |
| Win10 21H1 | 0x126 | win10-21h1 |
| Win10 21H2 | 0x127 | win10-21h2 |
| Win10 22H2 | 0x127 | win10-22h2 |
| Win11 21H2 | 0x12D | win11-21h2 |
| Win11 22H2 | 0x12F | win11-22h2 |
| Win11 23H2 | 0x12F | win11-23h2 |
| Win11 24H2 | 0x131 | win11-24h2 |
| Server 2016 | 0x117 | winserver-2016 |
| Server 2019 | 0x120 | winserver-2019 |
| Server 2022 | 0x12C | winserver-2022 |
| Server 2025 | 0x131 | winserver-2025 |
Kernel module
Related APIs
Syscall stub
4C 8B D1 mov r10, rcx B8 31 01 00 00 mov eax, 0x131 F6 04 25 08 03 FE 7F 01 test byte ptr [0x7FFE0308], 1 75 03 jne short +3 0F 05 syscall C3 ret CD 2E int 2Eh C3 ret
Undocumented notes
Companion `Open` counterpart to `NtCreatePartition`. The lookup is purely object-manager: the partition must already exist under its namespace path (commonly `\KernelObjects\…`) and the calling token must satisfy the partition's security descriptor for the requested rights. Unlike `NtCreatePartition`, opening a partition for query/inspect does not require `SeLockMemoryPrivilege` — only modify/attach paths do. The dynamic syscall lookup is straightforward via Hell's Gate because the SSN drifts predictably.
Common malware usage
Essentially zero direct abuse in commodity malware. A defender or researcher might call this to introspect Hyper-V container partitions on a host, and a sophisticated implant *theoretically* could use a pre-existing user-created partition to host its allocations and pollute working-set counters seen by the host EDR — but the gain over plain `NtAllocateVirtualMemory` is negligible relative to the privilege cost.
Detection opportunities
Pair with the `NtCreatePartition` signal: opening a named partition the operator did not create themselves is anomalous outside of vmcompute/vmwp/SystemSettings. ETW `Microsoft-Windows-Kernel-Memory` event 9 (`PartitionOpened`) carries the calling image and the partition object name. Most production environments will have an empty allowlist here.
Direct syscall examples
cOpen an existing partition for query
#include <windows.h>
#include <winternl.h>
#define MEMORY_PARTITION_QUERY_ACCESS 0x0001
typedef NTSTATUS (NTAPI* pNtOpenPartition)(
PHANDLE, ACCESS_MASK, POBJECT_ATTRIBUTES);
HANDLE open_partition(LPCWSTR name) {
UNICODE_STRING us;
RtlInitUnicodeString(&us, name);
OBJECT_ATTRIBUTES oa;
InitializeObjectAttributes(&oa, &us, OBJ_CASE_INSENSITIVE, NULL, NULL);
pNtOpenPartition f = (pNtOpenPartition)GetProcAddress(
GetModuleHandleA("ntdll.dll"), "NtOpenPartition");
HANDLE h = NULL;
f(&h, MEMORY_PARTITION_QUERY_ACCESS, &oa);
return h;
}asmx64 direct stub (Win11 24H2, SSN 0x131)
NtOpenPartition PROC
mov r10, rcx
mov eax, 131h
syscall
ret
NtOpenPartition ENDPMITRE ATT&CK mappings
Last verified: 2026-05-20