[PORTCLS]

* Initializes object attributes with correct handle attributes.
* Use the provided access rights and create options.
See issue #5934 for more details.

svn path=/trunk/; revision=54969
This commit is contained in:
Amine Khaldi 2012-01-15 10:10:54 +00:00
parent 4a76b4fbe8
commit 6c47d1fade

View file

@ -156,8 +156,8 @@ CRegistryKey::NewSubKey(
return STATUS_INVALID_HANDLE;
}
InitializeObjectAttributes(&Attributes, SubKeyName, 0, m_hKey, NULL);
Status = ZwCreateKey(&hKey, KEY_READ | KEY_WRITE, &Attributes, 0, NULL, 0, Disposition);
InitializeObjectAttributes(&Attributes, SubKeyName, OBJ_INHERIT | OBJ_CASE_INSENSITIVE | OBJ_OPENIF | OBJ_KERNEL_HANDLE, m_hKey, NULL);
Status = ZwCreateKey(&hKey, DesiredAccess, &Attributes, 0, NULL, CreateOptions, Disposition);
if (!NT_SUCCESS(Status))
{
DPRINT("CRegistryKey::NewSubKey failed with %x\n", Status);
@ -177,8 +177,6 @@ CRegistryKey::NewSubKey(
return Status;
}
*RegistrySubKey = (PREGISTRYKEY)RegistryKey;
DPRINT("CRegistryKey::NewSubKey RESULT %p\n", *RegistrySubKey);
return STATUS_SUCCESS;
}