mirror of
https://github.com/reactos/reactos.git
synced 2025-02-24 17:34:57 +00:00
Send right security descriptor to InitializeObjectAttributes, so ntoskrnl won't fail
The code was working because we never tried to call RegCreateKeyEx with a security descriptor... svn path=/trunk/; revision=24491
This commit is contained in:
parent
47ef13cf4a
commit
cc0716b65d
1 changed files with 9 additions and 4 deletions
|
@ -1,5 +1,4 @@
|
||||||
/* $Id$
|
/*
|
||||||
*
|
|
||||||
* COPYRIGHT: See COPYING in the top level directory
|
* COPYRIGHT: See COPYING in the top level directory
|
||||||
* PROJECT: ReactOS system libraries
|
* PROJECT: ReactOS system libraries
|
||||||
* FILE: lib/advapi32/reg/reg.c
|
* FILE: lib/advapi32/reg/reg.c
|
||||||
|
@ -981,6 +980,9 @@ RegCreateKeyExA (HKEY hKey,
|
||||||
|
|
||||||
TRACE("RegCreateKeyExA() called\n");
|
TRACE("RegCreateKeyExA() called\n");
|
||||||
|
|
||||||
|
if (lpSecurityAttributes && lpSecurityAttributes->nLength != sizeof(SECURITY_ATTRIBUTES))
|
||||||
|
return ERROR_INVALID_USER_BUFFER;
|
||||||
|
|
||||||
/* get the real parent key */
|
/* get the real parent key */
|
||||||
Status = MapDefaultKey (&ParentKey,
|
Status = MapDefaultKey (&ParentKey,
|
||||||
hKey);
|
hKey);
|
||||||
|
@ -1002,7 +1004,7 @@ RegCreateKeyExA (HKEY hKey,
|
||||||
&SubKeyString,
|
&SubKeyString,
|
||||||
OBJ_CASE_INSENSITIVE,
|
OBJ_CASE_INSENSITIVE,
|
||||||
(HANDLE)ParentKey,
|
(HANDLE)ParentKey,
|
||||||
(PSECURITY_DESCRIPTOR)lpSecurityAttributes);
|
lpSecurityAttributes ? (PSECURITY_DESCRIPTOR)lpSecurityAttributes->lpSecurityDescriptor : NULL);
|
||||||
Status = CreateNestedKey(phkResult,
|
Status = CreateNestedKey(phkResult,
|
||||||
&Attributes,
|
&Attributes,
|
||||||
(lpClass == NULL)? NULL : &ClassString,
|
(lpClass == NULL)? NULL : &ClassString,
|
||||||
|
@ -1051,6 +1053,9 @@ RegCreateKeyExW (HKEY hKey,
|
||||||
|
|
||||||
TRACE("RegCreateKeyExW() called\n");
|
TRACE("RegCreateKeyExW() called\n");
|
||||||
|
|
||||||
|
if (lpSecurityAttributes && lpSecurityAttributes->nLength != sizeof(SECURITY_ATTRIBUTES))
|
||||||
|
return ERROR_INVALID_USER_BUFFER;
|
||||||
|
|
||||||
/* get the real parent key */
|
/* get the real parent key */
|
||||||
Status = MapDefaultKey (&ParentKey,
|
Status = MapDefaultKey (&ParentKey,
|
||||||
hKey);
|
hKey);
|
||||||
|
@ -1068,7 +1073,7 @@ RegCreateKeyExW (HKEY hKey,
|
||||||
&SubKeyString,
|
&SubKeyString,
|
||||||
OBJ_CASE_INSENSITIVE,
|
OBJ_CASE_INSENSITIVE,
|
||||||
(HANDLE)ParentKey,
|
(HANDLE)ParentKey,
|
||||||
(PSECURITY_DESCRIPTOR)lpSecurityAttributes);
|
lpSecurityAttributes ? (PSECURITY_DESCRIPTOR)lpSecurityAttributes->lpSecurityDescriptor : NULL);
|
||||||
Status = CreateNestedKey(phkResult,
|
Status = CreateNestedKey(phkResult,
|
||||||
&Attributes,
|
&Attributes,
|
||||||
(lpClass == NULL)? NULL : &ClassString,
|
(lpClass == NULL)? NULL : &ClassString,
|
||||||
|
|
Loading…
Reference in a new issue