public DirectInputGenerator(EventSize size) : base(size) { _record = new EVENT_RECORD(); _recordHandle = GCHandle.Alloc(_record, GCHandleType.Pinned); _record.EventHeader.ProviderId = new Guid("3838EF9A-CB6F-4A1C-9033-84C0E8EBF5A7"); _record.EventHeader.EventDescriptor.Id = (ushort)size; _record.UserData = EventData.AddrOfPinnedObject(); _record.UserDataLength = (ushort)Marshal.SizeOf(EventData.Target); }
unsafe void EtwCallback(ref EVENT_RECORD record) { fixed (EVENT_RECORD* p = &record) { EtwNativeEvent evt; evt.record = p; evt._data = (byte*)record.UserData.ToPointer(); evt._end = evt._data + record.UserDataLength; evt._length = 0; _observer.OnNext(evt); } }
public static extern Int32 TdhGetEventInformation( ref EVENT_RECORD Event, UInt32 TdhContextCount, IntPtr TdhContext, [Out] IntPtr eventInfoPtr, ref Int32 BufferSize);