Move save_registry and unload_key server calls to ntdll.
diff --git a/dlls/advapi32/registry.c b/dlls/advapi32/registry.c
index 5ee66d7..eaffa0e 100644
--- a/dlls/advapi32/registry.c
+++ b/dlls/advapi32/registry.c
@@ -1680,13 +1680,7 @@
MESSAGE("Wow, we are already fiddling with a temp file %s with an ordinal as high as %d !\nYou might want to delete all corresponding temp files in that directory.\n", debugstr_w(buffer), count);
}
- SERVER_START_REQ( save_registry )
- {
- req->hkey = hkey;
- req->file = handle;
- ret = RtlNtStatusToDosError( wine_server_call( req ) );
- }
- SERVER_END_REQ;
+ ret = RtlNtStatusToDosError(NtSaveKey(hkey, handle));
CloseHandle( handle );
if (!ret)
@@ -1791,12 +1785,8 @@
if( ret )
return ERROR_INVALID_PARAMETER;
- SERVER_START_REQ( unload_registry )
- {
- req->hkey = shkey;
- ret = RtlNtStatusToDosError( wine_server_call(req) );
- }
- SERVER_END_REQ;
+ ret = RtlNtStatusToDosError(NtUnloadKey(shkey));
+
RegCloseKey(shkey);
return ret;
diff --git a/dlls/ntdll/reg.c b/dlls/ntdll/reg.c
index 283044b..329bb96 100644
--- a/dlls/ntdll/reg.c
+++ b/dlls/ntdll/reg.c
@@ -656,13 +656,21 @@
* NtSaveKey [NTDLL.@]
* ZwSaveKey [NTDLL.@]
*/
-NTSTATUS WINAPI NtSaveKey(
- IN HKEY KeyHandle,
- IN HANDLE FileHandle)
+NTSTATUS WINAPI NtSaveKey(IN HKEY KeyHandle, IN HANDLE FileHandle)
{
- FIXME("(%p,%p) stub\n",
- KeyHandle, FileHandle);
- return STATUS_SUCCESS;
+ NTSTATUS ret;
+
+ TRACE("(%p,%p)\n", KeyHandle, FileHandle);
+
+ SERVER_START_REQ( save_registry )
+ {
+ req->hkey = KeyHandle;
+ req->file = FileHandle;
+ ret = wine_server_call( req );
+ }
+ SERVER_END_REQ;
+
+ return ret;
}
/******************************************************************************
* NtSetInformationKey [NTDLL.@]
@@ -727,12 +735,20 @@
* NtUnloadKey [NTDLL.@]
* ZwUnloadKey [NTDLL.@]
*/
-NTSTATUS WINAPI NtUnloadKey(
- IN HKEY KeyHandle)
+NTSTATUS WINAPI NtUnloadKey(IN HKEY KeyHandle)
{
- FIXME("(%p) stub\n",
- KeyHandle);
- return STATUS_SUCCESS;
+ NTSTATUS ret;
+
+ TRACE("(%p)\n", KeyHandle);
+
+ SERVER_START_REQ( unload_registry )
+ {
+ req->hkey = KeyHandle;
+ ret = wine_server_call(req);
+ }
+ SERVER_END_REQ;
+
+ return ret;
}
/******************************************************************************