예제 #1
0
        public void EventAccessTest()
        {
            var etp = EVENT_TRACE_PROPERTIES.Create(Guid.NewGuid());

            etp.LogFileMode     = LogFileMode.EVENT_TRACE_FILE_MODE_SEQUENTIAL;
            etp.MaximumFileSize = 1;
            etp.LogFileName     = logfilePath;
            etp.LoggerName      = "MySession";
            var sess = new EventTraceSession(etp);

            var sz = 1024U;

            using var sd = new SafePSECURITY_DESCRIPTOR((int)sz);
            Assert.That(EventAccessQuery(sess.ProviderGuid, sd, ref sz), ResultIs.Successful);
            Assert.That(EventAccessControl(sess.ProviderGuid, EVENTSECURITYOPERATION.EventSecurityAddDACL, SafePSID.Current, TRACELOG_RIGHTS.WMIGUID_QUERY, true), ResultIs.Successful);
            Assert.That(EventAccessRemove(sess.ProviderGuid), ResultIs.Successful);
        }
예제 #2
0
 public EventTraceController(string loggerName) : this(EventTraceSession.GetSessionHandleFromLoggerName(loggerName))
 {
 }