> Windows Syscalls
ntoskrnl.exeT1106

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

NameTypeDirDescription
PartitionHandlePHANDLEoutReceives the handle to the opened partition object.
DesiredAccessACCESS_MASKinRequested access mask; e.g. MEMORY_PARTITION_QUERY_ACCESS (0x0001) or MEMORY_PARTITION_MODIFY_ACCESS (0x0002).
ObjectAttributesPOBJECT_ATTRIBUTESinObject-manager path of the partition, e.g. \KernelObjects\Sandbox1.

Syscall IDs by Windows version

Windows versionSyscall IDBuild
Win10 15070x112win10-1507
Win10 16070x117win10-1607
Win10 17030x11Bwin10-1703
Win10 17090x11Dwin10-1709
Win10 18030x11Fwin10-1803
Win10 18090x120win10-1809
Win10 19030x121win10-1903
Win10 19090x121win10-1909
Win10 20040x126win10-2004
Win10 20H20x126win10-20h2
Win10 21H10x126win10-21h1
Win10 21H20x127win10-21h2
Win10 22H20x127win10-22h2
Win11 21H20x12Dwin11-21h2
Win11 22H20x12Fwin11-22h2
Win11 23H20x12Fwin11-23h2
Win11 24H20x131win11-24h2
Server 20160x117winserver-2016
Server 20190x120winserver-2019
Server 20220x12Cwinserver-2022
Server 20250x131winserver-2025

Kernel module

ntoskrnl.exeNtOpenPartition

Related APIs

NtCreatePartitionNtManagePartitionOpenPartition

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 ENDP

MITRE ATT&CK mappings

Last verified: 2026-05-20