PiProcessClearDeviceProblem

VOID __stdcall PiProcessClearDeviceProblem(_PNP_DEVICE_ACTION_ENTRY *Request){
  _DEVICE_OBJECT *DeviceObject; 
  _DEVICE_NODE *DeviceNode; 
  _PNP_DEVNODE_STATE State; 
  unsigned int Flags; 
  _PNP_DEVICE_ACTION_REQUEST RequestType; 
  bool v7; 
  HPNPOPCTX *hPnpOpCtx; 

  DeviceObject = Request->DeviceObject;
  hPnpOpCtx = 0i64;
  DeviceNode = (_DEVICE_NODE *)DeviceObject->DeviceObjectExtension->DeviceNode;
  State = DeviceNode->State;
  if( ((State - 769) & 0xFFFFFFEE) != 0 )
    return;
  if( State == DeviceNodeRemovePendingCloses )
    return;
  Flags = DeviceNode->Flags;
  if( (Flags & 0x6000) == 0 )
    return;
  RequestType = Request->RequestType;
  switch( RequestType )
  {
    case ClearDeviceProblem:
      if( (unsigned int)PipIsProblemReadonly(DeviceNode, DeviceNode->Problem) )
        return;
      break;
    case ClearEjectProblem:
      if( (Flags & 0x2000) == 0 )
        return;
      v7 = DeviceNode->Problem == 47;
LABEL_15:
      if( !v7 )
        return;
      break;
    case ClearDmaGuardProblem:
      if( (Flags & 0x2000) == 0 )
        return;
      v7 = DeviceNode->Problem == 55;
      goto LABEL_15;
  }
  PiPnpRtlBeginOperation(&hPnpOpCtx);
  PipClearDevNodeFlags(DeviceNode, 0x4000ui64);
  PipClearDevNodeProblem(DeviceNode);
  if( DeviceNode->State != DeviceNodeUninitialized )
    PnpRestartDeviceNode(DeviceNode);
  if( hPnpOpCtx )
    PiPnpRtlEndOperation(hPnpOpCtx);
}

Referenced by:

PnpDeviceActionWorker