IopSynchronousCall

NTSTATUS __stdcall IopSynchronousCall(
        DEVICE_OBJECT *DeviceObject,
        IO_STACK_LOCATION *TopStackLocation,
        INT64 DefaultStatus,
        UINT64 DefaultInformation,
        UINT64 *Information){
  int v7; 
  INT64 v8; 
  INT64 v9; 
  IRP *Irp; 
  IRP *v11; 
  __int64 v12; 
  __int128 v13; 
  __int128 v14; 
  __int128 v15; 
  NTSTATUS v16; 
  VOID *LowerDeviceObjectWithTag; 
  __int128 v19; 
  struct _KEVENT Event; 
  memset(&Event, 0, sizeof(Event));
  v7 = DefaultStatus;
  v19 = 0i64;
  LODWORD(v8) = IoGetAttachedDeviceReferenceWithTag(DeviceObject, 0x69706E50u);
  v9 = v8;
  if( (*(_DWORD *)(v8 + 48) & 0x80u) != 0 )
  {
    LowerDeviceObjectWithTag = IoGetLowerDeviceObjectWithTag(v8, 0x69706E50ui64);
    if( !LowerDeviceObjectWithTag )
    {
      v16 = -1073741436;
      goto LABEL_7;
    }
    ObfDereferenceObjectWithTag((PVOID)v9, 0x69706E50ui64);
    v9 = (INT64)LowerDeviceObjectWithTag;
  }
  Irp = IoAllocateIrp(*(_BYTE *)(v9 + 76), 0);
  v11 = Irp;
  if( Irp )
  {
    IovUtilWatermarkIrp(Irp, 1ui64);
    LODWORD(v19) = v7;
    *((_DWORD *)v11 + 12) = v7;
    *((_QWORD *)&v19 + 1) = DefaultInformation;
    *((_QWORD *)v11 + 7) = DefaultInformation;
    KeInitializeEvent(&Event, SynchronizationEvent, 0);
    *((_QWORD *)v11 + 9) = &v19;
    *((_QWORD *)v11 + 10) = &Event;
    *((_QWORD *)v11 + 19) = KeGetCurrentThread();
    IopQueueThreadIrp(v11);
    v12 = *((_QWORD *)v11 + 23);
    v13 = *((_OWORD *)TopStackLocation + 1);
    *(_OWORD *)(v12 - 72) = *(_OWORD *)TopStackLocation;
    v14 = *((_OWORD *)TopStackLocation + 2);
    *(_OWORD *)(v12 - 56) = v13;
    v15 = *((_OWORD *)TopStackLocation + 3);
    *(_OWORD *)(v12 - 40) = v14;
    *(_QWORD *)&v14 = *((_QWORD *)TopStackLocation + 8);
    *(_OWORD *)(v12 - 24) = v15;
    *(_QWORD *)(v12 - 8) = v14;
    v16 = IofCallDriver((PDEVICE_OBJECT)v9, v11);
    if( v16 == 259 )
    {
      KeWaitForSingleObject(&Event, Executive, 0, 0, 0i64);
      v16 = v19;
    }
    if( Information )
      *Information = *((_QWORD *)&v19 + 1);
  }
  else
  {
    v16 = -1073741670;
  }
LABEL_7:
  ObfDereferenceObjectWithTag((PVOID)v9, 0x69706E50ui64);
  return v16;
}

Referenced by:

IopQueryDeviceResources
IopQueryDeviceState
IopQueryDockRemovalInterface
IopQueryLegacyBusInformation
IopQueryReconfiguration
IopQueryResourceHandlerInterface
IopRemoveDevice
PnpIrpDeviceEnumerated
PnpIrpQueryID
PnpQueryBusInformation
PnpQueryDeviceText
PnpSendIrp
PpIrpQueryCapabilities
PpIrpQueryResourceRequirements