mirror of
https://github.com/reactos/reactos.git
synced 2025-08-05 19:52:56 +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,
|
||||
(PVOID *) &KeyObject,
|
||||
NULL);
|
||||
|
||||
if (!NT_SUCCESS(Status))
|
||||
return Status;
|
||||
return(Status);
|
||||
|
||||
VERIFY_KEY_OBJECT(KeyObject);
|
||||
|
||||
|
@ -1232,13 +1231,12 @@ NtSetValueKey(
|
|||
ValueName2,
|
||||
&ValueCell,
|
||||
&VBOffset);
|
||||
|
||||
if (!NT_SUCCESS(Status))
|
||||
{
|
||||
DPRINT1("Value not found. Status 0x%X\n", Status);
|
||||
|
||||
ObDereferenceObject(KeyObject);
|
||||
return Status;
|
||||
return(Status);
|
||||
}
|
||||
|
||||
// KeAcquireSpinLock(&RegistryHive->RegLock, &OldIrql);
|
||||
|
@ -1255,8 +1253,9 @@ NtSetValueKey(
|
|||
if (!NT_SUCCESS(Status))
|
||||
{
|
||||
DPRINT1("Cannot add value. Status 0x%X\n", Status);
|
||||
|
||||
ObDereferenceObject(KeyObject);
|
||||
return Status;
|
||||
return(Status);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -1265,8 +1264,9 @@ NtSetValueKey(
|
|||
/* If datasize <= 4 then write in valueblock directly */
|
||||
if (DataSize <= 4)
|
||||
{
|
||||
if ((ValueCell->DataSize < 0)
|
||||
&& (DataCell = CmiGetBlock(RegistryHive, ValueCell->DataOffset, NULL)))
|
||||
DPRINT("ValueCell->DataSize %lu\n", ValueCell->DataSize);
|
||||
if ((ValueCell->DataSize >= 0) &&
|
||||
(DataCell = CmiGetBlock(RegistryHive, ValueCell->DataOffset, NULL)))
|
||||
{
|
||||
CmiDestroyBlock(RegistryHive, DataCell, ValueCell->DataOffset);
|
||||
}
|
||||
|
@ -1295,8 +1295,8 @@ NtSetValueKey(
|
|||
BLOCK_OFFSET NewOffset;
|
||||
|
||||
/* Destroy current data block and allocate a new one */
|
||||
if ((ValueCell->DataSize < 0)
|
||||
&& (DataCell = CmiGetBlock(RegistryHive, ValueCell->DataOffset, NULL)))
|
||||
if ((ValueCell->DataSize >= 0) &&
|
||||
(DataCell = CmiGetBlock(RegistryHive, ValueCell->DataOffset, NULL)))
|
||||
{
|
||||
CmiDestroyBlock(RegistryHive, DataCell, ValueCell->DataOffset);
|
||||
}
|
||||
|
@ -1324,7 +1324,7 @@ NtSetValueKey(
|
|||
|
||||
DPRINT("Return Status 0x%X\n", Status);
|
||||
|
||||
return Status;
|
||||
return(Status);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -621,7 +621,7 @@ RtlpGetRegistryHandle(ULONG RelativeTo,
|
|||
|
||||
InitializeObjectAttributes(&ObjectAttributes,
|
||||
&KeyName,
|
||||
OBJ_CASE_INSENSITIVE,
|
||||
OBJ_CASE_INSENSITIVE | OBJ_OPENIF,
|
||||
NULL,
|
||||
NULL);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue