NtAlpcDeleteSecurityContext

NTSTATUS __stdcall NtAlpcDeleteSecurityContext(PVOID PortHandle, UINT64 Flags, PVOID ContextHandle){
  _ETHREAD *CurrentThread; 
  int v5; 
  struct _DMA_ADAPTER *v6; 
  _EX_PUSH_LOCK *v7; 
  _EX_PUSH_LOCK *v8; 
  PADAPTER_OBJECT DmaAdapter; 
  CurrentThread = (_ETHREAD *)KeGetCurrentThread();
  --*((_WORD *)CurrentThread + 242);
  if( (_DWORD)Flags )
  {
    v5 = -1073741811;
  }
  else
  {
    DmaAdapter = 0i64;
    v5 = ObReferenceObjectByHandle(
           PortHandle,
           1u,
           AlpcPortObjectType,
           *((_BYTE *)KeGetCurrentThread() + 562),
           (PVOID *)&DmaAdapter,
           0i64);
    if( v5 >= 0 )
    {
      v6 = DmaAdapter;
      v7 = AlpcReferenceBlobByHandle(
             (_ALPC_HANDLE_TABLE *)(*(_QWORD *)&DmaAdapter[1].Version + 40i64),
             ContextHandle,
             &AlpcSecurityType);
      v8 = v7;
      if( v7 )
      {
        if( v6 == (struct _DMA_ADAPTER *)v7[3].Value )
        {
          if( AlpcpDeleteBlob(v7) )
            AlpcpDereferenceBlobEx(v8, 1i64);
          else
            v5 = -1073741738;
        }
        else
        {
          v5 = -1073741790;
        }
        AlpcpDereferenceBlobEx(v8, 1i64);
      }
      else
      {
        v5 = -1073741816;
      }
      HalPutDmaAdapter(v6);
    }
  }
  KeLeaveCriticalRegionThread((__int64)KeGetCurrentThread());
  return v5;
}

Referenced by:

No references.