Esempio n. 1
0
        internal static void FlushData()
        {
            EVENT_TRACE_PROPERTIES properties = new EVENT_TRACE_PROPERTIES(String.Empty, String.Empty);
            uint err = SafeNativeMethods.FlushTrace(0, WsatTraceSessionName, ref properties);

            if (err != SafeNativeMethods.ERROR_SUCCESS)
            {
                if (err == SafeNativeMethods.ERROR_ACCESS_DENIED)
                {
                    throw new WsatAdminException(WsatAdminErrorCode.ETW_SESSION_ACCESS_DENIED,
                                                 SR.GetString(SR.ErrorSessionFlushDataAccessDenied));
                }
                else
                {
                    throw new WsatAdminException(WsatAdminErrorCode.ETW_SESSION_ERROR,
                                                 SR.GetString(SR.ErrorSessionFlushData, err));
                }
            }
        }