From 96a428066ad04b0bbf0f7fc46d0466a525bb2804 Mon Sep 17 00:00:00 2001 From: James Hawkins Date: Mon, 3 Apr 2006 12:04:21 -0500 Subject: [PATCH] advpack: Forward RegSaveRestoreA to its Unicode counterpart. --- dlls/advpack/advpack.spec | 2 +- dlls/advpack/reg.c | 37 ++++++++++++++++++++++++++++++++++--- 2 files changed, 35 insertions(+), 4 deletions(-) diff --git a/dlls/advpack/advpack.spec b/dlls/advpack/advpack.spec index 5889c924ea..5964403ab5 100644 --- a/dlls/advpack/advpack.spec +++ b/dlls/advpack/advpack.spec @@ -56,7 +56,7 @@ @ stdcall RegRestoreAllW(ptr wstr long) @ stdcall RegRestoreAll(ptr str long) RegRestoreAllA @ stdcall RegSaveRestoreA(ptr str long str str str long) -# stdcall RegSaveRestoreW(ptr wstr long wstr wstr wstr long) +@ stdcall RegSaveRestoreW(ptr wstr long wstr wstr wstr long) @ stdcall RegSaveRestore(ptr str long str str str long) RegSaveRestoreA @ stdcall RegSaveRestoreOnINFA(ptr str str str long long long) # stdcall RegSaveRestoreOnINFW(ptr wstr wstr wstr long long long) diff --git a/dlls/advpack/reg.c b/dlls/advpack/reg.c index 546d24928e..270a9df8a8 100644 --- a/dlls/advpack/reg.c +++ b/dlls/advpack/reg.c @@ -236,6 +236,37 @@ HRESULT WINAPI RegRestoreAllW(HWND hWnd, LPWSTR pszTitleString, HKEY hkBackupKey /*********************************************************************** * RegSaveRestoreA (advpack.@) * + * See RegSaveRestoreW. + */ +HRESULT WINAPI RegSaveRestoreA(HWND hWnd, LPCSTR pszTitleString, HKEY hkBackupKey, + LPCSTR pcszRootKey, LPCSTR pcszSubKey, + LPCSTR pcszValueName, DWORD dwFlags) +{ + UNICODE_STRING title, root, subkey, value; + HRESULT hr; + + TRACE("(%p, %p, %p, %p, %p, %p, %ld)\n", hWnd, pszTitleString, + hkBackupKey, pcszRootKey, pcszSubKey, pcszValueName, dwFlags); + + RtlCreateUnicodeStringFromAsciiz(&title, pszTitleString); + RtlCreateUnicodeStringFromAsciiz(&root, pcszRootKey); + RtlCreateUnicodeStringFromAsciiz(&subkey, pcszSubKey); + RtlCreateUnicodeStringFromAsciiz(&value, pcszValueName); + + hr = RegSaveRestoreW(hWnd, title.Buffer, hkBackupKey, root.Buffer, + subkey.Buffer, value.Buffer, dwFlags); + + RtlFreeUnicodeString(&title); + RtlFreeUnicodeString(&root); + RtlFreeUnicodeString(&subkey); + RtlFreeUnicodeString(&value); + + return hr; +} + +/*********************************************************************** + * RegSaveRestoreW (advpack.@) + * * Saves or restores the specified registry value. * * PARAMS @@ -254,9 +285,9 @@ HRESULT WINAPI RegRestoreAllW(HWND hWnd, LPWSTR pszTitleString, HKEY hkBackupKey * BUGS * Unimplemented. */ -HRESULT WINAPI RegSaveRestoreA(HWND hWnd, LPCSTR pszTitleString, HKEY hkBackupKey, - LPCSTR pcszRootKey, LPCSTR pcszSubKey, - LPCSTR pcszValueName, DWORD dwFlags) +HRESULT WINAPI RegSaveRestoreW(HWND hWnd, LPCWSTR pszTitleString, HKEY hkBackupKey, + LPCWSTR pcszRootKey, LPCWSTR pcszSubKey, + LPCWSTR pcszValueName, DWORD dwFlags) { FIXME("(%p, %p, %p, %p, %p, %p, %ld) stub\n", hWnd, pszTitleString, hkBackupKey, pcszRootKey, pcszSubKey, pcszValueName, dwFlags); -- 2.32.0.93.g670b81a890