ntdll: Check for failure to get the user path in RtlOpenCurrentUser.
Fixed the return value type.
diff --git a/dlls/ntdll/reg.c b/dlls/ntdll/reg.c
index e30051f..5ade8bd 100644
--- a/dlls/ntdll/reg.c
+++ b/dlls/ntdll/reg.c
@@ -843,7 +843,7 @@
* If we return just HKEY_CURRENT_USER the advapi tries to find a remote
* registry (odd handle) and fails.
*/
-DWORD WINAPI RtlOpenCurrentUser(
+NTSTATUS WINAPI RtlOpenCurrentUser(
IN ACCESS_MASK DesiredAccess, /* [in] */
OUT PHANDLE KeyHandle) /* [out] handle of HKEY_CURRENT_USER */
{
@@ -853,7 +853,7 @@
TRACE("(0x%08lx, %p)\n",DesiredAccess, KeyHandle);
- RtlFormatCurrentUserKeyPath(&ObjectName);
+ if ((ret = RtlFormatCurrentUserKeyPath(&ObjectName))) return ret;
InitializeObjectAttributes(&ObjectAttributes,&ObjectName,OBJ_CASE_INSENSITIVE,0, NULL);
ret = NtCreateKey(KeyHandle, DesiredAccess, &ObjectAttributes, 0, NULL, 0, NULL);
RtlFreeUnicodeString(&ObjectName);
diff --git a/include/winternl.h b/include/winternl.h
index 060f8a7..2be14d3 100644
--- a/include/winternl.h
+++ b/include/winternl.h
@@ -2120,7 +2120,7 @@
UINT WINAPI RtlOemStringToUnicodeSize(const STRING*);
NTSTATUS WINAPI RtlOemStringToUnicodeString(UNICODE_STRING*,const STRING*,BOOLEAN);
NTSTATUS WINAPI RtlOemToUnicodeN(LPWSTR,DWORD,LPDWORD,LPCSTR,DWORD);
-DWORD WINAPI RtlOpenCurrentUser(ACCESS_MASK,PHANDLE);
+NTSTATUS WINAPI RtlOpenCurrentUser(ACCESS_MASK,PHANDLE);
NTSTATUS WINAPI RtlPinAtomInAtomTable(RTL_ATOM_TABLE,RTL_ATOM);
BOOLEAN WINAPI RtlPrefixString(const STRING*,const STRING*,BOOLEAN);