> Windows Syscalls
ntoskrnl.exeT1106

NtManagePartition

Consulta o modifica una partición de memoria existente — añadir memoria, transferir páginas, configurar memory-lists.

Prototipo

NTSTATUS NtManagePartition(
  HANDLE                       TargetHandle,
  HANDLE                       SourceHandle,
  PARTITION_INFORMATION_CLASS  PartitionInformationClass,
  PVOID                        PartitionInformation,
  ULONG                        PartitionInformationLength
);

Argumentos

NameTypeDirDescription
TargetHandleHANDLEinHandle a la partición objetivo siendo consultada o modificada.
SourceHandleHANDLEinPartición fuente opcional (usada por SystemMemoryPartitionMoveMemory para donar páginas); si no, NULL.
PartitionInformationClassPARTITION_INFORMATION_CLASSinSelector de operación: 0 PageInformation, 1 AllocationInformation, 2 ClearAddedRanges, 3 AddMemory, 4 MoveMemory, 5 DepositPages, 6 WithdrawPages, 7 OpenHandle, 8 MemoryEvent, 9 EmptyCompressionStore, 10 PageCombiningInformation.
PartitionInformationPVOIDin/outBúfer de entrada/salida específico de la clase (p. ej. MEMORY_PARTITION_PAGE_INFORMATION).
PartitionInformationLengthULONGinTamaño en bytes del búfer PartitionInformation.

IDs de syscalls por versión de Windows

Versión de WindowsID de syscallBuild
Win10 15070xFFwin10-1507
Win10 16070x104win10-1607
Win10 17030x108win10-1703
Win10 17090x109win10-1709
Win10 18030x10Awin10-1803
Win10 18090x10Bwin10-1809
Win10 19030x10Cwin10-1903
Win10 19090x10Cwin10-1909
Win10 20040x111win10-2004
Win10 20H20x111win10-20h2
Win10 21H10x111win10-21h1
Win10 21H20x112win10-21h2
Win10 22H20x112win10-22h2
Win11 21H20x118win11-21h2
Win11 22H20x119win11-22h2
Win11 23H20x119win11-23h2
Win11 24H20x11Bwin11-24h2
Server 20160x104winserver-2016
Server 20190x10Bwinserver-2019
Server 20220x117winserver-2022
Server 20250x11Bwinserver-2025

Módulo del kernel

ntoskrnl.exeNtManagePartition

APIs relacionadas

NtCreatePartitionNtOpenPartitionGetMemoryErrorHandlingCapabilities

Stub del syscall

4C 8B D1                  mov r10, rcx
B8 1B 01 00 00            mov eax, 0x11B
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

Notas no documentadas

La navaja suiza hermana de `NtCreatePartition` y `NtOpenPartition`. El selector `PARTITION_INFORMATION_CLASS` lo decide todo: `0` (PageInformation) devuelve contadores vivos comparables a `MEMORYSTATUSEX` pero limitados a la partición; `3` (AddMemory) entrega un rango de memoria física del padre al objetivo; `4` (MoveMemory) re-asigna páginas ya adjuntas entre dos particiones y es la única clase que usa tanto `TargetHandle` como `SourceHandle`; `9` (EmptyCompressionStore) vacía el almacén de páginas comprimidas de la partición a memoria paginable o pagefile. Todas las clases de modificación requieren `SeLockMemoryPrivilege` (además de `MEMORY_PARTITION_MODIFY_ACCESS` en el handle).

Uso común por malware

Señal de malware commodity muy débil. El ángulo de investigación interesante es `EmptyCompressionStore`: forzar a una partición padre a vaciar sus páginas respaldadas por MemCompression puede usarse como un canal lateral grueso de timing de caché contra un proceso co-residente, y hay trabajo académico demostrándolo. Nada de eso ha migrado a ransomware o stealers in-the-wild. La mayoría de defensores pueden tratar con seguridad a cualquier llamante no-Microsoft de `NtManagePartition` como merecedor de inspección detenida.

Oportunidades de detección

Empareje Sysmon Event ID 1 (creación de proceso) con ETW de kernel: el provider `Microsoft-Windows-Kernel-Memory` emite eventos granulares para operaciones de modificación de partición incluyendo la clase de información. Busque cualquier imagen fuera de `vmcompute.exe`, `vmwp.exe`, `vmms.exe` y los pocos servicios de game-mode llamando `NtManagePartition` con clase de información `3`, `4`, `5`, `6` o `9`. Las llamadas query-only de clase `0` también surgen de `taskmgr.exe` / `procexp.exe` y no son interesantes por sí solas.

Ejemplos de syscalls directos

cQuery partition page accounting

#include <windows.h>
#include <winternl.h>

typedef NTSTATUS (NTAPI* pNtManagePartition)(
    HANDLE, HANDLE, ULONG /*info class*/, PVOID, ULONG);

typedef struct _MEMORY_PARTITION_PAGE_INFORMATION {
    SIZE_T TotalCommittedPages;
    SIZE_T TotalCommitLimit;
    SIZE_T CurrentCommittedPages;
    SIZE_T PageCombinesAttempted;
    SIZE_T PageCombinesSucceeded;
} MEMORY_PARTITION_PAGE_INFORMATION;

void query_partition_pages(HANDLE hPart) {
    MEMORY_PARTITION_PAGE_INFORMATION info = { 0 };
    pNtManagePartition f = (pNtManagePartition)GetProcAddress(
        GetModuleHandleA("ntdll.dll"), "NtManagePartition");
    f(hPart, NULL, 0 /* SystemMemoryPartitionPageInformation */,
      &info, sizeof(info));
}

asmx64 direct stub (Win11 24H2 / Server 2025, SSN 0x11B)

NtManagePartition PROC
    mov  r10, rcx
    mov  eax, 11Bh
    syscall
    ret
NtManagePartition ENDP

Mapeos MITRE ATT&CK

Last verified: 2026-05-20