public static partial bool ReportEvent( SafeEventLogWriteHandle hEventLog, short wType, ushort wcategory, uint dwEventID, byte[] lpUserSid, short wNumStrings, int dwDataSize, IntPtr lpStrings, byte[] lpRawData);
private void UnsafeWriteEventLog(TraceEventType type, ushort eventLogCategory, uint eventId, string[] logValues, byte[] sidBA, GCHandle stringsRootHandle) { using (SafeEventLogWriteHandle safeEventLogWriteHandle = SafeEventLogWriteHandle.RegisterEventSource(null, this.eventLogSourceName)) { if (safeEventLogWriteHandle != null) { HandleRef handleRef = new HandleRef(safeEventLogWriteHandle, stringsRootHandle.AddrOfPinnedObject()); UnsafeNativeMethods.ReportEvent(safeEventLogWriteHandle, (ushort)EventLogger.EventLogEntryTypeFromEventType(type), eventLogCategory, eventId, sidBA, (ushort)((int)logValues.Length), 0, handleRef, null); } } }