Commit df0f42fe authored by Alexandre Julliard's avatar Alexandre Julliard

advapi32: Implemented RegOverridePredefKey.

parent 9ab07d5b
......@@ -499,7 +499,7 @@
@ stdcall RegOpenKeyExW(long wstr long long ptr)
@ stdcall RegOpenKeyW(long wstr ptr)
@ stdcall RegOpenUserClassesRoot(ptr long long ptr)
@ stub RegOverridePredefKey
@ stdcall RegOverridePredefKey(long long)
@ stdcall RegQueryInfoKeyA(long ptr ptr ptr ptr ptr ptr ptr ptr ptr ptr ptr)
@ stdcall RegQueryInfoKeyW(long ptr ptr ptr ptr ptr ptr ptr ptr ptr ptr ptr)
@ stdcall RegQueryMultipleValuesA(long ptr long ptr ptr)
......
......@@ -150,6 +150,32 @@ static inline HKEY get_special_root_hkey( HKEY hkey )
/******************************************************************************
* RegOverridePredefKey [ADVAPI32.@]
*/
LSTATUS WINAPI RegOverridePredefKey( HKEY hkey, HKEY override )
{
HKEY old_key;
int idx;
if ((hkey < HKEY_SPECIAL_ROOT_FIRST) || (hkey > HKEY_SPECIAL_ROOT_LAST))
return ERROR_INVALID_PARAMETER;
idx = (UINT_PTR)hkey - (UINT_PTR)HKEY_SPECIAL_ROOT_FIRST;
if (override)
{
NTSTATUS status = NtDuplicateObject( GetCurrentProcess(), override,
GetCurrentProcess(), (HANDLE *)&override,
0, 0, DUPLICATE_SAME_ACCESS );
if (status) return RtlNtStatusToDosError( status );
}
old_key = InterlockedExchangePointer( (void **)&special_root_keys[idx], override );
if (old_key) NtClose( old_key );
return ERROR_SUCCESS;
}
/******************************************************************************
* RegCreateKeyExW [ADVAPI32.@]
*
* See RegCreateKeyExA.
......
......@@ -143,6 +143,7 @@ WINADVAPI LSTATUS WINAPI RegOpenKeyExW(HKEY,LPCWSTR,DWORD,REGSAM,PHKEY);
WINADVAPI LSTATUS WINAPI RegOpenKeyExA(HKEY,LPCSTR,DWORD,REGSAM,PHKEY);
#define RegOpenKeyEx WINELIB_NAME_AW(RegOpenKeyEx)
WINADVAPI LSTATUS WINAPI RegOpenUserClassesRoot(HANDLE,DWORD,REGSAM,PHKEY);
WINADVAPI LSTATUS WINAPI RegOverridePredefKey(HKEY,HKEY);
WINADVAPI LSTATUS WINAPI RegQueryInfoKeyW(HKEY,LPWSTR,LPDWORD,LPDWORD,LPDWORD,LPDWORD,LPDWORD,LPDWORD,LPDWORD,LPDWORD,LPDWORD,LPFILETIME);
WINADVAPI LSTATUS WINAPI RegQueryInfoKeyA(HKEY,LPSTR,LPDWORD,LPDWORD,LPDWORD,LPDWORD,LPDWORD,LPDWORD,LPDWORD,LPDWORD,LPDWORD,LPFILETIME);
#define RegQueryInfoKey WINELIB_NAME_AW(RegQueryInfoKey)
......
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