PiProcessAddBootDevices

NTSTATUS __stdcall PiProcessAddBootDevices(_DEVICE_OBJECT *DeviceObject){
  _DEVOBJ_EXTENSION *DeviceObjectExtension; 
  _DEVICE_NODE *DeviceNode; 
  _ADD_CONTEXT Context; 
  HPNPOPCTX *hPnpOpCtx; 

  Context = 0i64;
  DeviceObjectExtension = DeviceObject->DeviceObjectExtension;
  hPnpOpCtx = 0i64;
  DeviceNode = (_DEVICE_NODE *)DeviceObjectExtension->DeviceNode;
  if( DeviceNode->State == DeviceNodeInitialized && (DeviceNode->Flags & 0x6002) == 0 && !DeviceNode->DuplicatePDO )
  {
    PiPnpRtlBeginOperation(&hPnpOpCtx);
    Context.LoadDriver = *(&PnpReplaceEvent + 6682);
    if( PipCallDriverAddDevice(DeviceNode, &Context) >= 0 )
      PoFxPrepareDevice(DeviceNode, 0);
    if( hPnpOpCtx )
      PiPnpRtlEndOperation(hPnpOpCtx);
  }
  return 0;
}

Referenced by:

PipAddDevicesToBootDriverWorker