{
ACPI_NAMESPACE_NODE *ChildNode;
ACPI_NAMESPACE_NODE *DeletionNode;
ACPI_NAMESPACE_NODE *ParentNode;
UINT32Level;
ACPI_STATUSStatus;
ACPI_FUNCTION_TRACE_U32 (NsDeleteNamespaceByOwner, OwnerId);
if (OwnerId == 0)
{
return_VOID;
}
/* Lock namespace for possible update */
Status = AcpiUtAcquireMutex (ACPI_MTX_NAMESPACE);
if (ACPI_FAILURE (Status))
{
return_VOID;
}
DeletionNode = NULL;
ParentNode = AcpiGbl_RootNode;
ChildNode = NULL;
Level = 1;
/* * Traverse the tree of nodes until we bubble back up * to where we started. */while (Level > 0)
{
/* * Get the next child of this parent node. When ChildNode is NULL, * the first child of the parent is returned */
ChildNode = AcpiNsGetNextNode (ParentNode, ChildNode);
if (DeletionNode)
{
AcpiNsDeleteChildren (DeletionNode);
AcpiNsRemoveNode (DeletionNode);
DeletionNode = NULL;
}
if (ChildNode)
{
if (ChildNode->OwnerId == OwnerId)
{
/* Found a matching child node - detach any attached object */AcpiNsDetachObject (ChildNode);
}
/* Check if this node has any children */if (ChildNode->Child)
{
/* * There is at least one child of this node, * visit the node */
Level++;
ParentNode = ChildNode;
ChildNode = NULL;
}
elseif (ChildNode->OwnerId == OwnerId)
{
DeletionNode = ChildNode;
}
}
else
{
/* * No more children of this parent node. * Move up to the grandparent. */
Level--;
if (Level != 0)
{
if (ParentNode->OwnerId == OwnerId)
{
DeletionNode = ParentNode;
}
}
/* New "last child" is this parent node */
ChildNode = ParentNode;
/* Move up the tree to the grandparent */
ParentNode = ParentNode->Parent;
}
}
(void) AcpiUtReleaseMutex (ACPI_MTX_NAMESPACE);
return_VOID;
}
Generated on Sat May 26 2012 05:21:28 for ReactOS by
1.7.6.1
ReactOS is a registered trademark or a trademark of ReactOS Foundation in the United States and other countries.