Пример #1
0
        private static void FireWinSQMEvent(
            WinSQMWrapper.EventDescriptor eventDescriptor,
            uint dataPointID,
            uint dataPointValue)
        {
            Guid empty = Guid.Empty;

            if (!WinSQMWrapper.WinSqmEventEnabled(ref eventDescriptor, ref empty))
            {
                return;
            }
            IntPtr num1 = Marshal.AllocHGlobal(Marshal.SizeOf((object)WinSQMWrapper.WINDOWS_SQM_GLOBALSESSION));
            IntPtr num2 = Marshal.AllocHGlobal(4);
            IntPtr num3 = Marshal.AllocHGlobal(4);

            try
            {
                Marshal.StructureToPtr((object)WinSQMWrapper.WINDOWS_SQM_GLOBALSESSION, num1, true);
                Marshal.StructureToPtr((object)dataPointID, num2, true);
                Marshal.StructureToPtr((object)dataPointValue, num3, true);
                WinSQMWrapper.FireWinSQMEvent(eventDescriptor, num1, num2, num3);
            }
            finally
            {
                Marshal.FreeHGlobal(num1);
                Marshal.FreeHGlobal(num2);
                Marshal.FreeHGlobal(num3);
            }
        }
Пример #2
0
        private static void FireWinSQMEvent(
            WinSQMWrapper.EventDescriptor eventDescriptor,
            Dictionary <uint, uint> dataToWrite)
        {
            Guid empty = Guid.Empty;

            if (!WinSQMWrapper.WinSqmEventEnabled(ref eventDescriptor, ref empty))
            {
                return;
            }
            IntPtr num1 = Marshal.AllocHGlobal(Marshal.SizeOf((object)WinSQMWrapper.WINDOWS_SQM_GLOBALSESSION));
            IntPtr num2 = Marshal.AllocHGlobal(4);
            IntPtr num3 = Marshal.AllocHGlobal(4);

            try
            {
                Marshal.StructureToPtr((object)WinSQMWrapper.WINDOWS_SQM_GLOBALSESSION, num1, true);
                foreach (uint key in dataToWrite.Keys)
                {
                    uint num4 = dataToWrite[key];
                    Marshal.StructureToPtr((object)key, num2, true);
                    Marshal.StructureToPtr((object)num4, num3, true);
                    WinSQMWrapper.FireWinSQMEvent(eventDescriptor, num1, num2, num3);
                }
            }
            finally
            {
                Marshal.FreeHGlobal(num1);
                Marshal.FreeHGlobal(num2);
                Marshal.FreeHGlobal(num3);
            }
        }
Пример #3
0
 public static void WinSqmIncrement(Dictionary <uint, uint> dataToWrite) => WinSQMWrapper.FireWinSQMEvent(new WinSQMWrapper.EventDescriptor((ushort)6, (byte)0, (byte)0, (byte)4, (byte)2, (ushort)0, 2251799813685248UL), dataToWrite);
Пример #4
0
 public static void WinSqmSet(uint dataPointID, uint dataPointValue) => WinSQMWrapper.FireWinSQMEvent(new WinSQMWrapper.EventDescriptor((ushort)5, (byte)0, (byte)0, (byte)4, (byte)0, (ushort)0, 2251799813685248UL), dataPointID, dataPointValue);
Пример #5
0
 public static void WinSqmIncrement(uint dataPointID, uint incAmount) => WinSQMWrapper.FireWinSQMEvent(new WinSQMWrapper.EventDescriptor((ushort)6, (byte)0, (byte)0, (byte)4, (byte)2, (ushort)0, 2251799813685248UL), dataPointID, incAmount);