NtCreateKeyedEvent

NTSTATUS __stdcall NtCreateKeyedEvent(
        PVOID *KeyedEventHandle,
        UINT64 DesiredAccess,
        OBJECT_ATTRIBUTES *ObjectAttributes,
        UINT64 Flags){
  unsigned int v4; 
  char v6; 
  NTSTATUS result; 
  PADAPTER_OBJECT v8; 
  _DMA_OPERATIONS **p_DmaOperations; 
  __int64 v10; 
  __int64 v11; 
  __int64 v12; 
  PADAPTER_OBJECT DmaAdapter; 
  void *Handle[5]; 
  v4 = DesiredAccess;
  DmaAdapter = 0i64;
  Handle[0] = 0i64;
  v6 = *((_BYTE *)KeGetCurrentThread() + 562);
  if( v6 && ((unsigned __int8)KeyedEventHandle & 7) != 0 )
    ExRaiseDatatypeMisalignment();
  *KeyedEventHandle = 0i64;
  if( (_DWORD)Flags )
    return -1073741582;
  result = ObCreateObjectEx(
             v6,
             ExpKeyedEventObjectType,
             (__int64)ObjectAttributes,
             v6,
             v11,
             1536,
             0,
             0,
             &DmaAdapter,
             0i64);
  if( result >= 0 )
  {
    v8 = DmaAdapter;
    p_DmaOperations = &DmaAdapter->DmaOperations;
    v10 = 64i64;
    do
    {
      *(p_DmaOperations - 1) = 0i64;
      p_DmaOperations[1] = (_DMA_OPERATIONS *)p_DmaOperations;
      *p_DmaOperations = (_DMA_OPERATIONS *)p_DmaOperations;
      p_DmaOperations += 3;
      --v10;
    }
    while( v10 );
    LODWORD(v12) = 0;
    result = ObInsertObjectEx(v8, 0i64, v4, 0i64, v12, 0i64, Handle);
    if( result >= 0 )
      *KeyedEventHandle = Handle[0];
  }
  return result;
}

Referenced by:

No references.