NtStopProfile

NTSTATUS __stdcall NtStopProfile(PVOID ProfileHandle){
  NTSTATUS v1; 
  NTSTATUS result; 
  PADAPTER_OBJECT v3; 
  void *v4; 
  struct _MDL *DmaOperations; 
  _DMA_OPERATIONS *v6; 
  PADAPTER_OBJECT DmaAdapter; 
  v1 = 0;
  DmaAdapter = 0i64;
  result = ObReferenceObjectByHandle(
             ProfileHandle,
             1u,
             ExProfileObjectType,
             *((_BYTE *)KeGetCurrentThread() + 562),
             (PVOID *)&DmaAdapter,
             0i64);
  if( result >= 0 )
  {
    KeWaitForSingleObject(&ExpProfileStateMutex, Executive, 0, 0, 0i64);
    v3 = DmaAdapter;
    if( *(_QWORD *)&DmaAdapter[3].Version )
    {
      KeStopProfile((ULONG_PTR)DmaAdapter[2].DmaOperations);
      v4 = *(void **)&v3[3].Version;
      DmaOperations = (struct _MDL *)v3[3].DmaOperations;
      v6 = v3[2].DmaOperations;
      --ExpCurrentProfileUsage;
      *(_QWORD *)&v3[3].Version = 0i64;
      KeReleaseMutex(&ExpProfileStateMutex, 0);
      MmUnmapLockedPages(v4, DmaOperations);
      MmUnlockPages(DmaOperations);
      ExFreePoolWithTag(v6, 0);
    }
    else
    {
      KeReleaseMutex(&ExpProfileStateMutex, 0);
      v1 = -1073741641;
    }
    HalPutDmaAdapter(v3);
    return v1;
  }
  return result;
}

Referenced by:

No references.