IoRequestDeviceEjectEx

NTSTATUS __stdcall IoRequestDeviceEjectEx(
        PDEVICE_OBJECT PhysicalDeviceObject,
        PIO_DEVICE_EJECT_CALLBACK Callback,
        PVOID Context,
        PDRIVER_OBJECT DriverObject){
  __int64 v8; 
  VOID *PoolWithTag; 
  __int64 v11; 
  __int16 *v12; 
  _WORD *v13; 
  PVOID *v14; 
  PVOID *v15; 
  __int64 v16; 
  _WORD *v17; 
  __int64 v18; 
  _WORD *v19; 
  __int64 v20; 
  if( !PhysicalDeviceObject )
    goto LABEL_20;
  v8 = *(_QWORD *)(*((_QWORD *)PhysicalDeviceObject + 39) + 40i64);
  if( !v8 || (*(_DWORD *)(v8 + 396) & 0x20000) != 0 )
  {
    IoAddTriageDumpDataBlock(PhysicalDeviceObject, *((unsigned __int16 *)PhysicalDeviceObject + 1));
    v12 = (__int16 *)*((_QWORD *)PhysicalDeviceObject + 1);
    if( v12 )
    {
      IoAddTriageDumpDataBlock(v12, (unsigned int)v12[1]);
      v13 = (_WORD *)(*((_QWORD *)PhysicalDeviceObject + 1) + 56i64);
      if( *v13 )
      {
        IoAddTriageDumpDataBlock(v13, 2ui64);
        IoAddTriageDumpDataBlock(
          *(PVOID *)(*((_QWORD *)PhysicalDeviceObject + 1) + 64i64),
          *(unsigned __int16 *)(*((_QWORD *)PhysicalDeviceObject + 1) + 56i64));
      }
    }
    v14 = *(PVOID **)(*((_QWORD *)PhysicalDeviceObject + 39) + 40i64);
    if( v14 )
    {
      v15 = v14 + 5;
      IoAddTriageDumpDataBlock(v14, 0x310ui64);
      if( *(_WORD *)v15 )
      {
        IoAddTriageDumpDataBlock(v15, 2ui64);
        IoAddTriageDumpDataBlock(v15[1], *(unsigned __int16 *)v15);
      }
      v16 = *((_QWORD *)PhysicalDeviceObject + 39);
      v17 = (_WORD *)(*(_QWORD *)(v16 + 40) + 56i64);
      if( *v17 )
      {
        IoAddTriageDumpDataBlock(v17, 2ui64);
        IoAddTriageDumpDataBlock(
          *(PVOID *)(*(_QWORD *)(*((_QWORD *)PhysicalDeviceObject + 39) + 40i64) + 64i64),
          *(unsigned __int16 *)(*(_QWORD *)(*((_QWORD *)PhysicalDeviceObject + 39) + 40i64) + 56i64));
        v16 = *((_QWORD *)PhysicalDeviceObject + 39);
      }
      v18 = *(_QWORD *)(*(_QWORD *)(v16 + 40) + 16i64);
      if( v18 )
      {
        v19 = (_WORD *)(v18 + 56);
        if( *v19 )
        {
          IoAddTriageDumpDataBlock(v19, 2ui64);
          v20 = *(_QWORD *)(*(_QWORD *)(*((_QWORD *)PhysicalDeviceObject + 39) + 40i64) + 16i64);
          IoAddTriageDumpDataBlock(*(PVOID *)(v20 + 64), *(unsigned __int16 *)(v20 + 56));
        }
      }
    }
LABEL_20:
    KeBugCheckEx(0xCAu, 2ui64, (ULONG_PTR)PhysicalDeviceObject, 0i64, 0i64);
  }
  PoolWithTag = ExAllocatePoolWithTag(NonPagedPoolNx, 0x5D8ui64, 0x46706E50ui64);
  if( !PoolWithTag )
    return -1073741670;
  v11 = *(_QWORD *)(*((_QWORD *)PhysicalDeviceObject + 39) + 40i64);
  *(_QWORD *)PoolWithTag = Callback;
  *((_QWORD *)PoolWithTag + 1) = Context;
  memmove((UINT8 *)PoolWithTag + 64, *(UINT8 **)(v11 + 48), *(unsigned __int16 *)(v11 + 40));
  *((_WORD *)PoolWithTag + ((unsigned __int64)*(unsigned __int16 *)(v11 + 40) >> 1) + 32) = 0;
  if( DriverObject )
    ObfReferenceObjectWithTag(DriverObject, 0x45706E50u);
  *((_QWORD *)PoolWithTag + 2) = DriverObject;
  *((_DWORD *)PoolWithTag + 116) = 0;
  *((_WORD *)PoolWithTag + 234) = 0;
  *((_QWORD *)PoolWithTag + 6) = PnpRequestDeviceEjectExWorker;
  *((_QWORD *)PoolWithTag + 7) = PoolWithTag;
  *((_QWORD *)PoolWithTag + 4) = 0i64;
  ExQueueWorkItem((WORK_QUEUE_ITEM *)PoolWithTag + 1, DelayedWorkQueue);
  return 0;
}

Referenced by:

IoRequestDeviceEject