Exemple #1
0
        internal static void Trace(EtwTraceType traceType, HttpWorkerRequest workerRequest, string data1, string data2, string data3, string data4)
        {
            if (s_WrType == EtwWorkerRequestType.Undefined)
            {
                ResolveWorkerRequestType(workerRequest);
            }

            if (s_WrType == EtwWorkerRequestType.Unknown)
            {
                return;
            }

            if (workerRequest == null)
            {
                return;
            }

            if (s_WrType == EtwWorkerRequestType.IIS7Integrated)
            {
                UnsafeNativeMethods.TraceRaiseEventMgdHandler((int)traceType, ((IIS7WorkerRequest)workerRequest).RequestContext, data1, data2, data3, data4);
            }
            else if (s_WrType == EtwWorkerRequestType.InProc)
            {
                UnsafeNativeMethods.TraceRaiseEventWithEcb((int)traceType, ((ISAPIWorkerRequest)workerRequest).Ecb, data1, data2, data3, data4);
            }
            else if (s_WrType == EtwWorkerRequestType.OutOfProc)
            {
                UnsafeNativeMethods.PMTraceRaiseEvent((int)traceType, ((ISAPIWorkerRequest)workerRequest).Ecb, data1, data2, data3, data4);
            }
        }
Exemple #2
0
        internal static void Trace(EtwTraceType traceType, HttpWorkerRequest workerRequest, string data1, string data2, string data3, string data4)
        {
            if (workerRequest == null)
            {
                return;
            }

            //
            // IIS7WorkerRequest
            IIS7WorkerRequest iis7wr = workerRequest as IIS7WorkerRequest;

            if (iis7wr != null)
            {
                UnsafeNativeMethods.TraceRaiseEventMgdHandler((int)traceType, iis7wr.RequestContext, data1, data2, data3, data4);
                return;
            }

            //
            // ISAPIWorkerRequestInProc
            ISAPIWorkerRequestInProc inproc = workerRequest as ISAPIWorkerRequestInProc;

            if (inproc != null)
            {
                UnsafeNativeMethods.TraceRaiseEventWithEcb((int)traceType, inproc.Ecb, data1, data2, data3, data4);
                return;
            }

            //
            // ISAPIWorkerRequestOutOfProc
            ISAPIWorkerRequestOutOfProc outofproc = workerRequest as ISAPIWorkerRequestOutOfProc;

            if (outofproc != null)
            {
                UnsafeNativeMethods.PMTraceRaiseEvent((int)traceType, outofproc.Ecb, data1, data2, data3, data4);
                return;
            }
        }