public Native(EvtStringVariant managed)
 {
     StringVal = Marshal.StringToCoTaskMemUni(managed.StringVal);
     Count     = managed.Count;
     Type      = managed.Type;
 }
Exemple #2
0
		internal static bool EvtFormatMessage (EventLogHandle publisherMetadataHandle, EventLogHandle eventHandle, uint messageId, int valueCount, EvtStringVariant[] values, [MarshalAs(UnmanagedType.I4)] EvtFormatMessageFlags flags, int bufferSize, [Out, MarshalAs(UnmanagedType.LPWStr)] StringBuilder buffer, out int bufferUsed)
		{
			buffer = new StringBuilder();
			if (values != null && valueCount > 0) {
				foreach (var e in values) {
					buffer.Append(e.StringVal);
				}
			}
			bufferUsed = buffer.Length;
			return true;
		}
 internal static extern bool EvtFormatMessage(EventLogHandle publisherMetadataHandle, EventLogHandle eventHandle, uint messageId, int valueCount, EvtStringVariant[] values, [MarshalAs(UnmanagedType.I4)] EvtFormatMessageFlags flags, int bufferSize, [Out, MarshalAs(UnmanagedType.LPWStr)] StringBuilder buffer, out int bufferUsed);
Exemple #4
0
 public static Native ConvertToUnmanaged(EvtStringVariant managed) => new(managed);