diff --git a/dlls/ntdll/reg.c b/dlls/ntdll/reg.c index e30051f2306..5ade8bdea5c 100644 --- a/dlls/ntdll/reg.c +++ b/dlls/ntdll/reg.c @@ -843,7 +843,7 @@ NTSTATUS WINAPI RtlFormatCurrentUserKeyPath( IN OUT PUNICODE_STRING KeyPath) * 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 @@ DWORD WINAPI RtlOpenCurrentUser( 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 060f8a7d37a..2be14d353f8 100644 --- a/include/winternl.h +++ b/include/winternl.h @@ -2120,7 +2120,7 @@ ULONG WINAPI RtlNumberOfClearBits(PCRTL_BITMAP); 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);