File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1231,8 +1231,9 @@ NTSYSAPI NTSTATUS NTAPI NtQueryValueKey(
12311231 _Out_ PULONG ResultLength
12321232);
12331233
1234- NTSYSAPI NTSTATUS NTAPI RtlFormatCurrentUserKeyPath (
1235- _Out_ PUNICODE_STRING CurrentUserKeyPath
1234+ NTSYSAPI NTSTATUS NTAPI RtlOpenCurrentUser (
1235+ _In_ ACCESS_MASK DesiredAccess ,
1236+ _Out_ PHANDLE CurrentUserKey
12361237);
12371238
12381239typedef struct _KEY_VALUE_PARTIAL_INFORMATION
Original file line number Diff line number Diff line change @@ -42,27 +42,15 @@ HANDLE ffRegGetRootKeyHandle(HKEY hKey)
4242 switch ((uintptr_t ) hKey )
4343 {
4444 case (uintptr_t ) HKEY_CURRENT_USER : {
45- UNICODE_STRING path = {};
46- NTSTATUS status = RtlFormatCurrentUserKeyPath (& path );
45+ NTSTATUS status = RtlOpenCurrentUser (KEY_READ , & result );
4746 if (!NT_SUCCESS (status ))
4847 {
49- FF_DEBUG ("RtlFormatCurrentUserKeyPath () failed: %s" , ffDebugNtStatus (status ));
48+ FF_DEBUG ("RtlOpenCurrentUser () failed: %s" , ffDebugNtStatus (status ));
5049 return NULL ;
5150 }
52- status = NtOpenKey (& result , KEY_READ , & (OBJECT_ATTRIBUTES ) {
53- .Length = sizeof (OBJECT_ATTRIBUTES ),
54- .RootDirectory = NULL ,
55- .ObjectName = & path ,
56- });
57- if (!NT_SUCCESS (status ))
58- {
59- FF_DEBUG ("NtOpenKey(%ls) failed: %s (0x%08lx)" , path .Buffer , ffDebugNtStatus (status ), status );
60- RtlFreeUnicodeString (& path );
61- return NULL ;
62- }
63- RtlFreeUnicodeString (& path );
6451 break ;
6552 }
53+
6654 case (uintptr_t ) HKEY_LOCAL_MACHINE : {
6755 UNICODE_STRING path = RTL_CONSTANT_STRING (L"\\Registry\\Machine" );
6856 NTSTATUS status = NtOpenKey (& result , KEY_READ , & (OBJECT_ATTRIBUTES ) {
You can’t perform that action at this time.
0 commit comments