#ifndef _NTREGAPI_H
/**
* Sets information for a registry key.
*
* \param[in] KeyHandle A handle to the key to be modified.
* \param[in] KeySetInformationClass The type of information to be set.
* \param[in] KeySetInformation A pointer to a buffer that contains the key information.
* \param[in] KeySetInformationLength The size of the buffer.
* \return NTSTATUS Successful or errant status.
*/
NTSYSCALLAPI
NTSTATUS
NTAPI
NtSetInformationKey(
_In_ HANDLE KeyHandle,
_In_ KEY_SET_INFORMATION_CLASS KeySetInformationClass,
_In_reads_bytes_(KeySetInformationLength) PVOID KeySetInformation,
_In_ ULONG KeySetInformationLength
);
View code on GitHub#ifndef _NTZWAPI_H
NTSYSCALLAPI
NTSTATUS
NTAPI
ZwSetInformationKey(
_In_ HANDLE KeyHandle,
_In_ KEY_SET_INFORMATION_CLASS KeySetInformationClass,
_In_reads_bytes_(KeySetInformationLength) PVOID KeySetInformation,
_In_ ULONG KeySetInformationLength
);
View code on GitHub// winternl.h
__kernel_entry NTSTATUS NtSetInformationKey(
[in] HANDLE KeyHandle,
[in] KEY_SET_INFORMATION_CLASS KeySetInformationClass,
[in] PVOID KeySetInformation,
[in] ULONG KeySetInformationLength
);
View the official Win32 API referenceNo description available.
[This function may be changed or removed from Windows without further notice.]
Sets information for the specified registry key.
KeyHandle [in]A handle to the registry key. The handle must be opened with the KEY_WRITE access right.
KeySetInformationClass [in]A KEY_SET_INFORMATION_CLASS value that specifies the kind of information to be set.
KeySetInformation [in]A pointer to the buffer that contains the information to be set. The format of this buffer is determined by the KeySetInformationClass parameter.
KeySetInformationLength [in]The length of the buffer specified by the KeySetInformation parameter, in bytes.
Returns an NTSTATUS or error code. An error code of STATUS_INFO_LENGTH_MISMATCH indicates that the KeySetInformationLength parameter is the wrong length for the information class specified by the KeySetInformationClass parameter.
The forms and significance of NTSTATUS error codes are listed in the Ntstatus.h header file available in the WDK, and are described in the WDK documentation.
You can also use the LoadLibrary and GetProcAddress functions to dynamically link to Ntdll.dll.
Registry Key Security and Access Rights
This function is documented in Windows SDK.
See <ntddk.h> for possible values. Currently only KEY_WRITE_TIME_INFORMATION is supported.
See <ntddk.h> for detailed structure KEY_WRITE_TIME_INFORMATION.