PiProcessClearDeviceProblem

VOID __stdcall PiProcessClearDeviceProblem(_PNP_DEVICE_ACTION_ENTRY *Request){
  _DEVICE_OBJECT *DeviceObject; 
  __int64 v3; 
  int v4; 
  int v5; 
  _PNP_DEVICE_ACTION_REQUEST RequestType; 
  const WCHAR *v7; 
  INT64 v8; 
  bool v9; 
  PVOID P; 
  DeviceObject = Request->DeviceObject;
  P = 0i64;
  v3 = *(_QWORD *)(*((_QWORD *)DeviceObject + 39) + 40i64);
  v4 = *(_DWORD *)(v3 + 300);
  if( ((v4 - 769) & 0xFFFFFFEE) != 0 )
    return;
  if( v4 == 785 )
    return;
  v5 = *(_DWORD *)(v3 + 396);
  if( (v5 & 0x6000) == 0 )
    return;
  RequestType = Request->RequestType;
  switch( RequestType )
  {
    case ClearDeviceProblem:
      if( (unsigned int)PipIsProblemReadonly(v3, *(_DWORD *)(v3 + 404)) )
        return;
      break;
    case ClearEjectProblem:
      if( (v5 & 0x2000) == 0 )
        return;
      v9 = *(_DWORD *)(v3 + 404) == 47;
LABEL_15:
      if( !v9 )
        return;
      break;
    case ClearDmaGuardProblem:
      if( (v5 & 0x2000) == 0 )
        return;
      v9 = *(_DWORD *)(v3 + 404) == 55;
      goto LABEL_15;
  }
  PiPnpRtlBeginOperation((__int64 **)&P);
  PipClearDevNodeFlags((_DEVICE_NODE *)v3, 0x4000ui64);
  PipClearDevNodeProblem(v3, v7, v8);
  if( *(_DWORD *)(v3 + 300) != 769 )
    PnpRestartDeviceNode(v3);
  if( P )
    PiPnpRtlEndOperation(P);
}

Referenced by:

PnpDeviceActionWorker