Commit fdff5c3a authored by Bang Jun-Young's avatar Bang Jun-Young Committed by Alexandre Julliard

ntdll: Fix NtUnloadKey to match the DDK.

parent b71e42b7
...@@ -2089,6 +2089,8 @@ LONG WINAPI RegUnLoadKeyW( HKEY hkey, LPCWSTR lpSubKey ) ...@@ -2089,6 +2089,8 @@ LONG WINAPI RegUnLoadKeyW( HKEY hkey, LPCWSTR lpSubKey )
{ {
DWORD ret; DWORD ret;
HKEY shkey; HKEY shkey;
OBJECT_ATTRIBUTES attr;
UNICODE_STRING subkey;
TRACE("(%p,%s)\n",hkey, debugstr_w(lpSubKey)); TRACE("(%p,%s)\n",hkey, debugstr_w(lpSubKey));
...@@ -2096,7 +2098,9 @@ LONG WINAPI RegUnLoadKeyW( HKEY hkey, LPCWSTR lpSubKey ) ...@@ -2096,7 +2098,9 @@ LONG WINAPI RegUnLoadKeyW( HKEY hkey, LPCWSTR lpSubKey )
if( ret ) if( ret )
return ERROR_INVALID_PARAMETER; 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); RegCloseKey(shkey);
......
...@@ -775,15 +775,15 @@ NTSTATUS WINAPI RtlpNtSetValueKey( HANDLE hkey, ULONG type, const void *data, ...@@ -775,15 +775,15 @@ NTSTATUS WINAPI RtlpNtSetValueKey( HANDLE hkey, ULONG type, const void *data,
* NtUnloadKey [NTDLL.@] * NtUnloadKey [NTDLL.@]
* ZwUnloadKey [NTDLL.@] * ZwUnloadKey [NTDLL.@]
*/ */
NTSTATUS WINAPI NtUnloadKey(IN HANDLE KeyHandle) NTSTATUS WINAPI NtUnloadKey(IN POBJECT_ATTRIBUTES attr)
{ {
NTSTATUS ret; NTSTATUS ret;
TRACE("(%p)\n", KeyHandle); TRACE("(%p)\n", attr);
SERVER_START_REQ( unload_registry ) SERVER_START_REQ( unload_registry )
{ {
req->hkey = KeyHandle; req->hkey = attr->RootDirectory;
ret = wine_server_call(req); ret = wine_server_call(req);
} }
SERVER_END_REQ; SERVER_END_REQ;
......
...@@ -1935,7 +1935,7 @@ NTSTATUS WINAPI NtTerminateProcess(HANDLE,LONG); ...@@ -1935,7 +1935,7 @@ NTSTATUS WINAPI NtTerminateProcess(HANDLE,LONG);
NTSTATUS WINAPI NtTerminateThread(HANDLE,LONG); NTSTATUS WINAPI NtTerminateThread(HANDLE,LONG);
NTSTATUS WINAPI NtTestAlert(VOID); NTSTATUS WINAPI NtTestAlert(VOID);
NTSTATUS WINAPI NtUnloadDriver(const UNICODE_STRING *); NTSTATUS WINAPI NtUnloadDriver(const UNICODE_STRING *);
NTSTATUS WINAPI NtUnloadKey(HANDLE); NTSTATUS WINAPI NtUnloadKey(POBJECT_ATTRIBUTES);
NTSTATUS WINAPI NtUnloadKeyEx(POBJECT_ATTRIBUTES,HANDLE); NTSTATUS WINAPI NtUnloadKeyEx(POBJECT_ATTRIBUTES,HANDLE);
NTSTATUS WINAPI NtUnlockFile(HANDLE,PIO_STATUS_BLOCK,PLARGE_INTEGER,PLARGE_INTEGER,PULONG); NTSTATUS WINAPI NtUnlockFile(HANDLE,PIO_STATUS_BLOCK,PLARGE_INTEGER,PLARGE_INTEGER,PULONG);
NTSTATUS WINAPI NtUnlockVirtualMemory(HANDLE,PVOID*,SIZE_T*,ULONG); NTSTATUS WINAPI NtUnlockVirtualMemory(HANDLE,PVOID*,SIZE_T*,ULONG);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment