PiProcessReenumeration

NTSTATUS __stdcall PiProcessReenumeration(_PNP_DEVICE_ACTION_ENTRY *Request){
  _ADAPTER_OBJECT *DeviceObject; 
  __int64 v3; 
  _ENUM_TYPE v4; 
  UINT64 ReallocateResources; 
  UINT64 Synchronous; 
  UINT64 ProcessOnlyIntermediateStates; 
  _ADD_CONTEXT AddContext; 

  AddContext = 0i64;
  DeviceObject = (_ADAPTER_OBJECT *)Request->DeviceObject;
  v3 = *(_QWORD *)(DeviceObject->ExpiredLock._bf_0 + 40);
  if( (unsigned int)(*(_DWORD *)(v3 + 300) - 787) <= 1 )
  {
    HalPutDmaAdapter(DeviceObject);
    return -1073741738;
  }
  else
  {
    if( Request->RequestType == ReenumerateDeviceOnly )
    {
      if( LOBYTE(Request->RequestArgument) )
        PipClearDevNodeFlags(*(_DEVICE_NODE **)(DeviceObject->ExpiredLock._bf_0 + 40), 0x80000000ui64);
      v4 = EnumTypeShallow;
    }
    else
    {
      v4 = EnumTypeDeep;
    }
    PiMarkDeviceTreeForReenumeration((_DEVICE_NODE *)v3, v4 != EnumTypeShallow);
    LOBYTE(ProcessOnlyIntermediateStates) = 0;
    LOBYTE(Synchronous) = 0;
    AddContext.LoadDriver = *(&PnpReplaceEvent + 6682);
    AddContext.DriverStartType = 3;
    LOBYTE(ReallocateResources) = 0;
    PipProcessDevNodeTree(
      (_DEVICE_NODE *)v3,
      Request,
      &AddContext,
      v4,
      ReallocateResources,
      Synchronous,
      ProcessOnlyIntermediateStates);
    return 0;
  }
}

Referenced by:

PnpDeviceActionWorker