58 ULONG cbInfoSize, cbDataSize;
62 if (cbInfoSize <=
sizeof(ajBuffer))
64 pInfo = (
PVOID)ajBuffer;
78 Status = ZwQueryValueKey(hkey,
95 else if (cbDataSize > *pcbValue)
116 *pcbValue = cbDataSize;
119 if (pInfo != (
PVOID)ajBuffer)
134 ZwSetValueKey(hkey, &ustrValue, 0,
REG_SZ, &ustrData, ustrData.
Length +
sizeof(
WCHAR));
164 L"\\Registry\\Machine\\Software\\Microsoft\\Windows NT\\CurrentVersion\\";
203 ULONG cbInfoSize, cbReqSize;
213 RtlInitEmptyUnicodeString(&usKeyName, awcBuffer,
sizeof(awcBuffer));
254 if (cbInfoSize <=
sizeof(awcBuffer))
256 pInfo = (
PVOID)awcBuffer;
271 Status = ZwQueryValueKey(hkey,
289 if (pInfo != (
PVOID)awcBuffer)
316 DPRINT1(
"RtlFormatCurrentUserKeyPath failed\n");
321 RtlInitEmptyUnicodeString(&usKeyName, awcBuffer,
sizeof(awcBuffer));
341 DPRINT1(
"RtlAppendUnicodeToString failed with Status=0x%lx, buf:%u,%u\n",
373 DPRINT1(
"Failed to write reg key '%S' value '%S', Status = %lx\n",
IN PUNICODE_STRING IN POBJECT_ATTRIBUTES ObjectAttributes
#define STATUS_OBJECT_TYPE_MISMATCH
#define NT_SUCCESS(StatCode)
#define ExAllocatePoolWithTag(hernya, size, tag)
NTSTATUS RtlAppendUnicodeToString(IN PUNICODE_STRING Str1, IN PWSTR Str2)
#define OBJ_KERNEL_HANDLE
#define OBJ_CASE_INSENSITIVE
#define ExFreePoolWithTag(_P, _T)
static HANDLE ULONG_PTR dwData
#define InitializeObjectAttributes(p, n, a, r, s)
NTSYSAPI NTSTATUS NTAPI ZwClose(_In_ HANDLE Handle)
#define _In_reads_bytes_(s)
@ KeyValuePartialInformation
NTSYSAPI NTSTATUS NTAPI RtlAppendUnicodeStringToString(PUNICODE_STRING Destination, PUNICODE_STRING Source)
NTSYSAPI VOID NTAPI RtlInitUnicodeString(PUNICODE_STRING DestinationString, PCWSTR SourceString)
struct _KEY_VALUE_PARTIAL_INFORMATION KEY_VALUE_PARTIAL_INFORMATION
NTSYSAPI VOID NTAPI RtlFreeUnicodeString(PUNICODE_STRING UnicodeString)
NTSTRSAFEAPI RtlStringCchCatW(_Inout_updates_(cchDest) _Always_(_Post_z_) NTSTRSAFE_PWSTR pszDest, _In_ size_t cchDest, _In_ NTSTRSAFE_PCWSTR pszSrc)
NTSTATUS NTAPI RtlFormatCurrentUserKeyPath(OUT PUNICODE_STRING KeyPath)
#define STATUS_BUFFER_TOO_SMALL
#define STATUS_BUFFER_OVERFLOW
#define _PRAGMA_WARNING_SUPPRESS(x)
#define FIELD_OFFSET(t, f)
#define RtlCopyMemory(Destination, Source, Length)
#define STATUS_INSUFFICIENT_RESOURCES
_In_z_ PCWSTR _In_ ULONG _Post_z_ PVOID _In_ ULONG cjDataSize
_In_z_ PCWSTR pwszValueName
_In_z_ PCWSTR _In_ ULONG ulType
VOID NTAPI RegWriteDWORD(HKEY hkey, PCWSTR pwszValue, DWORD dwData)
NTSTATUS NTAPI RegOpenSectionKey(LPCWSTR pszSection, PHKEY phkey)
DWORD NTAPI RegGetSectionDWORD(LPCWSTR pszSection, PCWSTR pszValue, DWORD dwDefault)
BOOL NTAPI RegReadDWORD(HKEY hkey, PCWSTR pwszValue, PDWORD pdwData)
VOID NTAPI RegWriteSZ(HKEY hkey, PCWSTR pwszValue, PWSTR pwszData)
_In_ ULONG _In_opt_ PVOID pvData