Exemple #1
0
        internal EventTraceProperties(bool initialize)
        {
            Internal          = new EventTracePropertiesInternal();
            LogFileNameBuffer = null;
            LoggerNameBuffer  = null;

            if (initialize)
            {
                const uint WNODE_FLAG_TRACED_GUID = 0x00020000;

                Internal.Wnode.BufferSize = Marshal.SizeOf(typeof(EventTracePropertiesInternal))
                                            + MaxPath * 2 /*unicode*/ * 2 /*fields*/;
                Debug.Assert(Internal.Wnode.BufferSize == 1160);
                Internal.Wnode.Flags = WNODE_FLAG_TRACED_GUID;

                Internal.LogFileNameOffset = Marshal.SizeOf(typeof(EventTracePropertiesInternal));
                Debug.Assert(Internal.LogFileNameOffset == 120);
                Internal.LoggerNameOffset = Internal.LogFileNameOffset + MaxPath * 2 /*unicode*/;
            }
        }
        internal EventTraceProperties(bool initialize)
        {
            this.Internal = new EventTracePropertiesInternal();
            this.LogFileNameBuffer = null;
            this.LoggerNameBuffer = null;

            if (initialize)
            {
                const uint WNODE_FLAG_TRACED_GUID = 0x00020000;

                this.Internal.Wnode.BufferSize = Marshal.SizeOf(typeof(EventTracePropertiesInternal)) + MaxPath * 2 /*unicode*/ * 2 /*fields*/;
                System.Diagnostics.Debug.Assert(this.Internal.Wnode.BufferSize == 1160);
                this.Internal.Wnode.Flags = WNODE_FLAG_TRACED_GUID;

                this.Internal.LogFileNameOffset = Marshal.SizeOf(typeof(EventTracePropertiesInternal));
                System.Diagnostics.Debug.Assert(this.Internal.LogFileNameOffset == 120);
                this.Internal.LoggerNameOffset = this.Internal.LogFileNameOffset + MaxPath * 2 /*unicode*/;
            }
        }