mirror of
https://github.com/reactos/reactos.git
synced 2025-08-05 07:53:07 +00:00
Fixed wrong interpretation of value cell size in NtSetValueKey().
svn path=/trunk/; revision=3105
This commit is contained in:
parent
7c5d3bb9ef
commit
e6b5136b65
2 changed files with 93 additions and 93 deletions
|
@ -1218,9 +1218,8 @@ NtSetValueKey(
|
||||||
UserMode,
|
UserMode,
|
||||||
(PVOID *) &KeyObject,
|
(PVOID *) &KeyObject,
|
||||||
NULL);
|
NULL);
|
||||||
|
|
||||||
if (!NT_SUCCESS(Status))
|
if (!NT_SUCCESS(Status))
|
||||||
return Status;
|
return(Status);
|
||||||
|
|
||||||
VERIFY_KEY_OBJECT(KeyObject);
|
VERIFY_KEY_OBJECT(KeyObject);
|
||||||
|
|
||||||
|
@ -1232,13 +1231,12 @@ NtSetValueKey(
|
||||||
ValueName2,
|
ValueName2,
|
||||||
&ValueCell,
|
&ValueCell,
|
||||||
&VBOffset);
|
&VBOffset);
|
||||||
|
|
||||||
if (!NT_SUCCESS(Status))
|
if (!NT_SUCCESS(Status))
|
||||||
{
|
{
|
||||||
DPRINT1("Value not found. Status 0x%X\n", Status);
|
DPRINT1("Value not found. Status 0x%X\n", Status);
|
||||||
|
|
||||||
ObDereferenceObject(KeyObject);
|
ObDereferenceObject(KeyObject);
|
||||||
return Status;
|
return(Status);
|
||||||
}
|
}
|
||||||
|
|
||||||
// KeAcquireSpinLock(&RegistryHive->RegLock, &OldIrql);
|
// KeAcquireSpinLock(&RegistryHive->RegLock, &OldIrql);
|
||||||
|
@ -1255,8 +1253,9 @@ NtSetValueKey(
|
||||||
if (!NT_SUCCESS(Status))
|
if (!NT_SUCCESS(Status))
|
||||||
{
|
{
|
||||||
DPRINT1("Cannot add value. Status 0x%X\n", Status);
|
DPRINT1("Cannot add value. Status 0x%X\n", Status);
|
||||||
|
|
||||||
ObDereferenceObject(KeyObject);
|
ObDereferenceObject(KeyObject);
|
||||||
return Status;
|
return(Status);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -1265,8 +1264,9 @@ NtSetValueKey(
|
||||||
/* If datasize <= 4 then write in valueblock directly */
|
/* If datasize <= 4 then write in valueblock directly */
|
||||||
if (DataSize <= 4)
|
if (DataSize <= 4)
|
||||||
{
|
{
|
||||||
if ((ValueCell->DataSize < 0)
|
DPRINT("ValueCell->DataSize %lu\n", ValueCell->DataSize);
|
||||||
&& (DataCell = CmiGetBlock(RegistryHive, ValueCell->DataOffset, NULL)))
|
if ((ValueCell->DataSize >= 0) &&
|
||||||
|
(DataCell = CmiGetBlock(RegistryHive, ValueCell->DataOffset, NULL)))
|
||||||
{
|
{
|
||||||
CmiDestroyBlock(RegistryHive, DataCell, ValueCell->DataOffset);
|
CmiDestroyBlock(RegistryHive, DataCell, ValueCell->DataOffset);
|
||||||
}
|
}
|
||||||
|
@ -1295,8 +1295,8 @@ NtSetValueKey(
|
||||||
BLOCK_OFFSET NewOffset;
|
BLOCK_OFFSET NewOffset;
|
||||||
|
|
||||||
/* Destroy current data block and allocate a new one */
|
/* Destroy current data block and allocate a new one */
|
||||||
if ((ValueCell->DataSize < 0)
|
if ((ValueCell->DataSize >= 0) &&
|
||||||
&& (DataCell = CmiGetBlock(RegistryHive, ValueCell->DataOffset, NULL)))
|
(DataCell = CmiGetBlock(RegistryHive, ValueCell->DataOffset, NULL)))
|
||||||
{
|
{
|
||||||
CmiDestroyBlock(RegistryHive, DataCell, ValueCell->DataOffset);
|
CmiDestroyBlock(RegistryHive, DataCell, ValueCell->DataOffset);
|
||||||
}
|
}
|
||||||
|
@ -1324,7 +1324,7 @@ NtSetValueKey(
|
||||||
|
|
||||||
DPRINT("Return Status 0x%X\n", Status);
|
DPRINT("Return Status 0x%X\n", Status);
|
||||||
|
|
||||||
return Status;
|
return(Status);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -621,7 +621,7 @@ RtlpGetRegistryHandle(ULONG RelativeTo,
|
||||||
|
|
||||||
InitializeObjectAttributes(&ObjectAttributes,
|
InitializeObjectAttributes(&ObjectAttributes,
|
||||||
&KeyName,
|
&KeyName,
|
||||||
OBJ_CASE_INSENSITIVE,
|
OBJ_CASE_INSENSITIVE | OBJ_OPENIF,
|
||||||
NULL,
|
NULL,
|
||||||
NULL);
|
NULL);
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue