HalpAllocateAdapterCallbackV2

NTSTATUS __stdcall HalpAllocateAdapterCallbackV2(
        DEVICE_OBJECT *DeviceObject,
        IRP *Irp,
        PVOID MapRegisterBase,
        PVOID Context){
  __int64 *v4; 
  int *v5; 
  PHYSICAL_ADDRESS *v6; 
  char *v7; 
  BOOLEAN v9; 
  unsigned int v10; 
  unsigned int v11; 
  struct _DMA_ADAPTER *v12; 
  __int64 *v13; 
  int v14; 
  int v15; 
  unsigned int v16; 
  PHYSICAL_ADDRESS *v17; 
  __int64 LowPart; 
  int *v20; 
  __int64 v21; 
  __int64 v22; 
  void(__fastcall *v23)(DEVICE_OBJECT *, __int64, int *, __int64); 
  BOOLEAN WriteToDevice; 
  PDMA_ADAPTER DmaAdapter; 
  unsigned int DmaAdaptera; 
  v4 = (__int64 *)*((_QWORD *)Context + 1);
  v5 = (int *)((char *)Context + 48);
  v6 = (PHYSICAL_ADDRESS *)((char *)Context + 64);
  v7 = (char *)*((_QWORD *)Context + 4);
  v9 = *((_BYTE *)Context + 152);
  v10 = *((_DWORD *)Context + 10);
  v23 = (void(__fastcall *)(DEVICE_OBJECT *, __int64, int *, __int64))*((_QWORD *)Context + 15);
  v21 = *((_QWORD *)Context + 16);
  v22 = *((_QWORD *)Context + 13);
  DmaAdapter = (PDMA_ADAPTER)*((_QWORD *)Context + 18);
  *((_QWORD *)Context + 3) = MapRegisterBase;
  *((_QWORD *)Context + 7) = Context;
  v11 = *((_DWORD *)v4 + 8) + *((_DWORD *)v4 + 10) + *((_DWORD *)v4 + 11) - (_DWORD)v7;
  WriteToDevice = v9;
  v20 = (int *)((char *)Context + 48);
  if( v10 )
  {
    v12 = DmaAdapter;
    do
    {
      v13 = (__int64 *)*v4;
      v14 = v10;
      v15 = v10;
      if( v11 <= v10 )
        v14 = v11;
      if( v13 )
        v15 = v14;
      v16 = v10 - v14;
      v10 = v13 != 0i64 ? v10 - v14 : 0;
      DmaAdaptera = v13 != 0i64 ? v16 : 0;
      if( v15 > 0 )
      {
        do
        {
          v17 = v6 + 1;
          v6[1].LowPart = v15;
          *v6 = IoMapTransfer(v12, (PMDL)v4, MapRegisterBase, v7, (PULONG)&v6[1], WriteToDevice);
          v6 += 3;
          LowPart = v17->LowPart;
          v15 -= LowPart;
          v7 += LowPart;
        }
        while( v15 > 0 );
        v10 = DmaAdaptera;
        v13 = (__int64 *)*v4;
      }
      if( !v13 )
        break;
      v4 = v13;
      v7 = (char *)(v13[4] + *((unsigned int *)v13 + 11));
      v11 = *((_DWORD *)v13 + 10);
    }
    while( v10 );
    v5 = v20;
  }
  *v5 = ((int)v6 - (int)v5 - 16) / 24;
  v23(DeviceObject, v22, v5, v21);
  return 3;
}

Referenced by:

No references.