PiRestartDevice

INT64 __fastcall PiRestartDevice(_PNP_DEVICE_ACTION_ENTRY *Request){
  __int64 v2; 
  int v3; 
  INT64 v5; 
  v5 = 0i64;
  v2 = *(_QWORD *)(*((_QWORD *)Request->DeviceObject + 39) + 40i64);
  v3 = *(_DWORD *)(v2 + 300);
  if( (unsigned int)(v3 - 787) <= 1 )
    return 3221225558i64;
  if( (*(_DWORD *)(v2 + 396) & 0x6000) != 0 )
    return 3221225473i64;
  switch( v3 )
  {
    case 769:
    case 771:
    case 772:
    case 774:
    case 775:
    case 781:
      goto LABEL_4;
    case 770:
    case 786:
      PnpRestartDeviceNode(v2);
LABEL_4:
      if( Request->RequestType == StartDevice )
      {
        BYTE4(v5) = PnPBootDriversInitialized;
        LODWORD(v5) = 3;
        ObfReferenceObject(*(PVOID *)(v2 + 32));
        PipProcessDevNodeTree(v2, (INT64)Request, (INT64)&v5, 0i64, 0, 0, 0);
      }
      break;
    case 773:
    case 776:
    case 777:
    case 778:
    case 779:
    case 780:
      return 0i64;
    default:
      return 3221225473i64;
  }
  return 0i64;
}

Referenced by:

PnpDeviceActionWorker