Bang Jun-Young : ntdll: Fix NtUnloadKey to match the DDK.

Alexandre Julliard julliard at wine.codeweavers.com
Mon Feb 5 07:44:56 CST 2007


Module: wine
Branch: master
Commit: fdff5c3a3a9e7c90c2ac65b39e2a2fb47628c0c5
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=fdff5c3a3a9e7c90c2ac65b39e2a2fb47628c0c5

Author: Bang Jun-Young <junyoung at mogua.com>
Date:   Mon Jan 29 22:55:02 2007 +0900

ntdll: Fix NtUnloadKey to match the DDK.

---

 dlls/advapi32/registry.c |    6 +++++-
 dlls/ntdll/reg.c         |    6 +++---
 include/winternl.h       |    2 +-
 3 files changed, 9 insertions(+), 5 deletions(-)

diff --git a/dlls/advapi32/registry.c b/dlls/advapi32/registry.c
index 54b0bfb..6589a23 100644
--- a/dlls/advapi32/registry.c
+++ b/dlls/advapi32/registry.c
@@ -2089,6 +2089,8 @@ LONG WINAPI RegUnLoadKeyW( HKEY hkey, LP
 {
     DWORD ret;
     HKEY shkey;
+    OBJECT_ATTRIBUTES attr;
+    UNICODE_STRING subkey;
 
     TRACE("(%p,%s)\n",hkey, debugstr_w(lpSubKey));
 
@@ -2096,7 +2098,9 @@ LONG WINAPI RegUnLoadKeyW( HKEY hkey, LP
     if( ret )
         return ERROR_INVALID_PARAMETER;
 
-    ret = RtlNtStatusToDosError(NtUnloadKey(shkey));
+    RtlInitUnicodeString(&subkey, lpSubKey);
+    InitializeObjectAttributes(&attr, &subkey, OBJ_CASE_INSENSITIVE, shkey, NULL);
+    ret = RtlNtStatusToDosError(NtUnloadKey(&attr));
 
     RegCloseKey(shkey);
 
diff --git a/dlls/ntdll/reg.c b/dlls/ntdll/reg.c
index be9a34a..99a46c0 100644
--- a/dlls/ntdll/reg.c
+++ b/dlls/ntdll/reg.c
@@ -775,15 +775,15 @@ NTSTATUS WINAPI RtlpNtSetValueKey( HANDL
  * NtUnloadKey [NTDLL.@]
  * ZwUnloadKey [NTDLL.@]
  */
-NTSTATUS WINAPI NtUnloadKey(IN HANDLE KeyHandle)
+NTSTATUS WINAPI NtUnloadKey(IN POBJECT_ATTRIBUTES attr)
 {
     NTSTATUS ret;
 
-    TRACE("(%p)\n", KeyHandle);
+    TRACE("(%p)\n", attr);
 
     SERVER_START_REQ( unload_registry )
     {
-        req->hkey  = KeyHandle;
+        req->hkey = attr->RootDirectory;
         ret = wine_server_call(req);
     }
     SERVER_END_REQ;
diff --git a/include/winternl.h b/include/winternl.h
index 19b2ac9..e128268 100644
--- a/include/winternl.h
+++ b/include/winternl.h
@@ -1935,7 +1935,7 @@ NTSTATUS  WINAPI NtTerminateProcess(HAND
 NTSTATUS  WINAPI NtTerminateThread(HANDLE,LONG);
 NTSTATUS  WINAPI NtTestAlert(VOID); 
 NTSTATUS  WINAPI NtUnloadDriver(const UNICODE_STRING *);
-NTSTATUS  WINAPI NtUnloadKey(HANDLE);
+NTSTATUS  WINAPI NtUnloadKey(POBJECT_ATTRIBUTES);
 NTSTATUS  WINAPI NtUnloadKeyEx(POBJECT_ATTRIBUTES,HANDLE);
 NTSTATUS  WINAPI NtUnlockFile(HANDLE,PIO_STATUS_BLOCK,PLARGE_INTEGER,PLARGE_INTEGER,PULONG);
 NTSTATUS  WINAPI NtUnlockVirtualMemory(HANDLE,PVOID*,SIZE_T*,ULONG);




More information about the wine-cvs mailing list