mirror of
https://github.com/reactos/reactos.git
synced 2025-08-05 17:03:02 +00:00
- Change the registry name from Registry to REGISTRY, which fixes almost all Wine registry tests and any other application using the registry in case-sensitive mode, because the real name is REGISTRY.
- Add SEH to NtCreate/OpenKey, which fixes the rest of the wine registry tests. - Fix PnP Manager code that was doing case sensitive registry access with "Registry". svn path=/trunk/; revision=33869
This commit is contained in:
parent
d409591250
commit
edc9924731
3 changed files with 71 additions and 11 deletions
|
@ -860,7 +860,7 @@ CmpCreateRegistryRoot(VOID)
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Create '\Registry' key. */
|
/* Create '\Registry' key. */
|
||||||
RtlInitUnicodeString(&KeyName, L"\\Registry");
|
RtlInitUnicodeString(&KeyName, L"\\REGISTRY");
|
||||||
SecurityDescriptor = CmpHiveRootSecurityDescriptor();
|
SecurityDescriptor = CmpHiveRootSecurityDescriptor();
|
||||||
InitializeObjectAttributes(&ObjectAttributes,
|
InitializeObjectAttributes(&ObjectAttributes,
|
||||||
&KeyName,
|
&KeyName,
|
||||||
|
@ -885,7 +885,7 @@ CmpCreateRegistryRoot(VOID)
|
||||||
if (!KeyCell) return FALSE;
|
if (!KeyCell) return FALSE;
|
||||||
|
|
||||||
/* Create the KCB */
|
/* Create the KCB */
|
||||||
RtlInitUnicodeString(&KeyName, L"Registry");
|
RtlInitUnicodeString(&KeyName, L"\\REGISTRY");
|
||||||
Kcb = CmpCreateKeyControlBlock(&CmiVolatileHive->Hive,
|
Kcb = CmpCreateKeyControlBlock(&CmiVolatileHive->Hive,
|
||||||
RootIndex,
|
RootIndex,
|
||||||
KeyCell,
|
KeyCell,
|
||||||
|
|
|
@ -27,17 +27,54 @@ NtCreateKey(OUT PHANDLE KeyHandle,
|
||||||
IN ULONG CreateOptions,
|
IN ULONG CreateOptions,
|
||||||
OUT PULONG Disposition)
|
OUT PULONG Disposition)
|
||||||
{
|
{
|
||||||
NTSTATUS Status;
|
NTSTATUS Status = STATUS_SUCCESS;
|
||||||
KPROCESSOR_MODE PreviousMode = ExGetPreviousMode();
|
KPROCESSOR_MODE PreviousMode = ExGetPreviousMode();
|
||||||
CM_PARSE_CONTEXT ParseContext = {0};
|
CM_PARSE_CONTEXT ParseContext = {0};
|
||||||
HANDLE Handle;
|
HANDLE Handle;
|
||||||
PAGED_CODE();
|
PAGED_CODE();
|
||||||
DPRINT("NtCreateKey(OB 0x%wZ)\n", ObjectAttributes->ObjectName);
|
DPRINT("NtCreateKey(OB 0x%wZ)\n", ObjectAttributes->ObjectName);
|
||||||
|
|
||||||
|
/* Prepare to probe parameters */
|
||||||
|
_SEH_TRY
|
||||||
|
{
|
||||||
|
/* Check for user-mode caller */
|
||||||
|
if (PreviousMode == UserMode)
|
||||||
|
{
|
||||||
|
/* Check if we have a class */
|
||||||
|
if (Class)
|
||||||
|
{
|
||||||
|
/* Probe it */
|
||||||
|
ProbeForReadUnicodeString(Class);
|
||||||
|
ProbeForRead(ParseContext.Class.Buffer,
|
||||||
|
ParseContext.Class.Length,
|
||||||
|
sizeof(WCHAR));
|
||||||
|
ParseContext.Class = *Class;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Probe the key handle */
|
||||||
|
ProbeForWriteHandle(KeyHandle);
|
||||||
|
*KeyHandle = NULL;
|
||||||
|
|
||||||
|
/* Probe object attributes */
|
||||||
|
ProbeForRead(ObjectAttributes, sizeof(OBJECT_ATTRIBUTES), 4);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
/* Save the class directly */
|
||||||
|
if (Class) ParseContext.Class = *Class;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
_SEH_HANDLE
|
||||||
|
{
|
||||||
|
/* Get the status */
|
||||||
|
Status = _SEH_GetExceptionCode();
|
||||||
|
}
|
||||||
|
_SEH_END;
|
||||||
|
if (!NT_SUCCESS(Status)) return Status;
|
||||||
|
|
||||||
/* Setup the parse context */
|
/* Setup the parse context */
|
||||||
ParseContext.CreateOperation = TRUE;
|
ParseContext.CreateOperation = TRUE;
|
||||||
ParseContext.CreateOptions = CreateOptions;
|
ParseContext.CreateOptions = CreateOptions;
|
||||||
if (Class) ParseContext.Class = *Class;
|
|
||||||
|
|
||||||
/* Do the create */
|
/* Do the create */
|
||||||
Status = ObOpenObjectByName(ObjectAttributes,
|
Status = ObOpenObjectByName(ObjectAttributes,
|
||||||
|
@ -62,10 +99,33 @@ NtOpenKey(OUT PHANDLE KeyHandle,
|
||||||
{
|
{
|
||||||
CM_PARSE_CONTEXT ParseContext = {0};
|
CM_PARSE_CONTEXT ParseContext = {0};
|
||||||
HANDLE Handle;
|
HANDLE Handle;
|
||||||
NTSTATUS Status;
|
NTSTATUS Status = STATUS_SUCCESS;
|
||||||
|
KPROCESSOR_MODE PreviousMode = ExGetPreviousMode();
|
||||||
PAGED_CODE();
|
PAGED_CODE();
|
||||||
DPRINT("NtOpenKey(OB 0x%wZ)\n", ObjectAttributes->ObjectName);
|
DPRINT("NtOpenKey(OB 0x%wZ)\n", ObjectAttributes->ObjectName);
|
||||||
|
|
||||||
|
/* Prepare to probe parameters */
|
||||||
|
_SEH_TRY
|
||||||
|
{
|
||||||
|
/* Check for user-mode caller */
|
||||||
|
if (PreviousMode == UserMode)
|
||||||
|
{
|
||||||
|
/* Probe the key handle */
|
||||||
|
ProbeForWriteHandle(KeyHandle);
|
||||||
|
*KeyHandle = NULL;
|
||||||
|
|
||||||
|
/* Probe object attributes */
|
||||||
|
ProbeForRead(ObjectAttributes, sizeof(OBJECT_ATTRIBUTES), 4);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
_SEH_HANDLE
|
||||||
|
{
|
||||||
|
/* Get the status */
|
||||||
|
Status = _SEH_GetExceptionCode();
|
||||||
|
}
|
||||||
|
_SEH_END;
|
||||||
|
if (!NT_SUCCESS(Status)) return Status;
|
||||||
|
|
||||||
/* Just let the object manager handle this */
|
/* Just let the object manager handle this */
|
||||||
Status = ObOpenObjectByName(ObjectAttributes,
|
Status = ObOpenObjectByName(ObjectAttributes,
|
||||||
CmpKeyObjectType,
|
CmpKeyObjectType,
|
||||||
|
|
|
@ -3217,7 +3217,7 @@ IopUpdateRootKey(VOID)
|
||||||
HANDLE hEnum, hRoot, hHalAcpiDevice, hHalAcpiId, hLogConf;
|
HANDLE hEnum, hRoot, hHalAcpiDevice, hHalAcpiId, hLogConf;
|
||||||
NTSTATUS Status;
|
NTSTATUS Status;
|
||||||
|
|
||||||
InitializeObjectAttributes(&ObjectAttributes, &EnumU, OBJ_KERNEL_HANDLE, NULL, NULL);
|
InitializeObjectAttributes(&ObjectAttributes, &EnumU, OBJ_KERNEL_HANDLE | OBJ_CASE_INSENSITIVE, NULL, NULL);
|
||||||
Status = ZwCreateKey(&hEnum, KEY_CREATE_SUB_KEY, &ObjectAttributes, 0, NULL, 0, NULL);
|
Status = ZwCreateKey(&hEnum, KEY_CREATE_SUB_KEY, &ObjectAttributes, 0, NULL, 0, NULL);
|
||||||
if (!NT_SUCCESS(Status))
|
if (!NT_SUCCESS(Status))
|
||||||
{
|
{
|
||||||
|
@ -3225,7 +3225,7 @@ IopUpdateRootKey(VOID)
|
||||||
return Status;
|
return Status;
|
||||||
}
|
}
|
||||||
|
|
||||||
InitializeObjectAttributes(&ObjectAttributes, &RootPathU, OBJ_KERNEL_HANDLE, hEnum, NULL);
|
InitializeObjectAttributes(&ObjectAttributes, &RootPathU, OBJ_KERNEL_HANDLE | OBJ_CASE_INSENSITIVE, hEnum, NULL);
|
||||||
Status = ZwCreateKey(&hRoot, KEY_CREATE_SUB_KEY, &ObjectAttributes, 0, NULL, 0, NULL);
|
Status = ZwCreateKey(&hRoot, KEY_CREATE_SUB_KEY, &ObjectAttributes, 0, NULL, 0, NULL);
|
||||||
ZwClose(hEnum);
|
ZwClose(hEnum);
|
||||||
if (!NT_SUCCESS(Status))
|
if (!NT_SUCCESS(Status))
|
||||||
|
@ -3236,12 +3236,12 @@ IopUpdateRootKey(VOID)
|
||||||
|
|
||||||
if (IopIsAcpiComputer())
|
if (IopIsAcpiComputer())
|
||||||
{
|
{
|
||||||
InitializeObjectAttributes(&ObjectAttributes, &HalAcpiDevice, OBJ_KERNEL_HANDLE, hRoot, NULL);
|
InitializeObjectAttributes(&ObjectAttributes, &HalAcpiDevice, OBJ_KERNEL_HANDLE | OBJ_CASE_INSENSITIVE, hRoot, NULL);
|
||||||
Status = ZwCreateKey(&hHalAcpiDevice, KEY_CREATE_SUB_KEY, &ObjectAttributes, 0, NULL, REG_OPTION_VOLATILE, NULL);
|
Status = ZwCreateKey(&hHalAcpiDevice, KEY_CREATE_SUB_KEY, &ObjectAttributes, 0, NULL, REG_OPTION_VOLATILE, NULL);
|
||||||
ZwClose(hRoot);
|
ZwClose(hRoot);
|
||||||
if (!NT_SUCCESS(Status))
|
if (!NT_SUCCESS(Status))
|
||||||
return Status;
|
return Status;
|
||||||
InitializeObjectAttributes(&ObjectAttributes, &HalAcpiId, OBJ_KERNEL_HANDLE, hHalAcpiDevice, NULL);
|
InitializeObjectAttributes(&ObjectAttributes, &HalAcpiId, OBJ_KERNEL_HANDLE | OBJ_CASE_INSENSITIVE, hHalAcpiDevice, NULL);
|
||||||
Status = ZwCreateKey(&hHalAcpiId, KEY_CREATE_SUB_KEY, &ObjectAttributes, 0, NULL, REG_OPTION_VOLATILE, NULL);
|
Status = ZwCreateKey(&hHalAcpiId, KEY_CREATE_SUB_KEY, &ObjectAttributes, 0, NULL, REG_OPTION_VOLATILE, NULL);
|
||||||
ZwClose(hHalAcpiDevice);
|
ZwClose(hHalAcpiDevice);
|
||||||
if (!NT_SUCCESS(Status))
|
if (!NT_SUCCESS(Status))
|
||||||
|
@ -3251,7 +3251,7 @@ IopUpdateRootKey(VOID)
|
||||||
Status = ZwSetValueKey(hHalAcpiId, &HardwareIDU, 0, REG_MULTI_SZ, HalAcpiHardwareID.Buffer, HalAcpiHardwareID.MaximumLength);
|
Status = ZwSetValueKey(hHalAcpiId, &HardwareIDU, 0, REG_MULTI_SZ, HalAcpiHardwareID.Buffer, HalAcpiHardwareID.MaximumLength);
|
||||||
if (NT_SUCCESS(Status))
|
if (NT_SUCCESS(Status))
|
||||||
{
|
{
|
||||||
InitializeObjectAttributes(&ObjectAttributes, &LogConfU, OBJ_KERNEL_HANDLE, hHalAcpiId, NULL);
|
InitializeObjectAttributes(&ObjectAttributes, &LogConfU, OBJ_KERNEL_HANDLE | OBJ_CASE_INSENSITIVE, hHalAcpiId, NULL);
|
||||||
Status = ZwCreateKey(&hLogConf, 0, &ObjectAttributes, 0, NULL, REG_OPTION_VOLATILE, NULL);
|
Status = ZwCreateKey(&hLogConf, 0, &ObjectAttributes, 0, NULL, REG_OPTION_VOLATILE, NULL);
|
||||||
if (NT_SUCCESS(Status))
|
if (NT_SUCCESS(Status))
|
||||||
ZwClose(hLogConf);
|
ZwClose(hLogConf);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue