> Windows Syscalls
ntoskrnl.exeT1106

NtManagePartition

Interroge ou modifie une partition mémoire existante — ajout de mémoire, transfert de pages, configuration des memory-lists.

Prototype

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

Arguments

NameTypeDirDescription
TargetHandleHANDLEinHandle vers la partition cible interrogée ou modifiée.
SourceHandleHANDLEinPartition source optionnelle (utilisée par SystemMemoryPartitionMoveMemory pour donner des pages) ; sinon NULL.
PartitionInformationClassPARTITION_INFORMATION_CLASSinSélecteur d'opération : 0 PageInformation, 1 AllocationInformation, 2 ClearAddedRanges, 3 AddMemory, 4 MoveMemory, 5 DepositPages, 6 WithdrawPages, 7 OpenHandle, 8 MemoryEvent, 9 EmptyCompressionStore, 10 PageCombiningInformation.
PartitionInformationPVOIDin/outTampon d'entrée/sortie spécifique à la classe (ex. MEMORY_PARTITION_PAGE_INFORMATION).
PartitionInformationLengthULONGinTaille en octets du tampon PartitionInformation.

IDs de syscalls par version de Windows

Version 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

Module noyau

ntoskrnl.exeNtManagePartition

APIs liées

NtCreatePartitionNtOpenPartitionGetMemoryErrorHandlingCapabilities

Stub du 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

Notes non documentées

Le couteau-suisse de la fratrie `NtCreatePartition` / `NtOpenPartition`. Le sélecteur `PARTITION_INFORMATION_CLASS` décide tout : `0` (PageInformation) renvoie des compteurs vivants comparables à `MEMORYSTATUSEX` mais restreints à la partition ; `3` (AddMemory) donne une plage de mémoire physique du parent à la cible ; `4` (MoveMemory) re-attribue des pages déjà attachées entre deux partitions et est la seule classe utilisant à la fois `TargetHandle` et `SourceHandle` ; `9` (EmptyCompressionStore) vide le compressed-page store de la partition vers la mémoire paginable ou le pagefile. Toutes les classes de modification requièrent `SeLockMemoryPrivilege` (en plus de `MEMORY_PARTITION_MODIFY_ACCESS` sur le handle).

Usage courant par les malwares

Signal de malware commodity très faible. L'angle de recherche intéressant est `EmptyCompressionStore` : forcer une partition parente à vider ses pages MemCompression peut servir de canal auxiliaire grossier de timing de cache contre un processus co-résident, et des travaux académiques le démontrent. Rien de tout cela n'a migré dans des ransomwares ou stealers in-the-wild. La plupart des défenseurs peuvent traiter sans risque tout appelant non-Microsoft de `NtManagePartition` comme méritant un examen approfondi.

Opportunités de détection

Couplez Sysmon Event ID 1 (création de processus) avec l'ETW noyau : le provider `Microsoft-Windows-Kernel-Memory` émet des évènements granulaires pour les opérations de modification de partition, incluant la classe d'information. Cherchez toute image hors `vmcompute.exe`, `vmwp.exe`, `vmms.exe` et les quelques services de mode-jeu appelant `NtManagePartition` avec classe d'information `3`, `4`, `5`, `6` ou `9`. Les appels query-only en classe `0` sortent aussi de `taskmgr.exe` / `procexp.exe` et ne sont pas intéressants en soi.

Exemples de syscalls directs

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

Mappings MITRE ATT&CK

Last verified: 2026-05-20