mirror of
https://github.com/reactos/reactos.git
synced 2026-05-30 14:34:57 +08:00
[NTOS:CM] In CmpParseKey(), do not assert but instead correctly return failure if CmpHandleExitNode() doesn't return a valid node, or CmpCreateKeyControlBlock() fails.
This commit is contained in:
@@ -960,7 +960,7 @@ CmpHandleExitNode(IN OUT PHHIVE *Hive,
|
||||
{
|
||||
/* Release it */
|
||||
ASSERT(*ReleaseHive != NULL);
|
||||
HvReleaseCell((*ReleaseHive), *ReleaseCell);
|
||||
HvReleaseCell(*ReleaseHive, *ReleaseCell);
|
||||
}
|
||||
|
||||
/* Get the link references */
|
||||
@@ -968,7 +968,7 @@ CmpHandleExitNode(IN OUT PHHIVE *Hive,
|
||||
*Cell = (*KeyNode)->ChildHiveReference.KeyCell;
|
||||
|
||||
/* Get the new node */
|
||||
*KeyNode = (PCM_KEY_NODE)HvGetCell((*Hive), *Cell);
|
||||
*KeyNode = (PCM_KEY_NODE)HvGetCell(*Hive, *Cell);
|
||||
if (*KeyNode)
|
||||
{
|
||||
/* Set the new release values */
|
||||
@@ -1191,7 +1191,12 @@ CmpParseKey(IN PVOID ParseObject,
|
||||
&Node,
|
||||
&HiveToRelease,
|
||||
&CellToRelease);
|
||||
if (!Node) ASSERT(FALSE);
|
||||
if (!Node)
|
||||
{
|
||||
/* Fail */
|
||||
Status = STATUS_INSUFFICIENT_RESOURCES;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/* Do the open */
|
||||
@@ -1232,7 +1237,12 @@ CmpParseKey(IN PVOID ParseObject,
|
||||
&Node,
|
||||
&HiveToRelease,
|
||||
&CellToRelease);
|
||||
if (!Node) ASSERT(FALSE);
|
||||
if (!Node)
|
||||
{
|
||||
/* Fail */
|
||||
Status = STATUS_INSUFFICIENT_RESOURCES;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/* Create a KCB for this key */
|
||||
@@ -1242,7 +1252,12 @@ CmpParseKey(IN PVOID ParseObject,
|
||||
ParentKcb,
|
||||
0,
|
||||
&NextName);
|
||||
if (!Kcb) ASSERT(FALSE);
|
||||
if (!Kcb)
|
||||
{
|
||||
/* Fail */
|
||||
Status = STATUS_INSUFFICIENT_RESOURCES;
|
||||
break;
|
||||
}
|
||||
|
||||
/* Dereference the parent and set the new one */
|
||||
CmpDereferenceKeyControlBlock(ParentKcb);
|
||||
@@ -1353,7 +1368,12 @@ CmpParseKey(IN PVOID ParseObject,
|
||||
&Node,
|
||||
&HiveToRelease,
|
||||
&CellToRelease);
|
||||
if (!Node) ASSERT(FALSE);
|
||||
if (!Node)
|
||||
{
|
||||
/* Fail */
|
||||
Status = STATUS_INSUFFICIENT_RESOURCES;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/* Do the open */
|
||||
@@ -1386,7 +1406,8 @@ CmpParseKey(IN PVOID ParseObject,
|
||||
|
||||
/* Dereference the parent if it exists */
|
||||
Quickie:
|
||||
if (ParentKcb) CmpDereferenceKeyControlBlock(ParentKcb);
|
||||
if (ParentKcb)
|
||||
CmpDereferenceKeyControlBlock(ParentKcb);
|
||||
|
||||
/* Unlock the registry */
|
||||
CmpUnlockRegistry();
|
||||
|
||||
Reference in New Issue
Block a user