PipProcessStartPhase2

__int64 __fastcall PipProcessStartPhase2(__int64 a1, __int64 a2, __int64 a3){
  int v4; 
  _PNP_DEVNODE_STATE *v5; 
  INT64 v6; 
  _INTERFACE_TYPE v8; 
  int v9; 
  if( (byte_140C130BB & 0x10) != 0 )
    McTemplateK0dz_EtwWriteTransfer(a1, &KMPnPEvt_ProcessDeviceStart_Start, a3, 2i64, *(const WCHAR **)(a1 + 48));
  v4 = *(_DWORD *)(a1 + 392);
  if( *(_DWORD *)(a1 + 568) )
  {
    if( v4 < 0 )
      PpProfileCancelHardwareProfileTransition();
    else
      PpProfileCommitTransitioningDock((_DEVICE_NODE *)a1, DOCK_ARRIVING);
  }
  if( v4 < 0 )
  {
    if( v4 == -1073741102 )
    {
      v9 = 14;
      PnpUpdateRebootRequiredReason(*(_QWORD *)(a1 + 48), a2, 0x40000000i64);
    }
    else
    {
      v9 = 10;
    }
    PnpRequestDeviceRemoval(a1, 0, v9, v4);
    if( *(_DWORD *)(a1 + 568) )
      IoRequestDeviceEject(*(_DEVICE_OBJECT **)(a1 + 32));
  }
  else
  {
    IopDoDeferredSetInterfaceState((_DEVICE_NODE *)a1);
    if( !IopBootConfigsReserved )
    {
      v8 = *(_DWORD *)(a1 + 448);
      if( v8 != InterfaceTypeUndefined )
      {
        if( v8 == Isa )
        {
          IopAllocateLegacyBootResources(Eisa, *(unsigned int *)(a1 + 452));
          v8 = *(_DWORD *)(a1 + 448);
        }
        IopAllocateLegacyBootResources(v8, *(unsigned int *)(a1 + 452));
      }
    }
    PipSetDevNodeState((_DEVICE_NODE *)a1, DeviceNodeStartPostWork, v5);
  }
  if( (byte_140C130BB & 0x10) != 0 )
    McTemplateK0dz_EtwWriteTransfer(
      *(_QWORD *)(a1 + 48),
      &KMPnPEvt_ProcessDeviceStart_Stop,
      v6,
      2i64,
      *(const WCHAR **)(a1 + 48));
  return(unsigned int)v4;
}

Referenced by:

PipProcessDevNodeTree