From f74b0adbca82d0aabef5b25432483e9f101f5458 Mon Sep 17 00:00:00 2001 From: Robert Shearman Date: Wed, 30 Mar 2005 10:21:15 +0000 Subject: [PATCH] Move save_registry and unload_key server calls to ntdll. --- dlls/advapi32/registry.c | 16 +++------------- dlls/ntdll/reg.c | 38 +++++++++++++++++++++++++++----------- 2 files changed, 30 insertions(+), 24 deletions(-) diff --git a/dlls/advapi32/registry.c b/dlls/advapi32/registry.c index 5ee66d722b2..eaffa0e82c2 100644 --- a/dlls/advapi32/registry.c +++ b/dlls/advapi32/registry.c @@ -1680,13 +1680,7 @@ LONG WINAPI RegSaveKeyW( HKEY hkey, LPCWSTR file, LPSECURITY_ATTRIBUTES sa ) 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 @@ LONG WINAPI RegUnLoadKeyW( HKEY hkey, LPCWSTR lpSubKey ) 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 283044b5f6b..329bb966cf4 100644 --- a/dlls/ntdll/reg.c +++ b/dlls/ntdll/reg.c @@ -656,13 +656,21 @@ NTSTATUS WINAPI NtRestoreKey( * 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 @@ NTSTATUS WINAPI RtlpNtSetValueKey( HKEY hkey, ULONG type, const void *data, * 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; } /******************************************************************************