mirror of
https://github.com/reactos/reactos.git
synced 2024-07-08 21:55:08 +00:00
[ADVAPI32]
RegCreateKeyExA/W and RegOpenKeyExA/W: Handle Option REG_OPTION_OPEN_LINK properly. This fixes four wine tests. svn path=/trunk/; revision=56742
This commit is contained in:
parent
ad9a9cc38c
commit
6f12cdf02c
|
@ -1021,8 +1021,9 @@ RegCreateKeyExA(HKEY hKey,
|
||||||
{
|
{
|
||||||
UNICODE_STRING SubKeyString;
|
UNICODE_STRING SubKeyString;
|
||||||
UNICODE_STRING ClassString;
|
UNICODE_STRING ClassString;
|
||||||
OBJECT_ATTRIBUTES Attributes;
|
OBJECT_ATTRIBUTES ObjectAttributes;
|
||||||
HANDLE ParentKey;
|
HANDLE ParentKey;
|
||||||
|
ULONG Attributes = OBJ_CASE_INSENSITIVE;
|
||||||
NTSTATUS Status;
|
NTSTATUS Status;
|
||||||
|
|
||||||
TRACE("RegCreateKeyExA() called\n");
|
TRACE("RegCreateKeyExA() called\n");
|
||||||
|
@ -1046,15 +1047,18 @@ RegCreateKeyExA(HKEY hKey,
|
||||||
lpClass);
|
lpClass);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (dwOptions & REG_OPTION_OPEN_LINK)
|
||||||
|
Attributes |= OBJ_OPENLINK;
|
||||||
|
|
||||||
RtlCreateUnicodeStringFromAsciiz(&SubKeyString,
|
RtlCreateUnicodeStringFromAsciiz(&SubKeyString,
|
||||||
(LPSTR)lpSubKey);
|
(LPSTR)lpSubKey);
|
||||||
InitializeObjectAttributes(&Attributes,
|
InitializeObjectAttributes(&ObjectAttributes,
|
||||||
&SubKeyString,
|
&SubKeyString,
|
||||||
OBJ_CASE_INSENSITIVE,
|
Attributes,
|
||||||
(HANDLE)ParentKey,
|
(HANDLE)ParentKey,
|
||||||
lpSecurityAttributes ? (PSECURITY_DESCRIPTOR)lpSecurityAttributes->lpSecurityDescriptor : NULL);
|
lpSecurityAttributes ? (PSECURITY_DESCRIPTOR)lpSecurityAttributes->lpSecurityDescriptor : NULL);
|
||||||
Status = CreateNestedKey(phkResult,
|
Status = CreateNestedKey(phkResult,
|
||||||
&Attributes,
|
&ObjectAttributes,
|
||||||
(lpClass == NULL)? NULL : &ClassString,
|
(lpClass == NULL)? NULL : &ClassString,
|
||||||
dwOptions,
|
dwOptions,
|
||||||
samDesired,
|
samDesired,
|
||||||
|
@ -1095,8 +1099,9 @@ RegCreateKeyExW(HKEY hKey,
|
||||||
{
|
{
|
||||||
UNICODE_STRING SubKeyString;
|
UNICODE_STRING SubKeyString;
|
||||||
UNICODE_STRING ClassString;
|
UNICODE_STRING ClassString;
|
||||||
OBJECT_ATTRIBUTES Attributes;
|
OBJECT_ATTRIBUTES ObjectAttributes;
|
||||||
HANDLE ParentKey;
|
HANDLE ParentKey;
|
||||||
|
ULONG Attributes = OBJ_CASE_INSENSITIVE;
|
||||||
NTSTATUS Status;
|
NTSTATUS Status;
|
||||||
|
|
||||||
TRACE("RegCreateKeyExW() called\n");
|
TRACE("RegCreateKeyExW() called\n");
|
||||||
|
@ -1114,17 +1119,20 @@ RegCreateKeyExW(HKEY hKey,
|
||||||
|
|
||||||
TRACE("ParentKey %p\n", ParentKey);
|
TRACE("ParentKey %p\n", ParentKey);
|
||||||
|
|
||||||
|
if (dwOptions & REG_OPTION_OPEN_LINK)
|
||||||
|
Attributes |= OBJ_OPENLINK;
|
||||||
|
|
||||||
RtlInitUnicodeString(&ClassString,
|
RtlInitUnicodeString(&ClassString,
|
||||||
lpClass);
|
lpClass);
|
||||||
RtlInitUnicodeString(&SubKeyString,
|
RtlInitUnicodeString(&SubKeyString,
|
||||||
lpSubKey);
|
lpSubKey);
|
||||||
InitializeObjectAttributes(&Attributes,
|
InitializeObjectAttributes(&ObjectAttributes,
|
||||||
&SubKeyString,
|
&SubKeyString,
|
||||||
OBJ_CASE_INSENSITIVE,
|
Attributes,
|
||||||
(HANDLE)ParentKey,
|
(HANDLE)ParentKey,
|
||||||
lpSecurityAttributes ? (PSECURITY_DESCRIPTOR)lpSecurityAttributes->lpSecurityDescriptor : NULL);
|
lpSecurityAttributes ? (PSECURITY_DESCRIPTOR)lpSecurityAttributes->lpSecurityDescriptor : NULL);
|
||||||
Status = CreateNestedKey(phkResult,
|
Status = CreateNestedKey(phkResult,
|
||||||
&Attributes,
|
&ObjectAttributes,
|
||||||
(lpClass == NULL)? NULL : &ClassString,
|
(lpClass == NULL)? NULL : &ClassString,
|
||||||
dwOptions,
|
dwOptions,
|
||||||
samDesired,
|
samDesired,
|
||||||
|
@ -3347,6 +3355,7 @@ RegOpenKeyExA(HKEY hKey,
|
||||||
UNICODE_STRING SubKeyString;
|
UNICODE_STRING SubKeyString;
|
||||||
HANDLE KeyHandle;
|
HANDLE KeyHandle;
|
||||||
NTSTATUS Status;
|
NTSTATUS Status;
|
||||||
|
ULONG Attributes = OBJ_CASE_INSENSITIVE;
|
||||||
LONG ErrorCode = ERROR_SUCCESS;
|
LONG ErrorCode = ERROR_SUCCESS;
|
||||||
|
|
||||||
TRACE("RegOpenKeyExA hKey 0x%x lpSubKey %s ulOptions 0x%x samDesired 0x%x phkResult %p\n",
|
TRACE("RegOpenKeyExA hKey 0x%x lpSubKey %s ulOptions 0x%x samDesired 0x%x phkResult %p\n",
|
||||||
|
@ -3363,11 +3372,14 @@ RegOpenKeyExA(HKEY hKey,
|
||||||
return RtlNtStatusToDosError(Status);
|
return RtlNtStatusToDosError(Status);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (ulOptions & REG_OPTION_OPEN_LINK)
|
||||||
|
Attributes |= OBJ_OPENLINK;
|
||||||
|
|
||||||
RtlCreateUnicodeStringFromAsciiz(&SubKeyString,
|
RtlCreateUnicodeStringFromAsciiz(&SubKeyString,
|
||||||
(LPSTR)lpSubKey);
|
(LPSTR)lpSubKey);
|
||||||
InitializeObjectAttributes(&ObjectAttributes,
|
InitializeObjectAttributes(&ObjectAttributes,
|
||||||
&SubKeyString,
|
&SubKeyString,
|
||||||
OBJ_CASE_INSENSITIVE,
|
Attributes,
|
||||||
KeyHandle,
|
KeyHandle,
|
||||||
NULL);
|
NULL);
|
||||||
|
|
||||||
|
@ -3402,6 +3414,7 @@ RegOpenKeyExW(HKEY hKey,
|
||||||
UNICODE_STRING SubKeyString;
|
UNICODE_STRING SubKeyString;
|
||||||
HANDLE KeyHandle;
|
HANDLE KeyHandle;
|
||||||
NTSTATUS Status;
|
NTSTATUS Status;
|
||||||
|
ULONG Attributes = OBJ_CASE_INSENSITIVE;
|
||||||
LONG ErrorCode = ERROR_SUCCESS;
|
LONG ErrorCode = ERROR_SUCCESS;
|
||||||
|
|
||||||
TRACE("RegOpenKeyExW hKey 0x%x lpSubKey %S ulOptions 0x%x samDesired 0x%x phkResult %p\n",
|
TRACE("RegOpenKeyExW hKey 0x%x lpSubKey %S ulOptions 0x%x samDesired 0x%x phkResult %p\n",
|
||||||
|
@ -3417,6 +3430,9 @@ RegOpenKeyExW(HKEY hKey,
|
||||||
return RtlNtStatusToDosError(Status);
|
return RtlNtStatusToDosError(Status);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (ulOptions & REG_OPTION_OPEN_LINK)
|
||||||
|
Attributes |= OBJ_OPENLINK;
|
||||||
|
|
||||||
if (lpSubKey != NULL)
|
if (lpSubKey != NULL)
|
||||||
RtlInitUnicodeString(&SubKeyString, (LPWSTR)lpSubKey);
|
RtlInitUnicodeString(&SubKeyString, (LPWSTR)lpSubKey);
|
||||||
else
|
else
|
||||||
|
@ -3424,7 +3440,7 @@ RegOpenKeyExW(HKEY hKey,
|
||||||
|
|
||||||
InitializeObjectAttributes(&ObjectAttributes,
|
InitializeObjectAttributes(&ObjectAttributes,
|
||||||
&SubKeyString,
|
&SubKeyString,
|
||||||
OBJ_CASE_INSENSITIVE,
|
Attributes,
|
||||||
KeyHandle,
|
KeyHandle,
|
||||||
NULL);
|
NULL);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue