Alexandre Julliard : ntdll: Check for failure to get the user path in RtlOpenCurrentUser.

Alexandre Julliard julliard at wine.codeweavers.com
Thu Dec 8 07:06:10 CST 2005


Module: wine
Branch: refs/heads/master
Commit: 0603559de28a43a63df66b6d00eb84f78cf7483d
URL:    http://source.winehq.org/git/?p=wine.git;a=commit;h=0603559de28a43a63df66b6d00eb84f78cf7483d

Author: Alexandre Julliard <julliard at winehq.org>
Date:   Thu Dec  8 11:53:42 2005 +0100

ntdll: Check for failure to get the user path in RtlOpenCurrentUser.
Fixed the return value type.

---

 dlls/ntdll/reg.c   |    4 ++--
 include/winternl.h |    2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

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 @@ NTSTATUS WINAPI RtlFormatCurrentUserKeyP
  *  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 060f8a7..2be14d3 100644
--- a/include/winternl.h
+++ b/include/winternl.h
@@ -2120,7 +2120,7 @@ ULONG     WINAPI RtlNumberOfClearBits(PC
 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);




More information about the wine-cvs mailing list