SmCreateEvent

INT64 __stdcall SmCreateEvent(KEVENT **EventOut){
  PVOID *v1; 
  PVOID *v2; 
  NTSTATUS v3; 
  NTSTATUS v4; 
  struct _DMA_ADAPTER *v5; 
  struct _OBJECT_ATTRIBUTES ObjectAttributes; 
  void *EventHandle; 
  PVOID Object; 
  memset(&ObjectAttributes.Length + 1, 0, 20);
  memset(&ObjectAttributes.Attributes + 1, 0, 20);
  EventHandle = 0i64;
  v2 = v1;
  ObjectAttributes.Length = 48;
  ObjectAttributes.Attributes = 512;
  v3 = ZwCreateEvent(&EventHandle, 0x1F0003ui64, &ObjectAttributes, SynchronizationEvent, 0);
  if( v3 >= 0 )
  {
    Object = 0i64;
    v4 = ObReferenceObjectByHandle(EventHandle, 0x1F0003u, (POBJECT_TYPE)ExEventObjectType, 0, &Object, 0i64);
    v5 = (struct _DMA_ADAPTER *)Object;
    v3 = v4;
    if( v4 >= 0 )
    {
      *v2 = Object;
      v5 = 0i64;
      v3 = 0;
    }
    if( v5 )
      HalPutDmaAdapter(v5);
  }
  if( EventHandle )
    ZwClose(EventHandle);
  return(unsigned int)v3;
}

Referenced by:

SmRegistrationCtxStart