public SecurityLog(EventRecord rec) { Console.WriteLine(count++); ProcessId = rec.ProcessId; TimeCreated = rec.TimeCreated; Source = rec.ProviderName; var keyTask = new ProviderMetadataCache <int?>(rec.ProviderName, rec.Task); if (!Tasks.ContainsKey(keyTask)) { Tasks[keyTask] = rec.TaskDisplayName; } Task = Tasks[keyTask]; var keyOpeCode = new ProviderMetadataCache <short?>(rec.ProviderName, rec.Opcode); if (!OpCodes.ContainsKey(keyOpeCode)) { OpCodes[keyOpeCode] = rec.OpcodeDisplayName; } OpCode = OpCodes[keyOpeCode]; var keyKeyword = new ProviderMetadataCache <long?>(rec.ProviderName, rec.Keywords); if (!Keywords.ContainsKey(keyKeyword)) { Keywords[keyKeyword] = rec.KeywordsDisplayNames.FirstOrDefault(); } Message = rec.FormatDescription(); }
public SecurityLog(EventLogRecord rec, string[] refs) { var props = rec.GetPropertyValues(new EventLogPropertySelector(refs)); Console.WriteLine(count++); ProcessId = (int)(uint)props[2]; TimeCreated = (DateTime?)props[1]; Source = (string)props[0]; var keyTask = new ProviderMetadataCache <int?>(Source, (int?)(ushort)props[3]); if (!Tasks.ContainsKey(keyTask)) { Tasks[keyTask] = rec.TaskDisplayName; } Task = Tasks[keyTask]; var keyOpeCode = new ProviderMetadataCache <short?>(Source, (short?)(byte)props[4]); if (!OpCodes.ContainsKey(keyOpeCode)) { OpCodes[keyOpeCode] = rec.OpcodeDisplayName; } OpCode = OpCodes[keyOpeCode]; var keyKeyword = new ProviderMetadataCache <long?>(Source, (long?)(ulong)props[5]); if (!Keywords.ContainsKey(keyKeyword)) { Keywords[keyKeyword] = rec.KeywordsDisplayNames.FirstOrDefault(); } Message = rec.FormatDescription(); }
public bool Equals(ProviderMetadataCache <T> x, ProviderMetadataCache <T> y) { return(x.GetHashCode() == y.GetHashCode()); }
public int GetHashCode(ProviderMetadataCache <T> obj) { return(obj.GetHashCode()); }