PiSwCloseDescendants

VOID __stdcall PiSwCloseDescendants(UNICODE_STRING *ParentDeviceInstancePath){
  char v1; 
  char v2; 
  __int64 v3; 
  _QWORD *v4; 
  _QWORD *v5; 
  INT64 v6; 
  v2 = v1;
  LODWORD(v3) = PiSwFindBusRelations((INT64)ParentDeviceInstancePath);
  if( v3 )
  {
    v4 = (_QWORD *)(v3 + 16);
    v5 = *(_QWORD **)(v3 + 16);
    while( v5 != v4 )
    {
      v6 = (INT64)(v5 - 12);
      v5 = (_QWORD *)*v5;
      if( (*(_DWORD *)(v6 + 4) & 1) == 0 && (!v2 || PiSwIsPdoAssociationsEmpty(v6)) )
      {
        PiSwCloseDescendants((UNICODE_STRING *)(v6 + 72));
        PiSwCloseDevice((CHAR *)v6);
      }
    }
  }
}

Referenced by:

PiSwCloseDescendants
PiSwIrpCleanup
PiSwProcessParentRemoveIrp