advapi32: Implemented RegOverridePredefKey.

This commit is contained in:
Alexandre Julliard 2008-03-11 19:48:57 +01:00
parent 9ab07d5b37
commit df0f42fe78
3 changed files with 28 additions and 1 deletions

View File

@ -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)

View File

@ -149,6 +149,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.@]
*

View File

@ -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)