NtCreateRegistryTransaction - NtDoc

Native API online documentation, based on the System Informer (formerly Process Hacker) phnt headers
#ifndef _NTREGAPI_H
#if (PHNT_VERSION >= PHNT_WINDOWS_10_RS1)

/**
 * Creates a registry-only lightweight transaction object, distinct from a KTM transaction created by
 * NtCreateTransaction. Pass it to the transacted key create/open APIs to group registry changes for explicit
 * commit or rollback. Do not pass it to KTM query/set/commit/rollback routines: object types differ.
 *
 * \param RegistryTransactionHandle Required writable output receiving a caller- owned handle on success.
 * Close it with NtClose. Last-handle close of an active transaction rolls back staged changes; closing a key
 * handle alone does not end the transaction.
 * \param DesiredAccess Requested transaction rights. The registry APIs use 0x4 for enlistment through
 * transacted key operations, 0x8 for commit and 0x10 for rollback. These checks do not grant access to the
 * keys themselves.
 * \param ObjAttributes Optional object attributes, or NULL for an unnamed object. A named transaction lives
 * in the Object Manager namespace, not the registry key namespace; NtOpenRegistryTransaction opens it by that
 * object name.
 * \param CreateOptions Reserved; must be 0. Every nonzero bit is rejected with STATUS_INVALID_PARAMETER on
 * the native/WoW64 paths.
 * \return STATUS_SUCCESS or an NTSTATUS failure. Initialize the output and consume it only on success: native
 * nonzero-option rejection occurs before clearing it, while the WoW64 wrapper copies back a NULL temporary.
 * \remarks The implementation is in ntoskrnl, not tm.sys. These APIs do not take KTM UOW identifiers,
 * descriptions or timeouts. Named opens and registry transactions do not imply support for arbitrary
 * resource-manager enlistments or KTM recovery semantics.
 */
_Kernel_entry_
NTSYSCALLAPI
NTSTATUS
NTAPI
NtCreateRegistryTransaction(
    _Out_ HANDLE *RegistryTransactionHandle,
    _In_ ACCESS_MASK DesiredAccess,
    _In_opt_ POBJECT_ATTRIBUTES ObjAttributes,
    _Reserved_ ULONG CreateOptions
    );

#endif
#endif

View code on GitHub
#ifndef _NTZWAPI_H

_Kernel_entry_
NTSYSCALLAPI
NTSTATUS
NTAPI
ZwCreateRegistryTransaction(
    _Out_ HANDLE *RegistryTransactionHandle,
    _In_ ACCESS_MASK DesiredAccess,
    _In_opt_ POBJECT_ATTRIBUTES ObjAttributes,
    _Reserved_ ULONG CreateOptions
    );

#endif

View code on GitHub

NtDoc

No description available.