Пример #1
0
        private void EndFeedbackSession(bool normalExit)
        {
            if (this.sqmSessionHandle == null && (this.sqmSessionHandle == null || !this.sqmSessionHandle.IsInvalid && !this.sqmSessionHandle.IsClosed))
            {
                return;
            }
            if (!UnsafeNativeMethods.Set(this.sqmSessionHandle, 4U, normalExit ? 0U : 1U))
            {
                Marshal.GetLastWin32Error();
            }
            string feedbackPath = FeedbackService.FeedbackPath;

            try
            {
                this.sqmSessionHandle.FilePattern = this.EndSessionFileNamePattern;
            }
            catch (ArgumentException ex)
            {
            }
            try
            {
                if (!UnsafeNativeMethods.EndSession(this.sqmSessionHandle, this.EndSessionFileNamePattern, HSQMSESSION.MaxFilesToQueue, 10U))
                {
                    Marshal.GetLastWin32Error();
                }
            }
            catch (Exception ex)
            {
            }
            this.sqmSessionHandle = (HSQMSESSION)null;
        }
Пример #2
0
        private bool CreateFeedbackSession(ExpressionApplication application)
        {
            if (string.IsNullOrEmpty(this.LoggingFileName))
            {
                this.LoggingFileName = "MySqmSession";
            }
            this.sqmSessionHandle = UnsafeNativeMethods.GetSession(this.LoggingFileName, 65536U, 1U);
            if (this.sqmSessionHandle == null)
            {
                Marshal.GetLastWin32Error();
                return(false);
            }
            if (this.sqmSessionHandle.IsInvalid)
            {
                return(false);
            }
            if (!UnsafeNativeMethods.SetAppId(this.sqmSessionHandle, (uint)application.CustomerFeedbackApplicationIdentifier))
            {
                Marshal.GetLastWin32Error();
                return(false);
            }
            Version version = ExpressionApplication.Version;

            if (!UnsafeNativeMethods.SetAppVersion(this.sqmSessionHandle, (uint)((version.Major << 16) + version.Minor), (uint)((version.Build << 16) + version.Revision)))
            {
                Marshal.GetLastWin32Error();
                return(false);
            }
            if (!UnsafeNativeMethods.ReadSharedMachineId(ref this.sharedMachineId) && !UnsafeNativeMethods.CreateNewId(ref this.sharedMachineId))
            {
                UnsafeNativeMethods.WriteSharedMachineId(ref this.sharedMachineId);
            }
            UnsafeNativeMethods.SetMachineId(this.sqmSessionHandle, ref this.sharedMachineId);
            if (!UnsafeNativeMethods.ReadSharedUserId(ref this.sharedUserId) && !UnsafeNativeMethods.CreateNewId(ref this.sharedUserId))
            {
                UnsafeNativeMethods.WriteSharedUserId(ref this.sharedUserId);
            }
            UnsafeNativeMethods.SetUserId(this.sqmSessionHandle, ref this.sharedUserId);
            return(true);
        }
Пример #3
0
 public static extern bool Increment(HSQMSESSION hSession, uint dwId, uint dwInc);
Пример #4
0
 public static extern bool SetIfMin(HSQMSESSION hSession, uint dwId, uint dwVal);
Пример #5
0
 public static extern bool SetAppId(HSQMSESSION hSession, uint dwAppId);
Пример #6
0
 public static extern bool GetEnabled(HSQMSESSION hSession);
Пример #7
0
 public static extern bool ClearFlags(HSQMSESSION hSession, uint dwFlags);
Пример #8
0
 public static extern bool AddToStreamDWord(HSQMSESSION hSession, uint dwId, uint cTuple, uint dwVal);
Пример #9
0
 public static extern bool SetString(HSQMSESSION hSession, uint dwId, string pwszVal);
Пример #10
0
 public static extern bool GetUserId(HSQMSESSION hSession, ref Guid pGuid);
Пример #11
0
 public static extern bool GetMachineId(HSQMSESSION hSession, ref Guid pGuid);
Пример #12
0
 public static extern bool TimerAddToAverage(HSQMSESSION hSession, uint dwId);
Пример #13
0
 public static extern bool TimerAccumulate(HSQMSESSION hSession, uint dwId);
Пример #14
0
 public static extern bool TimerRecord(HSQMSESSION hSession, uint dwId);
Пример #15
0
 public static extern bool TimerStart(HSQMSESSION hSession, uint dwId);
Пример #16
0
 public static extern bool AddToAverage(HSQMSESSION hSession, uint dwId, uint dwVal);
Пример #17
0
 public static extern bool AddToStream(HSQMSESSION hSession, uint dwId, int nArgs, int p1, int p2, int p3, int p4, int p5, int p6, int p7, int p8, int p9);
Пример #18
0
 public static extern System.Runtime.InteropServices.ComTypes.FILETIME GetSessionStartTime(HSQMSESSION hSession);
Пример #19
0
 public static extern bool AddToStreamString(HSQMSESSION hSession, uint dwId, uint cTuple, string pwszVal);
Пример #20
0
 public static extern bool StartSession(HSQMSESSION hSession);
Пример #21
0
 public static extern bool GetFlags(HSQMSESSION hSession, out uint pdwFlags);
Пример #22
0
 public static extern bool EndSession(HSQMSESSION hSession, string pwszPattern, uint dwMaxFilesToQueue, uint dwFlags);
Пример #23
0
 public static extern bool SetEnabled(HSQMSESSION hSession, [MarshalAs(UnmanagedType.Bool)] bool fEnabled);
Пример #24
0
 public static extern bool SqmFlushSession(HSQMSESSION hSession, string pwszFileName);
Пример #25
0
 public static extern bool SetBits(HSQMSESSION hSession, uint dwId, uint dwOrBits);
Пример #26
0
 public static extern bool SetAppVersion(HSQMSESSION hSession, uint dwVersionHigh, uint dwVersionLow);