NtManagePartition
Fragt eine bestehende Memory-Partition ab oder verändert sie — Speicher hinzufügen, Seiten verschieben, Memory-List-Konfiguration setzen.
Prototyp
NTSTATUS NtManagePartition( HANDLE TargetHandle, HANDLE SourceHandle, PARTITION_INFORMATION_CLASS PartitionInformationClass, PVOID PartitionInformation, ULONG PartitionInformationLength );
Argumente
| Name | Type | Dir | Description |
|---|---|---|---|
| TargetHandle | HANDLE | in | Handle auf die abzufragende oder zu verändernde Ziel-Partition. |
| SourceHandle | HANDLE | in | Optionale Quell-Partition (von SystemMemoryPartitionMoveMemory genutzt, um Seiten abzugeben); sonst NULL. |
| PartitionInformationClass | PARTITION_INFORMATION_CLASS | in | Operations-Selektor: 0 PageInformation, 1 AllocationInformation, 2 ClearAddedRanges, 3 AddMemory, 4 MoveMemory, 5 DepositPages, 6 WithdrawPages, 7 OpenHandle, 8 MemoryEvent, 9 EmptyCompressionStore, 10 PageCombiningInformation. |
| PartitionInformation | PVOID | in/out | Klassenspezifischer Ein-/Ausgabepuffer (z. B. MEMORY_PARTITION_PAGE_INFORMATION). |
| PartitionInformationLength | ULONG | in | Größe des PartitionInformation-Puffers in Bytes. |
Syscall-IDs pro Windows-Version
| Windows-Version | Syscall-ID | Build |
|---|---|---|
| Win10 1507 | 0xFF | win10-1507 |
| Win10 1607 | 0x104 | win10-1607 |
| Win10 1703 | 0x108 | win10-1703 |
| Win10 1709 | 0x109 | win10-1709 |
| Win10 1803 | 0x10A | win10-1803 |
| Win10 1809 | 0x10B | win10-1809 |
| Win10 1903 | 0x10C | win10-1903 |
| Win10 1909 | 0x10C | win10-1909 |
| Win10 2004 | 0x111 | win10-2004 |
| Win10 20H2 | 0x111 | win10-20h2 |
| Win10 21H1 | 0x111 | win10-21h1 |
| Win10 21H2 | 0x112 | win10-21h2 |
| Win10 22H2 | 0x112 | win10-22h2 |
| Win11 21H2 | 0x118 | win11-21h2 |
| Win11 22H2 | 0x119 | win11-22h2 |
| Win11 23H2 | 0x119 | win11-23h2 |
| Win11 24H2 | 0x11B | win11-24h2 |
| Server 2016 | 0x104 | winserver-2016 |
| Server 2019 | 0x10B | winserver-2019 |
| Server 2022 | 0x117 | winserver-2022 |
| Server 2025 | 0x11B | winserver-2025 |
Kernel-Modul
Verwandte APIs
Syscall-Stub
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
Undokumentierte Hinweise
Das Schweizer-Taschenmesser-Pendant zu `NtCreatePartition` und `NtOpenPartition`. Der Selektor `PARTITION_INFORMATION_CLASS` entscheidet alles: `0` (PageInformation) liefert Live-Zähler vergleichbar mit `MEMORYSTATUSEX`, aber auf die Partition begrenzt; `3` (AddMemory) übergibt einen Physical-Memory-Range vom Elternteil ans Ziel; `4` (MoveMemory) ordnet bereits angebundene Seiten zwischen zwei Partitionen um und ist die einzige Klasse, die sowohl `TargetHandle` als auch `SourceHandle` nutzt; `9` (EmptyCompressionStore) leert den Compressed-Page-Store der Partition zurück in pageable Memory oder die Pagefile. Alle modifizierenden Klassen erfordern `SeLockMemoryPrivilege` (zusätzlich zu `MEMORY_PARTITION_MODIFY_ACCESS` auf dem Handle).
Häufige Malware-Nutzung
Sehr schwaches Commodity-Malware-Signal. Der interessante Forschungs-Aspekt ist `EmptyCompressionStore`: eine Eltern-Partition zu zwingen, ihre MemCompression-gesicherten Seiten zu leeren, lässt sich als grober Cache-Timing-Side-Channel gegen einen koresidenten Prozess nutzen, akademische Arbeiten demonstrieren das. Nichts davon ist in In-the-Wild-Ransomware oder -Stealer übergegangen. Die meisten Verteidiger können jeden Nicht-Microsoft-Caller von `NtManagePartition` getrost als prüfwürdig einstufen.
Erkennungsmöglichkeiten
Sysmon Event ID 1 (Process Create) mit Kernel-ETW koppeln: der Provider `Microsoft-Windows-Kernel-Memory` emittiert granulare Events für Partition-Modify-Operationen samt Informationsklasse. Suchen Sie nach jedem Image außerhalb von `vmcompute.exe`, `vmwp.exe`, `vmms.exe` und den wenigen Game-Mode-Diensten, das `NtManagePartition` mit Informationsklasse `3`, `4`, `5`, `6` oder `9` aufruft. Query-only-Aufrufe der Klasse `0` kommen auch von `taskmgr.exe` / `procexp.exe` und sind für sich genommen uninteressant.
Direkte Syscall-Beispiele
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 ENDPMITRE ATT&CK-Mappings
Last verified: 2026-05-20