Пример #1
0
        static unsafe uint TraceTransfer(Guid activityId, Guid relatedId)
        {
            uint result = unchecked ((uint)-1);

            if (null != Provider && Provider.ShouldTrace)
            {
                Guid2Event evt = new Guid2Event();
                evt.Header.Guid          = WCFTraceGuid;
                evt.Header.Type          = (byte)TraceType.Transfer;
                evt.Header.ClientContext = 0;
                evt.Header.Flags         = WnodeFlags.WnodeFlagTracedGuid;
                evt.Header.BufferSize    = (ushort)EtwStructSizes.SizeofEventHeader + 2 * (ushort)EtwStructSizes.SizeofGuid;


                evt.Guid1 = activityId;
                evt.Guid2 = relatedId;

                if (null != Provider)
                {
                    result = provider.Trace((MofEvent *)&evt);
                }
            }

            return(result);
        }
Пример #2
0
        static unsafe uint TraceTransfer(Guid activityId, Guid relatedId)
        {
            uint result = unchecked((uint)-1);

            if (null != Provider && Provider.ShouldTrace)
            {
                Guid2Event evt = new Guid2Event();
                evt.Header.Guid = WCFTraceGuid;
                evt.Header.Type = (byte)TraceType.Transfer;
                evt.Header.ClientContext = 0;
                evt.Header.Flags = WnodeFlags.WnodeFlagTracedGuid;
                evt.Header.BufferSize = (ushort)EtwStructSizes.SizeofEventHeader + 2 * (ushort)EtwStructSizes.SizeofGuid;


                evt.Guid1 = activityId;
                evt.Guid2 = relatedId;

                if (null != Provider)
                {
                    result = provider.Trace((MofEvent*)&evt);
                }
            }

            return result;
        }