SMKM_STORE_MGR::SmAsyncReadQueueInsert

ULONG_PTR *__fastcall SMKM_STORE_MGR::SmAsyncReadQueueInsert(__int64 a1, ULONG_PTR a2, unsigned int a3){
  UINT64 *v3; 
  __int64 v6; 
  unsigned __int8 v7; 
  unsigned __int64 v8; 
  ULONG_PTR *v9; 
  UINT64 v10; 
  ULONG_PTR *result; 
  WORK_QUEUE_ITEM *v12; 
  unsigned __int64 v13; 
  __int128 v14; 
  ULONG_PTR BugCheckParameter2[2]; 
  BugCheckParameter2[0] = 0i64;
  BugCheckParameter2[1] = (ULONG_PTR)BugCheckParameter2;
  v3 = (UINT64 *)(a1 + 768);
  *(_DWORD *)(a2 + 32) ^= (*(_DWORD *)(a2 + 32) ^ a3) & 7;
  v6 = a1 + 24i64 * a3;
  *(_DWORD *)(a2 + 40) ^= (*(_DWORD *)(a2 + 40) ^ (a3 >> 3)) & 3;
  KeAcquireSpinLockRaiseToDpc((UINT64 *)(a1 + 768), a2);
  v8 = v7;
  if( *(_QWORD *)(v6 + 16) )
  {
    *(_QWORD *)a2 = **(_QWORD **)(v6 + 8) + 1i64;
    **(_QWORD **)(v6 + 8) = a2;
    *(_QWORD *)(v6 + 8) = a2;
    v13 = *(_QWORD *)a2;
    if( v13 >= (unsigned int)KeQueryActiveProcessorCountEx(0xFFFFu) && *(_QWORD *)(v6 + 8) != v6 )
    {
      v14 = *(_OWORD *)v6;
      *(_QWORD *)(v6 + 8) = v6;
      *(_OWORD *)BugCheckParameter2 = v14;
      *(_QWORD *)v6 = 0i64;
    }
  }
  else
  {
    v9 = (ULONG_PTR *)BugCheckParameter2[1];
    *(_QWORD *)a2 = *(_QWORD *)BugCheckParameter2[1] + 1i64;
    *v9 = a2;
    BugCheckParameter2[1] = a2;
  }
  *(_DWORD *)(v6 + 16) += *(_DWORD *)BugCheckParameter2[1];
  KxReleaseSpinLock(v3);
  __writecr8(v8);
  while( 1 )
  {
    result = BugCheckParameter2;
    if( (ULONG_PTR *)BugCheckParameter2[1] == BugCheckParameter2 )
      break;
    v12 = (WORK_QUEUE_ITEM *)BugCheckParameter2[0];
    BugCheckParameter2[0] = *(_QWORD *)BugCheckParameter2[0];
    if( v12 == (WORK_QUEUE_ITEM *)BugCheckParameter2[1] )
    {
      BugCheckParameter2[0] = 0i64;
      BugCheckParameter2[1] = (ULONG_PTR)BugCheckParameter2;
    }
    else
    {
      --*(_QWORD *)BugCheckParameter2[1];
    }
    v12->List.Flink = 0i64;
    v12->WorkerRoutine = (void(__fastcall *)(void *))SMKM_STORE_MGR::SmAsyncReadQueueWorker;
    v12->Parameter = v12;
    ExQueueWorkItemToPrivatePool(v12, a3, v10, PoolID);
  }
  return result;
}

Referenced by:

No references.