PoHandleIrp

UINT8 __stdcall PoHandleIrp(_IRP *Irp, INT64 *Status){
  _IO_STACK_LOCATION *CurrentStackLocation; 
  _DEVICE_OBJECT *DeviceObject; 
  __int64 v6; 
  _DEVICE_OBJECT *v7; 
  unsigned int *p_Flags; 
  unsigned int Flags; 
  unsigned int *v10; 
  UINT8 v11; 
  _KLOCK_QUEUE_HANDLE LockHandle; 

  CurrentStackLocation = Irp->Tail.CurrentStackLocation;
  memset(&LockHandle, 0, sizeof(LockHandle));
  DeviceObject = CurrentStackLocation->DeviceObject;
  v6 = *((_QWORD *)&Irp->Tail.IrpExtension + 9 * Irp->StackCount);
  v7 = *(_DEVICE_OBJECT **)(v6 + 40);
  if( v7 )
  {
    PoDeviceReleaseIrp(Irp, *(_BYTE *)(v6 + 184), v7);
    p_Flags = &DeviceObject->Flags;
    Flags = DeviceObject->Flags;
    v10 = &DeviceObject->Flags;
    if( (Flags & 0x8000) == 0 && ((Flags & 0x2000) == 0 || KeGetCurrentIrql() != 2) )
    {
      v11 = 0;
      goto LABEL_5;
    }
  }
  else
  {
    v10 = &DeviceObject->Flags;
  }
  p_Flags = v10;
  v11 = 1;
  if( (*v10 & 0x8000) != 0 )
  {
LABEL_5:
    PoDeviceAcquireIrp(Irp, CurrentStackLocation->MinorFunction, DeviceObject);
    if( !v11 )
      return v11;
  }
  if( (*p_Flags & 0x8000) != 0 )
  {
    Irp->IoStatus.Status = 0;
    Irp->IoStatus.Information = 0i64;
    IofCompleteRequest(Irp, 0);
    *(_DWORD *)Status = 0;
  }
  else
  {
    KeAcquireInStackQueuedSpinLock((PKSPIN_LOCK)&stru_140C23628 + 121, &LockHandle);
    PopDispatchQuerySetIrp(Irp);
    KeReleaseInStackQueuedSpinLockFromDpcLevel(&LockHandle);
    __writecr8(LockHandle.OldIrql);
    *(_DWORD *)Status = 259;
  }
  return v11;
}

Referenced by:

IopPoHandleIrp