NtAlpcRevokeSecurityContext

NTSTATUS __stdcall NtAlpcRevokeSecurityContext(PVOID PortHandle, UINT64 Flags, PVOID ContextHandle){
  _ETHREAD *CurrentThread; 
  int v5; 
  struct _DMA_ADAPTER *v6; 
  _EX_PUSH_LOCK *v7; 
  _EX_PUSH_LOCK *v8; 
  volatile INT64 *v9; 
  int v10; 
  PVOID Object; 
  CurrentThread = (_ETHREAD *)KeGetCurrentThread();
  --*((_WORD *)CurrentThread + 242);
  if( (_DWORD)Flags )
  {
    v5 = -1073741811;
  }
  else
  {
    Object = 0i64;
    v5 = ObReferenceObjectByHandle(
           PortHandle,
           1u,
           AlpcPortObjectType,
           *((_BYTE *)KeGetCurrentThread() + 562),
           &Object,
           0i64);
    if( v5 >= 0 )
    {
      v6 = (struct _DMA_ADAPTER *)Object;
      v7 = AlpcReferenceBlobByHandle(
             (_ALPC_HANDLE_TABLE *)(*((_QWORD *)Object + 2) + 40i64),
             ContextHandle,
             &AlpcSecurityType);
      v8 = v7;
      if( v7 )
      {
        if( v6 == (struct _DMA_ADAPTER *)v7[3].Value )
        {
          v9 = (volatile INT64 *)&v7[-2];
          ExAcquirePushLockExclusiveEx((UINT64)&v7[-2], 0i64);
          v10 = (int)v8[13].0;
          if( (v10 & 2) != 0 )
          {
            v5 = -1073741823;
          }
          else
          {
            *(_DWORD *)&v8[13].0 = v10 | 1;
            v5 = 0;
          }
          if( (_InterlockedExchangeAdd64(v9, 0xFFFFFFFFFFFFFFFFui64) & 6) == 2 )
            ExfTryToWakePushLock(v9);
          KeAbPostRelease((PVOID)v9);
          v6 = (struct _DMA_ADAPTER *)Object;
        }
        else
        {
          v5 = -1073741790;
        }
        AlpcpDereferenceBlobEx(v8, 1i64);
      }
      else
      {
        v5 = -1073741816;
      }
      HalPutDmaAdapter(v6);
    }
  }
  KeLeaveCriticalRegionThread((__int64)KeGetCurrentThread());
  return v5;
}

Referenced by:

No references.