diff --git a/PowerToys.sln b/PowerToys.sln index 7da94ee5eb..b6de4dad4f 100644 --- a/PowerToys.sln +++ b/PowerToys.sln @@ -298,6 +298,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Telemetry", "Telemetry", "{ src\common\Telemetry\ProjectTelemetry.h = src\common\Telemetry\ProjectTelemetry.h src\common\Telemetry\TelemetryBase.cs = src\common\Telemetry\TelemetryBase.cs src\common\Telemetry\TraceLoggingDefines.h = src\common\Telemetry\TraceLoggingDefines.h + src\common\Telemetry\TraceBase.h = src\common\Telemetry\TraceBase.h EndProjectSection EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Common.UI", "src\common\Common.UI\Common.UI.csproj", "{C3A17DCA-217B-462C-BB0C-BE086AF80081}" diff --git a/installer/PowerToysSetupCustomActions/CustomAction.cpp b/installer/PowerToysSetupCustomActions/CustomAction.cpp index 64c03bc44f..d72ba06dc9 100644 --- a/installer/PowerToysSetupCustomActions/CustomAction.cpp +++ b/installer/PowerToysSetupCustomActions/CustomAction.cpp @@ -38,6 +38,48 @@ const DWORD USERNAME_LEN = UNLEN + 1; // User Name + '\0' static const wchar_t* POWERTOYS_EXE_COMPONENT = L"{A2C66D91-3485-4D00-B04D-91844E6B345B}"; static const wchar_t* POWERTOYS_UPGRADE_CODE = L"{42B84BF7-5FBF-473B-9C8B-049DC16F7708}"; +constexpr inline const wchar_t* DataDiagnosticsRegKey = L"Software\\Classes\\PowerToys"; +constexpr inline const wchar_t* DataDiagnosticsRegValueName = L"AllowDataDiagnostics"; + +#define TraceLoggingWriteWrapper(provider, eventName, ...) \ + if (isDataDiagnosticEnabled()) \ + { \ + TraceLoggingWrite(provider, eventName, __VA_ARGS__); \ + } + +inline bool isDataDiagnosticEnabled() +{ + HKEY key{}; + if (RegOpenKeyExW(HKEY_CURRENT_USER, + DataDiagnosticsRegKey, + 0, + KEY_READ, + &key) != ERROR_SUCCESS) + { + return false; + } + + bool isDataDiagnosticsEnabled; + DWORD boolSize = static_cast(sizeof(bool)); + + if (RegGetValueW( + key, + DataDiagnosticsRegValueName, + nullptr, + RRF_RT_REG_QWORD, + nullptr, + &isDataDiagnosticsEnabled, + &boolSize) != ERROR_SUCCESS) + { + RegCloseKey(key); + return false; + } + RegCloseKey(key); + + return isDataDiagnosticsEnabled; +} + + HRESULT getInstallFolder(MSIHANDLE hInstall, std::wstring& installationDir) { DWORD len = 0; @@ -793,7 +835,7 @@ UINT __stdcall TelemetryLogInstallSuccessCA(MSIHANDLE hInstall) hr = WcaInitialize(hInstall, "TelemetryLogInstallSuccessCA"); ExitOnFailure(hr, "Failed to initialize"); - TraceLoggingWrite( + TraceLoggingWriteWrapper( g_hProvider, "Install_Success", TraceLoggingWideString(get_product_version().c_str(), "Version"), @@ -814,7 +856,7 @@ UINT __stdcall TelemetryLogInstallCancelCA(MSIHANDLE hInstall) hr = WcaInitialize(hInstall, "TelemetryLogInstallCancelCA"); ExitOnFailure(hr, "Failed to initialize"); - TraceLoggingWrite( + TraceLoggingWriteWrapper( g_hProvider, "Install_Cancel", TraceLoggingWideString(get_product_version().c_str(), "Version"), @@ -835,7 +877,7 @@ UINT __stdcall TelemetryLogInstallFailCA(MSIHANDLE hInstall) hr = WcaInitialize(hInstall, "TelemetryLogInstallFailCA"); ExitOnFailure(hr, "Failed to initialize"); - TraceLoggingWrite( + TraceLoggingWriteWrapper( g_hProvider, "Install_Fail", TraceLoggingWideString(get_product_version().c_str(), "Version"), @@ -856,7 +898,7 @@ UINT __stdcall TelemetryLogUninstallSuccessCA(MSIHANDLE hInstall) hr = WcaInitialize(hInstall, "TelemetryLogUninstallSuccessCA"); ExitOnFailure(hr, "Failed to initialize"); - TraceLoggingWrite( + TraceLoggingWriteWrapper( g_hProvider, "UnInstall_Success", TraceLoggingWideString(get_product_version().c_str(), "Version"), @@ -877,7 +919,7 @@ UINT __stdcall TelemetryLogUninstallCancelCA(MSIHANDLE hInstall) hr = WcaInitialize(hInstall, "TelemetryLogUninstallCancelCA"); ExitOnFailure(hr, "Failed to initialize"); - TraceLoggingWrite( + TraceLoggingWriteWrapper( g_hProvider, "UnInstall_Cancel", TraceLoggingWideString(get_product_version().c_str(), "Version"), @@ -898,7 +940,7 @@ UINT __stdcall TelemetryLogUninstallFailCA(MSIHANDLE hInstall) hr = WcaInitialize(hInstall, "TelemetryLogUninstallFailCA"); ExitOnFailure(hr, "Failed to initialize"); - TraceLoggingWrite( + TraceLoggingWriteWrapper( g_hProvider, "UnInstall_Fail", TraceLoggingWideString(get_product_version().c_str(), "Version"), @@ -919,7 +961,7 @@ UINT __stdcall TelemetryLogRepairCancelCA(MSIHANDLE hInstall) hr = WcaInitialize(hInstall, "TelemetryLogRepairCancelCA"); ExitOnFailure(hr, "Failed to initialize"); - TraceLoggingWrite( + TraceLoggingWriteWrapper( g_hProvider, "Repair_Cancel", TraceLoggingWideString(get_product_version().c_str(), "Version"), @@ -940,7 +982,7 @@ UINT __stdcall TelemetryLogRepairFailCA(MSIHANDLE hInstall) hr = WcaInitialize(hInstall, "TelemetryLogRepairFailCA"); ExitOnFailure(hr, "Failed to initialize"); - TraceLoggingWrite( + TraceLoggingWriteWrapper( g_hProvider, "Repair_Fail", TraceLoggingWideString(get_product_version().c_str(), "Version"), diff --git a/src/common/GPOWrapper/GPOWrapper.cpp b/src/common/GPOWrapper/GPOWrapper.cpp index de987ed81e..8cb1195943 100644 --- a/src/common/GPOWrapper/GPOWrapper.cpp +++ b/src/common/GPOWrapper/GPOWrapper.cpp @@ -212,4 +212,8 @@ namespace winrt::PowerToys::GPOWrapper::implementation // Convert std::wstring to winrt::hstring return to_hstring(rules.c_str()); } + GpoRuleConfigured GPOWrapper::GetAllowDataDiagnosticsValue() + { + return static_cast(powertoys_gpo::getAllowDataDiagnosticsValue()); + } } diff --git a/src/common/GPOWrapper/GPOWrapper.h b/src/common/GPOWrapper/GPOWrapper.h index 670124527b..8aae235c44 100644 --- a/src/common/GPOWrapper/GPOWrapper.h +++ b/src/common/GPOWrapper/GPOWrapper.h @@ -58,6 +58,7 @@ namespace winrt::PowerToys::GPOWrapper::implementation static GpoRuleConfigured GetConfiguredMwbValidateRemoteIpValue(); static GpoRuleConfigured GetConfiguredMwbDisableUserDefinedIpMappingRulesValue(); static winrt::hstring GPOWrapper::GetConfiguredMwbPolicyDefinedIpMappingRules(); + static GpoRuleConfigured GetAllowDataDiagnosticsValue(); }; } diff --git a/src/common/GPOWrapper/GPOWrapper.idl b/src/common/GPOWrapper/GPOWrapper.idl index 27c2420b6e..6c10897bd0 100644 --- a/src/common/GPOWrapper/GPOWrapper.idl +++ b/src/common/GPOWrapper/GPOWrapper.idl @@ -62,6 +62,7 @@ namespace PowerToys static GpoRuleConfigured GetConfiguredMwbValidateRemoteIpValue(); static GpoRuleConfigured GetConfiguredMwbDisableUserDefinedIpMappingRulesValue(); static String GetConfiguredMwbPolicyDefinedIpMappingRules(); + static GpoRuleConfigured GetAllowDataDiagnosticsValue(); } } } diff --git a/src/common/ManagedTelemetry/Telemetry/ManagedTelemetry.csproj b/src/common/ManagedTelemetry/Telemetry/ManagedTelemetry.csproj index 19e1b0015c..db542dcaf7 100644 --- a/src/common/ManagedTelemetry/Telemetry/ManagedTelemetry.csproj +++ b/src/common/ManagedTelemetry/Telemetry/ManagedTelemetry.csproj @@ -3,7 +3,7 @@ net8.0-windows - win-x64;win-arm64 + win-x64;win-arm64 $(Version).0 Microsoft Corporation PowerToys @@ -14,5 +14,4 @@ - diff --git a/src/common/ManagedTelemetry/Telemetry/PowerToysTelemetry.cs b/src/common/ManagedTelemetry/Telemetry/PowerToysTelemetry.cs index cad79cbd3d..62baa201df 100644 --- a/src/common/ManagedTelemetry/Telemetry/PowerToysTelemetry.cs +++ b/src/common/ManagedTelemetry/Telemetry/PowerToysTelemetry.cs @@ -2,8 +2,10 @@ // The Microsoft Corporation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. +using System; using System.Diagnostics.Tracing; using Microsoft.PowerToys.Telemetry.Events; +using Microsoft.Win32; namespace Microsoft.PowerToys.Telemetry { @@ -12,6 +14,9 @@ namespace Microsoft.PowerToys.Telemetry /// public class PowerToysTelemetry : TelemetryBase { + private static readonly string DataDiagnosticsRegistryKey = @"HKEY_CURRENT_USER\Software\Classes\PowerToys\"; + private static readonly string DataDiagnosticsRegistryValueName = @"AllowDataDiagnostics"; + /// /// Name for ETW event. /// @@ -30,20 +35,42 @@ namespace Microsoft.PowerToys.Telemetry /// public static PowerToysTelemetry Log { get; } = new PowerToysTelemetry(); + private static bool IsDataDiagnosticsEnabled() + { + object registryValue = null; + try + { + registryValue = Registry.GetValue(DataDiagnosticsRegistryKey, DataDiagnosticsRegistryValueName, false); + } + catch + { + } + + if (registryValue is not null) + { + return (int)registryValue == 1 ? true : false; + } + + return false; + } + /// /// Publishes ETW event when an action is triggered on /// public void WriteEvent(T telemetryEvent) where T : EventBase, IEvent { - this.Write( - telemetryEvent.EventName, - new EventSourceOptions() - { - Keywords = ProjectKeywordMeasure, - Tags = ProjectTelemetryTagProductAndServicePerformance, - }, - telemetryEvent); + if (IsDataDiagnosticsEnabled()) + { + this.Write( + telemetryEvent.EventName, + new EventSourceOptions() + { + Keywords = ProjectKeywordMeasure, + Tags = ProjectTelemetryTagProductAndServicePerformance, + }, + telemetryEvent); + } } } } diff --git a/src/common/SettingsAPI/settings_helpers.cpp b/src/common/SettingsAPI/settings_helpers.cpp index 974b2fff6a..25d9719a66 100644 --- a/src/common/SettingsAPI/settings_helpers.cpp +++ b/src/common/SettingsAPI/settings_helpers.cpp @@ -8,6 +8,8 @@ namespace PTSettingsHelper constexpr inline const wchar_t* last_version_run_filename = L"last_version_run.json"; constexpr inline const wchar_t* opened_at_first_launch_json_field_name = L"openedAtFirstLaunch"; constexpr inline const wchar_t* last_version_json_field_name = L"last_version"; + constexpr inline const wchar_t* DataDiagnosticsRegKey = L"Software\\Classes\\PowerToys"; + constexpr inline const wchar_t* DataDiagnosticsRegValueName = L"AllowDataDiagnostics"; std::wstring get_root_save_folder_location() { @@ -25,7 +27,7 @@ namespace PTSettingsHelper return result; } - std::wstring get_local_low_folder_location() + std::wstring get_local_low_folder_location() { PWSTR local_app_path; winrt::check_hresult(SHGetKnownFolderPath(FOLDERID_LocalAppDataLow, 0, NULL, &local_app_path)); @@ -112,7 +114,7 @@ namespace PTSettingsHelper bool opened = saved_settings->GetNamedBoolean(opened_at_first_launch_json_field_name, false); return opened; } - + return false; } @@ -124,12 +126,11 @@ namespace PTSettingsHelper json::JsonObject obj; obj.SetNamedValue(opened_at_first_launch_json_field_name, json::value(true)); - json::to_file(oobePath.c_str(), obj); + json::to_file(oobePath.c_str(), obj); } std::wstring get_last_version_run() { - std::filesystem::path lastVersionRunPath(PTSettingsHelper::get_root_save_folder_location()); lastVersionRunPath = lastVersionRunPath.append(last_version_run_filename); if (std::filesystem::exists(lastVersionRunPath)) @@ -157,4 +158,29 @@ namespace PTSettingsHelper json::to_file(lastVersionRunPath.c_str(), obj); } + void save_data_diagnostics(bool enabled) + { + HKEY key{}; + if (RegCreateKeyExW(HKEY_CURRENT_USER, + DataDiagnosticsRegKey, + 0, + nullptr, + REG_OPTION_NON_VOLATILE, + KEY_ALL_ACCESS, + nullptr, + &key, + nullptr) != ERROR_SUCCESS) + { + return; + } + + const bool value = enabled; + const size_t buf_size = sizeof(bool); + if (RegSetValueExW(key, DataDiagnosticsRegValueName, 0, REG_QWORD, reinterpret_cast(&value), buf_size) != ERROR_SUCCESS) + { + RegCloseKey(key); + return; + } + RegCloseKey(key); + } } diff --git a/src/common/SettingsAPI/settings_helpers.h b/src/common/SettingsAPI/settings_helpers.h index 9e01b3b206..14eae8ac62 100644 --- a/src/common/SettingsAPI/settings_helpers.h +++ b/src/common/SettingsAPI/settings_helpers.h @@ -24,4 +24,6 @@ namespace PTSettingsHelper void save_oobe_opened_state(); std::wstring get_last_version_run(); void save_last_version_run(const std::wstring& version); + + void save_data_diagnostics(bool enabled); } diff --git a/src/common/Telemetry/TraceBase.h b/src/common/Telemetry/TraceBase.h new file mode 100644 index 0000000000..065c25a5c5 --- /dev/null +++ b/src/common/Telemetry/TraceBase.h @@ -0,0 +1,63 @@ +#pragma once + +#include "ProjectTelemetry.h" + +#define TraceLoggingWriteWrapper(provider, eventName, ...) \ + if (IsDataDiagnosticsEnabled()) \ + { \ + TraceLoggingWrite(provider, eventName, __VA_ARGS__); \ + } + +namespace telemetry +{ + +constexpr inline const wchar_t* DataDiagnosticsRegKey = L"Software\\Classes\\PowerToys"; +constexpr inline const wchar_t* DataDiagnosticsRegValueName = L"AllowDataDiagnostics"; + +class TraceBase +{ +public: + static void RegisterProvider() + { + TraceLoggingRegister(g_hProvider); + } + + static void UnregisterProvider() + { + TraceLoggingUnregister(g_hProvider); + } + + static bool IsDataDiagnosticsEnabled() + { + HKEY key{}; + if (RegOpenKeyExW(HKEY_CURRENT_USER, + DataDiagnosticsRegKey, + 0, + KEY_READ, + &key) != ERROR_SUCCESS) + { + return false; + } + + bool isDataDiagnosticsEnabled; + DWORD boolSize = static_cast(sizeof(bool)); + + if (RegGetValueW( + key, + DataDiagnosticsRegValueName, + nullptr, + RRF_RT_REG_QWORD, + nullptr, + &isDataDiagnosticsEnabled, + &boolSize) != ERROR_SUCCESS) + { + RegCloseKey(key); + return false; + } + RegCloseKey(key); + + return isDataDiagnosticsEnabled; + } +}; + +} // namespace telemetry \ No newline at end of file diff --git a/src/common/utils/gpo.h b/src/common/utils/gpo.h index cba300d8e5..13e1acc1d1 100644 --- a/src/common/utils/gpo.h +++ b/src/common/utils/gpo.h @@ -70,6 +70,7 @@ namespace powertoys_gpo { // The registry value names for other PowerToys policies. const std::wstring POLICY_ALLOW_EXPERIMENTATION = L"AllowExperimentation"; + const std::wstring POLICY_ALLOW_DATA_DIAGNOSTICS = L"AllowDataDiagnostics"; const std::wstring POLICY_CONFIGURE_ENABLED_POWER_LAUNCHER_ALL_PLUGINS = L"PowerLauncherAllPluginsEnabledState"; const std::wstring POLICY_ALLOW_ADVANCED_PASTE_ONLINE_AI_MODELS = L"AllowPowerToysAdvancedPasteOnlineAIModels"; const std::wstring POLICY_MWB_CLIPBOARD_SHARING_ENABLED = L"MwbClipboardSharingEnabled"; @@ -454,6 +455,11 @@ namespace powertoys_gpo { return getConfiguredValue(POLICY_ALLOW_EXPERIMENTATION); } + inline gpo_rule_configured_t getAllowDataDiagnosticsValue() + { + return getConfiguredValue(POLICY_ALLOW_DATA_DIAGNOSTICS); + } + inline gpo_rule_configured_t getRunPluginEnabledValue(std::string pluginID) { if (pluginID == "" || pluginID == " ") diff --git a/src/gpo/assets/PowerToys.admx b/src/gpo/assets/PowerToys.admx index a0f70baa30..5ca8672f77 100644 --- a/src/gpo/assets/PowerToys.admx +++ b/src/gpo/assets/PowerToys.admx @@ -1,11 +1,11 @@ - + - + @@ -20,6 +20,7 @@ + @@ -484,6 +485,16 @@ + + + + + + + + + + diff --git a/src/gpo/assets/en-US/PowerToys.adml b/src/gpo/assets/en-US/PowerToys.adml index 761abde90f..288f4bccf7 100644 --- a/src/gpo/assets/en-US/PowerToys.adml +++ b/src/gpo/assets/en-US/PowerToys.adml @@ -25,6 +25,7 @@ PowerToys version 0.81.0 or later PowerToys version 0.81.1 or later PowerToys version 0.83.0 or later + PowerToys version 0.84.0 or later This policy configures the enabled state for all PowerToys utilities. @@ -98,6 +99,12 @@ If disabled or not configured, the user can control this in the settings of Powe If this setting is enabled or not configured, the user can control experimentation in the PowerToys settings menu. If this setting is disabled, experimentation is not allowed. + + This policy configures whether sending of PowerToys diagnostic data is allowed. With diagnostic data sending allowed the user helps inform bug fixes, performance and improvements. + +If this setting is enabled or not configured, the user can control diagnostic data sending in the PowerToys settings menu. + +If this setting is disabled, diagnostic data sending is not allowed. This policy configures the enabled state for all PowerToys Run plugins. All plugins will have the same state. @@ -244,6 +251,8 @@ If you disable or don't configure this policy, no predefined rules are applied. Validate remote machine IP Address Disable user defined IP Address mapping rules Predefined IP Address mapping rules + Advanced Paste: Allow using online AI models + Allow sending diagnostic data diff --git a/src/modules/AdvancedPaste/AdvancedPasteModuleInterface/pch.h b/src/modules/AdvancedPaste/AdvancedPasteModuleInterface/pch.h index 809b965271..e730ab2036 100644 --- a/src/modules/AdvancedPaste/AdvancedPasteModuleInterface/pch.h +++ b/src/modules/AdvancedPaste/AdvancedPasteModuleInterface/pch.h @@ -2,7 +2,6 @@ #include #include #include -#include #include #include #include \ No newline at end of file diff --git a/src/modules/AdvancedPaste/AdvancedPasteModuleInterface/trace.cpp b/src/modules/AdvancedPaste/AdvancedPasteModuleInterface/trace.cpp index 87d610682f..7fb679bf33 100644 --- a/src/modules/AdvancedPaste/AdvancedPasteModuleInterface/trace.cpp +++ b/src/modules/AdvancedPaste/AdvancedPasteModuleInterface/trace.cpp @@ -8,20 +8,10 @@ TRACELOGGING_DEFINE_PROVIDER( (0x38e8889b, 0x9731, 0x53f5, 0xe9, 0x01, 0xe8, 0xa7, 0xc1, 0x75, 0x30, 0x74), TraceLoggingOptionProjectTelemetry()); -void Trace::RegisterProvider() -{ - TraceLoggingRegister(g_hProvider); -} - -void Trace::UnregisterProvider() -{ - TraceLoggingUnregister(g_hProvider); -} - // Log if the user has AdvancedPaste enabled or disabled void Trace::AdvancedPaste_Enable(const bool enabled) noexcept { - TraceLoggingWrite( + TraceLoggingWriteWrapper( g_hProvider, "AdvancedPaste_EnableAdvancedPaste", ProjectTelemetryPrivacyDataTag(ProjectTelemetryTag_ProductAndServicePerformance), @@ -32,7 +22,7 @@ void Trace::AdvancedPaste_Enable(const bool enabled) noexcept // Log if the user has invoked AdvancedPaste void Trace::AdvancedPaste_Invoked(std::wstring mode) noexcept { - TraceLoggingWrite( + TraceLoggingWriteWrapper( g_hProvider, "AdvancedPaste_InvokeAdvancedPaste", ProjectTelemetryPrivacyDataTag(ProjectTelemetryTag_ProductAndServicePerformance), @@ -43,7 +33,7 @@ void Trace::AdvancedPaste_Invoked(std::wstring mode) noexcept // Log if an error occurs in AdvancedPaste void Trace::AdvancedPaste_Error(const DWORD errorCode, std::wstring errorMessage, std::wstring methodName) noexcept { - TraceLoggingWrite( + TraceLoggingWriteWrapper( g_hProvider, "AdvancedPaste_Error", ProjectTelemetryPrivacyDataTag(ProjectTelemetryTag_ProductAndServicePerformance), @@ -88,7 +78,7 @@ void Trace::AdvancedPaste_SettingsTelemetry(const PowertoyModuleIface::Hotkey& p std::wstring(pasteJsonHotkey.alt ? L"Alt + " : L"") + std::wstring(L"VK ") + std::to_wstring(pasteJsonHotkey.key); - TraceLoggingWrite( + TraceLoggingWriteWrapper( g_hProvider, "AdvancedPaste_Settings", ProjectTelemetryPrivacyDataTag(ProjectTelemetryTag_ProductAndServicePerformance), diff --git a/src/modules/AdvancedPaste/AdvancedPasteModuleInterface/trace.h b/src/modules/AdvancedPaste/AdvancedPasteModuleInterface/trace.h index d64d1cd874..8faf9ce9de 100644 --- a/src/modules/AdvancedPaste/AdvancedPasteModuleInterface/trace.h +++ b/src/modules/AdvancedPaste/AdvancedPasteModuleInterface/trace.h @@ -1,12 +1,10 @@ #pragma once +#include #include -class Trace +class Trace : public telemetry::TraceBase { public: - static void RegisterProvider(); - static void UnregisterProvider(); - // Log if the user has AdvancedPaste enabled or disabled static void AdvancedPaste_Enable(const bool enabled) noexcept; diff --git a/src/modules/CropAndLock/CropAndLock/pch.h b/src/modules/CropAndLock/CropAndLock/pch.h index 720033cbca..75bb5f4a61 100644 --- a/src/modules/CropAndLock/CropAndLock/pch.h +++ b/src/modules/CropAndLock/CropAndLock/pch.h @@ -74,7 +74,6 @@ #include "WindowRectUtil.h" // PowerToys -#include #include // Application resources diff --git a/src/modules/CropAndLock/CropAndLock/trace.cpp b/src/modules/CropAndLock/CropAndLock/trace.cpp index fb5dd802c5..5f23911590 100644 --- a/src/modules/CropAndLock/CropAndLock/trace.cpp +++ b/src/modules/CropAndLock/CropAndLock/trace.cpp @@ -11,19 +11,9 @@ TRACELOGGING_DEFINE_PROVIDER( (0x38e8889b, 0x9731, 0x53f5, 0xe9, 0x01, 0xe8, 0xa7, 0xc1, 0x75, 0x30, 0x74), TraceLoggingOptionProjectTelemetry()); -void Trace::RegisterProvider() noexcept -{ - TraceLoggingRegister(g_hProvider); -} - -void Trace::UnregisterProvider() noexcept -{ - TraceLoggingUnregister(g_hProvider); -} - void Trace::CropAndLock::Enable(bool enabled) noexcept { - TraceLoggingWrite( + TraceLoggingWriteWrapper( g_hProvider, "CropAndLock_EnableCropAndLock", ProjectTelemetryPrivacyDataTag(ProjectTelemetryTag_ProductAndServicePerformance), @@ -33,7 +23,7 @@ void Trace::CropAndLock::Enable(bool enabled) noexcept void Trace::CropAndLock::ActivateReparent() noexcept { - TraceLoggingWrite( + TraceLoggingWriteWrapper( g_hProvider, "CropAndLock_ActivateReparent", ProjectTelemetryPrivacyDataTag(ProjectTelemetryTag_ProductAndServicePerformance), @@ -42,7 +32,7 @@ void Trace::CropAndLock::ActivateReparent() noexcept void Trace::CropAndLock::ActivateThumbnail() noexcept { - TraceLoggingWrite( + TraceLoggingWriteWrapper( g_hProvider, "CropAndLock_ActivateThumbnail", ProjectTelemetryPrivacyDataTag(ProjectTelemetryTag_ProductAndServicePerformance), @@ -51,7 +41,7 @@ void Trace::CropAndLock::ActivateThumbnail() noexcept void Trace::CropAndLock::CreateReparentWindow() noexcept { - TraceLoggingWrite( + TraceLoggingWriteWrapper( g_hProvider, "CropAndLock_CreateReparentWindow", ProjectTelemetryPrivacyDataTag(ProjectTelemetryTag_ProductAndServicePerformance), @@ -60,7 +50,7 @@ void Trace::CropAndLock::CreateReparentWindow() noexcept void Trace::CropAndLock::CreateThumbnailWindow() noexcept { - TraceLoggingWrite( + TraceLoggingWriteWrapper( g_hProvider, "CropAndLock_CreateThumbnailWindow", ProjectTelemetryPrivacyDataTag(ProjectTelemetryTag_ProductAndServicePerformance), @@ -84,7 +74,7 @@ void Trace::CropAndLock::SettingsTelemetry(PowertoyModuleIface::Hotkey& reparent std::wstring(thumbnailHotkey.alt ? L"Alt + " : L"") + std::wstring(L"VK ") + std::to_wstring(thumbnailHotkey.key); - TraceLoggingWrite( + TraceLoggingWriteWrapper( g_hProvider, "CropAndLock_Settings", ProjectTelemetryPrivacyDataTag(ProjectTelemetryTag_ProductAndServicePerformance), diff --git a/src/modules/CropAndLock/CropAndLock/trace.h b/src/modules/CropAndLock/CropAndLock/trace.h index f7e1903ee6..5a9aaa95ca 100644 --- a/src/modules/CropAndLock/CropAndLock/trace.h +++ b/src/modules/CropAndLock/CropAndLock/trace.h @@ -1,13 +1,12 @@ #pragma once + +#include #include class Trace { public: - static void RegisterProvider() noexcept; - static void UnregisterProvider() noexcept; - - class CropAndLock + class CropAndLock : public telemetry::TraceBase { public: static void Enable(bool enabled) noexcept; diff --git a/src/modules/CropAndLock/CropAndLockModuleInterface/dllmain.cpp b/src/modules/CropAndLock/CropAndLockModuleInterface/dllmain.cpp index c313d63cd7..42c7c6da7e 100644 --- a/src/modules/CropAndLock/CropAndLockModuleInterface/dllmain.cpp +++ b/src/modules/CropAndLock/CropAndLockModuleInterface/dllmain.cpp @@ -40,13 +40,13 @@ BOOL APIENTRY DllMain( HMODULE /*hModule*/, switch (ul_reason_for_call) { case DLL_PROCESS_ATTACH: - Trace::RegisterProvider(); + Trace::CropAndLock::RegisterProvider(); break; case DLL_THREAD_ATTACH: case DLL_THREAD_DETACH: break; case DLL_PROCESS_DETACH: - Trace::UnregisterProvider(); + Trace::CropAndLock::UnregisterProvider(); break; } return TRUE; diff --git a/src/modules/CropAndLock/CropAndLockModuleInterface/pch.h b/src/modules/CropAndLock/CropAndLockModuleInterface/pch.h index 0df2e08a6f..3914e22561 100644 --- a/src/modules/CropAndLock/CropAndLockModuleInterface/pch.h +++ b/src/modules/CropAndLock/CropAndLockModuleInterface/pch.h @@ -6,7 +6,5 @@ #include #include #include -#include -#include #include #include diff --git a/src/modules/EnvironmentVariables/EnvironmentVariablesModuleInterface/pch.h b/src/modules/EnvironmentVariables/EnvironmentVariablesModuleInterface/pch.h index 6f70098567..308dff2b3a 100644 --- a/src/modules/EnvironmentVariables/EnvironmentVariablesModuleInterface/pch.h +++ b/src/modules/EnvironmentVariables/EnvironmentVariablesModuleInterface/pch.h @@ -10,7 +10,6 @@ #define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers // Windows Header Files #include -#include #include #include diff --git a/src/modules/EnvironmentVariables/EnvironmentVariablesModuleInterface/trace.cpp b/src/modules/EnvironmentVariables/EnvironmentVariablesModuleInterface/trace.cpp index bb458c1b6d..6cb84aed08 100644 --- a/src/modules/EnvironmentVariables/EnvironmentVariablesModuleInterface/trace.cpp +++ b/src/modules/EnvironmentVariables/EnvironmentVariablesModuleInterface/trace.cpp @@ -1,6 +1,8 @@ #include "pch.h" #include "trace.h" +#include + TRACELOGGING_DEFINE_PROVIDER( g_hProvider, "Microsoft.PowerToys", @@ -8,20 +10,10 @@ TRACELOGGING_DEFINE_PROVIDER( (0x38e8889b, 0x9731, 0x53f5, 0xe9, 0x01, 0xe8, 0xa7, 0xc1, 0x75, 0x30, 0x74), TraceLoggingOptionProjectTelemetry()); -void Trace::RegisterProvider() noexcept -{ - TraceLoggingRegister(g_hProvider); -} - -void Trace::UnregisterProvider() noexcept -{ - TraceLoggingUnregister(g_hProvider); -} - // Log if the user has Environment Variables enabled or disabled void Trace::EnableEnvironmentVariables(const bool enabled) noexcept { - TraceLoggingWrite( + TraceLoggingWriteWrapper( g_hProvider, "EnvironmentVariables_EnableEnvironmentVariables", ProjectTelemetryPrivacyDataTag(ProjectTelemetryTag_ProductAndServicePerformance), @@ -32,7 +24,7 @@ void Trace::EnableEnvironmentVariables(const bool enabled) noexcept // Log that the user tried to activate the editor void Trace::ActivateEnvironmentVariables() noexcept { - TraceLoggingWrite( + TraceLoggingWriteWrapper( g_hProvider, "EnvironmentVariables_Activate", ProjectTelemetryPrivacyDataTag(ProjectTelemetryTag_ProductAndServicePerformance), diff --git a/src/modules/EnvironmentVariables/EnvironmentVariablesModuleInterface/trace.h b/src/modules/EnvironmentVariables/EnvironmentVariablesModuleInterface/trace.h index 0898da4602..fa37b043b5 100644 --- a/src/modules/EnvironmentVariables/EnvironmentVariablesModuleInterface/trace.h +++ b/src/modules/EnvironmentVariables/EnvironmentVariablesModuleInterface/trace.h @@ -1,11 +1,10 @@ #pragma once -class Trace +#include + +class Trace : public telemetry::TraceBase { public: - static void RegisterProvider() noexcept; - static void UnregisterProvider() noexcept; - // Log if the user has EnvironmentVariables enabled or disabled static void EnableEnvironmentVariables(const bool enabled) noexcept; diff --git a/src/modules/FileLocksmith/FileLocksmithContextMenu/FileLocksmithContextMenu.vcxproj.filters b/src/modules/FileLocksmith/FileLocksmithContextMenu/FileLocksmithContextMenu.vcxproj.filters index 5ec8585829..6646b4fc10 100644 --- a/src/modules/FileLocksmith/FileLocksmithContextMenu/FileLocksmithContextMenu.vcxproj.filters +++ b/src/modules/FileLocksmith/FileLocksmithContextMenu/FileLocksmithContextMenu.vcxproj.filters @@ -1,5 +1,6 @@  - + {4FC737F1-C7A5-4376-A066-2A32D752A2FF} diff --git a/src/modules/FileLocksmith/FileLocksmithLib/Trace.cpp b/src/modules/FileLocksmith/FileLocksmithLib/Trace.cpp index 98b2f9985d..a3d8e9038e 100644 --- a/src/modules/FileLocksmith/FileLocksmithLib/Trace.cpp +++ b/src/modules/FileLocksmith/FileLocksmithLib/Trace.cpp @@ -1,7 +1,8 @@ #include "pch.h" #include "Trace.h" -#include "../common/Telemetry/ProjectTelemetry.h" + +#include TRACELOGGING_DEFINE_PROVIDER( g_hProvider, @@ -10,19 +11,9 @@ TRACELOGGING_DEFINE_PROVIDER( (0x38e8889b, 0x9731, 0x53f5, 0xe9, 0x01, 0xe8, 0xa7, 0xc1, 0x75, 0x30, 0x74), TraceLoggingOptionProjectTelemetry()); -void Trace::RegisterProvider() noexcept -{ - TraceLoggingRegister(g_hProvider); -} - -void Trace::UnregisterProvider() noexcept -{ - TraceLoggingUnregister(g_hProvider); -} - void Trace::EnableFileLocksmith(_In_ bool enabled) noexcept { - TraceLoggingWrite( + TraceLoggingWriteWrapper( g_hProvider, "FileLocksmith_EnableFileLocksmith", ProjectTelemetryPrivacyDataTag(ProjectTelemetryTag_ProductAndServicePerformance), @@ -32,7 +23,7 @@ void Trace::EnableFileLocksmith(_In_ bool enabled) noexcept void Trace::Invoked() noexcept { - TraceLoggingWrite( + TraceLoggingWriteWrapper( g_hProvider, "FileLocksmith_Invoked", ProjectTelemetryPrivacyDataTag(ProjectTelemetryTag_ProductAndServicePerformance), @@ -41,7 +32,7 @@ void Trace::Invoked() noexcept void Trace::InvokedRet(_In_ HRESULT hr) noexcept { - TraceLoggingWrite( + TraceLoggingWriteWrapper( g_hProvider, "FileLocksmith_InvokedRet", ProjectTelemetryPrivacyDataTag(ProjectTelemetryTag_ProductAndServicePerformance), @@ -51,7 +42,7 @@ void Trace::InvokedRet(_In_ HRESULT hr) noexcept void Trace::QueryContextMenuError(_In_ HRESULT hr) noexcept { - TraceLoggingWrite( + TraceLoggingWriteWrapper( g_hProvider, "FileLocksmith_QueryContextMenuError", ProjectTelemetryPrivacyDataTag(ProjectTelemetryTag_ProductAndServicePerformance), diff --git a/src/modules/FileLocksmith/FileLocksmithLib/Trace.h b/src/modules/FileLocksmith/FileLocksmithLib/Trace.h index a9516b5d5c..98642de854 100644 --- a/src/modules/FileLocksmith/FileLocksmithLib/Trace.h +++ b/src/modules/FileLocksmith/FileLocksmithLib/Trace.h @@ -2,11 +2,11 @@ #include "pch.h" -class Trace +#include + +class Trace : public telemetry::TraceBase { public: - static void RegisterProvider() noexcept; - static void UnregisterProvider() noexcept; static void EnableFileLocksmith(_In_ bool enabled) noexcept; static void Invoked() noexcept; static void InvokedRet(_In_ HRESULT hr) noexcept; diff --git a/src/modules/Hosts/HostsModuleInterface/pch.h b/src/modules/Hosts/HostsModuleInterface/pch.h index 7c6ad2a235..5cb4cbf823 100644 --- a/src/modules/Hosts/HostsModuleInterface/pch.h +++ b/src/modules/Hosts/HostsModuleInterface/pch.h @@ -2,4 +2,3 @@ #define WIN32_LEAN_AND_MEAN #include -#include \ No newline at end of file diff --git a/src/modules/Hosts/HostsModuleInterface/trace.cpp b/src/modules/Hosts/HostsModuleInterface/trace.cpp index 391917a8f2..104075a829 100644 --- a/src/modules/Hosts/HostsModuleInterface/trace.cpp +++ b/src/modules/Hosts/HostsModuleInterface/trace.cpp @@ -1,6 +1,8 @@ #include "pch.h" #include "trace.h" +#include + TRACELOGGING_DEFINE_PROVIDER( g_hProvider, "Microsoft.PowerToys", @@ -8,20 +10,10 @@ TRACELOGGING_DEFINE_PROVIDER( (0x38e8889b, 0x9731, 0x53f5, 0xe9, 0x01, 0xe8, 0xa7, 0xc1, 0x75, 0x30, 0x74), TraceLoggingOptionProjectTelemetry()); -void Trace::RegisterProvider() noexcept -{ - TraceLoggingRegister(g_hProvider); -} - -void Trace::UnregisterProvider() noexcept -{ - TraceLoggingUnregister(g_hProvider); -} - // Log if the user has HostsFileEditor enabled or disabled void Trace::EnableHostsFileEditor(const bool enabled) noexcept { - TraceLoggingWrite( + TraceLoggingWriteWrapper( g_hProvider, "HostsFileEditor_EnableHostsFileEditor", ProjectTelemetryPrivacyDataTag(ProjectTelemetryTag_ProductAndServicePerformance), @@ -32,7 +24,7 @@ void Trace::EnableHostsFileEditor(const bool enabled) noexcept // Log that the user tried to activate the editor void Trace::ActivateEditor() noexcept { - TraceLoggingWrite( + TraceLoggingWriteWrapper( g_hProvider, "HostsFileEditor_Activate", ProjectTelemetryPrivacyDataTag(ProjectTelemetryTag_ProductAndServicePerformance), diff --git a/src/modules/Hosts/HostsModuleInterface/trace.h b/src/modules/Hosts/HostsModuleInterface/trace.h index 92132b7f54..f3dc6310b5 100644 --- a/src/modules/Hosts/HostsModuleInterface/trace.h +++ b/src/modules/Hosts/HostsModuleInterface/trace.h @@ -1,11 +1,10 @@ #pragma once -class Trace +#include + +class Trace : public telemetry::TraceBase { public: - static void RegisterProvider() noexcept; - static void UnregisterProvider() noexcept; - // Log if the user has HostsFileEditor enabled or disabled static void EnableHostsFileEditor(const bool enabled) noexcept; diff --git a/src/modules/MeasureTool/MeasureToolCore/pch.h b/src/modules/MeasureTool/MeasureToolCore/pch.h index 67ca0f9d8c..16cc5a1a62 100644 --- a/src/modules/MeasureTool/MeasureToolCore/pch.h +++ b/src/modules/MeasureTool/MeasureToolCore/pch.h @@ -30,7 +30,6 @@ #include #include #include -#include // Undefine GetCurrentTime macro to prevent // conflict with Storyboard::GetCurrentTime diff --git a/src/modules/MeasureTool/MeasureToolModuleInterface/pch.h b/src/modules/MeasureTool/MeasureToolModuleInterface/pch.h index 207418a921..9e02b6c9ce 100644 --- a/src/modules/MeasureTool/MeasureToolModuleInterface/pch.h +++ b/src/modules/MeasureTool/MeasureToolModuleInterface/pch.h @@ -9,6 +9,5 @@ #include #include -#include #include #include diff --git a/src/modules/MeasureTool/MeasureToolModuleInterface/trace.cpp b/src/modules/MeasureTool/MeasureToolModuleInterface/trace.cpp index 8c1bb93605..1a56838048 100644 --- a/src/modules/MeasureTool/MeasureToolModuleInterface/trace.cpp +++ b/src/modules/MeasureTool/MeasureToolModuleInterface/trace.cpp @@ -1,6 +1,8 @@ #include "pch.h" #include "trace.h" +#include + TRACELOGGING_DEFINE_PROVIDER( g_hProvider, "Microsoft.PowerToys", @@ -8,19 +10,9 @@ TRACELOGGING_DEFINE_PROVIDER( (0x38e8889b, 0x9731, 0x53f5, 0xe9, 0x01, 0xe8, 0xa7, 0xc1, 0x75, 0x30, 0x74), TraceLoggingOptionProjectTelemetry()); -void Trace::RegisterProvider() noexcept -{ - TraceLoggingRegister(g_hProvider); -} - -void Trace::UnregisterProvider() noexcept -{ - TraceLoggingUnregister(g_hProvider); -} - void Trace::EnableMeasureTool(const bool enabled) noexcept { - TraceLoggingWrite( + TraceLoggingWriteWrapper( g_hProvider, "MeasureTool_EnableMeasureTool", ProjectTelemetryPrivacyDataTag(ProjectTelemetryTag_ProductAndServicePerformance), @@ -30,7 +22,7 @@ void Trace::EnableMeasureTool(const bool enabled) noexcept void Trace::BoundsToolActivated() noexcept { - TraceLoggingWrite( + TraceLoggingWriteWrapper( g_hProvider, "MeasureTool_BoundsToolActivated", ProjectTelemetryPrivacyDataTag(ProjectTelemetryTag_ProductAndServicePerformance), @@ -39,7 +31,7 @@ void Trace::BoundsToolActivated() noexcept void Trace::MeasureToolActivated() noexcept { - TraceLoggingWrite( + TraceLoggingWriteWrapper( g_hProvider, "MeasureTool_MeasureToolActivated", ProjectTelemetryPrivacyDataTag(ProjectTelemetryTag_ProductAndServicePerformance), diff --git a/src/modules/MeasureTool/MeasureToolModuleInterface/trace.h b/src/modules/MeasureTool/MeasureToolModuleInterface/trace.h index e85a14bb38..fb2019c8d5 100644 --- a/src/modules/MeasureTool/MeasureToolModuleInterface/trace.h +++ b/src/modules/MeasureTool/MeasureToolModuleInterface/trace.h @@ -1,11 +1,10 @@ #pragma once -class Trace +#include + +class Trace : public telemetry::TraceBase { public: - static void RegisterProvider() noexcept; - static void UnregisterProvider() noexcept; - static void EnableMeasureTool(const bool enabled) noexcept; static void BoundsToolActivated() noexcept; diff --git a/src/modules/MouseUtils/FindMyMouse/pch.h b/src/modules/MouseUtils/FindMyMouse/pch.h index 6dbc256004..26da2455f2 100644 --- a/src/modules/MouseUtils/FindMyMouse/pch.h +++ b/src/modules/MouseUtils/FindMyMouse/pch.h @@ -15,6 +15,5 @@ #endif #include -#include #include #include diff --git a/src/modules/MouseUtils/FindMyMouse/trace.cpp b/src/modules/MouseUtils/FindMyMouse/trace.cpp index a5cfe02417..bf79461e9a 100644 --- a/src/modules/MouseUtils/FindMyMouse/trace.cpp +++ b/src/modules/MouseUtils/FindMyMouse/trace.cpp @@ -1,6 +1,8 @@ #include "pch.h" #include "trace.h" +#include + TRACELOGGING_DEFINE_PROVIDER( g_hProvider, "Microsoft.PowerToys", @@ -8,20 +10,10 @@ TRACELOGGING_DEFINE_PROVIDER( (0x38e8889b, 0x9731, 0x53f5, 0xe9, 0x01, 0xe8, 0xa7, 0xc1, 0x75, 0x30, 0x74), TraceLoggingOptionProjectTelemetry()); -void Trace::RegisterProvider() noexcept -{ - TraceLoggingRegister(g_hProvider); -} - -void Trace::UnregisterProvider() noexcept -{ - TraceLoggingUnregister(g_hProvider); -} - // Log if the user has FindMyMouse enabled or disabled void Trace::EnableFindMyMouse(const bool enabled) noexcept { - TraceLoggingWrite( + TraceLoggingWriteWrapper( g_hProvider, "FindMyMouse_EnableFindMyMouse", ProjectTelemetryPrivacyDataTag(ProjectTelemetryTag_ProductAndServicePerformance), @@ -32,7 +24,7 @@ void Trace::EnableFindMyMouse(const bool enabled) noexcept // Log that the user activated the module by focusing the mouse pointer void Trace::MousePointerFocused() noexcept { - TraceLoggingWrite( + TraceLoggingWriteWrapper( g_hProvider, "FindMyMouse_MousePointerFocused", ProjectTelemetryPrivacyDataTag(ProjectTelemetryTag_ProductAndServicePerformance), diff --git a/src/modules/MouseUtils/FindMyMouse/trace.h b/src/modules/MouseUtils/FindMyMouse/trace.h index 623ce60176..59d3183b5b 100644 --- a/src/modules/MouseUtils/FindMyMouse/trace.h +++ b/src/modules/MouseUtils/FindMyMouse/trace.h @@ -1,11 +1,10 @@ #pragma once -class Trace +#include + +class Trace : public telemetry::TraceBase { public: - static void RegisterProvider() noexcept; - static void UnregisterProvider() noexcept; - // Log if the user has FindMyMouse enabled or disabled static void EnableFindMyMouse(const bool enabled) noexcept; diff --git a/src/modules/MouseUtils/MouseHighlighter/pch.h b/src/modules/MouseUtils/MouseHighlighter/pch.h index bfb4a4776a..da08f4898a 100644 --- a/src/modules/MouseUtils/MouseHighlighter/pch.h +++ b/src/modules/MouseUtils/MouseHighlighter/pch.h @@ -16,7 +16,6 @@ #include #endif -#include #include #include #include diff --git a/src/modules/MouseUtils/MouseHighlighter/trace.cpp b/src/modules/MouseUtils/MouseHighlighter/trace.cpp index feefa17745..7f8d413b5a 100644 --- a/src/modules/MouseUtils/MouseHighlighter/trace.cpp +++ b/src/modules/MouseUtils/MouseHighlighter/trace.cpp @@ -1,6 +1,8 @@ #include "pch.h" #include "trace.h" +#include + TRACELOGGING_DEFINE_PROVIDER( g_hProvider, "Microsoft.PowerToys", @@ -8,20 +10,10 @@ TRACELOGGING_DEFINE_PROVIDER( (0x38e8889b, 0x9731, 0x53f5, 0xe9, 0x01, 0xe8, 0xa7, 0xc1, 0x75, 0x30, 0x74), TraceLoggingOptionProjectTelemetry()); -void Trace::RegisterProvider() noexcept -{ - TraceLoggingRegister(g_hProvider); -} - -void Trace::UnregisterProvider() noexcept -{ - TraceLoggingUnregister(g_hProvider); -} - // Log if the user has MouseHighlighter enabled or disabled void Trace::EnableMouseHighlighter(const bool enabled) noexcept { - TraceLoggingWrite( + TraceLoggingWriteWrapper( g_hProvider, "MouseHighlighter_EnableMouseHighlighter", ProjectTelemetryPrivacyDataTag(ProjectTelemetryTag_ProductAndServicePerformance), @@ -32,7 +24,7 @@ void Trace::EnableMouseHighlighter(const bool enabled) noexcept // Log that the user activated the module by starting a highlighting session void Trace::StartHighlightingSession() noexcept { - TraceLoggingWrite( + TraceLoggingWriteWrapper( g_hProvider, "MouseHighlighter_StartHighlightingSession", ProjectTelemetryPrivacyDataTag(ProjectTelemetryTag_ProductAndServicePerformance), diff --git a/src/modules/MouseUtils/MouseHighlighter/trace.h b/src/modules/MouseUtils/MouseHighlighter/trace.h index 01d660bbc0..12708940e9 100644 --- a/src/modules/MouseUtils/MouseHighlighter/trace.h +++ b/src/modules/MouseUtils/MouseHighlighter/trace.h @@ -1,11 +1,10 @@ #pragma once -class Trace +#include + +class Trace : public telemetry::TraceBase { public: - static void RegisterProvider() noexcept; - static void UnregisterProvider() noexcept; - // Log if the user has MouseHighlighter enabled or disabled static void EnableMouseHighlighter(const bool enabled) noexcept; diff --git a/src/modules/MouseUtils/MouseJump/pch.h b/src/modules/MouseUtils/MouseJump/pch.h index 74abb62da1..575f5e9355 100644 --- a/src/modules/MouseUtils/MouseJump/pch.h +++ b/src/modules/MouseUtils/MouseJump/pch.h @@ -5,6 +5,5 @@ #include //#include -#include #include #include diff --git a/src/modules/MouseUtils/MouseJump/trace.cpp b/src/modules/MouseUtils/MouseJump/trace.cpp index 9f5380284d..dd2399eb68 100644 --- a/src/modules/MouseUtils/MouseJump/trace.cpp +++ b/src/modules/MouseUtils/MouseJump/trace.cpp @@ -1,6 +1,8 @@ #include "pch.h" #include "trace.h" +#include + TRACELOGGING_DEFINE_PROVIDER( g_hProvider, "Microsoft.PowerToys", @@ -8,19 +10,9 @@ TRACELOGGING_DEFINE_PROVIDER( (0x38e8889b, 0x9731, 0x53f5, 0xe9, 0x01, 0xe8, 0xa7, 0xc1, 0x75, 0x30, 0x74), TraceLoggingOptionProjectTelemetry()); -void Trace::RegisterProvider() -{ - TraceLoggingRegister(g_hProvider); -} - -void Trace::UnregisterProvider() -{ - TraceLoggingUnregister(g_hProvider); -} - void Trace::EnableJumpTool(const bool enabled) noexcept { - TraceLoggingWrite( + TraceLoggingWriteWrapper( g_hProvider, "MouseJump_EnableJumpTool", ProjectTelemetryPrivacyDataTag(ProjectTelemetryTag_ProductAndServicePerformance), @@ -30,7 +22,7 @@ void Trace::EnableJumpTool(const bool enabled) noexcept void Trace::InvokeJumpTool() noexcept { - TraceLoggingWrite( + TraceLoggingWriteWrapper( g_hProvider, "MouseJump_InvokeJumpTool", ProjectTelemetryPrivacyDataTag(ProjectTelemetryTag_ProductAndServicePerformance), diff --git a/src/modules/MouseUtils/MouseJump/trace.h b/src/modules/MouseUtils/MouseJump/trace.h index aaaa336291..c70e2c746c 100644 --- a/src/modules/MouseUtils/MouseJump/trace.h +++ b/src/modules/MouseUtils/MouseJump/trace.h @@ -1,11 +1,10 @@ #pragma once -class Trace +#include + +class Trace : public telemetry::TraceBase { public: - static void RegisterProvider(); - static void UnregisterProvider(); - static void EnableJumpTool(const bool enabled) noexcept; static void InvokeJumpTool() noexcept; diff --git a/src/modules/MouseUtils/MousePointerCrosshairs/pch.h b/src/modules/MouseUtils/MousePointerCrosshairs/pch.h index 5fc459cbc9..1240987498 100644 --- a/src/modules/MouseUtils/MousePointerCrosshairs/pch.h +++ b/src/modules/MouseUtils/MousePointerCrosshairs/pch.h @@ -9,7 +9,6 @@ #include #include #include -#include #include #include #include diff --git a/src/modules/MouseUtils/MousePointerCrosshairs/trace.cpp b/src/modules/MouseUtils/MousePointerCrosshairs/trace.cpp index afc9844bc5..00924f030d 100644 --- a/src/modules/MouseUtils/MousePointerCrosshairs/trace.cpp +++ b/src/modules/MouseUtils/MousePointerCrosshairs/trace.cpp @@ -1,6 +1,8 @@ #include "pch.h" #include "trace.h" +#include + TRACELOGGING_DEFINE_PROVIDER( g_hProvider, "Microsoft.PowerToys", @@ -8,20 +10,10 @@ TRACELOGGING_DEFINE_PROVIDER( (0x38e8889b, 0x9731, 0x53f5, 0xe9, 0x01, 0xe8, 0xa7, 0xc1, 0x75, 0x30, 0x74), TraceLoggingOptionProjectTelemetry()); -void Trace::RegisterProvider() noexcept -{ - TraceLoggingRegister(g_hProvider); -} - -void Trace::UnregisterProvider() noexcept -{ - TraceLoggingUnregister(g_hProvider); -} - // Log if the user has MousePointerCrosshairs enabled or disabled void Trace::EnableMousePointerCrosshairs(const bool enabled) noexcept { - TraceLoggingWrite( + TraceLoggingWriteWrapper( g_hProvider, "MousePointerCrosshairs_EnableMousePointerCrosshairs", ProjectTelemetryPrivacyDataTag(ProjectTelemetryTag_ProductAndServicePerformance), @@ -32,7 +24,7 @@ void Trace::EnableMousePointerCrosshairs(const bool enabled) noexcept // Log that the user activated the module by having the crosshairs be drawn void Trace::StartDrawingCrosshairs() noexcept { - TraceLoggingWrite( + TraceLoggingWriteWrapper( g_hProvider, "MousePointerCrosshairs_StartDrawingCrosshairs", ProjectTelemetryPrivacyDataTag(ProjectTelemetryTag_ProductAndServicePerformance), diff --git a/src/modules/MouseUtils/MousePointerCrosshairs/trace.h b/src/modules/MouseUtils/MousePointerCrosshairs/trace.h index d7373e5347..b60fc33336 100644 --- a/src/modules/MouseUtils/MousePointerCrosshairs/trace.h +++ b/src/modules/MouseUtils/MousePointerCrosshairs/trace.h @@ -1,11 +1,10 @@ #pragma once -class Trace +#include + +class Trace : public telemetry::TraceBase { public: - static void RegisterProvider() noexcept; - static void UnregisterProvider() noexcept; - // Log if the user has MousePointerCrosshairs enabled or disabled static void EnableMousePointerCrosshairs(const bool enabled) noexcept; diff --git a/src/modules/MouseWithoutBorders/ModuleInterface/dllmain.cpp b/src/modules/MouseWithoutBorders/ModuleInterface/dllmain.cpp index d2203e6ff5..463d527230 100644 --- a/src/modules/MouseWithoutBorders/ModuleInterface/dllmain.cpp +++ b/src/modules/MouseWithoutBorders/ModuleInterface/dllmain.cpp @@ -22,13 +22,13 @@ BOOL APIENTRY DllMain(HMODULE hModule, DWORD ul_reason_for_call, LPVOID /*lpRese { case DLL_PROCESS_ATTACH: g_hInst_MouseWithoutBorders = hModule; - Trace::RegisterProvider(); + Trace::MouseWithoutBorders::RegisterProvider(); break; case DLL_THREAD_ATTACH: case DLL_THREAD_DETACH: break; case DLL_PROCESS_DETACH: - Trace::UnregisterProvider(); + Trace::MouseWithoutBorders::UnregisterProvider(); break; } return TRUE; diff --git a/src/modules/MouseWithoutBorders/ModuleInterface/pch.h b/src/modules/MouseWithoutBorders/ModuleInterface/pch.h index cb0737a69d..0270a7bc39 100644 --- a/src/modules/MouseWithoutBorders/ModuleInterface/pch.h +++ b/src/modules/MouseWithoutBorders/ModuleInterface/pch.h @@ -9,8 +9,6 @@ #include #include #include -#include -#include #include #include diff --git a/src/modules/MouseWithoutBorders/ModuleInterface/trace.cpp b/src/modules/MouseWithoutBorders/ModuleInterface/trace.cpp index fb2f631bc6..7986ceefa4 100644 --- a/src/modules/MouseWithoutBorders/ModuleInterface/trace.cpp +++ b/src/modules/MouseWithoutBorders/ModuleInterface/trace.cpp @@ -1,6 +1,8 @@ #include "pch.h" #include "trace.h" +#include + // Telemetry strings should not be localized. #define LoggingProviderKey "Microsoft.PowerToys" @@ -14,19 +16,9 @@ TRACELOGGING_DEFINE_PROVIDER( (0x38e8889b, 0x9731, 0x53f5, 0xe9, 0x01, 0xe8, 0xa7, 0xc1, 0x75, 0x30, 0x74), TraceLoggingOptionProjectTelemetry()); -void Trace::RegisterProvider() noexcept -{ - TraceLoggingRegister(g_hProvider); -} - -void Trace::UnregisterProvider() noexcept -{ - TraceLoggingUnregister(g_hProvider); -} - void Trace::MouseWithoutBorders::Enable(bool enabled) noexcept { - TraceLoggingWrite( + TraceLoggingWriteWrapper( g_hProvider, EventEnableMouseWithoutBordersKey, ProjectTelemetryPrivacyDataTag(ProjectTelemetryTag_ProductAndServicePerformance), @@ -36,7 +28,7 @@ void Trace::MouseWithoutBorders::Enable(bool enabled) noexcept void Trace::MouseWithoutBorders::ToggleServiceRegistration(bool enabled) noexcept { - TraceLoggingWrite( + TraceLoggingWriteWrapper( g_hProvider, "MouseWithoutBorders_ToggleServiceRegistration", ProjectTelemetryPrivacyDataTag(ProjectTelemetryTag_ProductAndServicePerformance), @@ -46,7 +38,7 @@ void Trace::MouseWithoutBorders::ToggleServiceRegistration(bool enabled) noexcep void Trace::MouseWithoutBorders::Activate() noexcept { - TraceLoggingWrite( + TraceLoggingWriteWrapper( g_hProvider, "MouseWithoutBorders_Activate", ProjectTelemetryPrivacyDataTag(ProjectTelemetryTag_ProductAndServicePerformance), @@ -56,7 +48,7 @@ void Trace::MouseWithoutBorders::Activate() noexcept // Log that the user tried to activate the editor void Trace::MouseWithoutBorders::AddFirewallRule() noexcept { - TraceLoggingWrite( + TraceLoggingWriteWrapper( g_hProvider, "MouseWithoutBorders_AddFirewallRule", ProjectTelemetryPrivacyDataTag(ProjectTelemetryTag_ProductAndServicePerformance), diff --git a/src/modules/MouseWithoutBorders/ModuleInterface/trace.h b/src/modules/MouseWithoutBorders/ModuleInterface/trace.h index 1f9099eaae..ecd27cbd2d 100644 --- a/src/modules/MouseWithoutBorders/ModuleInterface/trace.h +++ b/src/modules/MouseWithoutBorders/ModuleInterface/trace.h @@ -1,12 +1,11 @@ #pragma once +#include + class Trace { public: - static void RegisterProvider() noexcept; - static void UnregisterProvider() noexcept; - - class MouseWithoutBorders + class MouseWithoutBorders : public telemetry::TraceBase { public: static void Enable(bool enabled) noexcept; diff --git a/src/modules/PowerOCR/PowerOCRModuleInterface/pch.h b/src/modules/PowerOCR/PowerOCRModuleInterface/pch.h index eddac0fdc1..329705f63b 100644 --- a/src/modules/PowerOCR/PowerOCRModuleInterface/pch.h +++ b/src/modules/PowerOCR/PowerOCRModuleInterface/pch.h @@ -2,6 +2,5 @@ #include #include #include -#include #include #include \ No newline at end of file diff --git a/src/modules/PowerOCR/PowerOCRModuleInterface/trace.cpp b/src/modules/PowerOCR/PowerOCRModuleInterface/trace.cpp index 6751270726..979619b915 100644 --- a/src/modules/PowerOCR/PowerOCRModuleInterface/trace.cpp +++ b/src/modules/PowerOCR/PowerOCRModuleInterface/trace.cpp @@ -1,6 +1,8 @@ #include "pch.h" #include "trace.h" +#include + TRACELOGGING_DEFINE_PROVIDER( g_hProvider, "Microsoft.PowerToys", @@ -8,20 +10,10 @@ TRACELOGGING_DEFINE_PROVIDER( (0x38e8889b, 0x9731, 0x53f5, 0xe9, 0x01, 0xe8, 0xa7, 0xc1, 0x75, 0x30, 0x74), TraceLoggingOptionProjectTelemetry()); -void Trace::RegisterProvider() -{ - TraceLoggingRegister(g_hProvider); -} - -void Trace::UnregisterProvider() -{ - TraceLoggingUnregister(g_hProvider); -} - // Log if the user has PowerOCR enabled or disabled void Trace::EnablePowerOCR(const bool enabled) noexcept { - TraceLoggingWrite( + TraceLoggingWriteWrapper( g_hProvider, "PowerOCR_EnablePowerOCR", ProjectTelemetryPrivacyDataTag(ProjectTelemetryTag_ProductAndServicePerformance), diff --git a/src/modules/PowerOCR/PowerOCRModuleInterface/trace.h b/src/modules/PowerOCR/PowerOCRModuleInterface/trace.h index a68576c302..b8e428994e 100644 --- a/src/modules/PowerOCR/PowerOCRModuleInterface/trace.h +++ b/src/modules/PowerOCR/PowerOCRModuleInterface/trace.h @@ -1,10 +1,10 @@ #pragma once -class Trace + +#include + +class Trace : public telemetry::TraceBase { public: - static void RegisterProvider(); - static void UnregisterProvider(); - // Log if the user has PowerOCR enabled or disabled static void EnablePowerOCR(const bool enabled) noexcept; }; diff --git a/src/modules/ShortcutGuide/ShortcutGuide/pch.h b/src/modules/ShortcutGuide/ShortcutGuide/pch.h index 7cfa22c4fa..9ec2bbcb41 100644 --- a/src/modules/ShortcutGuide/ShortcutGuide/pch.h +++ b/src/modules/ShortcutGuide/ShortcutGuide/pch.h @@ -25,6 +25,5 @@ #include #include #include -#include #include #include \ No newline at end of file diff --git a/src/modules/ShortcutGuide/ShortcutGuide/trace.cpp b/src/modules/ShortcutGuide/ShortcutGuide/trace.cpp index b68e7bbcad..f2a414d6ac 100644 --- a/src/modules/ShortcutGuide/ShortcutGuide/trace.cpp +++ b/src/modules/ShortcutGuide/ShortcutGuide/trace.cpp @@ -1,6 +1,8 @@ #include "pch.h" #include "trace.h" +#include + TRACELOGGING_DEFINE_PROVIDER( g_hProvider, "Microsoft.PowerToys", @@ -8,19 +10,9 @@ TRACELOGGING_DEFINE_PROVIDER( (0x38e8889b, 0x9731, 0x53f5, 0xe9, 0x01, 0xe8, 0xa7, 0xc1, 0x75, 0x30, 0x74), TraceLoggingOptionProjectTelemetry()); -void Trace::RegisterProvider() noexcept -{ - TraceLoggingRegister(g_hProvider); -} - -void Trace::UnregisterProvider() noexcept -{ - TraceLoggingUnregister(g_hProvider); -} - void Trace::SendGuideSession(const __int64 duration_ms, const wchar_t* close_type) noexcept { - TraceLoggingWrite( + TraceLoggingWriteWrapper( g_hProvider, "ShortcutGuide_GuideSession", TraceLoggingInt64(duration_ms, "DurationInMs"), @@ -32,7 +24,7 @@ void Trace::SendGuideSession(const __int64 duration_ms, const wchar_t* close_typ void Trace::SendSettings(ShortcutGuideSettings settings) noexcept { - TraceLoggingWrite( + TraceLoggingWriteWrapper( g_hProvider, "ShortcutGuide_Settings", TraceLoggingWideString(settings.hotkey.c_str(), "Hotkey"), diff --git a/src/modules/ShortcutGuide/ShortcutGuide/trace.h b/src/modules/ShortcutGuide/ShortcutGuide/trace.h index 97f9d75bc8..a3446a8570 100644 --- a/src/modules/ShortcutGuide/ShortcutGuide/trace.h +++ b/src/modules/ShortcutGuide/ShortcutGuide/trace.h @@ -1,11 +1,11 @@ #pragma once #include "ShortcutGuideSettings.h" -class Trace +#include + +class Trace : public telemetry::TraceBase { public: - static void RegisterProvider() noexcept; - static void UnregisterProvider() noexcept; static void SendGuideSession(const __int64 duration_ms, const wchar_t* close_type) noexcept; static void SendSettings(ShortcutGuideSettings settings) noexcept; }; diff --git a/src/modules/ShortcutGuide/ShortcutGuideModuleInterface/pch.h b/src/modules/ShortcutGuide/ShortcutGuideModuleInterface/pch.h index 799a9214a1..37cb34a58a 100644 --- a/src/modules/ShortcutGuide/ShortcutGuideModuleInterface/pch.h +++ b/src/modules/ShortcutGuide/ShortcutGuideModuleInterface/pch.h @@ -2,7 +2,6 @@ #define NOMINMAX #include #include -#include #include #include #include \ No newline at end of file diff --git a/src/modules/alwaysontop/AlwaysOnTop/main.cpp b/src/modules/alwaysontop/AlwaysOnTop/main.cpp index 8b7d901c7d..afb510b93f 100644 --- a/src/modules/alwaysontop/AlwaysOnTop/main.cpp +++ b/src/modules/alwaysontop/AlwaysOnTop/main.cpp @@ -58,13 +58,13 @@ int WINAPI wWinMain(_In_ HINSTANCE hInstance, _In_opt_ HINSTANCE hPrevInstance, }); } - Trace::RegisterProvider(); + Trace::AlwaysOnTop::RegisterProvider(); AlwaysOnTop app(!pid.empty()); run_message_loop(); - Trace::UnregisterProvider(); + Trace::AlwaysOnTop::UnregisterProvider(); return 0; } diff --git a/src/modules/alwaysontop/AlwaysOnTop/pch.h b/src/modules/alwaysontop/AlwaysOnTop/pch.h index 848c90fea2..d3a92e228f 100644 --- a/src/modules/alwaysontop/AlwaysOnTop/pch.h +++ b/src/modules/alwaysontop/AlwaysOnTop/pch.h @@ -4,7 +4,6 @@ #include #include #include -#include #include #include diff --git a/src/modules/alwaysontop/AlwaysOnTop/trace.cpp b/src/modules/alwaysontop/AlwaysOnTop/trace.cpp index ae32849bbf..fb3739f4df 100644 --- a/src/modules/alwaysontop/AlwaysOnTop/trace.cpp +++ b/src/modules/alwaysontop/AlwaysOnTop/trace.cpp @@ -1,6 +1,8 @@ #include "pch.h" #include "trace.h" +#include + // Telemetry strings should not be localized. #define LoggingProviderKey "Microsoft.PowerToys" @@ -16,19 +18,9 @@ TRACELOGGING_DEFINE_PROVIDER( (0x38e8889b, 0x9731, 0x53f5, 0xe9, 0x01, 0xe8, 0xa7, 0xc1, 0x75, 0x30, 0x74), TraceLoggingOptionProjectTelemetry()); -void Trace::RegisterProvider() noexcept -{ - TraceLoggingRegister(g_hProvider); -} - -void Trace::UnregisterProvider() noexcept -{ - TraceLoggingUnregister(g_hProvider); -} - void Trace::AlwaysOnTop::Enable(bool enabled) noexcept { - TraceLoggingWrite( + TraceLoggingWriteWrapper( g_hProvider, EventEnableAlwaysOnTopKey, ProjectTelemetryPrivacyDataTag(ProjectTelemetryTag_ProductAndServicePerformance), @@ -38,7 +30,7 @@ void Trace::AlwaysOnTop::Enable(bool enabled) noexcept void Trace::AlwaysOnTop::PinWindow() noexcept { - TraceLoggingWrite( + TraceLoggingWriteWrapper( g_hProvider, EventPinWindowKey, ProjectTelemetryPrivacyDataTag(ProjectTelemetryTag_ProductAndServicePerformance), @@ -47,7 +39,7 @@ void Trace::AlwaysOnTop::PinWindow() noexcept void Trace::AlwaysOnTop::UnpinWindow() noexcept { - TraceLoggingWrite( + TraceLoggingWriteWrapper( g_hProvider, EventUnpinWindowKey, ProjectTelemetryPrivacyDataTag(ProjectTelemetryTag_ProductAndServicePerformance), diff --git a/src/modules/alwaysontop/AlwaysOnTop/trace.h b/src/modules/alwaysontop/AlwaysOnTop/trace.h index 23c88d3c01..05ac601101 100644 --- a/src/modules/alwaysontop/AlwaysOnTop/trace.h +++ b/src/modules/alwaysontop/AlwaysOnTop/trace.h @@ -1,12 +1,11 @@ #pragma once +#include + class Trace { public: - static void RegisterProvider() noexcept; - static void UnregisterProvider() noexcept; - - class AlwaysOnTop + class AlwaysOnTop : public telemetry::TraceBase { public: static void Enable(bool enabled) noexcept; diff --git a/src/modules/alwaysontop/AlwaysOnTopModuleInterface/dllmain.cpp b/src/modules/alwaysontop/AlwaysOnTopModuleInterface/dllmain.cpp index 83158813c6..ec8bd1470d 100644 --- a/src/modules/alwaysontop/AlwaysOnTopModuleInterface/dllmain.cpp +++ b/src/modules/alwaysontop/AlwaysOnTopModuleInterface/dllmain.cpp @@ -35,7 +35,7 @@ BOOL APIENTRY DllMain(HMODULE /*hModule*/, DWORD ul_reason_for_call, LPVOID /*lp switch (ul_reason_for_call) { case DLL_PROCESS_ATTACH: - Trace::RegisterProvider(); + Trace::AlwaysOnTop::RegisterProvider(); break; case DLL_THREAD_ATTACH: @@ -43,7 +43,7 @@ BOOL APIENTRY DllMain(HMODULE /*hModule*/, DWORD ul_reason_for_call, LPVOID /*lp break; case DLL_PROCESS_DETACH: - Trace::UnregisterProvider(); + Trace::AlwaysOnTop::UnregisterProvider(); break; } return TRUE; diff --git a/src/modules/alwaysontop/AlwaysOnTopModuleInterface/pch.h b/src/modules/alwaysontop/AlwaysOnTopModuleInterface/pch.h index d70de4e4d4..9dc1f70972 100644 --- a/src/modules/alwaysontop/AlwaysOnTopModuleInterface/pch.h +++ b/src/modules/alwaysontop/AlwaysOnTopModuleInterface/pch.h @@ -5,7 +5,5 @@ #include #include #include -#include -#include #include #include diff --git a/src/modules/awake/AwakeModuleInterface/pch.h b/src/modules/awake/AwakeModuleInterface/pch.h index eddac0fdc1..329705f63b 100644 --- a/src/modules/awake/AwakeModuleInterface/pch.h +++ b/src/modules/awake/AwakeModuleInterface/pch.h @@ -2,6 +2,5 @@ #include #include #include -#include #include #include \ No newline at end of file diff --git a/src/modules/awake/AwakeModuleInterface/trace.cpp b/src/modules/awake/AwakeModuleInterface/trace.cpp index fe90aa2658..971084e4ab 100644 --- a/src/modules/awake/AwakeModuleInterface/trace.cpp +++ b/src/modules/awake/AwakeModuleInterface/trace.cpp @@ -1,6 +1,8 @@ #include "pch.h" #include "trace.h" +#include + TRACELOGGING_DEFINE_PROVIDER( g_hProvider, "Microsoft.PowerToys", @@ -8,20 +10,10 @@ TRACELOGGING_DEFINE_PROVIDER( (0x38e8889b, 0x9731, 0x53f5, 0xe9, 0x01, 0xe8, 0xa7, 0xc1, 0x75, 0x30, 0x74), TraceLoggingOptionProjectTelemetry()); -void Trace::RegisterProvider() -{ - TraceLoggingRegister(g_hProvider); -} - -void Trace::UnregisterProvider() -{ - TraceLoggingUnregister(g_hProvider); -} - // Log if the user has Awake enabled or disabled void Trace::EnableAwake(const bool enabled) noexcept { - TraceLoggingWrite( + TraceLoggingWriteWrapper( g_hProvider, "Awake_EnableAwake", ProjectTelemetryPrivacyDataTag(ProjectTelemetryTag_ProductAndServicePerformance), diff --git a/src/modules/awake/AwakeModuleInterface/trace.h b/src/modules/awake/AwakeModuleInterface/trace.h index 40a903b98a..95a9a4e46e 100644 --- a/src/modules/awake/AwakeModuleInterface/trace.h +++ b/src/modules/awake/AwakeModuleInterface/trace.h @@ -1,11 +1,10 @@ #pragma once -class Trace +#include + +class Trace : public telemetry::TraceBase { public: - static void RegisterProvider(); - static void UnregisterProvider(); - // Log if the user has Awake enabled or disabled static void EnableAwake(const bool enabled) noexcept; }; diff --git a/src/modules/cmdNotFound/CmdNotFoundModuleInterface/pch.h b/src/modules/cmdNotFound/CmdNotFoundModuleInterface/pch.h index 96a774ab2a..8706bb4cf9 100644 --- a/src/modules/cmdNotFound/CmdNotFoundModuleInterface/pch.h +++ b/src/modules/cmdNotFound/CmdNotFoundModuleInterface/pch.h @@ -11,6 +11,4 @@ // Windows Header Files #include -#include - #endif //PCH_H diff --git a/src/modules/cmdNotFound/CmdNotFoundModuleInterface/trace.cpp b/src/modules/cmdNotFound/CmdNotFoundModuleInterface/trace.cpp index 255c46ea99..c136909f32 100644 --- a/src/modules/cmdNotFound/CmdNotFoundModuleInterface/trace.cpp +++ b/src/modules/cmdNotFound/CmdNotFoundModuleInterface/trace.cpp @@ -1,6 +1,8 @@ #include "pch.h" #include "trace.h" +#include + TRACELOGGING_DEFINE_PROVIDER( g_hProvider, "Microsoft.PowerToys", @@ -8,20 +10,10 @@ TRACELOGGING_DEFINE_PROVIDER( (0x38e8889b, 0x9731, 0x53f5, 0xe9, 0x01, 0xe8, 0xa7, 0xc1, 0x75, 0x30, 0x74), TraceLoggingOptionProjectTelemetry()); -void Trace::RegisterProvider() -{ - TraceLoggingRegister(g_hProvider); -} - -void Trace::UnregisterProvider() -{ - TraceLoggingUnregister(g_hProvider); -} - // Log if the user has CmdNotFound enabled or disabled void Trace::EnableCmdNotFoundGpo(const bool enabled) noexcept { - TraceLoggingWrite( + TraceLoggingWriteWrapper( g_hProvider, "CmdNotFound_EnableCmdNotFound", ProjectTelemetryPrivacyDataTag(ProjectTelemetryTag_ProductAndServicePerformance), diff --git a/src/modules/cmdNotFound/CmdNotFoundModuleInterface/trace.h b/src/modules/cmdNotFound/CmdNotFoundModuleInterface/trace.h index 4294c510a6..6fb84c5f10 100644 --- a/src/modules/cmdNotFound/CmdNotFoundModuleInterface/trace.h +++ b/src/modules/cmdNotFound/CmdNotFoundModuleInterface/trace.h @@ -1,11 +1,10 @@ #pragma once -class Trace +#include + +class Trace : public telemetry::TraceBase { public: - static void RegisterProvider(); - static void UnregisterProvider(); - // Log if the user has CmdNotFound enabled or disabled static void EnableCmdNotFoundGpo(const bool enabled) noexcept; }; diff --git a/src/modules/colorPicker/ColorPicker/pch.h b/src/modules/colorPicker/ColorPicker/pch.h index eddac0fdc1..329705f63b 100644 --- a/src/modules/colorPicker/ColorPicker/pch.h +++ b/src/modules/colorPicker/ColorPicker/pch.h @@ -2,6 +2,5 @@ #include #include #include -#include #include #include \ No newline at end of file diff --git a/src/modules/colorPicker/ColorPicker/trace.cpp b/src/modules/colorPicker/ColorPicker/trace.cpp index 285cea034e..61ddb9b3e1 100644 --- a/src/modules/colorPicker/ColorPicker/trace.cpp +++ b/src/modules/colorPicker/ColorPicker/trace.cpp @@ -1,6 +1,8 @@ #include "pch.h" #include "trace.h" +#include + TRACELOGGING_DEFINE_PROVIDER( g_hProvider, "Microsoft.PowerToys", @@ -8,20 +10,10 @@ TRACELOGGING_DEFINE_PROVIDER( (0x38e8889b, 0x9731, 0x53f5, 0xe9, 0x01, 0xe8, 0xa7, 0xc1, 0x75, 0x30, 0x74), TraceLoggingOptionProjectTelemetry()); -void Trace::RegisterProvider() -{ - TraceLoggingRegister(g_hProvider); -} - -void Trace::UnregisterProvider() -{ - TraceLoggingUnregister(g_hProvider); -} - // Log if ColorPicker is enabled or disabled void Trace::EnableColorPicker(const bool enabled) noexcept { - TraceLoggingWrite( + TraceLoggingWriteWrapper( g_hProvider, "ColorPicker_EnableColorPicker", ProjectTelemetryPrivacyDataTag(ProjectTelemetryTag_ProductAndServicePerformance), diff --git a/src/modules/colorPicker/ColorPicker/trace.h b/src/modules/colorPicker/ColorPicker/trace.h index b133664008..594239cf34 100644 --- a/src/modules/colorPicker/ColorPicker/trace.h +++ b/src/modules/colorPicker/ColorPicker/trace.h @@ -1,10 +1,10 @@ #pragma once -class Trace + +#include + +class Trace : public telemetry::TraceBase { public: - static void RegisterProvider(); - static void UnregisterProvider(); - // Log if ColorPicker is enabled or disabled static void EnableColorPicker(const bool enabled) noexcept; diff --git a/src/modules/fancyzones/FancyZones/pch.h b/src/modules/fancyzones/FancyZones/pch.h index 472d051e25..291159e4e8 100644 --- a/src/modules/fancyzones/FancyZones/pch.h +++ b/src/modules/fancyzones/FancyZones/pch.h @@ -1,7 +1,6 @@ #pragma once #define WIN32_LEAN_AND_MEAN #include -#include #include #include #include diff --git a/src/modules/fancyzones/FancyZonesLib/pch.h b/src/modules/fancyzones/FancyZonesLib/pch.h index 70a402b0fa..d201dabd0c 100644 --- a/src/modules/fancyzones/FancyZonesLib/pch.h +++ b/src/modules/fancyzones/FancyZonesLib/pch.h @@ -8,11 +8,9 @@ #include #include #include -#include #include #include #include -#include #include #include #include diff --git a/src/modules/fancyzones/FancyZonesLib/trace.cpp b/src/modules/fancyzones/FancyZonesLib/trace.cpp index 4c6024fe5a..69e341197a 100644 --- a/src/modules/fancyzones/FancyZonesLib/trace.cpp +++ b/src/modules/fancyzones/FancyZonesLib/trace.cpp @@ -10,6 +10,8 @@ #include "FancyZonesLib/FancyZonesDataTypes.h" #include "FancyZonesLib/util.h" +#include + // Telemetry strings should not be localized. #define LoggingProviderKey "Microsoft.PowerToys" @@ -108,19 +110,9 @@ ZoneSetInfo GetZoneSetInfo(_In_opt_ Layout* layout, const LayoutAssignedWindows& return info; } -void Trace::RegisterProvider() noexcept -{ - TraceLoggingRegister(g_hProvider); -} - -void Trace::UnregisterProvider() noexcept -{ - TraceLoggingUnregister(g_hProvider); -} - void Trace::FancyZones::EnableFancyZones(bool enabled) noexcept { - TraceLoggingWrite( + TraceLoggingWriteWrapper( g_hProvider, EventEnableFancyZonesKey, ProjectTelemetryPrivacyDataTag(ProjectTelemetryTag_ProductAndServicePerformance), @@ -130,7 +122,7 @@ void Trace::FancyZones::EnableFancyZones(bool enabled) noexcept void Trace::FancyZones::OnKeyDown(DWORD vkCode, bool win, bool control, bool inMoveSize) noexcept { - TraceLoggingWrite( + TraceLoggingWriteWrapper( g_hProvider, EventKeyDownKey, ProjectTelemetryPrivacyDataTag(ProjectTelemetryTag_ProductAndServicePerformance), @@ -211,7 +203,7 @@ void Trace::FancyZones::DataChanged() noexcept activeZoneSetInfo += L", custom zone data was deleted"; } } - TraceLoggingWrite( + TraceLoggingWriteWrapper( g_hProvider, EventZoneSettingsChangedKey, ProjectTelemetryPrivacyDataTag(ProjectTelemetryTag_ProductAndServicePerformance), @@ -226,7 +218,7 @@ void Trace::FancyZones::DataChanged() noexcept void Trace::FancyZones::EditorLaunched(int value) noexcept { - TraceLoggingWrite( + TraceLoggingWriteWrapper( g_hProvider, EventEditorLaunchKey, ProjectTelemetryPrivacyDataTag(ProjectTelemetryTag_ProductAndServicePerformance), @@ -237,7 +229,7 @@ void Trace::FancyZones::EditorLaunched(int value) noexcept // Log if an error occurs in FZ void Trace::FancyZones::Error(const DWORD errorCode, std::wstring errorMessage, std::wstring methodName) noexcept { - TraceLoggingWrite( + TraceLoggingWriteWrapper( g_hProvider, "FancyZones_Error", ProjectTelemetryPrivacyDataTag(ProjectTelemetryTag_ProductAndServicePerformance), @@ -249,7 +241,7 @@ void Trace::FancyZones::Error(const DWORD errorCode, std::wstring errorMessage, void Trace::FancyZones::QuickLayoutSwitched(bool shortcutUsed) noexcept { - TraceLoggingWrite( + TraceLoggingWriteWrapper( g_hProvider, EventQuickLayoutSwitchKey, ProjectTelemetryPrivacyDataTag(ProjectTelemetryTag_ProductAndServicePerformance), @@ -260,7 +252,7 @@ void Trace::FancyZones::QuickLayoutSwitched(bool shortcutUsed) noexcept void Trace::FancyZones::SnapNewWindowIntoZone(Layout* activeLayout, const LayoutAssignedWindows& layoutWindows) noexcept { auto const zoneInfo = GetZoneSetInfo(activeLayout, layoutWindows); - TraceLoggingWrite( + TraceLoggingWriteWrapper( g_hProvider, EventSnapNewWindowIntoZone, ProjectTelemetryPrivacyDataTag(ProjectTelemetryTag_ProductAndServicePerformance), @@ -273,7 +265,7 @@ void Trace::FancyZones::SnapNewWindowIntoZone(Layout* activeLayout, const Layout void Trace::FancyZones::KeyboardSnapWindowToZone(Layout* activeLayout, const LayoutAssignedWindows& layoutWindows) noexcept { auto const zoneInfo = GetZoneSetInfo(activeLayout, layoutWindows); - TraceLoggingWrite( + TraceLoggingWriteWrapper( g_hProvider, EventKeyboardSnapWindowToZone, ProjectTelemetryPrivacyDataTag(ProjectTelemetryTag_ProductAndServicePerformance), @@ -299,7 +291,7 @@ void Trace::SettingsTelemetry(const Settings& settings) noexcept auto nextTabHotkeyStr = HotKeyToString(settings.nextTabHotkey); auto prevTabHotkeyStr = HotKeyToString(settings.prevTabHotkey); - TraceLoggingWrite( + TraceLoggingWriteWrapper( g_hProvider, EventSettingsKey, ProjectTelemetryPrivacyDataTag(ProjectTelemetryTag_ProductAndServicePerformance), @@ -337,7 +329,7 @@ void Trace::SettingsTelemetry(const Settings& settings) noexcept void Trace::VirtualDesktopChanged() noexcept { - TraceLoggingWrite( + TraceLoggingWriteWrapper( g_hProvider, EventDesktopChangedKey, ProjectTelemetryPrivacyDataTag(ProjectTelemetryTag_ProductAndServicePerformance), @@ -346,7 +338,7 @@ void Trace::VirtualDesktopChanged() noexcept void Trace::WorkArea::KeyUp(WPARAM wParam) noexcept { - TraceLoggingWrite( + TraceLoggingWriteWrapper( g_hProvider, EventWorkAreaKeyUpKey, ProjectTelemetryPrivacyDataTag(ProjectTelemetryTag_ProductAndServicePerformance), @@ -357,7 +349,7 @@ void Trace::WorkArea::KeyUp(WPARAM wParam) noexcept void Trace::WorkArea::MoveOrResizeStarted(_In_opt_ Layout* activeLayout, const LayoutAssignedWindows& layoutWindows) noexcept { auto const zoneInfo = GetZoneSetInfo(activeLayout, layoutWindows); - TraceLoggingWrite( + TraceLoggingWriteWrapper( g_hProvider, EventMoveOrResizeStartedKey, ProjectTelemetryPrivacyDataTag(ProjectTelemetryTag_ProductAndServicePerformance), @@ -370,7 +362,7 @@ void Trace::WorkArea::MoveOrResizeStarted(_In_opt_ Layout* activeLayout, const L void Trace::WorkArea::MoveOrResizeEnd(_In_opt_ Layout* activeLayout, const LayoutAssignedWindows& layoutWindows) noexcept { auto const zoneInfo = GetZoneSetInfo(activeLayout, layoutWindows); - TraceLoggingWrite( + TraceLoggingWriteWrapper( g_hProvider, EventMoveOrResizeEndedKey, ProjectTelemetryPrivacyDataTag(ProjectTelemetryTag_ProductAndServicePerformance), @@ -383,7 +375,7 @@ void Trace::WorkArea::MoveOrResizeEnd(_In_opt_ Layout* activeLayout, const Layou void Trace::WorkArea::CycleActiveZoneSet(_In_opt_ Layout* activeLayout, const LayoutAssignedWindows& layoutWindows, InputMode mode) noexcept { auto const zoneInfo = GetZoneSetInfo(activeLayout, layoutWindows); - TraceLoggingWrite( + TraceLoggingWriteWrapper( g_hProvider, EventCycleActiveZoneSetKey, ProjectTelemetryPrivacyDataTag(ProjectTelemetryTag_ProductAndServicePerformance), diff --git a/src/modules/fancyzones/FancyZonesLib/trace.h b/src/modules/fancyzones/FancyZonesLib/trace.h index 3bef5cc8c1..db4206fd1f 100644 --- a/src/modules/fancyzones/FancyZonesLib/trace.h +++ b/src/modules/fancyzones/FancyZonesLib/trace.h @@ -1,16 +1,15 @@ #pragma once +#include + struct Settings; class Layout; class LayoutAssignedWindows; -class Trace +class Trace : public telemetry::TraceBase { public: - static void RegisterProvider() noexcept; - static void UnregisterProvider() noexcept; - - class FancyZones + class FancyZones : public telemetry::TraceBase { public: static void EnableFancyZones(bool enabled) noexcept; @@ -26,7 +25,7 @@ public: static void SettingsTelemetry(const Settings& settings) noexcept; static void VirtualDesktopChanged() noexcept; - class WorkArea + class WorkArea : public telemetry::TraceBase { public: enum class InputMode diff --git a/src/modules/fancyzones/FancyZonesModuleInterface/pch.h b/src/modules/fancyzones/FancyZonesModuleInterface/pch.h index d70de4e4d4..9dc1f70972 100644 --- a/src/modules/fancyzones/FancyZonesModuleInterface/pch.h +++ b/src/modules/fancyzones/FancyZonesModuleInterface/pch.h @@ -5,7 +5,5 @@ #include #include #include -#include -#include #include #include diff --git a/src/modules/fancyzones/FancyZonesTests/UnitTests/UnitTests.vcxproj b/src/modules/fancyzones/FancyZonesTests/UnitTests/UnitTests.vcxproj index f1c2e8975e..72f540c0dc 100644 --- a/src/modules/fancyzones/FancyZonesTests/UnitTests/UnitTests.vcxproj +++ b/src/modules/fancyzones/FancyZonesTests/UnitTests/UnitTests.vcxproj @@ -1,5 +1,6 @@ - + 16.0 @@ -83,6 +84,7 @@ + diff --git a/src/modules/imageresizer/ImageResizerLib/pch.h b/src/modules/imageresizer/ImageResizerLib/pch.h index dcca9b830b..3664d7390e 100644 --- a/src/modules/imageresizer/ImageResizerLib/pch.h +++ b/src/modules/imageresizer/ImageResizerLib/pch.h @@ -13,6 +13,4 @@ #include #include -#include - #endif //PCH_H diff --git a/src/modules/imageresizer/ImageResizerLib/trace.cpp b/src/modules/imageresizer/ImageResizerLib/trace.cpp index 352af3676a..41bb080d52 100644 --- a/src/modules/imageresizer/ImageResizerLib/trace.cpp +++ b/src/modules/imageresizer/ImageResizerLib/trace.cpp @@ -1,6 +1,8 @@ #include "pch.h" #include "trace.h" +#include + TRACELOGGING_DEFINE_PROVIDER( g_hProvider, "Microsoft.PowerToys", @@ -8,19 +10,9 @@ TRACELOGGING_DEFINE_PROVIDER( (0x38e8889b, 0x9731, 0x53f5, 0xe9, 0x01, 0xe8, 0xa7, 0xc1, 0x75, 0x30, 0x74), TraceLoggingOptionProjectTelemetry()); -void Trace::RegisterProvider() noexcept -{ - TraceLoggingRegister(g_hProvider); -} - -void Trace::UnregisterProvider() noexcept -{ - TraceLoggingUnregister(g_hProvider); -} - void Trace::EnableImageResizer(_In_ bool enabled) noexcept { - TraceLoggingWrite( + TraceLoggingWriteWrapper( g_hProvider, "ImageResizer_EnableImageResizer", ProjectTelemetryPrivacyDataTag(ProjectTelemetryTag_ProductAndServicePerformance), @@ -31,7 +23,7 @@ void Trace::EnableImageResizer(_In_ bool enabled) noexcept void Trace::Invoked() noexcept { - TraceLoggingWrite( + TraceLoggingWriteWrapper( g_hProvider, "ImageResizer_Invoked", ProjectTelemetryPrivacyDataTag(ProjectTelemetryTag_ProductAndServicePerformance), @@ -40,7 +32,7 @@ void Trace::Invoked() noexcept void Trace::InvokedRet(_In_ HRESULT hr) noexcept { - TraceLoggingWrite( + TraceLoggingWriteWrapper( g_hProvider, "ImageResizer_InvokedRet", ProjectTelemetryPrivacyDataTag(ProjectTelemetryTag_ProductAndServicePerformance), @@ -50,7 +42,7 @@ void Trace::InvokedRet(_In_ HRESULT hr) noexcept void Trace::QueryContextMenuError(_In_ HRESULT hr) noexcept { - TraceLoggingWrite( + TraceLoggingWriteWrapper( g_hProvider, "ImageResizer_QueryContextMenuError", ProjectTelemetryPrivacyDataTag(ProjectTelemetryTag_ProductAndServicePerformance), diff --git a/src/modules/imageresizer/ImageResizerLib/trace.h b/src/modules/imageresizer/ImageResizerLib/trace.h index 9ff1e49f4e..a337e70b03 100644 --- a/src/modules/imageresizer/ImageResizerLib/trace.h +++ b/src/modules/imageresizer/ImageResizerLib/trace.h @@ -1,10 +1,10 @@ #pragma once -class Trace +#include + +class Trace : public telemetry::TraceBase { public: - static void RegisterProvider() noexcept; - static void UnregisterProvider() noexcept; static void EnableImageResizer(_In_ bool enabled) noexcept; static void Invoked() noexcept; static void InvokedRet(_In_ HRESULT hr) noexcept; diff --git a/src/modules/imageresizer/dll/pch.h b/src/modules/imageresizer/dll/pch.h index 4fef14e85a..a6dd9999a9 100644 --- a/src/modules/imageresizer/dll/pch.h +++ b/src/modules/imageresizer/dll/pch.h @@ -22,4 +22,3 @@ #include #include -#include diff --git a/src/modules/keyboardmanager/KeyboardManagerEditorLibrary/pch.h b/src/modules/keyboardmanager/KeyboardManagerEditorLibrary/pch.h index ffc3ff39aa..316ab36e42 100644 --- a/src/modules/keyboardmanager/KeyboardManagerEditorLibrary/pch.h +++ b/src/modules/keyboardmanager/KeyboardManagerEditorLibrary/pch.h @@ -29,8 +29,6 @@ #include #include -#include - #include //#include diff --git a/src/modules/keyboardmanager/KeyboardManagerEditorLibrary/trace.cpp b/src/modules/keyboardmanager/KeyboardManagerEditorLibrary/trace.cpp index 290b11cc41..54ec7539b1 100644 --- a/src/modules/keyboardmanager/KeyboardManagerEditorLibrary/trace.cpp +++ b/src/modules/keyboardmanager/KeyboardManagerEditorLibrary/trace.cpp @@ -1,6 +1,8 @@ #include "pch.h" #include "trace.h" +#include + TRACELOGGING_DEFINE_PROVIDER( g_hProvider, "Microsoft.PowerToys", @@ -8,20 +10,10 @@ TRACELOGGING_DEFINE_PROVIDER( (0x38e8889b, 0x9731, 0x53f5, 0xe9, 0x01, 0xe8, 0xa7, 0xc1, 0x75, 0x30, 0x74), TraceLoggingOptionProjectTelemetry()); -void Trace::RegisterProvider() noexcept -{ - TraceLoggingRegister(g_hProvider); -} - -void Trace::UnregisterProvider() noexcept -{ - TraceLoggingUnregister(g_hProvider); -} - // Log number of key remaps when the user uses Edit Keyboard and saves settings void Trace::KeyRemapCount(const DWORD keyToKeyCount, const DWORD keyToShortcutCount, const DWORD keyToTextCount) noexcept { - TraceLoggingWrite( + TraceLoggingWriteWrapper( g_hProvider, "KeyboardManager_KeyRemapCount", ProjectTelemetryPrivacyDataTag(ProjectTelemetryTag_ProductAndServicePerformance), @@ -35,7 +27,7 @@ void Trace::KeyRemapCount(const DWORD keyToKeyCount, const DWORD keyToShortcutCo // Log number of os level shortcut remaps when the user uses Edit Shortcuts and saves settings void Trace::OSLevelShortcutRemapCount(const DWORD shortcutToShortcutCount, const DWORD shortcutToKeyCount) noexcept { - TraceLoggingWrite( + TraceLoggingWriteWrapper( g_hProvider, "KeyboardManager_OSLevelShortcutRemapCount", ProjectTelemetryPrivacyDataTag(ProjectTelemetryTag_ProductAndServicePerformance), @@ -48,7 +40,7 @@ void Trace::OSLevelShortcutRemapCount(const DWORD shortcutToShortcutCount, const // Log number of app specific shortcut remaps when the user uses Edit Shortcuts and saves settings void Trace::AppSpecificShortcutRemapCount(const DWORD shortcutToShortcutCount, const DWORD shortcutToKeyCount) noexcept { - TraceLoggingWrite( + TraceLoggingWriteWrapper( g_hProvider, "KeyboardManager_AppSpecificShortcutRemapCount", ProjectTelemetryPrivacyDataTag(ProjectTelemetryTag_ProductAndServicePerformance), @@ -61,7 +53,7 @@ void Trace::AppSpecificShortcutRemapCount(const DWORD shortcutToShortcutCount, c // Log if an error occurs in KBM void Trace::Error(const DWORD errorCode, std::wstring errorMessage, std::wstring methodName) noexcept { - TraceLoggingWrite( + TraceLoggingWriteWrapper( g_hProvider, "KeyboardManager_Error", ProjectTelemetryPrivacyDataTag(ProjectTelemetryTag_ProductAndServicePerformance), diff --git a/src/modules/keyboardmanager/KeyboardManagerEditorLibrary/trace.h b/src/modules/keyboardmanager/KeyboardManagerEditorLibrary/trace.h index b91f5b625b..9c219bf8e8 100644 --- a/src/modules/keyboardmanager/KeyboardManagerEditorLibrary/trace.h +++ b/src/modules/keyboardmanager/KeyboardManagerEditorLibrary/trace.h @@ -1,11 +1,10 @@ #pragma once -class Trace +#include + +class Trace : public telemetry::TraceBase { public: - static void RegisterProvider() noexcept; - static void UnregisterProvider() noexcept; - // Log number of key remaps when the user uses Edit Keyboard and saves settings static void KeyRemapCount(const DWORD keyToKeyCount, const DWORD keyToShortcutCount, const DWORD keyToTextCount) noexcept; diff --git a/src/modules/keyboardmanager/KeyboardManagerEditorTest/pch.h b/src/modules/keyboardmanager/KeyboardManagerEditorTest/pch.h index 6364eacd48..4cf0be54c2 100644 --- a/src/modules/keyboardmanager/KeyboardManagerEditorTest/pch.h +++ b/src/modules/keyboardmanager/KeyboardManagerEditorTest/pch.h @@ -1,7 +1,6 @@ #pragma once #define WIN32_LEAN_AND_MEAN #include -#include #include #include #include diff --git a/src/modules/keyboardmanager/KeyboardManagerEngine/pch.h b/src/modules/keyboardmanager/KeyboardManagerEngine/pch.h index 472d051e25..291159e4e8 100644 --- a/src/modules/keyboardmanager/KeyboardManagerEngine/pch.h +++ b/src/modules/keyboardmanager/KeyboardManagerEngine/pch.h @@ -1,7 +1,6 @@ #pragma once #define WIN32_LEAN_AND_MEAN #include -#include #include #include #include diff --git a/src/modules/keyboardmanager/KeyboardManagerEngineLibrary/pch.h b/src/modules/keyboardmanager/KeyboardManagerEngineLibrary/pch.h index ded05a85a7..817bab9a85 100644 --- a/src/modules/keyboardmanager/KeyboardManagerEngineLibrary/pch.h +++ b/src/modules/keyboardmanager/KeyboardManagerEngineLibrary/pch.h @@ -1,7 +1,6 @@ #pragma once #define WIN32_LEAN_AND_MEAN #include -#include #include #include #include diff --git a/src/modules/keyboardmanager/KeyboardManagerEngineLibrary/trace.cpp b/src/modules/keyboardmanager/KeyboardManagerEngineLibrary/trace.cpp index fd11255283..d69323a8ed 100644 --- a/src/modules/keyboardmanager/KeyboardManagerEngineLibrary/trace.cpp +++ b/src/modules/keyboardmanager/KeyboardManagerEngineLibrary/trace.cpp @@ -2,6 +2,8 @@ #include "trace.h" #include +#include + TRACELOGGING_DEFINE_PROVIDER( g_hProvider, "Microsoft.PowerToys", @@ -9,20 +11,10 @@ TRACELOGGING_DEFINE_PROVIDER( (0x38e8889b, 0x9731, 0x53f5, 0xe9, 0x01, 0xe8, 0xa7, 0xc1, 0x75, 0x30, 0x74), TraceLoggingOptionProjectTelemetry()); -void Trace::RegisterProvider() noexcept -{ - TraceLoggingRegister(g_hProvider); -} - -void Trace::UnregisterProvider() noexcept -{ - TraceLoggingUnregister(g_hProvider); -} - // Log if a key to key remap has been invoked today. void Trace::DailyKeyToKeyRemapInvoked() noexcept { - TraceLoggingWrite( + TraceLoggingWriteWrapper( g_hProvider, "KeyboardManager_DailyKeyToKeyRemapInvoked", ProjectTelemetryPrivacyDataTag(ProjectTelemetryTag_ProductAndServicePerformance), @@ -32,7 +24,7 @@ void Trace::DailyKeyToKeyRemapInvoked() noexcept // Log if a key to shortcut remap has been invoked today. void Trace::DailyKeyToShortcutRemapInvoked() noexcept { - TraceLoggingWrite( + TraceLoggingWriteWrapper( g_hProvider, "KeyboardManager_DailyKeyToShortcutRemapInvoked", ProjectTelemetryPrivacyDataTag(ProjectTelemetryTag_ProductAndServicePerformance), @@ -42,7 +34,7 @@ void Trace::DailyKeyToShortcutRemapInvoked() noexcept // Log if a shortcut to key remap has been invoked today. void Trace::DailyShortcutToKeyRemapInvoked() noexcept { - TraceLoggingWrite( + TraceLoggingWriteWrapper( g_hProvider, "KeyboardManager_DailyShortcutToKeyRemapInvoked", ProjectTelemetryPrivacyDataTag(ProjectTelemetryTag_ProductAndServicePerformance), @@ -52,7 +44,7 @@ void Trace::DailyShortcutToKeyRemapInvoked() noexcept // Log if a shortcut to shortcut remap has been invoked today. void Trace::DailyShortcutToShortcutRemapInvoked() noexcept { - TraceLoggingWrite( + TraceLoggingWriteWrapper( g_hProvider, "KeyboardManager_DailyShortcutToShortcutRemapInvoked", ProjectTelemetryPrivacyDataTag(ProjectTelemetryTag_ProductAndServicePerformance), @@ -62,7 +54,7 @@ void Trace::DailyShortcutToShortcutRemapInvoked() noexcept // Log if an app specific shortcut to key remap has been invoked today. void Trace::DailyAppSpecificShortcutToKeyRemapInvoked() noexcept { - TraceLoggingWrite( + TraceLoggingWriteWrapper( g_hProvider, "KeyboardManager_DailyAppSpecificShortcutToKeyRemapInvoked", ProjectTelemetryPrivacyDataTag(ProjectTelemetryTag_ProductAndServicePerformance), @@ -72,7 +64,7 @@ void Trace::DailyAppSpecificShortcutToKeyRemapInvoked() noexcept // Log if an app specific shortcut to shortcut remap has been invoked today. void Trace::DailyAppSpecificShortcutToShortcutRemapInvoked() noexcept { - TraceLoggingWrite( + TraceLoggingWriteWrapper( g_hProvider, "KeyboardManager_DailyAppSpecificShortcutToShortcutRemapInvoked", ProjectTelemetryPrivacyDataTag(ProjectTelemetryTag_ProductAndServicePerformance), @@ -84,7 +76,7 @@ void Trace::KeyRemapInvoked(bool isKeyToKey) noexcept { if (isKeyToKey) { - TraceLoggingWrite( + TraceLoggingWriteWrapper( g_hProvider, "KeyboardManager_KeyToKeyRemapInvoked", ProjectTelemetryPrivacyDataTag(ProjectTelemetryTag_ProductAndServicePerformance), @@ -92,7 +84,7 @@ void Trace::KeyRemapInvoked(bool isKeyToKey) noexcept } else { - TraceLoggingWrite( + TraceLoggingWriteWrapper( g_hProvider, "KeyboardManager_KeyToShortcutRemapInvoked", ProjectTelemetryPrivacyDataTag(ProjectTelemetryTag_ProductAndServicePerformance), @@ -107,7 +99,7 @@ void Trace::ShortcutRemapInvoked(bool isShortcutToShortcut, bool isAppSpecific) { if (isShortcutToShortcut) { - TraceLoggingWrite( + TraceLoggingWriteWrapper( g_hProvider, "KeyboardManager_AppSpecificShortcutToShortcutRemapInvoked", ProjectTelemetryPrivacyDataTag(ProjectTelemetryTag_ProductAndServicePerformance), @@ -115,7 +107,7 @@ void Trace::ShortcutRemapInvoked(bool isShortcutToShortcut, bool isAppSpecific) } else { - TraceLoggingWrite( + TraceLoggingWriteWrapper( g_hProvider, "KeyboardManager_AppSpecificShortcutToKeyRemapInvoked", ProjectTelemetryPrivacyDataTag(ProjectTelemetryTag_ProductAndServicePerformance), @@ -126,7 +118,7 @@ void Trace::ShortcutRemapInvoked(bool isShortcutToShortcut, bool isAppSpecific) { if (isShortcutToShortcut) { - TraceLoggingWrite( + TraceLoggingWriteWrapper( g_hProvider, "KeyboardManager_OSLevelShortcutToShortcutRemapInvoked", ProjectTelemetryPrivacyDataTag(ProjectTelemetryTag_ProductAndServicePerformance), @@ -134,7 +126,7 @@ void Trace::ShortcutRemapInvoked(bool isShortcutToShortcut, bool isAppSpecific) } else { - TraceLoggingWrite( + TraceLoggingWriteWrapper( g_hProvider, "KeyboardManager_OSLevelShortcutToKeyRemapInvoked", ProjectTelemetryPrivacyDataTag(ProjectTelemetryTag_ProductAndServicePerformance), @@ -184,7 +176,7 @@ void Trace::SendKeyAndShortcutRemapLoadedConfiguration(State& remappings) noexce if (keyRemap.second.index() == 0) // 0 - Remapping to key { DWORD keyRemappedTo = std::get(keyRemap.second); - TraceLoggingWrite( + TraceLoggingWriteWrapper( g_hProvider, "KeyboardManager_KeyRemapConfigurationLoaded", ProjectTelemetryPrivacyDataTag(ProjectTelemetryTag_ProductAndServicePerformance), @@ -198,7 +190,7 @@ void Trace::SendKeyAndShortcutRemapLoadedConfiguration(State& remappings) noexce else if (keyRemap.second.index() == 1) // 1 - Remapping to shortcut { Shortcut shortcutRemappedTo = std::get(keyRemap.second); - TraceLoggingWrite( + TraceLoggingWriteWrapper( g_hProvider, "KeyboardManager_KeyRemapConfigurationLoaded", ProjectTelemetryPrivacyDataTag(ProjectTelemetryTag_ProductAndServicePerformance), @@ -221,7 +213,7 @@ void Trace::SendKeyAndShortcutRemapLoadedConfiguration(State& remappings) noexce if (shortcutRemap.second.targetShortcut.index() == 0) // 0 - Remapping to key { DWORD keyRemappedTo = std::get(shortcutRemap.second.targetShortcut); - TraceLoggingWrite( + TraceLoggingWriteWrapper( g_hProvider, "KeyboardManager_ShortcutRemapConfigurationLoaded", ProjectTelemetryPrivacyDataTag(ProjectTelemetryTag_ProductAndServicePerformance), @@ -245,7 +237,7 @@ void Trace::SendKeyAndShortcutRemapLoadedConfiguration(State& remappings) noexce // Don't include Start app or Open URI mappings in this telemetry. continue; } - TraceLoggingWrite( + TraceLoggingWriteWrapper( g_hProvider, "KeyboardManager_ShortcutRemapConfigurationLoaded", ProjectTelemetryPrivacyDataTag(ProjectTelemetryTag_ProductAndServicePerformance), @@ -277,7 +269,7 @@ void Trace::SendKeyAndShortcutRemapLoadedConfiguration(State& remappings) noexce if (shortcutRemap.second.targetShortcut.index() == 0) // 0 - Remapping to key { DWORD keyRemappedTo = std::get(shortcutRemap.second.targetShortcut); - TraceLoggingWrite( + TraceLoggingWriteWrapper( g_hProvider, "KeyboardManager_AppSpecificShortcutRemapConfigurationLoaded", ProjectTelemetryPrivacyDataTag(ProjectTelemetryTag_ProductAndServicePerformance), @@ -303,7 +295,7 @@ void Trace::SendKeyAndShortcutRemapLoadedConfiguration(State& remappings) noexce // Don't include Start app or Open URI mappings in this telemetry. continue; } - TraceLoggingWrite( + TraceLoggingWriteWrapper( g_hProvider, "KeyboardManager_AppSpecificShortcutRemapConfigurationLoaded", ProjectTelemetryPrivacyDataTag(ProjectTelemetryTag_ProductAndServicePerformance), @@ -332,7 +324,7 @@ void Trace::SendKeyAndShortcutRemapLoadedConfiguration(State& remappings) noexce // Log an error while trying to send remappings telemetry. void Trace::ErrorSendingKeyAndShortcutRemapLoadedConfiguration() noexcept { - TraceLoggingWrite( + TraceLoggingWriteWrapper( g_hProvider, "KeyboardManager_ErrorSendingKeyAndShortcutRemapLoadedConfiguration", ProjectTelemetryPrivacyDataTag(ProjectTelemetryTag_ProductAndServicePerformance), @@ -343,7 +335,7 @@ void Trace::ErrorSendingKeyAndShortcutRemapLoadedConfiguration() noexcept // Log if an error occurs in KBM void Trace::Error(const DWORD errorCode, std::wstring errorMessage, std::wstring methodName) noexcept { - TraceLoggingWrite( + TraceLoggingWriteWrapper( g_hProvider, "KeyboardManager_Error", ProjectTelemetryPrivacyDataTag(ProjectTelemetryTag_ProductAndServicePerformance), diff --git a/src/modules/keyboardmanager/KeyboardManagerEngineLibrary/trace.h b/src/modules/keyboardmanager/KeyboardManagerEngineLibrary/trace.h index 9408a38e0e..8a91eef9c4 100644 --- a/src/modules/keyboardmanager/KeyboardManagerEngineLibrary/trace.h +++ b/src/modules/keyboardmanager/KeyboardManagerEngineLibrary/trace.h @@ -2,12 +2,11 @@ #include "State.h" -class Trace +#include + +class Trace : public telemetry::TraceBase { public: - static void RegisterProvider() noexcept; - static void UnregisterProvider() noexcept; - // Log if a key to key remap has been invoked today. static void DailyKeyToKeyRemapInvoked() noexcept; diff --git a/src/modules/keyboardmanager/KeyboardManagerEngineTest/pch.h b/src/modules/keyboardmanager/KeyboardManagerEngineTest/pch.h index 6364eacd48..4cf0be54c2 100644 --- a/src/modules/keyboardmanager/KeyboardManagerEngineTest/pch.h +++ b/src/modules/keyboardmanager/KeyboardManagerEngineTest/pch.h @@ -1,7 +1,6 @@ #pragma once #define WIN32_LEAN_AND_MEAN #include -#include #include #include #include diff --git a/src/modules/keyboardmanager/common/pch.h b/src/modules/keyboardmanager/common/pch.h index e01018e71e..48c81b6caf 100644 --- a/src/modules/keyboardmanager/common/pch.h +++ b/src/modules/keyboardmanager/common/pch.h @@ -6,4 +6,3 @@ #include #include #include -#include \ No newline at end of file diff --git a/src/modules/keyboardmanager/dll/pch.h b/src/modules/keyboardmanager/dll/pch.h index c4c30cb1ea..350550e299 100644 --- a/src/modules/keyboardmanager/dll/pch.h +++ b/src/modules/keyboardmanager/dll/pch.h @@ -1,7 +1,6 @@ #pragma once #define WIN32_LEAN_AND_MEAN #include -#include #include #include #include diff --git a/src/modules/keyboardmanager/dll/trace.cpp b/src/modules/keyboardmanager/dll/trace.cpp index 798204cae8..82057baefb 100644 --- a/src/modules/keyboardmanager/dll/trace.cpp +++ b/src/modules/keyboardmanager/dll/trace.cpp @@ -1,6 +1,8 @@ #include "pch.h" #include "trace.h" +#include + TRACELOGGING_DEFINE_PROVIDER( g_hProvider, "Microsoft.PowerToys", @@ -8,20 +10,10 @@ TRACELOGGING_DEFINE_PROVIDER( (0x38e8889b, 0x9731, 0x53f5, 0xe9, 0x01, 0xe8, 0xa7, 0xc1, 0x75, 0x30, 0x74), TraceLoggingOptionProjectTelemetry()); -void Trace::RegisterProvider() noexcept -{ - TraceLoggingRegister(g_hProvider); -} - -void Trace::UnregisterProvider() noexcept -{ - TraceLoggingUnregister(g_hProvider); -} - // Log if the user has KBM enabled or disabled - Can also be used to see how often users have to restart the keyboard hook void Trace::EnableKeyboardManager(const bool enabled) noexcept { - TraceLoggingWrite( + TraceLoggingWriteWrapper( g_hProvider, "KeyboardManager_EnableKeyboardManager", ProjectTelemetryPrivacyDataTag(ProjectTelemetryTag_ProductAndServicePerformance), diff --git a/src/modules/keyboardmanager/dll/trace.h b/src/modules/keyboardmanager/dll/trace.h index fab670a364..55e5ff6867 100644 --- a/src/modules/keyboardmanager/dll/trace.h +++ b/src/modules/keyboardmanager/dll/trace.h @@ -1,11 +1,10 @@ #pragma once -class Trace +#include + +class Trace : public telemetry::TraceBase { public: - static void RegisterProvider() noexcept; - static void UnregisterProvider() noexcept; - // Log if the user has KBM enabled or disabled - Can also be used to see how often users have to restart the keyboard hook static void EnableKeyboardManager(const bool enabled) noexcept; }; diff --git a/src/modules/launcher/Microsoft.Launcher/Microsoft.Launcher.vcxproj b/src/modules/launcher/Microsoft.Launcher/Microsoft.Launcher.vcxproj index fc1f8a1c85..8dc2df71bf 100644 --- a/src/modules/launcher/Microsoft.Launcher/Microsoft.Launcher.vcxproj +++ b/src/modules/launcher/Microsoft.Launcher/Microsoft.Launcher.vcxproj @@ -1,5 +1,6 @@ - + @@ -46,14 +47,12 @@ - Create - diff --git a/src/modules/launcher/Microsoft.Launcher/Microsoft.Launcher.vcxproj.filters b/src/modules/launcher/Microsoft.Launcher/Microsoft.Launcher.vcxproj.filters index 81c3649d1e..5e8c2b6605 100644 --- a/src/modules/launcher/Microsoft.Launcher/Microsoft.Launcher.vcxproj.filters +++ b/src/modules/launcher/Microsoft.Launcher/Microsoft.Launcher.vcxproj.filters @@ -3,11 +3,9 @@ - - Generated Files diff --git a/src/modules/launcher/Microsoft.Launcher/dllmain.cpp b/src/modules/launcher/Microsoft.Launcher/dllmain.cpp index e140fb728e..99c492c394 100644 --- a/src/modules/launcher/Microsoft.Launcher/dllmain.cpp +++ b/src/modules/launcher/Microsoft.Launcher/dllmain.cpp @@ -2,7 +2,6 @@ #include #include #include -#include "trace.h" #include "Generated Files/resource.h" #include #include @@ -34,13 +33,11 @@ BOOL APIENTRY DllMain(HMODULE /*hModule*/, DWORD ul_reason_for_call, LPVOID /*lp switch (ul_reason_for_call) { case DLL_PROCESS_ATTACH: - Trace::RegisterProvider(); break; case DLL_THREAD_ATTACH: case DLL_THREAD_DETACH: break; case DLL_PROCESS_DETACH: - Trace::UnregisterProvider(); break; } diff --git a/src/modules/launcher/Microsoft.Launcher/pch.h b/src/modules/launcher/Microsoft.Launcher/pch.h index 46fc911b44..c7e646b15e 100644 --- a/src/modules/launcher/Microsoft.Launcher/pch.h +++ b/src/modules/launcher/Microsoft.Launcher/pch.h @@ -3,6 +3,5 @@ #include #include #include -#include #include #include \ No newline at end of file diff --git a/src/modules/launcher/Microsoft.Launcher/trace.cpp b/src/modules/launcher/Microsoft.Launcher/trace.cpp deleted file mode 100644 index 3e5c2083a9..0000000000 --- a/src/modules/launcher/Microsoft.Launcher/trace.cpp +++ /dev/null @@ -1,17 +0,0 @@ -#include "pch.h" -#include "trace.h" - -TRACELOGGING_DEFINE_PROVIDER( - g_hProvider, - "Microsoft.PowerToys", - // {38e8889b-9731-53f5-e901-e8a7c1753074} - (0x38e8889b, 0x9731, 0x53f5, 0xe9, 0x01, 0xe8, 0xa7, 0xc1, 0x75, 0x30, 0x74), - TraceLoggingOptionProjectTelemetry()); - -void Trace::RegisterProvider() { - TraceLoggingRegister(g_hProvider); -} - -void Trace::UnregisterProvider() { - TraceLoggingUnregister(g_hProvider); -} diff --git a/src/modules/launcher/Microsoft.Launcher/trace.h b/src/modules/launcher/Microsoft.Launcher/trace.h deleted file mode 100644 index 1a260e8824..0000000000 --- a/src/modules/launcher/Microsoft.Launcher/trace.h +++ /dev/null @@ -1,7 +0,0 @@ -#pragma once - -class Trace { -public: - static void RegisterProvider(); - static void UnregisterProvider(); -}; diff --git a/src/modules/peek/peek/pch.h b/src/modules/peek/peek/pch.h index eddac0fdc1..329705f63b 100644 --- a/src/modules/peek/peek/pch.h +++ b/src/modules/peek/peek/pch.h @@ -2,6 +2,5 @@ #include #include #include -#include #include #include \ No newline at end of file diff --git a/src/modules/peek/peek/trace.cpp b/src/modules/peek/peek/trace.cpp index 1089b41ef8..529abb94f3 100644 --- a/src/modules/peek/peek/trace.cpp +++ b/src/modules/peek/peek/trace.cpp @@ -1,6 +1,8 @@ #include "pch.h" #include "trace.h" +#include + TRACELOGGING_DEFINE_PROVIDER( g_hProvider, "Microsoft.PowerToys", @@ -8,20 +10,10 @@ TRACELOGGING_DEFINE_PROVIDER( (0x38e8889b, 0x9731, 0x53f5, 0xe9, 0x01, 0xe8, 0xa7, 0xc1, 0x75, 0x30, 0x74), TraceLoggingOptionProjectTelemetry()); -void Trace::RegisterProvider() -{ - TraceLoggingRegister(g_hProvider); -} - -void Trace::UnregisterProvider() -{ - TraceLoggingUnregister(g_hProvider); -} - // Log if the user has Peek enabled or disabled void Trace::EnablePeek(const bool enabled) noexcept { - TraceLoggingWrite( + TraceLoggingWriteWrapper( g_hProvider, "Peek_EnablePeek", ProjectTelemetryPrivacyDataTag(ProjectTelemetryTag_ProductAndServicePerformance), @@ -32,7 +24,7 @@ void Trace::EnablePeek(const bool enabled) noexcept // Log if the user has invoked Peek void Trace::PeekInvoked() noexcept { - TraceLoggingWrite( + TraceLoggingWriteWrapper( g_hProvider, "Peek_InvokePeek", ProjectTelemetryPrivacyDataTag(ProjectTelemetryTag_ProductAndServicePerformance), @@ -49,7 +41,7 @@ void Trace::SettingsTelemetry(PowertoyModuleIface::Hotkey& hotkey) noexcept std::wstring(hotkey.alt ? L"Alt + " : L"") + std::wstring(L"VK ") + std::to_wstring(hotkey.key); - TraceLoggingWrite( + TraceLoggingWriteWrapper( g_hProvider, "Peek_Settings", ProjectTelemetryPrivacyDataTag(ProjectTelemetryTag_ProductAndServicePerformance), diff --git a/src/modules/peek/peek/trace.h b/src/modules/peek/peek/trace.h index 49cd45c32c..c250fc6b45 100644 --- a/src/modules/peek/peek/trace.h +++ b/src/modules/peek/peek/trace.h @@ -1,12 +1,11 @@ #pragma once #include -class Trace +#include + +class Trace : public telemetry::TraceBase { public: - static void RegisterProvider(); - static void UnregisterProvider(); - // Log if the user has Peek enabled or disabled static void EnablePeek(const bool enabled) noexcept; diff --git a/src/modules/poweraccent/PowerAccentModuleInterface/pch.h b/src/modules/poweraccent/PowerAccentModuleInterface/pch.h index eddac0fdc1..329705f63b 100644 --- a/src/modules/poweraccent/PowerAccentModuleInterface/pch.h +++ b/src/modules/poweraccent/PowerAccentModuleInterface/pch.h @@ -2,6 +2,5 @@ #include #include #include -#include #include #include \ No newline at end of file diff --git a/src/modules/poweraccent/PowerAccentModuleInterface/trace.cpp b/src/modules/poweraccent/PowerAccentModuleInterface/trace.cpp index c5f15cc216..8a063ea99f 100644 --- a/src/modules/poweraccent/PowerAccentModuleInterface/trace.cpp +++ b/src/modules/poweraccent/PowerAccentModuleInterface/trace.cpp @@ -1,6 +1,8 @@ #include "pch.h" #include "trace.h" +#include + TRACELOGGING_DEFINE_PROVIDER( g_hProvider, "Microsoft.PowerToys", @@ -8,19 +10,9 @@ TRACELOGGING_DEFINE_PROVIDER( (0x38e8889b, 0x9731, 0x53f5, 0xe9, 0x01, 0xe8, 0xa7, 0xc1, 0x75, 0x30, 0x74), TraceLoggingOptionProjectTelemetry()); -void Trace::RegisterProvider() -{ - TraceLoggingRegister(g_hProvider); -} - -void Trace::UnregisterProvider() -{ - TraceLoggingUnregister(g_hProvider); -} - void Trace::EnablePowerAccent(const bool enabled) noexcept { - TraceLoggingWrite( + TraceLoggingWriteWrapper( g_hProvider, "PowerAccent_EnablePowerAccent", ProjectTelemetryPrivacyDataTag(ProjectTelemetryTag_ProductAndServicePerformance), diff --git a/src/modules/poweraccent/PowerAccentModuleInterface/trace.h b/src/modules/poweraccent/PowerAccentModuleInterface/trace.h index 42b812f535..4d729f7683 100644 --- a/src/modules/poweraccent/PowerAccentModuleInterface/trace.h +++ b/src/modules/poweraccent/PowerAccentModuleInterface/trace.h @@ -1,11 +1,10 @@ #pragma once -class Trace +#include + +class Trace : public telemetry::TraceBase { public: - static void RegisterProvider(); - static void UnregisterProvider(); - // Log if the user has PowerAccent enabled or disabled static void EnablePowerAccent(const bool enabled) noexcept; }; diff --git a/src/modules/powerrename/lib/pch.h b/src/modules/powerrename/lib/pch.h index 7a12102fbe..c5a4711a03 100644 --- a/src/modules/powerrename/lib/pch.h +++ b/src/modules/powerrename/lib/pch.h @@ -29,6 +29,4 @@ #include #include -#include - #include diff --git a/src/modules/powerrename/lib/trace.cpp b/src/modules/powerrename/lib/trace.cpp index f04a085df0..37eefacc38 100644 --- a/src/modules/powerrename/lib/trace.cpp +++ b/src/modules/powerrename/lib/trace.cpp @@ -2,6 +2,8 @@ #include "trace.h" #include "Settings.h" +#include + TRACELOGGING_DEFINE_PROVIDER( g_hProvider, "Microsoft.PowerToys", @@ -9,19 +11,9 @@ TRACELOGGING_DEFINE_PROVIDER( (0x38e8889b, 0x9731, 0x53f5, 0xe9, 0x01, 0xe8, 0xa7, 0xc1, 0x75, 0x30, 0x74), TraceLoggingOptionProjectTelemetry()); -void Trace::RegisterProvider() noexcept -{ - TraceLoggingRegister(g_hProvider); -} - -void Trace::UnregisterProvider() noexcept -{ - TraceLoggingUnregister(g_hProvider); -} - void Trace::Invoked() noexcept { - TraceLoggingWrite( + TraceLoggingWriteWrapper( g_hProvider, "PowerRename_Invoked", ProjectTelemetryPrivacyDataTag(ProjectTelemetryTag_ProductAndServicePerformance), @@ -30,7 +22,7 @@ void Trace::Invoked() noexcept void Trace::InvokedRet(_In_ HRESULT hr) noexcept { - TraceLoggingWrite( + TraceLoggingWriteWrapper( g_hProvider, "PowerRename_InvokedRet", ProjectTelemetryPrivacyDataTag(ProjectTelemetryTag_ProductAndServicePerformance), @@ -40,7 +32,7 @@ void Trace::InvokedRet(_In_ HRESULT hr) noexcept void Trace::EnablePowerRename(_In_ bool enabled) noexcept { - TraceLoggingWrite( + TraceLoggingWriteWrapper( g_hProvider, "PowerRename_EnablePowerRename", ProjectTelemetryPrivacyDataTag(ProjectTelemetryTag_ProductAndServicePerformance), @@ -50,7 +42,7 @@ void Trace::EnablePowerRename(_In_ bool enabled) noexcept void Trace::UIShownRet(_In_ HRESULT hr) noexcept { - TraceLoggingWrite( + TraceLoggingWriteWrapper( g_hProvider, "PowerRename_UIShownRet", ProjectTelemetryPrivacyDataTag(ProjectTelemetryTag_ProductAndServicePerformance), @@ -60,7 +52,7 @@ void Trace::UIShownRet(_In_ HRESULT hr) noexcept void Trace::RenameOperation(_In_ UINT totalItemCount, _In_ UINT selectedItemCount, _In_ UINT renameItemCount, _In_ DWORD flags, _In_ PCWSTR extensionList) noexcept { - TraceLoggingWrite( + TraceLoggingWriteWrapper( g_hProvider, "PowerRename_RenameOperation", ProjectTelemetryPrivacyDataTag(ProjectTelemetryTag_ProductAndServicePerformance), @@ -74,7 +66,7 @@ void Trace::RenameOperation(_In_ UINT totalItemCount, _In_ UINT selectedItemCoun void Trace::SettingsChanged() noexcept { - TraceLoggingWrite( + TraceLoggingWriteWrapper( g_hProvider, "PowerRename_SettingsChanged", ProjectTelemetryPrivacyDataTag(ProjectTelemetryTag_ProductAndServicePerformance), diff --git a/src/modules/powerrename/lib/trace.h b/src/modules/powerrename/lib/trace.h index 9019c9c8ae..0a3a0af246 100644 --- a/src/modules/powerrename/lib/trace.h +++ b/src/modules/powerrename/lib/trace.h @@ -1,9 +1,9 @@ #pragma once -class Trace { +#include + +class Trace : public telemetry::TraceBase { public: - static void RegisterProvider() noexcept; - static void UnregisterProvider() noexcept; static void Invoked() noexcept; static void InvokedRet(_In_ HRESULT hr) noexcept; static void EnablePowerRename(_In_ bool enabled) noexcept; diff --git a/src/modules/previewpane/powerpreview/pch.h b/src/modules/previewpane/powerpreview/pch.h index cace4c2c94..2f130e79fa 100644 --- a/src/modules/previewpane/powerpreview/pch.h +++ b/src/modules/previewpane/powerpreview/pch.h @@ -4,5 +4,4 @@ #include #include #include -#include diff --git a/src/modules/previewpane/powerpreview/powerpreview.cpp b/src/modules/previewpane/powerpreview/powerpreview.cpp index 1eef1f0398..84d2a590dc 100644 --- a/src/modules/previewpane/powerpreview/powerpreview.cpp +++ b/src/modules/previewpane/powerpreview/powerpreview.cpp @@ -6,7 +6,6 @@ #include #include -#include #include #include #include diff --git a/src/modules/previewpane/powerpreview/trace.cpp b/src/modules/previewpane/powerpreview/trace.cpp index 903ecff487..d9273f130f 100644 --- a/src/modules/previewpane/powerpreview/trace.cpp +++ b/src/modules/previewpane/powerpreview/trace.cpp @@ -2,6 +2,8 @@ #include "trace.h" #include +#include + /* * * This file captures the telemetry for the File Explorer Custom Renders project. @@ -19,19 +21,9 @@ TRACELOGGING_DEFINE_PROVIDER( (0x38e8889b, 0x9731, 0x53f5, 0xe9, 0x01, 0xe8, 0xa7, 0xc1, 0x75, 0x30, 0x74), TraceLoggingOptionProjectTelemetry()); -void Trace::RegisterProvider() -{ - TraceLoggingRegister(g_hProvider); -} - -void Trace::UnregisterProvider() -{ - TraceLoggingUnregister(g_hProvider); -} - void Trace::EnabledPowerPreview(bool enabled) { - TraceLoggingWrite( + TraceLoggingWriteWrapper( g_hProvider, "PowerPreview_Enabled", TraceLoggingBoolean(enabled, "Enabled"), @@ -42,7 +34,7 @@ void Trace::EnabledPowerPreview(bool enabled) void Trace::PowerPreviewSettingsUpdated(LPCWSTR SettingsName, bool oldState, bool newState, bool globalState) { - TraceLoggingWrite( + TraceLoggingWriteWrapper( g_hProvider, "PowerPreview_TweakUISettings_SuccessfullyUpdatedSettings", TraceLoggingWideString(SettingsName, "Previewer_Settings_Name"), @@ -56,7 +48,7 @@ void Trace::PowerPreviewSettingsUpdated(LPCWSTR SettingsName, bool oldState, boo void Trace::PowerPreviewSettingsUpdateFailed(LPCWSTR SettingsName, bool oldState, bool newState, bool globalState) { - TraceLoggingWrite( + TraceLoggingWriteWrapper( g_hProvider, "PowerPreview_TweakUISettings_FailedUpdatingSettings", TraceLoggingWideString(SettingsName, "Previewer_Settings_Name"), @@ -70,7 +62,7 @@ void Trace::PowerPreviewSettingsUpdateFailed(LPCWSTR SettingsName, bool oldState void Trace::SetConfigInvalidJSON(const char* exceptionMessage) { - TraceLoggingWrite( + TraceLoggingWriteWrapper( g_hProvider, "PowerPreview_TweakUISettings_SetConfig__InvalidJSONGiven", TraceLoggingString(exceptionMessage, "ExceptionMessage"), @@ -81,7 +73,7 @@ void Trace::SetConfigInvalidJSON(const char* exceptionMessage) void Trace::Destroyed() { - TraceLoggingWrite( + TraceLoggingWriteWrapper( g_hProvider, "PowerPreview_TweakUISettings_Destroyed", ProjectTelemetryPrivacyDataTag(ProjectTelemetryTag_ProductAndServicePerformance), @@ -91,7 +83,7 @@ void Trace::Destroyed() void Trace::InitSetErrorLoadingFile(const char* exceptionMessage) { - TraceLoggingWrite( + TraceLoggingWriteWrapper( g_hProvider, "PowerPreview_TweakUISettings_InitSet__ErrorLoadingFile", TraceLoggingString(exceptionMessage, "ExceptionMessage"), diff --git a/src/modules/previewpane/powerpreview/trace.h b/src/modules/previewpane/powerpreview/trace.h index 6899bcdec1..8cd33fee52 100644 --- a/src/modules/previewpane/powerpreview/trace.h +++ b/src/modules/previewpane/powerpreview/trace.h @@ -1,10 +1,10 @@ #pragma once -class Trace +#include + +class Trace : public telemetry::TraceBase { public: - static void RegisterProvider(); - static void UnregisterProvider(); static void SetConfigInvalidJSON(const char* exceptionMessage); static void InitSetErrorLoadingFile(const char* exceptionMessage); static void EnabledPowerPreview(bool enabled); diff --git a/src/modules/registrypreview/RegistryPreviewExt/Trace.cpp b/src/modules/registrypreview/RegistryPreviewExt/Trace.cpp index 7dda85e43e..870669606b 100644 --- a/src/modules/registrypreview/RegistryPreviewExt/Trace.cpp +++ b/src/modules/registrypreview/RegistryPreviewExt/Trace.cpp @@ -1,6 +1,8 @@ #include "pch.h" #include "trace.h" +#include + TRACELOGGING_DEFINE_PROVIDER( g_hProvider, "Microsoft.PowerToys", @@ -8,20 +10,10 @@ TRACELOGGING_DEFINE_PROVIDER( (0x38e8889b, 0x9731, 0x53f5, 0xe9, 0x01, 0xe8, 0xa7, 0xc1, 0x75, 0x30, 0x74), TraceLoggingOptionProjectTelemetry()); -void Trace::RegisterProvider() -{ - TraceLoggingRegister(g_hProvider); -} - -void Trace::UnregisterProvider() -{ - TraceLoggingUnregister(g_hProvider); -} - // Log if the user has enabled or disabled the app void Trace::EnableRegistryPreview(_In_ bool enabled) noexcept { - TraceLoggingWrite( + TraceLoggingWriteWrapper( g_hProvider, "RegistryPreview_EnableRegistryPreview", ProjectTelemetryPrivacyDataTag(ProjectTelemetryTag_ProductAndServicePerformance), @@ -32,7 +24,7 @@ void Trace::EnableRegistryPreview(_In_ bool enabled) noexcept // Log that the user tried to activate the app void Trace::ActivateEditor() noexcept { - TraceLoggingWrite( + TraceLoggingWriteWrapper( g_hProvider, "RegistryPreview_Activate", ProjectTelemetryPrivacyDataTag(ProjectTelemetryTag_ProductAndServicePerformance), diff --git a/src/modules/registrypreview/RegistryPreviewExt/Trace.h b/src/modules/registrypreview/RegistryPreviewExt/Trace.h index d2cda345d8..7e08386e9c 100644 --- a/src/modules/registrypreview/RegistryPreviewExt/Trace.h +++ b/src/modules/registrypreview/RegistryPreviewExt/Trace.h @@ -1,11 +1,10 @@ #pragma once -class Trace +#include + +class Trace : public telemetry::TraceBase { public: - static void RegisterProvider(); - static void UnregisterProvider(); - // Log if the user has enabled or disabled the app static void EnableRegistryPreview(const bool enabled) noexcept; diff --git a/src/modules/registrypreview/RegistryPreviewExt/pch.h b/src/modules/registrypreview/RegistryPreviewExt/pch.h index be72eb015e..6b4ad38c10 100644 --- a/src/modules/registrypreview/RegistryPreviewExt/pch.h +++ b/src/modules/registrypreview/RegistryPreviewExt/pch.h @@ -9,7 +9,6 @@ #include -#include #include //#include #include diff --git a/src/modules/videoconference/VideoConferenceModule/pch.h b/src/modules/videoconference/VideoConferenceModule/pch.h index 3f4849aa44..7c614d9a5c 100644 --- a/src/modules/videoconference/VideoConferenceModule/pch.h +++ b/src/modules/videoconference/VideoConferenceModule/pch.h @@ -21,5 +21,3 @@ #include #include - -#include diff --git a/src/modules/videoconference/VideoConferenceModule/trace.cpp b/src/modules/videoconference/VideoConferenceModule/trace.cpp index 889cca2a15..043c6b30e7 100644 --- a/src/modules/videoconference/VideoConferenceModule/trace.cpp +++ b/src/modules/videoconference/VideoConferenceModule/trace.cpp @@ -2,6 +2,8 @@ #include "trace.h" +#include + TRACELOGGING_DEFINE_PROVIDER( g_hProvider, "Microsoft.PowerToys", @@ -9,20 +11,10 @@ TRACELOGGING_DEFINE_PROVIDER( (0x38e8889b, 0x9731, 0x53f5, 0xe9, 0x01, 0xe8, 0xa7, 0xc1, 0x75, 0x30, 0x74), TraceLoggingOptionProjectTelemetry()); -void Trace::RegisterProvider() noexcept -{ - TraceLoggingRegister(g_hProvider); -} - -void Trace::UnregisterProvider() noexcept -{ - TraceLoggingUnregister(g_hProvider); -} - // Log if the user has VCM enabled or disabled void Trace::EnableVideoConference(const bool enabled) noexcept { - TraceLoggingWrite( + TraceLoggingWriteWrapper( g_hProvider, "VideoConference_EnableVideoConference", ProjectTelemetryPrivacyDataTag(ProjectTelemetryTag_ProductAndServicePerformance), @@ -34,7 +26,7 @@ void Trace::SettingsChanged(const struct VideoConferenceSettings& settings) noex { bool CustomOverlayImage = (settings.imageOverlayPath.length() > 0); - TraceLoggingWrite( + TraceLoggingWriteWrapper( g_hProvider, "VideoConference_SettingsChanged", TraceLoggingWideString(settings.toolbarPositionString.c_str(), "ToolbarPosition"), @@ -47,7 +39,7 @@ void Trace::SettingsChanged(const struct VideoConferenceSettings& settings) noex void Trace::MicrophoneMuted() noexcept { - TraceLoggingWrite( + TraceLoggingWriteWrapper( g_hProvider, "VideoConference_MicrophoneMuted", TraceLoggingBoolean(true, "MicrophoneMuted"), @@ -58,7 +50,7 @@ void Trace::MicrophoneMuted() noexcept void Trace::CameraMuted() noexcept { - TraceLoggingWrite( + TraceLoggingWriteWrapper( g_hProvider, "VideoConference_CameraMuted", TraceLoggingBoolean(true, "CameraMuted"), diff --git a/src/modules/videoconference/VideoConferenceModule/trace.h b/src/modules/videoconference/VideoConferenceModule/trace.h index 5d42709be2..0a9f193e69 100644 --- a/src/modules/videoconference/VideoConferenceModule/trace.h +++ b/src/modules/videoconference/VideoConferenceModule/trace.h @@ -1,11 +1,11 @@ #pragma once #include "VideoConferenceModule.h" -class Trace +#include + +class Trace : public telemetry::TraceBase { public: - static void RegisterProvider() noexcept; - static void UnregisterProvider() noexcept; static void EnableVideoConference(const bool enabled) noexcept; static void SettingsChanged(const struct VideoConferenceSettings &settings) noexcept; static void MicrophoneMuted() noexcept; diff --git a/src/runner/general_settings.cpp b/src/runner/general_settings.cpp index 9925308507..9e3b170feb 100644 --- a/src/runner/general_settings.cpp +++ b/src/runner/general_settings.cpp @@ -65,7 +65,7 @@ json::JsonObject load_general_settings() show_new_updates_toast_notification = loaded.GetNamedBoolean(L"show_new_updates_toast_notification", true); download_updates_automatically = loaded.GetNamedBoolean(L"download_updates_automatically", true) && check_user_is_admin(); show_whats_new_after_updates = loaded.GetNamedBoolean(L"show_whats_new_after_updates", true); - enable_experimentation = loaded.GetNamedBoolean(L"enable_experimentation",true); + enable_experimentation = loaded.GetNamedBoolean(L"enable_experimentation", true); enable_warnings_elevated_apps = loaded.GetNamedBoolean(L"enable_warnings_elevated_apps", true); return loaded; @@ -241,8 +241,7 @@ void start_enabled_powertoys() { std::wstring disable_module_name{ static_cast(disabled_element.Key()) }; - if (powertoys_gpo_configuration.find(disable_module_name)!=powertoys_gpo_configuration.end() - && (powertoys_gpo_configuration[disable_module_name]==powertoys_gpo::gpo_rule_configured_enabled || powertoys_gpo_configuration[disable_module_name]==powertoys_gpo::gpo_rule_configured_disabled)) + if (powertoys_gpo_configuration.find(disable_module_name) != powertoys_gpo_configuration.end() && (powertoys_gpo_configuration[disable_module_name] == powertoys_gpo::gpo_rule_configured_enabled || powertoys_gpo_configuration[disable_module_name] == powertoys_gpo::gpo_rule_configured_disabled)) { // If gpo forces the enabled setting, no need to check the setting for this PowerToy. It will be applied later on this function. continue; diff --git a/src/runner/main.cpp b/src/runner/main.cpp index 7665cec3bf..aa245ac88b 100644 --- a/src/runner/main.cpp +++ b/src/runner/main.cpp @@ -435,6 +435,13 @@ int WINAPI WinMain(HINSTANCE /*hInstance*/, HINSTANCE /*hPrevInstance*/, LPSTR l openScoobe = false; } + bool dataDiagnosticsDisabledByGpo = powertoys_gpo::getAllowDataDiagnosticsValue() == powertoys_gpo::gpo_rule_configured_disabled; + if (dataDiagnosticsDisabledByGpo) + { + Logger::info(L"Data diagnostics: Data diagnostics is disabled by GPO."); + PTSettingsHelper::save_data_diagnostics(false); + } + if (elevated && with_dont_elevate_arg && !run_elevated_setting) { Logger::info("Scheduling restart as non elevated"); diff --git a/src/runner/pch.h b/src/runner/pch.h index a01e93cc17..537bef12d6 100644 --- a/src/runner/pch.h +++ b/src/runner/pch.h @@ -26,7 +26,6 @@ #include #include #include -#include #include #include diff --git a/src/runner/trace.cpp b/src/runner/trace.cpp index 8c0dd74b50..1c15092679 100644 --- a/src/runner/trace.cpp +++ b/src/runner/trace.cpp @@ -3,6 +3,8 @@ #include "general_settings.h" +#include + TRACELOGGING_DEFINE_PROVIDER( g_hProvider, "Microsoft.PowerToys", @@ -10,19 +12,9 @@ TRACELOGGING_DEFINE_PROVIDER( (0x38e8889b, 0x9731, 0x53f5, 0xe9, 0x01, 0xe8, 0xa7, 0xc1, 0x75, 0x30, 0x74), TraceLoggingOptionProjectTelemetry()); -void Trace::RegisterProvider() -{ - TraceLoggingRegister(g_hProvider); -} - -void Trace::UnregisterProvider() -{ - TraceLoggingUnregister(g_hProvider); -} - void Trace::EventLaunch(const std::wstring& versionNumber, bool isProcessElevated) { - TraceLoggingWrite( + TraceLoggingWriteWrapper( g_hProvider, "Runner_Launch", TraceLoggingWideString(versionNumber.c_str(), "Version"), @@ -48,7 +40,7 @@ void Trace::SettingsChanged(const GeneralSettings& settings) } } - TraceLoggingWrite( + TraceLoggingWriteWrapper( g_hProvider, "GeneralSettingsChanged", TraceLoggingBoolean(settings.isStartupEnabled, "RunAtStartup"), diff --git a/src/runner/trace.h b/src/runner/trace.h index fe337723d7..3170fa665a 100644 --- a/src/runner/trace.h +++ b/src/runner/trace.h @@ -1,12 +1,12 @@ #pragma once +#include + struct GeneralSettings; -class Trace +class Trace : public telemetry::TraceBase { public: - static void RegisterProvider(); - static void UnregisterProvider(); static void EventLaunch(const std::wstring& versionNumber, bool isProcessElevated); static void SettingsChanged(const GeneralSettings& settings); }; diff --git a/src/settings-ui/Settings.UI/Helpers/DataDiagnostics.cs b/src/settings-ui/Settings.UI/Helpers/DataDiagnostics.cs new file mode 100644 index 0000000000..a999405762 --- /dev/null +++ b/src/settings-ui/Settings.UI/Helpers/DataDiagnostics.cs @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation +// The Microsoft Corporation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. + +using System; +using ManagedCommon; +using Microsoft.Win32; + +namespace Microsoft.PowerToys.Settings.Helpers +{ + public static class DataDiagnostics + { + private static readonly string DataDiagnosticsRegistryKey = @"HKEY_CURRENT_USER\Software\Classes\PowerToys\"; + private static readonly string DataDiagnosticsRegistryValueName = @"AllowDataDiagnostics"; + + public static bool GetValue() + { + object registryValue = null; + try + { + registryValue = Registry.GetValue(DataDiagnosticsRegistryKey, DataDiagnosticsRegistryValueName, false); + } + catch + { + } + + if (registryValue is not null) + { + return (int)registryValue == 1 ? true : false; + } + + return false; + } + + public static void SetValue(bool value) + { + try + { + Registry.SetValue(DataDiagnosticsRegistryKey, DataDiagnosticsRegistryValueName, value ? 1 : 0); + } + catch (Exception ex) + { + Logger.LogError($"Failed to set the Data Diagnostics value in the registry: {ex.Message}"); + } + } + } +} diff --git a/src/settings-ui/Settings.UI/Helpers/StartProcessHelper.cs b/src/settings-ui/Settings.UI/Helpers/StartProcessHelper.cs index e530acc193..0680f95c69 100644 --- a/src/settings-ui/Settings.UI/Helpers/StartProcessHelper.cs +++ b/src/settings-ui/Settings.UI/Helpers/StartProcessHelper.cs @@ -9,6 +9,7 @@ namespace Microsoft.PowerToys.Settings.UI.Helpers public static class StartProcessHelper { public const string ColorsSettings = "ms-settings:colors"; + public const string DiagnosticsAndFeedback = "ms-settings:privacy-feedback"; public static void Start(string process) { diff --git a/src/settings-ui/Settings.UI/SettingsXAML/OOBE/Views/OobeOverview.xaml b/src/settings-ui/Settings.UI/SettingsXAML/OOBE/Views/OobeOverview.xaml index b6456d5eb0..665db62498 100644 --- a/src/settings-ui/Settings.UI/SettingsXAML/OOBE/Views/OobeOverview.xaml +++ b/src/settings-ui/Settings.UI/SettingsXAML/OOBE/Views/OobeOverview.xaml @@ -5,6 +5,8 @@ xmlns:controls="using:Microsoft.PowerToys.Settings.UI.Controls" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" + xmlns:tkcontrols="using:CommunityToolkit.WinUI.Controls" + xmlns:ui="using:CommunityToolkit.WinUI" mc:Ignorable="d"> @@ -17,6 +19,28 @@ + + + + + + + + + + diff --git a/src/settings-ui/Settings.UI/SettingsXAML/OOBE/Views/OobeOverview.xaml.cs b/src/settings-ui/Settings.UI/SettingsXAML/OOBE/Views/OobeOverview.xaml.cs index d43bda83bf..d6e0fed102 100644 --- a/src/settings-ui/Settings.UI/SettingsXAML/OOBE/Views/OobeOverview.xaml.cs +++ b/src/settings-ui/Settings.UI/SettingsXAML/OOBE/Views/OobeOverview.xaml.cs @@ -2,6 +2,9 @@ // The Microsoft Corporation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. +using global::PowerToys.GPOWrapper; +using Microsoft.PowerToys.Settings.Helpers; +using Microsoft.PowerToys.Settings.UI.Library; using Microsoft.PowerToys.Settings.UI.OOBE.Enums; using Microsoft.PowerToys.Settings.UI.OOBE.ViewModel; using Microsoft.PowerToys.Settings.UI.Views; @@ -14,9 +17,46 @@ namespace Microsoft.PowerToys.Settings.UI.OOBE.Views { public OobePowerToysModule ViewModel { get; set; } + private bool _enableDataDiagnostics; + + public bool EnableDataDiagnostics + { + get + { + return _enableDataDiagnostics; + } + + set + { + if (_enableDataDiagnostics != value) + { + _enableDataDiagnostics = value; + + DataDiagnostics.SetValue(_enableDataDiagnostics); + + this.DispatcherQueue.TryEnqueue(Microsoft.UI.Dispatching.DispatcherQueuePriority.Normal, () => + { + ShellPage.ShellHandler?.SignalGeneralDataUpdate(); + }); + } + } + } + + public bool ShowDataDiagnosticsSetting => GetIsDataDiagnosticsInfoBarEnabled(); + + private bool GetIsDataDiagnosticsInfoBarEnabled() + { + var isDataDiagnosticsGpoDisallowed = GPOWrapper.GetAllowDataDiagnosticsValue() == GpoRuleConfigured.Disabled; + + return !isDataDiagnosticsGpoDisallowed; + } + public OobeOverview() { this.InitializeComponent(); + + _enableDataDiagnostics = DataDiagnostics.GetValue(); + ViewModel = new OobePowerToysModule(OobeShellPage.OobeShellHandler.Modules[(int)PowerToysModules.Overview]); DataContext = ViewModel; } diff --git a/src/settings-ui/Settings.UI/SettingsXAML/OOBE/Views/OobeWhatsNew.xaml b/src/settings-ui/Settings.UI/SettingsXAML/OOBE/Views/OobeWhatsNew.xaml index 06c3b29067..5ee19696e4 100644 --- a/src/settings-ui/Settings.UI/SettingsXAML/OOBE/Views/OobeWhatsNew.xaml +++ b/src/settings-ui/Settings.UI/SettingsXAML/OOBE/Views/OobeWhatsNew.xaml @@ -12,12 +12,35 @@ + - + + + + + + +