/* Worker function. Search stream database for requested stream handle. */
EFI_STATUS FindStreamNode(IN UINTN SearchHandle, OUT CORE_SECTION_STREAM_NODE **FoundStream)
/* Worker function. Search stream database for requested stream handle. */
EFI_STATUS FindStreamNode(IN UINTN SearchHandle, OUT CORE_SECTION_STREAM_NODE **FoundStream)
{
  CORE_SECTION_STREAM_NODE  *StreamNode;
  if (!IsListEmpty (&mStreamRoot)) {
    StreamNode = STREAM_NODE_FROM_LINK (GetFirstNode (&mStreamRoot));
    for ( ; ;) {
      if (StreamNode->StreamHandle == SearchHandle) {
        *FoundStream = StreamNode;
        return EFI_SUCCESS;
      } else if (IsNodeAtEnd (&mStreamRoot, &StreamNode->Link)) {
        break;
      } else {
        StreamNode = STREAM_NODE_FROM_LINK (GetNextNode (&mStreamRoot, &StreamNode->Link));
      }
    }
  }
  return EFI_NOT_FOUND;
}