예제 #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);