mirror of
https://github.com/reactos/reactos.git
synced 2025-05-31 06:58:10 +00: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:
parent
627b1df579
commit
884db2ea06
1 changed files with 28 additions and 7 deletions
|
@ -960,7 +960,7 @@ CmpHandleExitNode(IN OUT PHHIVE *Hive,
|
||||||
{
|
{
|
||||||
/* Release it */
|
/* Release it */
|
||||||
ASSERT(*ReleaseHive != NULL);
|
ASSERT(*ReleaseHive != NULL);
|
||||||
HvReleaseCell((*ReleaseHive), *ReleaseCell);
|
HvReleaseCell(*ReleaseHive, *ReleaseCell);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Get the link references */
|
/* Get the link references */
|
||||||
|
@ -968,7 +968,7 @@ CmpHandleExitNode(IN OUT PHHIVE *Hive,
|
||||||
*Cell = (*KeyNode)->ChildHiveReference.KeyCell;
|
*Cell = (*KeyNode)->ChildHiveReference.KeyCell;
|
||||||
|
|
||||||
/* Get the new node */
|
/* Get the new node */
|
||||||
*KeyNode = (PCM_KEY_NODE)HvGetCell((*Hive), *Cell);
|
*KeyNode = (PCM_KEY_NODE)HvGetCell(*Hive, *Cell);
|
||||||
if (*KeyNode)
|
if (*KeyNode)
|
||||||
{
|
{
|
||||||
/* Set the new release values */
|
/* Set the new release values */
|
||||||
|
@ -1191,7 +1191,12 @@ CmpParseKey(IN PVOID ParseObject,
|
||||||
&Node,
|
&Node,
|
||||||
&HiveToRelease,
|
&HiveToRelease,
|
||||||
&CellToRelease);
|
&CellToRelease);
|
||||||
if (!Node) ASSERT(FALSE);
|
if (!Node)
|
||||||
|
{
|
||||||
|
/* Fail */
|
||||||
|
Status = STATUS_INSUFFICIENT_RESOURCES;
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Do the open */
|
/* Do the open */
|
||||||
|
@ -1232,7 +1237,12 @@ CmpParseKey(IN PVOID ParseObject,
|
||||||
&Node,
|
&Node,
|
||||||
&HiveToRelease,
|
&HiveToRelease,
|
||||||
&CellToRelease);
|
&CellToRelease);
|
||||||
if (!Node) ASSERT(FALSE);
|
if (!Node)
|
||||||
|
{
|
||||||
|
/* Fail */
|
||||||
|
Status = STATUS_INSUFFICIENT_RESOURCES;
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Create a KCB for this key */
|
/* Create a KCB for this key */
|
||||||
|
@ -1242,7 +1252,12 @@ CmpParseKey(IN PVOID ParseObject,
|
||||||
ParentKcb,
|
ParentKcb,
|
||||||
0,
|
0,
|
||||||
&NextName);
|
&NextName);
|
||||||
if (!Kcb) ASSERT(FALSE);
|
if (!Kcb)
|
||||||
|
{
|
||||||
|
/* Fail */
|
||||||
|
Status = STATUS_INSUFFICIENT_RESOURCES;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
/* Dereference the parent and set the new one */
|
/* Dereference the parent and set the new one */
|
||||||
CmpDereferenceKeyControlBlock(ParentKcb);
|
CmpDereferenceKeyControlBlock(ParentKcb);
|
||||||
|
@ -1353,7 +1368,12 @@ CmpParseKey(IN PVOID ParseObject,
|
||||||
&Node,
|
&Node,
|
||||||
&HiveToRelease,
|
&HiveToRelease,
|
||||||
&CellToRelease);
|
&CellToRelease);
|
||||||
if (!Node) ASSERT(FALSE);
|
if (!Node)
|
||||||
|
{
|
||||||
|
/* Fail */
|
||||||
|
Status = STATUS_INSUFFICIENT_RESOURCES;
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Do the open */
|
/* Do the open */
|
||||||
|
@ -1386,7 +1406,8 @@ CmpParseKey(IN PVOID ParseObject,
|
||||||
|
|
||||||
/* Dereference the parent if it exists */
|
/* Dereference the parent if it exists */
|
||||||
Quickie:
|
Quickie:
|
||||||
if (ParentKcb) CmpDereferenceKeyControlBlock(ParentKcb);
|
if (ParentKcb)
|
||||||
|
CmpDereferenceKeyControlBlock(ParentKcb);
|
||||||
|
|
||||||
/* Unlock the registry */
|
/* Unlock the registry */
|
||||||
CmpUnlockRegistry();
|
CmpUnlockRegistry();
|
||||||
|
|
Loading…
Reference in a new issue