diff --git a/DevHome.sln b/DevHome.sln
index 07fe229aad..633e796c1b 100644
--- a/DevHome.sln
+++ b/DevHome.sln
@@ -71,20 +71,6 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "ExtensionLibrary", "Extensi
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DevHome.Experiments", "tools\Experiments\src\DevHome.Experiments.csproj", "{2F9AD5AF-EF3B-496A-8566-9E9539E3DF43}"
EndProject
-Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "QuietBackgroundProcesses", "QuietBackgroundProcesses", "{D04CD3A1-0B45-4CB3-925F-204F5F6AE2D8}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "DevHome.QuietBackgroundProcesses.ElevatedServer", "tools\QuietBackgroundProcesses\DevHome.QuietBackgroundProcesses.ElevatedServer\DevHome.QuietBackgroundProcesses.ElevatedServer.vcxproj", "{75945141-03AC-4C40-A586-16D463A0AC1B}"
-EndProject
-Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DevHome.QuietBackgroundProcesses.ElevatedServer.Projection", "tools\QuietBackgroundProcesses\DevHome.QuietBackgroundProcesses.ElevatedServer.Projection\DevHome.QuietBackgroundProcesses.ElevatedServer.Projection.csproj", "{092AC740-DA01-4872-8E93-B9557DAD6BE5}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "DevHome.QuietBackgroundProcesses.Server", "tools\QuietBackgroundProcesses\DevHome.QuietBackgroundProcesses.Server\DevHome.QuietBackgroundProcesses.Server.vcxproj", "{80805B43-CE75-4C6E-92F8-F385C1039E53}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "DevHome.QuietBackgroundProcesses.Common", "tools\QuietBackgroundProcesses\DevHome.QuietBackgroundProcesses.Common\DevHome.QuietBackgroundProcesses.Common.vcxproj", "{4B370E2F-FB1D-4887-90BF-3B72517485CE}"
-EndProject
-Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DevHome.QuietBackgroundProcesses.UI", "tools\QuietBackgroundProcesses\DevHome.QuietBackgroundProcesses.UI\DevHome.QuietBackgroundProcesses.UI.csproj", "{1477F3EA-A9F6-4B4F-82F4-C2427F57EBEE}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "DevHome.QuietBackgroundProcesses.PerformanceRecorderEngine", "tools\QuietBackgroundProcesses\DevHome.QuietBackgroundProcesses.PerformanceRecorderEngine\DevHome.QuietBackgroundProcesses.PerformanceRecorderEngine.vcxproj", "{AF5A7FA0-E3E8-44C8-8830-31DD08F583E8}"
-EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Extensions", "Extensions", "{DCAF188B-60C3-4EDB-8049-BAA927FBCD7D}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "SampleTool", "SampleTool", "{E7C94F61-D6CF-464D-8D50-210488AF7A50}"
@@ -123,10 +109,6 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DevSetupAgent.Test", "exten
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "HyperVExtension.HostGuestCommunication", "extensions\HyperVExtension\src\HyperVExtension.HostGuestCommunication\HyperVExtension.HostGuestCommunication.csproj", "{D759CD66-494C-4A00-8075-8B65A9891349}"
EndProject
-Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DevHome.DevDiagnostics", "tools\DevDiagnostics\DevHome.DevDiagnostics\DevHome.DevDiagnostics.csproj", "{CAAC0CDF-9AB8-4F43-A3EB-38D785AF5725}"
-EndProject
-Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "DevDiagnostics", "DevDiagnostics", "{DB3D0F2C-1A7F-44B4-B408-B21A56212985}"
-EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Customization", "Customization", "{623998FD-B0A6-4980-95D5-A5072301CA10}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DevHome.Customization", "tools\Customization\DevHome.Customization\DevHome.Customization.csproj", "{AF527EA4-6A24-4BD6-BC6E-A5863DC3489C}"
@@ -145,8 +127,6 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DevHome.RegistryPreview", "
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DevHome.EnvironmentVariables", "tools\Utilities\EnvVariablesUtility\DevHome.EnvironmentVariables.csproj", "{5F9749BC-F34E-4F45-933F-61E0F3ED521F}"
EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "DevHome.Telemetry.Native", "telemetry\DevHome.Telemetry.Native\DevHome.Telemetry.Native.vcxproj", "{8EB52F7D-D216-49FF-BF16-DE06E4695950}"
-EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Services", "Services", "{E0A15760-487A-4CCB-8093-DE6FF3C4BC23}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DevHome.Services.WindowsPackageManager", "services\DevHome.Services.WindowsPackageManager\DevHome.Services.WindowsPackageManager.csproj", "{DA5C4FC8-18AF-4446-807F-A2FFFE4DCF6C}"
@@ -174,37 +154,14 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DevHome.FileExplorerSourceC
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DevHome.FileExplorerSourceControlIntegrationUnitTest", "tools\Customization\DevHome.FileExplorerSourceControlIntegrationUnitTest\DevHome.FileExplorerSourceControlIntegrationUnitTest.csproj", "{A1FAE679-39D4-4278-A8E8-EA351F21A3E7}"
EndProject
-Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DevHome.Service", "service\DevHome.Service\DevHome.Service.csproj", "{8A0AD1A7-29E1-47E1-9579-91F2B460518F}"
-EndProject
-Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DevHome.Service.Projection", "service\DevHome.Service.Projection\DevHome.Service.Projection.csproj", "{13F1F098-262B-432D-977C-F710E6826C5C}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "DevHome.Service.IDL", "service\DevHome.Service.IDL\DevHome.Service.IDL.vcxproj", "{17E96025-8251-4D62-BFFB-C571F728B66B}"
-EndProject
-Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "TestTools", "TestTools", "{7857275B-7970-4C26-B092-FF62EA890B1E}"
-EndProject
-Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "TestDumpAnalyzer", "tools\DevDiagnostics\TestTools\TestDumpAnalyzer\TestDumpAnalyzer.csproj", "{29963C5C-4CB6-4406-850A-99503CB87081}"
-EndProject
-Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Utilities", "Utilities", "{81AB1B86-AE3C-4E5B-8918-CA6CCED95266}"
-EndProject
-Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EnableLoaderSnaps", "tools\DevDiagnostics\Utilities\EnableLoaderSnaps\EnableLoaderSnaps.csproj", "{EB097CCA-D4B6-4C99-9EB8-161F26345562}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "TestLoadFailure", "tools\DevDiagnostics\TestTools\TestLoadFailure\TestLoadFailure.vcxproj", "{F196A38B-190C-4B00-813D-DC0B7AD24CB7}"
-EndProject
-Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "TestServiceCaller", "tools\DevDiagnostics\TestTools\TestServiceCaller\TestServiceCaller.csproj", "{024CB70C-3449-4204-9171-A25C6C25783D}"
-EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DevHome.Database", "database\DevHome.Database\DevHome.Database.csproj", "{01CADE81-7333-4E24-A39B-95B7E58D4503}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "RepositoryManagement", "RepositoryManagement", "{567A82BE-7E9E-4D95-AF45-4EE8D57FE16D}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DevHome.RepositoryManagement", "tools\RepositoryManagement\DevHome.RepositoryManagement\DevHome.RepositoryManagement.csproj", "{82BD8133-F1D4-4383-BC4F-12EFAE1AFF91}"
EndProject
-Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "NTService", "NTService", "{E6BC5785-34E5-4A19-81A4-2CC8A37FD63F}"
-EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Telemetry", "Telemetry", "{70D3F826-0057-4EAF-AA6D-09479075B056}"
EndProject
-Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DevHome.IfeoTool", "tools\Utilities\IfeoTool\DevHome.IfeoTool.csproj", "{A9B2E87D-540F-4B4C-A4AA-EF3BDDC4171C}"
-Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EnableLocalCabCollection", "tools\DevDiagnostics\Utilities\EnableLocalCabCollection\EnableLocalCabCollection.csproj", "{A382B448-A1F3-4D87-A674-736D2987E613}"
-EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug_FailFast|arm64 = Debug_FailFast|arm64
@@ -569,114 +526,6 @@ Global
{2F9AD5AF-EF3B-496A-8566-9E9539E3DF43}.Release|x64.Build.0 = Release|x64
{2F9AD5AF-EF3B-496A-8566-9E9539E3DF43}.Release|x86.ActiveCfg = Release|x86
{2F9AD5AF-EF3B-496A-8566-9E9539E3DF43}.Release|x86.Build.0 = Release|x86
- {75945141-03AC-4C40-A586-16D463A0AC1B}.Debug_FailFast|arm64.ActiveCfg = Debug_FailFast|ARM
- {75945141-03AC-4C40-A586-16D463A0AC1B}.Debug_FailFast|arm64.Build.0 = Debug_FailFast|ARM
- {75945141-03AC-4C40-A586-16D463A0AC1B}.Debug_FailFast|x64.ActiveCfg = Debug_FailFast|x64
- {75945141-03AC-4C40-A586-16D463A0AC1B}.Debug_FailFast|x64.Build.0 = Debug_FailFast|x64
- {75945141-03AC-4C40-A586-16D463A0AC1B}.Debug_FailFast|x86.ActiveCfg = Debug_FailFast|Win32
- {75945141-03AC-4C40-A586-16D463A0AC1B}.Debug_FailFast|x86.Build.0 = Debug_FailFast|Win32
- {75945141-03AC-4C40-A586-16D463A0AC1B}.Debug|arm64.ActiveCfg = Debug|ARM64
- {75945141-03AC-4C40-A586-16D463A0AC1B}.Debug|arm64.Build.0 = Debug|ARM64
- {75945141-03AC-4C40-A586-16D463A0AC1B}.Debug|x64.ActiveCfg = Debug|x64
- {75945141-03AC-4C40-A586-16D463A0AC1B}.Debug|x64.Build.0 = Debug|x64
- {75945141-03AC-4C40-A586-16D463A0AC1B}.Debug|x86.ActiveCfg = Debug|Win32
- {75945141-03AC-4C40-A586-16D463A0AC1B}.Debug|x86.Build.0 = Debug|Win32
- {75945141-03AC-4C40-A586-16D463A0AC1B}.Release|arm64.ActiveCfg = Release|ARM64
- {75945141-03AC-4C40-A586-16D463A0AC1B}.Release|arm64.Build.0 = Release|ARM64
- {75945141-03AC-4C40-A586-16D463A0AC1B}.Release|x64.ActiveCfg = Release|x64
- {75945141-03AC-4C40-A586-16D463A0AC1B}.Release|x64.Build.0 = Release|x64
- {75945141-03AC-4C40-A586-16D463A0AC1B}.Release|x86.ActiveCfg = Release|Win32
- {75945141-03AC-4C40-A586-16D463A0AC1B}.Release|x86.Build.0 = Release|Win32
- {092AC740-DA01-4872-8E93-B9557DAD6BE5}.Debug_FailFast|arm64.ActiveCfg = Debug_FailFast|arm64
- {092AC740-DA01-4872-8E93-B9557DAD6BE5}.Debug_FailFast|arm64.Build.0 = Debug_FailFast|arm64
- {092AC740-DA01-4872-8E93-B9557DAD6BE5}.Debug_FailFast|x64.ActiveCfg = Debug_FailFast|x64
- {092AC740-DA01-4872-8E93-B9557DAD6BE5}.Debug_FailFast|x64.Build.0 = Debug_FailFast|x64
- {092AC740-DA01-4872-8E93-B9557DAD6BE5}.Debug_FailFast|x86.ActiveCfg = Debug_FailFast|x86
- {092AC740-DA01-4872-8E93-B9557DAD6BE5}.Debug_FailFast|x86.Build.0 = Debug_FailFast|x86
- {092AC740-DA01-4872-8E93-B9557DAD6BE5}.Debug|arm64.ActiveCfg = Debug|ARM64
- {092AC740-DA01-4872-8E93-B9557DAD6BE5}.Debug|arm64.Build.0 = Debug|ARM64
- {092AC740-DA01-4872-8E93-B9557DAD6BE5}.Debug|x64.ActiveCfg = Debug|x64
- {092AC740-DA01-4872-8E93-B9557DAD6BE5}.Debug|x64.Build.0 = Debug|x64
- {092AC740-DA01-4872-8E93-B9557DAD6BE5}.Debug|x86.ActiveCfg = Debug|x86
- {092AC740-DA01-4872-8E93-B9557DAD6BE5}.Debug|x86.Build.0 = Debug|x86
- {092AC740-DA01-4872-8E93-B9557DAD6BE5}.Release|arm64.ActiveCfg = Release|ARM64
- {092AC740-DA01-4872-8E93-B9557DAD6BE5}.Release|arm64.Build.0 = Release|ARM64
- {092AC740-DA01-4872-8E93-B9557DAD6BE5}.Release|x64.ActiveCfg = Release|x64
- {092AC740-DA01-4872-8E93-B9557DAD6BE5}.Release|x64.Build.0 = Release|x64
- {092AC740-DA01-4872-8E93-B9557DAD6BE5}.Release|x86.ActiveCfg = Release|x86
- {092AC740-DA01-4872-8E93-B9557DAD6BE5}.Release|x86.Build.0 = Release|x86
- {80805B43-CE75-4C6E-92F8-F385C1039E53}.Debug_FailFast|arm64.ActiveCfg = Debug_FailFast|ARM
- {80805B43-CE75-4C6E-92F8-F385C1039E53}.Debug_FailFast|arm64.Build.0 = Debug_FailFast|ARM
- {80805B43-CE75-4C6E-92F8-F385C1039E53}.Debug_FailFast|x64.ActiveCfg = Debug_FailFast|x64
- {80805B43-CE75-4C6E-92F8-F385C1039E53}.Debug_FailFast|x64.Build.0 = Debug_FailFast|x64
- {80805B43-CE75-4C6E-92F8-F385C1039E53}.Debug_FailFast|x86.ActiveCfg = Debug_FailFast|Win32
- {80805B43-CE75-4C6E-92F8-F385C1039E53}.Debug_FailFast|x86.Build.0 = Debug_FailFast|Win32
- {80805B43-CE75-4C6E-92F8-F385C1039E53}.Debug|arm64.ActiveCfg = Debug|ARM64
- {80805B43-CE75-4C6E-92F8-F385C1039E53}.Debug|arm64.Build.0 = Debug|ARM64
- {80805B43-CE75-4C6E-92F8-F385C1039E53}.Debug|x64.ActiveCfg = Debug|x64
- {80805B43-CE75-4C6E-92F8-F385C1039E53}.Debug|x64.Build.0 = Debug|x64
- {80805B43-CE75-4C6E-92F8-F385C1039E53}.Debug|x86.ActiveCfg = Debug|Win32
- {80805B43-CE75-4C6E-92F8-F385C1039E53}.Debug|x86.Build.0 = Debug|Win32
- {80805B43-CE75-4C6E-92F8-F385C1039E53}.Release|arm64.ActiveCfg = Release|ARM64
- {80805B43-CE75-4C6E-92F8-F385C1039E53}.Release|arm64.Build.0 = Release|ARM64
- {80805B43-CE75-4C6E-92F8-F385C1039E53}.Release|x64.ActiveCfg = Release|x64
- {80805B43-CE75-4C6E-92F8-F385C1039E53}.Release|x64.Build.0 = Release|x64
- {80805B43-CE75-4C6E-92F8-F385C1039E53}.Release|x86.ActiveCfg = Release|Win32
- {80805B43-CE75-4C6E-92F8-F385C1039E53}.Release|x86.Build.0 = Release|Win32
- {4B370E2F-FB1D-4887-90BF-3B72517485CE}.Debug_FailFast|arm64.ActiveCfg = Debug_FailFast|ARM
- {4B370E2F-FB1D-4887-90BF-3B72517485CE}.Debug_FailFast|arm64.Build.0 = Debug_FailFast|ARM
- {4B370E2F-FB1D-4887-90BF-3B72517485CE}.Debug_FailFast|x64.ActiveCfg = Debug_FailFast|x64
- {4B370E2F-FB1D-4887-90BF-3B72517485CE}.Debug_FailFast|x64.Build.0 = Debug_FailFast|x64
- {4B370E2F-FB1D-4887-90BF-3B72517485CE}.Debug_FailFast|x86.ActiveCfg = Debug_FailFast|Win32
- {4B370E2F-FB1D-4887-90BF-3B72517485CE}.Debug_FailFast|x86.Build.0 = Debug_FailFast|Win32
- {4B370E2F-FB1D-4887-90BF-3B72517485CE}.Debug|arm64.ActiveCfg = Debug|ARM64
- {4B370E2F-FB1D-4887-90BF-3B72517485CE}.Debug|arm64.Build.0 = Debug|ARM64
- {4B370E2F-FB1D-4887-90BF-3B72517485CE}.Debug|x64.ActiveCfg = Debug|x64
- {4B370E2F-FB1D-4887-90BF-3B72517485CE}.Debug|x64.Build.0 = Debug|x64
- {4B370E2F-FB1D-4887-90BF-3B72517485CE}.Debug|x86.ActiveCfg = Debug|Win32
- {4B370E2F-FB1D-4887-90BF-3B72517485CE}.Debug|x86.Build.0 = Debug|Win32
- {4B370E2F-FB1D-4887-90BF-3B72517485CE}.Release|arm64.ActiveCfg = Release|ARM64
- {4B370E2F-FB1D-4887-90BF-3B72517485CE}.Release|arm64.Build.0 = Release|ARM64
- {4B370E2F-FB1D-4887-90BF-3B72517485CE}.Release|x64.ActiveCfg = Release|x64
- {4B370E2F-FB1D-4887-90BF-3B72517485CE}.Release|x64.Build.0 = Release|x64
- {4B370E2F-FB1D-4887-90BF-3B72517485CE}.Release|x86.ActiveCfg = Release|Win32
- {4B370E2F-FB1D-4887-90BF-3B72517485CE}.Release|x86.Build.0 = Release|Win32
- {1477F3EA-A9F6-4B4F-82F4-C2427F57EBEE}.Debug_FailFast|arm64.ActiveCfg = Debug_FailFast|arm64
- {1477F3EA-A9F6-4B4F-82F4-C2427F57EBEE}.Debug_FailFast|arm64.Build.0 = Debug_FailFast|arm64
- {1477F3EA-A9F6-4B4F-82F4-C2427F57EBEE}.Debug_FailFast|x64.ActiveCfg = Debug_FailFast|x64
- {1477F3EA-A9F6-4B4F-82F4-C2427F57EBEE}.Debug_FailFast|x64.Build.0 = Debug_FailFast|x64
- {1477F3EA-A9F6-4B4F-82F4-C2427F57EBEE}.Debug_FailFast|x86.ActiveCfg = Debug_FailFast|x86
- {1477F3EA-A9F6-4B4F-82F4-C2427F57EBEE}.Debug_FailFast|x86.Build.0 = Debug_FailFast|x86
- {1477F3EA-A9F6-4B4F-82F4-C2427F57EBEE}.Debug|arm64.ActiveCfg = Debug|arm64
- {1477F3EA-A9F6-4B4F-82F4-C2427F57EBEE}.Debug|arm64.Build.0 = Debug|arm64
- {1477F3EA-A9F6-4B4F-82F4-C2427F57EBEE}.Debug|x64.ActiveCfg = Debug|x64
- {1477F3EA-A9F6-4B4F-82F4-C2427F57EBEE}.Debug|x64.Build.0 = Debug|x64
- {1477F3EA-A9F6-4B4F-82F4-C2427F57EBEE}.Debug|x86.ActiveCfg = Debug|x86
- {1477F3EA-A9F6-4B4F-82F4-C2427F57EBEE}.Debug|x86.Build.0 = Debug|x86
- {1477F3EA-A9F6-4B4F-82F4-C2427F57EBEE}.Release|arm64.ActiveCfg = Release|arm64
- {1477F3EA-A9F6-4B4F-82F4-C2427F57EBEE}.Release|arm64.Build.0 = Release|arm64
- {1477F3EA-A9F6-4B4F-82F4-C2427F57EBEE}.Release|x64.ActiveCfg = Release|x64
- {1477F3EA-A9F6-4B4F-82F4-C2427F57EBEE}.Release|x64.Build.0 = Release|x64
- {1477F3EA-A9F6-4B4F-82F4-C2427F57EBEE}.Release|x86.ActiveCfg = Release|x86
- {1477F3EA-A9F6-4B4F-82F4-C2427F57EBEE}.Release|x86.Build.0 = Release|x86
- {AF5A7FA0-E3E8-44C8-8830-31DD08F583E8}.Debug_FailFast|arm64.ActiveCfg = Debug_FailFast|ARM64
- {AF5A7FA0-E3E8-44C8-8830-31DD08F583E8}.Debug_FailFast|arm64.Build.0 = Debug_FailFast|ARM64
- {AF5A7FA0-E3E8-44C8-8830-31DD08F583E8}.Debug_FailFast|x64.ActiveCfg = Debug_FailFast|x64
- {AF5A7FA0-E3E8-44C8-8830-31DD08F583E8}.Debug_FailFast|x64.Build.0 = Debug_FailFast|x64
- {AF5A7FA0-E3E8-44C8-8830-31DD08F583E8}.Debug_FailFast|x86.ActiveCfg = Debug_FailFast|Win32
- {AF5A7FA0-E3E8-44C8-8830-31DD08F583E8}.Debug_FailFast|x86.Build.0 = Debug_FailFast|Win32
- {AF5A7FA0-E3E8-44C8-8830-31DD08F583E8}.Debug|arm64.ActiveCfg = Debug|ARM64
- {AF5A7FA0-E3E8-44C8-8830-31DD08F583E8}.Debug|arm64.Build.0 = Debug|ARM64
- {AF5A7FA0-E3E8-44C8-8830-31DD08F583E8}.Debug|x64.ActiveCfg = Debug|x64
- {AF5A7FA0-E3E8-44C8-8830-31DD08F583E8}.Debug|x64.Build.0 = Debug|x64
- {AF5A7FA0-E3E8-44C8-8830-31DD08F583E8}.Debug|x86.ActiveCfg = Debug|Win32
- {AF5A7FA0-E3E8-44C8-8830-31DD08F583E8}.Debug|x86.Build.0 = Debug|Win32
- {AF5A7FA0-E3E8-44C8-8830-31DD08F583E8}.Release|arm64.ActiveCfg = Release|ARM64
- {AF5A7FA0-E3E8-44C8-8830-31DD08F583E8}.Release|arm64.Build.0 = Release|ARM64
- {AF5A7FA0-E3E8-44C8-8830-31DD08F583E8}.Release|x64.ActiveCfg = Release|x64
- {AF5A7FA0-E3E8-44C8-8830-31DD08F583E8}.Release|x64.Build.0 = Release|x64
- {AF5A7FA0-E3E8-44C8-8830-31DD08F583E8}.Release|x86.ActiveCfg = Release|Win32
- {AF5A7FA0-E3E8-44C8-8830-31DD08F583E8}.Release|x86.Build.0 = Release|Win32
{CFD8A90D-8B6D-4ED6-BA35-FF894BEB46C0}.Debug_FailFast|arm64.ActiveCfg = Debug_FailFast|arm64
{CFD8A90D-8B6D-4ED6-BA35-FF894BEB46C0}.Debug_FailFast|arm64.Build.0 = Debug_FailFast|arm64
{CFD8A90D-8B6D-4ED6-BA35-FF894BEB46C0}.Debug_FailFast|x64.ActiveCfg = Debug_FailFast|x64
@@ -911,24 +760,6 @@ Global
{D759CD66-494C-4A00-8075-8B65A9891349}.Release|x64.Build.0 = Release|x64
{D759CD66-494C-4A00-8075-8B65A9891349}.Release|x86.ActiveCfg = Release|x86
{D759CD66-494C-4A00-8075-8B65A9891349}.Release|x86.Build.0 = Release|x86
- {CAAC0CDF-9AB8-4F43-A3EB-38D785AF5725}.Debug_FailFast|arm64.ActiveCfg = Debug_FailFast|ARM64
- {CAAC0CDF-9AB8-4F43-A3EB-38D785AF5725}.Debug_FailFast|arm64.Build.0 = Debug_FailFast|ARM64
- {CAAC0CDF-9AB8-4F43-A3EB-38D785AF5725}.Debug_FailFast|x64.ActiveCfg = Debug_FailFast|x64
- {CAAC0CDF-9AB8-4F43-A3EB-38D785AF5725}.Debug_FailFast|x64.Build.0 = Debug_FailFast|x64
- {CAAC0CDF-9AB8-4F43-A3EB-38D785AF5725}.Debug_FailFast|x86.ActiveCfg = Debug_FailFast|x86
- {CAAC0CDF-9AB8-4F43-A3EB-38D785AF5725}.Debug_FailFast|x86.Build.0 = Debug_FailFast|x86
- {CAAC0CDF-9AB8-4F43-A3EB-38D785AF5725}.Debug|arm64.ActiveCfg = Debug|ARM64
- {CAAC0CDF-9AB8-4F43-A3EB-38D785AF5725}.Debug|arm64.Build.0 = Debug|ARM64
- {CAAC0CDF-9AB8-4F43-A3EB-38D785AF5725}.Debug|x64.ActiveCfg = Debug|x64
- {CAAC0CDF-9AB8-4F43-A3EB-38D785AF5725}.Debug|x64.Build.0 = Debug|x64
- {CAAC0CDF-9AB8-4F43-A3EB-38D785AF5725}.Debug|x86.ActiveCfg = Debug|x86
- {CAAC0CDF-9AB8-4F43-A3EB-38D785AF5725}.Debug|x86.Build.0 = Debug|x86
- {CAAC0CDF-9AB8-4F43-A3EB-38D785AF5725}.Release|arm64.ActiveCfg = Release|ARM64
- {CAAC0CDF-9AB8-4F43-A3EB-38D785AF5725}.Release|arm64.Build.0 = Release|ARM64
- {CAAC0CDF-9AB8-4F43-A3EB-38D785AF5725}.Release|x64.ActiveCfg = Release|x64
- {CAAC0CDF-9AB8-4F43-A3EB-38D785AF5725}.Release|x64.Build.0 = Release|x64
- {CAAC0CDF-9AB8-4F43-A3EB-38D785AF5725}.Release|x86.ActiveCfg = Release|x86
- {CAAC0CDF-9AB8-4F43-A3EB-38D785AF5725}.Release|x86.Build.0 = Release|x86
{AF527EA4-6A24-4BD6-BC6E-A5863DC3489C}.Debug_FailFast|arm64.ActiveCfg = Debug_FailFast|arm64
{AF527EA4-6A24-4BD6-BC6E-A5863DC3489C}.Debug_FailFast|arm64.Build.0 = Debug_FailFast|arm64
{AF527EA4-6A24-4BD6-BC6E-A5863DC3489C}.Debug_FailFast|x64.ActiveCfg = Debug_FailFast|x64
@@ -1031,24 +862,6 @@ Global
{5F9749BC-F34E-4F45-933F-61E0F3ED521F}.Release|x64.Build.0 = Release|x64
{5F9749BC-F34E-4F45-933F-61E0F3ED521F}.Release|x86.ActiveCfg = Release|x86
{5F9749BC-F34E-4F45-933F-61E0F3ED521F}.Release|x86.Build.0 = Release|x86
- {8EB52F7D-D216-49FF-BF16-DE06E4695950}.Debug_FailFast|arm64.ActiveCfg = Debug_FailFast|x64
- {8EB52F7D-D216-49FF-BF16-DE06E4695950}.Debug_FailFast|arm64.Build.0 = Debug_FailFast|x64
- {8EB52F7D-D216-49FF-BF16-DE06E4695950}.Debug_FailFast|x64.ActiveCfg = Debug_FailFast|x64
- {8EB52F7D-D216-49FF-BF16-DE06E4695950}.Debug_FailFast|x64.Build.0 = Debug_FailFast|x64
- {8EB52F7D-D216-49FF-BF16-DE06E4695950}.Debug_FailFast|x86.ActiveCfg = Debug_FailFast|Win32
- {8EB52F7D-D216-49FF-BF16-DE06E4695950}.Debug_FailFast|x86.Build.0 = Debug_FailFast|Win32
- {8EB52F7D-D216-49FF-BF16-DE06E4695950}.Debug|arm64.ActiveCfg = Debug|x64
- {8EB52F7D-D216-49FF-BF16-DE06E4695950}.Debug|arm64.Build.0 = Debug|x64
- {8EB52F7D-D216-49FF-BF16-DE06E4695950}.Debug|x64.ActiveCfg = Debug|x64
- {8EB52F7D-D216-49FF-BF16-DE06E4695950}.Debug|x64.Build.0 = Debug|x64
- {8EB52F7D-D216-49FF-BF16-DE06E4695950}.Debug|x86.ActiveCfg = Debug|Win32
- {8EB52F7D-D216-49FF-BF16-DE06E4695950}.Debug|x86.Build.0 = Debug|Win32
- {8EB52F7D-D216-49FF-BF16-DE06E4695950}.Release|arm64.ActiveCfg = Release|x64
- {8EB52F7D-D216-49FF-BF16-DE06E4695950}.Release|arm64.Build.0 = Release|x64
- {8EB52F7D-D216-49FF-BF16-DE06E4695950}.Release|x64.ActiveCfg = Release|x64
- {8EB52F7D-D216-49FF-BF16-DE06E4695950}.Release|x64.Build.0 = Release|x64
- {8EB52F7D-D216-49FF-BF16-DE06E4695950}.Release|x86.ActiveCfg = Release|Win32
- {8EB52F7D-D216-49FF-BF16-DE06E4695950}.Release|x86.Build.0 = Release|Win32
{DA5C4FC8-18AF-4446-807F-A2FFFE4DCF6C}.Debug_FailFast|arm64.ActiveCfg = Debug|ARM64
{DA5C4FC8-18AF-4446-807F-A2FFFE4DCF6C}.Debug_FailFast|arm64.Build.0 = Debug|ARM64
{DA5C4FC8-18AF-4446-807F-A2FFFE4DCF6C}.Debug_FailFast|x64.ActiveCfg = Debug|x64
@@ -1193,132 +1006,6 @@ Global
{A1FAE679-39D4-4278-A8E8-EA351F21A3E7}.Release|x64.Build.0 = Release|x64
{A1FAE679-39D4-4278-A8E8-EA351F21A3E7}.Release|x86.ActiveCfg = Release|x86
{A1FAE679-39D4-4278-A8E8-EA351F21A3E7}.Release|x86.Build.0 = Release|x86
- {8A0AD1A7-29E1-47E1-9579-91F2B460518F}.Debug_FailFast|arm64.ActiveCfg = Debug|ARM64
- {8A0AD1A7-29E1-47E1-9579-91F2B460518F}.Debug_FailFast|arm64.Build.0 = Debug|ARM64
- {8A0AD1A7-29E1-47E1-9579-91F2B460518F}.Debug_FailFast|x64.ActiveCfg = Debug|x64
- {8A0AD1A7-29E1-47E1-9579-91F2B460518F}.Debug_FailFast|x64.Build.0 = Debug|x64
- {8A0AD1A7-29E1-47E1-9579-91F2B460518F}.Debug_FailFast|x86.ActiveCfg = Debug|x86
- {8A0AD1A7-29E1-47E1-9579-91F2B460518F}.Debug_FailFast|x86.Build.0 = Debug|x86
- {8A0AD1A7-29E1-47E1-9579-91F2B460518F}.Debug|arm64.ActiveCfg = Debug|ARM64
- {8A0AD1A7-29E1-47E1-9579-91F2B460518F}.Debug|arm64.Build.0 = Debug|ARM64
- {8A0AD1A7-29E1-47E1-9579-91F2B460518F}.Debug|x64.ActiveCfg = Debug|x64
- {8A0AD1A7-29E1-47E1-9579-91F2B460518F}.Debug|x64.Build.0 = Debug|x64
- {8A0AD1A7-29E1-47E1-9579-91F2B460518F}.Debug|x86.ActiveCfg = Debug|x86
- {8A0AD1A7-29E1-47E1-9579-91F2B460518F}.Debug|x86.Build.0 = Debug|x86
- {8A0AD1A7-29E1-47E1-9579-91F2B460518F}.Release|arm64.ActiveCfg = Release|ARM64
- {8A0AD1A7-29E1-47E1-9579-91F2B460518F}.Release|arm64.Build.0 = Release|ARM64
- {8A0AD1A7-29E1-47E1-9579-91F2B460518F}.Release|x64.ActiveCfg = Release|x64
- {8A0AD1A7-29E1-47E1-9579-91F2B460518F}.Release|x64.Build.0 = Release|x64
- {8A0AD1A7-29E1-47E1-9579-91F2B460518F}.Release|x86.ActiveCfg = Release|x86
- {8A0AD1A7-29E1-47E1-9579-91F2B460518F}.Release|x86.Build.0 = Release|x86
- {13F1F098-262B-432D-977C-F710E6826C5C}.Debug_FailFast|arm64.ActiveCfg = Debug|ARM64
- {13F1F098-262B-432D-977C-F710E6826C5C}.Debug_FailFast|arm64.Build.0 = Debug|ARM64
- {13F1F098-262B-432D-977C-F710E6826C5C}.Debug_FailFast|x64.ActiveCfg = Debug|x64
- {13F1F098-262B-432D-977C-F710E6826C5C}.Debug_FailFast|x64.Build.0 = Debug|x64
- {13F1F098-262B-432D-977C-F710E6826C5C}.Debug_FailFast|x86.ActiveCfg = Debug|x86
- {13F1F098-262B-432D-977C-F710E6826C5C}.Debug_FailFast|x86.Build.0 = Debug|x86
- {13F1F098-262B-432D-977C-F710E6826C5C}.Debug|arm64.ActiveCfg = Debug|ARM64
- {13F1F098-262B-432D-977C-F710E6826C5C}.Debug|arm64.Build.0 = Debug|ARM64
- {13F1F098-262B-432D-977C-F710E6826C5C}.Debug|x64.ActiveCfg = Debug|x64
- {13F1F098-262B-432D-977C-F710E6826C5C}.Debug|x64.Build.0 = Debug|x64
- {13F1F098-262B-432D-977C-F710E6826C5C}.Debug|x86.ActiveCfg = Debug|x86
- {13F1F098-262B-432D-977C-F710E6826C5C}.Debug|x86.Build.0 = Debug|x86
- {13F1F098-262B-432D-977C-F710E6826C5C}.Release|arm64.ActiveCfg = Release|ARM64
- {13F1F098-262B-432D-977C-F710E6826C5C}.Release|arm64.Build.0 = Release|ARM64
- {13F1F098-262B-432D-977C-F710E6826C5C}.Release|x64.ActiveCfg = Release|x64
- {13F1F098-262B-432D-977C-F710E6826C5C}.Release|x64.Build.0 = Release|x64
- {13F1F098-262B-432D-977C-F710E6826C5C}.Release|x86.ActiveCfg = Release|x86
- {13F1F098-262B-432D-977C-F710E6826C5C}.Release|x86.Build.0 = Release|x86
- {17E96025-8251-4D62-BFFB-C571F728B66B}.Debug_FailFast|arm64.ActiveCfg = Debug|x64
- {17E96025-8251-4D62-BFFB-C571F728B66B}.Debug_FailFast|arm64.Build.0 = Debug|x64
- {17E96025-8251-4D62-BFFB-C571F728B66B}.Debug_FailFast|x64.ActiveCfg = Debug|x64
- {17E96025-8251-4D62-BFFB-C571F728B66B}.Debug_FailFast|x64.Build.0 = Debug|x64
- {17E96025-8251-4D62-BFFB-C571F728B66B}.Debug_FailFast|x86.ActiveCfg = Debug|Win32
- {17E96025-8251-4D62-BFFB-C571F728B66B}.Debug_FailFast|x86.Build.0 = Debug|Win32
- {17E96025-8251-4D62-BFFB-C571F728B66B}.Debug|arm64.ActiveCfg = Debug|x64
- {17E96025-8251-4D62-BFFB-C571F728B66B}.Debug|arm64.Build.0 = Debug|x64
- {17E96025-8251-4D62-BFFB-C571F728B66B}.Debug|x64.ActiveCfg = Debug|x64
- {17E96025-8251-4D62-BFFB-C571F728B66B}.Debug|x64.Build.0 = Debug|x64
- {17E96025-8251-4D62-BFFB-C571F728B66B}.Debug|x86.ActiveCfg = Debug|Win32
- {17E96025-8251-4D62-BFFB-C571F728B66B}.Debug|x86.Build.0 = Debug|Win32
- {17E96025-8251-4D62-BFFB-C571F728B66B}.Release|arm64.ActiveCfg = Release|x64
- {17E96025-8251-4D62-BFFB-C571F728B66B}.Release|arm64.Build.0 = Release|x64
- {17E96025-8251-4D62-BFFB-C571F728B66B}.Release|x64.ActiveCfg = Release|x64
- {17E96025-8251-4D62-BFFB-C571F728B66B}.Release|x64.Build.0 = Release|x64
- {17E96025-8251-4D62-BFFB-C571F728B66B}.Release|x86.ActiveCfg = Release|Win32
- {17E96025-8251-4D62-BFFB-C571F728B66B}.Release|x86.Build.0 = Release|Win32
- {29963C5C-4CB6-4406-850A-99503CB87081}.Debug_FailFast|arm64.ActiveCfg = Debug_FailFast|ARM64
- {29963C5C-4CB6-4406-850A-99503CB87081}.Debug_FailFast|arm64.Build.0 = Debug_FailFast|ARM64
- {29963C5C-4CB6-4406-850A-99503CB87081}.Debug_FailFast|x64.ActiveCfg = Debug_FailFast|x64
- {29963C5C-4CB6-4406-850A-99503CB87081}.Debug_FailFast|x64.Build.0 = Debug_FailFast|x64
- {29963C5C-4CB6-4406-850A-99503CB87081}.Debug_FailFast|x86.ActiveCfg = Debug_FailFast|x86
- {29963C5C-4CB6-4406-850A-99503CB87081}.Debug_FailFast|x86.Build.0 = Debug_FailFast|x86
- {29963C5C-4CB6-4406-850A-99503CB87081}.Debug|arm64.ActiveCfg = Debug|ARM64
- {29963C5C-4CB6-4406-850A-99503CB87081}.Debug|arm64.Build.0 = Debug|ARM64
- {29963C5C-4CB6-4406-850A-99503CB87081}.Debug|x64.ActiveCfg = Debug|x64
- {29963C5C-4CB6-4406-850A-99503CB87081}.Debug|x64.Build.0 = Debug|x64
- {29963C5C-4CB6-4406-850A-99503CB87081}.Debug|x86.ActiveCfg = Debug|x86
- {29963C5C-4CB6-4406-850A-99503CB87081}.Debug|x86.Build.0 = Debug|x86
- {29963C5C-4CB6-4406-850A-99503CB87081}.Release|arm64.ActiveCfg = Release|ARM64
- {29963C5C-4CB6-4406-850A-99503CB87081}.Release|arm64.Build.0 = Release|ARM64
- {29963C5C-4CB6-4406-850A-99503CB87081}.Release|x64.ActiveCfg = Release|x64
- {29963C5C-4CB6-4406-850A-99503CB87081}.Release|x64.Build.0 = Release|x64
- {29963C5C-4CB6-4406-850A-99503CB87081}.Release|x86.ActiveCfg = Release|x86
- {29963C5C-4CB6-4406-850A-99503CB87081}.Release|x86.Build.0 = Release|x86
- {EB097CCA-D4B6-4C99-9EB8-161F26345562}.Debug_FailFast|arm64.ActiveCfg = Debug_FailFast|ARM64
- {EB097CCA-D4B6-4C99-9EB8-161F26345562}.Debug_FailFast|arm64.Build.0 = Debug_FailFast|ARM64
- {EB097CCA-D4B6-4C99-9EB8-161F26345562}.Debug_FailFast|x64.ActiveCfg = Debug_FailFast|x64
- {EB097CCA-D4B6-4C99-9EB8-161F26345562}.Debug_FailFast|x64.Build.0 = Debug_FailFast|x64
- {EB097CCA-D4B6-4C99-9EB8-161F26345562}.Debug_FailFast|x86.ActiveCfg = Debug_FailFast|x86
- {EB097CCA-D4B6-4C99-9EB8-161F26345562}.Debug_FailFast|x86.Build.0 = Debug_FailFast|x86
- {EB097CCA-D4B6-4C99-9EB8-161F26345562}.Debug|arm64.ActiveCfg = Debug|ARM64
- {EB097CCA-D4B6-4C99-9EB8-161F26345562}.Debug|arm64.Build.0 = Debug|ARM64
- {EB097CCA-D4B6-4C99-9EB8-161F26345562}.Debug|x64.ActiveCfg = Debug|x64
- {EB097CCA-D4B6-4C99-9EB8-161F26345562}.Debug|x64.Build.0 = Debug|x64
- {EB097CCA-D4B6-4C99-9EB8-161F26345562}.Debug|x86.ActiveCfg = Debug|x86
- {EB097CCA-D4B6-4C99-9EB8-161F26345562}.Debug|x86.Build.0 = Debug|x86
- {EB097CCA-D4B6-4C99-9EB8-161F26345562}.Release|arm64.ActiveCfg = Release|ARM64
- {EB097CCA-D4B6-4C99-9EB8-161F26345562}.Release|arm64.Build.0 = Release|ARM64
- {EB097CCA-D4B6-4C99-9EB8-161F26345562}.Release|x64.ActiveCfg = Release|x64
- {EB097CCA-D4B6-4C99-9EB8-161F26345562}.Release|x64.Build.0 = Release|x64
- {EB097CCA-D4B6-4C99-9EB8-161F26345562}.Release|x86.ActiveCfg = Release|x86
- {EB097CCA-D4B6-4C99-9EB8-161F26345562}.Release|x86.Build.0 = Release|x86
- {F196A38B-190C-4B00-813D-DC0B7AD24CB7}.Debug_FailFast|arm64.ActiveCfg = Debug|x64
- {F196A38B-190C-4B00-813D-DC0B7AD24CB7}.Debug_FailFast|arm64.Build.0 = Debug|x64
- {F196A38B-190C-4B00-813D-DC0B7AD24CB7}.Debug_FailFast|x64.ActiveCfg = Debug|x64
- {F196A38B-190C-4B00-813D-DC0B7AD24CB7}.Debug_FailFast|x64.Build.0 = Debug|x64
- {F196A38B-190C-4B00-813D-DC0B7AD24CB7}.Debug_FailFast|x86.ActiveCfg = Debug|Win32
- {F196A38B-190C-4B00-813D-DC0B7AD24CB7}.Debug_FailFast|x86.Build.0 = Debug|Win32
- {F196A38B-190C-4B00-813D-DC0B7AD24CB7}.Debug|arm64.ActiveCfg = Debug|x64
- {F196A38B-190C-4B00-813D-DC0B7AD24CB7}.Debug|arm64.Build.0 = Debug|x64
- {F196A38B-190C-4B00-813D-DC0B7AD24CB7}.Debug|x64.ActiveCfg = Debug|x64
- {F196A38B-190C-4B00-813D-DC0B7AD24CB7}.Debug|x64.Build.0 = Debug|x64
- {F196A38B-190C-4B00-813D-DC0B7AD24CB7}.Debug|x86.ActiveCfg = Debug|Win32
- {F196A38B-190C-4B00-813D-DC0B7AD24CB7}.Debug|x86.Build.0 = Debug|Win32
- {F196A38B-190C-4B00-813D-DC0B7AD24CB7}.Release|arm64.ActiveCfg = Release|x64
- {F196A38B-190C-4B00-813D-DC0B7AD24CB7}.Release|arm64.Build.0 = Release|x64
- {F196A38B-190C-4B00-813D-DC0B7AD24CB7}.Release|x64.ActiveCfg = Release|x64
- {F196A38B-190C-4B00-813D-DC0B7AD24CB7}.Release|x64.Build.0 = Release|x64
- {F196A38B-190C-4B00-813D-DC0B7AD24CB7}.Release|x86.ActiveCfg = Release|Win32
- {F196A38B-190C-4B00-813D-DC0B7AD24CB7}.Release|x86.Build.0 = Release|Win32
- {024CB70C-3449-4204-9171-A25C6C25783D}.Debug_FailFast|arm64.ActiveCfg = Debug_FailFast|ARM64
- {024CB70C-3449-4204-9171-A25C6C25783D}.Debug_FailFast|arm64.Build.0 = Debug_FailFast|ARM64
- {024CB70C-3449-4204-9171-A25C6C25783D}.Debug_FailFast|x64.ActiveCfg = Debug_FailFast|x64
- {024CB70C-3449-4204-9171-A25C6C25783D}.Debug_FailFast|x64.Build.0 = Debug_FailFast|x64
- {024CB70C-3449-4204-9171-A25C6C25783D}.Debug_FailFast|x86.ActiveCfg = Debug_FailFast|x86
- {024CB70C-3449-4204-9171-A25C6C25783D}.Debug_FailFast|x86.Build.0 = Debug_FailFast|x86
- {024CB70C-3449-4204-9171-A25C6C25783D}.Debug|arm64.ActiveCfg = Debug|ARM64
- {024CB70C-3449-4204-9171-A25C6C25783D}.Debug|arm64.Build.0 = Debug|ARM64
- {024CB70C-3449-4204-9171-A25C6C25783D}.Debug|x64.ActiveCfg = Debug|x64
- {024CB70C-3449-4204-9171-A25C6C25783D}.Debug|x64.Build.0 = Debug|x64
- {024CB70C-3449-4204-9171-A25C6C25783D}.Debug|x86.ActiveCfg = Debug|x86
- {024CB70C-3449-4204-9171-A25C6C25783D}.Debug|x86.Build.0 = Debug|x86
- {024CB70C-3449-4204-9171-A25C6C25783D}.Release|arm64.ActiveCfg = Release|ARM64
- {024CB70C-3449-4204-9171-A25C6C25783D}.Release|arm64.Build.0 = Release|ARM64
- {024CB70C-3449-4204-9171-A25C6C25783D}.Release|x64.ActiveCfg = Release|x64
- {024CB70C-3449-4204-9171-A25C6C25783D}.Release|x64.Build.0 = Release|x64
- {024CB70C-3449-4204-9171-A25C6C25783D}.Release|x86.ActiveCfg = Release|x86
- {024CB70C-3449-4204-9171-A25C6C25783D}.Release|x86.Build.0 = Release|x86
{01CADE81-7333-4E24-A39B-95B7E58D4503}.Debug_FailFast|arm64.ActiveCfg = Debug_FailFast|arm64
{01CADE81-7333-4E24-A39B-95B7E58D4503}.Debug_FailFast|arm64.Build.0 = Debug_FailFast|arm64
{01CADE81-7333-4E24-A39B-95B7E58D4503}.Debug_FailFast|x64.ActiveCfg = Debug_FailFast|x64
@@ -1355,42 +1042,6 @@ Global
{82BD8133-F1D4-4383-BC4F-12EFAE1AFF91}.Release|x64.Build.0 = Release|x64
{82BD8133-F1D4-4383-BC4F-12EFAE1AFF91}.Release|x86.ActiveCfg = Release|x86
{82BD8133-F1D4-4383-BC4F-12EFAE1AFF91}.Release|x86.Build.0 = Release|x86
- {A9B2E87D-540F-4B4C-A4AA-EF3BDDC4171C}.Debug_FailFast|arm64.ActiveCfg = Debug_FailFast|arm64
- {A9B2E87D-540F-4B4C-A4AA-EF3BDDC4171C}.Debug_FailFast|arm64.Build.0 = Debug_FailFast|arm64
- {A9B2E87D-540F-4B4C-A4AA-EF3BDDC4171C}.Debug_FailFast|x64.ActiveCfg = Debug_FailFast|x64
- {A9B2E87D-540F-4B4C-A4AA-EF3BDDC4171C}.Debug_FailFast|x64.Build.0 = Debug_FailFast|x64
- {A9B2E87D-540F-4B4C-A4AA-EF3BDDC4171C}.Debug_FailFast|x86.ActiveCfg = Debug_FailFast|x86
- {A9B2E87D-540F-4B4C-A4AA-EF3BDDC4171C}.Debug_FailFast|x86.Build.0 = Debug_FailFast|x86
- {A9B2E87D-540F-4B4C-A4AA-EF3BDDC4171C}.Debug|arm64.ActiveCfg = Debug|arm64
- {A9B2E87D-540F-4B4C-A4AA-EF3BDDC4171C}.Debug|arm64.Build.0 = Debug|arm64
- {A9B2E87D-540F-4B4C-A4AA-EF3BDDC4171C}.Debug|x64.ActiveCfg = Debug|x64
- {A9B2E87D-540F-4B4C-A4AA-EF3BDDC4171C}.Debug|x64.Build.0 = Debug|x64
- {A9B2E87D-540F-4B4C-A4AA-EF3BDDC4171C}.Debug|x86.ActiveCfg = Debug|x86
- {A9B2E87D-540F-4B4C-A4AA-EF3BDDC4171C}.Debug|x86.Build.0 = Debug|x86
- {A9B2E87D-540F-4B4C-A4AA-EF3BDDC4171C}.Release|arm64.ActiveCfg = Release|arm64
- {A9B2E87D-540F-4B4C-A4AA-EF3BDDC4171C}.Release|arm64.Build.0 = Release|arm64
- {A9B2E87D-540F-4B4C-A4AA-EF3BDDC4171C}.Release|x64.ActiveCfg = Release|x64
- {A9B2E87D-540F-4B4C-A4AA-EF3BDDC4171C}.Release|x64.Build.0 = Release|x64
- {A9B2E87D-540F-4B4C-A4AA-EF3BDDC4171C}.Release|x86.ActiveCfg = Release|x86
- {A9B2E87D-540F-4B4C-A4AA-EF3BDDC4171C}.Release|x86.Build.0 = Release|x86
- {A382B448-A1F3-4D87-A674-736D2987E613}.Debug_FailFast|arm64.ActiveCfg = Debug_FailFast|ARM64
- {A382B448-A1F3-4D87-A674-736D2987E613}.Debug_FailFast|arm64.Build.0 = Debug_FailFast|ARM64
- {A382B448-A1F3-4D87-A674-736D2987E613}.Debug_FailFast|x64.ActiveCfg = Debug_FailFast|x64
- {A382B448-A1F3-4D87-A674-736D2987E613}.Debug_FailFast|x64.Build.0 = Debug_FailFast|x64
- {A382B448-A1F3-4D87-A674-736D2987E613}.Debug_FailFast|x86.ActiveCfg = Debug_FailFast|x86
- {A382B448-A1F3-4D87-A674-736D2987E613}.Debug_FailFast|x86.Build.0 = Debug_FailFast|x86
- {A382B448-A1F3-4D87-A674-736D2987E613}.Debug|arm64.ActiveCfg = Debug|ARM64
- {A382B448-A1F3-4D87-A674-736D2987E613}.Debug|arm64.Build.0 = Debug|ARM64
- {A382B448-A1F3-4D87-A674-736D2987E613}.Debug|x64.ActiveCfg = Debug|x64
- {A382B448-A1F3-4D87-A674-736D2987E613}.Debug|x64.Build.0 = Debug|x64
- {A382B448-A1F3-4D87-A674-736D2987E613}.Debug|x86.ActiveCfg = Debug|x86
- {A382B448-A1F3-4D87-A674-736D2987E613}.Debug|x86.Build.0 = Debug|x86
- {A382B448-A1F3-4D87-A674-736D2987E613}.Release|arm64.ActiveCfg = Release|ARM64
- {A382B448-A1F3-4D87-A674-736D2987E613}.Release|arm64.Build.0 = Release|ARM64
- {A382B448-A1F3-4D87-A674-736D2987E613}.Release|x64.ActiveCfg = Release|x64
- {A382B448-A1F3-4D87-A674-736D2987E613}.Release|x64.Build.0 = Release|x64
- {A382B448-A1F3-4D87-A674-736D2987E613}.Release|x86.ActiveCfg = Release|x86
- {A382B448-A1F3-4D87-A674-736D2987E613}.Release|x86.Build.0 = Release|x86
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
@@ -1414,13 +1065,6 @@ Global
{69F8B7DF-F52B-4B74-9A16-AB3241BB8912} = {F6EAB7D3-8F0A-4455-8969-2EF4A67314A0}
{F6EAB7D3-8F0A-4455-8969-2EF4A67314A0} = {A972EC5B-FC61-4964-A6FF-F9633EB75DFD}
{2F9AD5AF-EF3B-496A-8566-9E9539E3DF43} = {A972EC5B-FC61-4964-A6FF-F9633EB75DFD}
- {D04CD3A1-0B45-4CB3-925F-204F5F6AE2D8} = {A972EC5B-FC61-4964-A6FF-F9633EB75DFD}
- {75945141-03AC-4C40-A586-16D463A0AC1B} = {D04CD3A1-0B45-4CB3-925F-204F5F6AE2D8}
- {092AC740-DA01-4872-8E93-B9557DAD6BE5} = {D04CD3A1-0B45-4CB3-925F-204F5F6AE2D8}
- {80805B43-CE75-4C6E-92F8-F385C1039E53} = {D04CD3A1-0B45-4CB3-925F-204F5F6AE2D8}
- {4B370E2F-FB1D-4887-90BF-3B72517485CE} = {D04CD3A1-0B45-4CB3-925F-204F5F6AE2D8}
- {1477F3EA-A9F6-4B4F-82F4-C2427F57EBEE} = {D04CD3A1-0B45-4CB3-925F-204F5F6AE2D8}
- {AF5A7FA0-E3E8-44C8-8830-31DD08F583E8} = {D04CD3A1-0B45-4CB3-925F-204F5F6AE2D8}
{E7C94F61-D6CF-464D-8D50-210488AF7A50} = {A972EC5B-FC61-4964-A6FF-F9633EB75DFD}
{8FC9A04E-1FFD-42BA-B304-D1FA964D99CE} = {A972EC5B-FC61-4964-A6FF-F9633EB75DFD}
{CFD8A90D-8B6D-4ED6-BA35-FF894BEB46C0} = {8FC9A04E-1FFD-42BA-B304-D1FA964D99CE}
@@ -1439,8 +1083,6 @@ Global
{F4095FD3-6A3F-490B-966D-E63059612EE6} = {3E3791DF-070D-4ADE-96E8-93D6FBD53953}
{0E05A442-BDC7-43D4-A000-F8C986826716} = {3E3791DF-070D-4ADE-96E8-93D6FBD53953}
{D759CD66-494C-4A00-8075-8B65A9891349} = {81AACED5-CFB5-47A6-AFD6-4625AADCFFA3}
- {CAAC0CDF-9AB8-4F43-A3EB-38D785AF5725} = {DB3D0F2C-1A7F-44B4-B408-B21A56212985}
- {DB3D0F2C-1A7F-44B4-B408-B21A56212985} = {A972EC5B-FC61-4964-A6FF-F9633EB75DFD}
{623998FD-B0A6-4980-95D5-A5072301CA10} = {A972EC5B-FC61-4964-A6FF-F9633EB75DFD}
{AF527EA4-6A24-4BD6-BC6E-A5863DC3489C} = {623998FD-B0A6-4980-95D5-A5072301CA10}
{FAB6FAA7-ADF4-4B65-9831-0C819915E6E1} = {A972EC5B-FC61-4964-A6FF-F9633EB75DFD}
@@ -1448,7 +1090,6 @@ Global
{1317314E-9BDD-4F1C-A76F-22121637A091} = {FAB6FAA7-ADF4-4B65-9831-0C819915E6E1}
{2E5629CA-0D1B-42B1-8D6E-934A6E1E18D9} = {FAB6FAA7-ADF4-4B65-9831-0C819915E6E1}
{5F9749BC-F34E-4F45-933F-61E0F3ED521F} = {FAB6FAA7-ADF4-4B65-9831-0C819915E6E1}
- {8EB52F7D-D216-49FF-BF16-DE06E4695950} = {70D3F826-0057-4EAF-AA6D-09479075B056}
{DA5C4FC8-18AF-4446-807F-A2FFFE4DCF6C} = {E0A15760-487A-4CCB-8093-DE6FF3C4BC23}
{8FB1EF90-B693-4A2A-A7F2-44ECA499D769} = {E0A15760-487A-4CCB-8093-DE6FF3C4BC23}
{E768781A-D1F7-4C03-B46D-E76354FAB587} = {A972EC5B-FC61-4964-A6FF-F9633EB75DFD}
@@ -1460,29 +1101,13 @@ Global
{8C1C7BF8-B27B-4F4D-97E5-A16E02C7860E} = {01AB3100-A939-41DD-A67F-1F8C275A307D}
{83D12033-364A-45F2-8FCA-9BD8E8322D91} = {623998FD-B0A6-4980-95D5-A5072301CA10}
{A1FAE679-39D4-4278-A8E8-EA351F21A3E7} = {623998FD-B0A6-4980-95D5-A5072301CA10}
- {8A0AD1A7-29E1-47E1-9579-91F2B460518F} = {E6BC5785-34E5-4A19-81A4-2CC8A37FD63F}
- {13F1F098-262B-432D-977C-F710E6826C5C} = {E6BC5785-34E5-4A19-81A4-2CC8A37FD63F}
- {17E96025-8251-4D62-BFFB-C571F728B66B} = {E6BC5785-34E5-4A19-81A4-2CC8A37FD63F}
- {7857275B-7970-4C26-B092-FF62EA890B1E} = {DB3D0F2C-1A7F-44B4-B408-B21A56212985}
- {29963C5C-4CB6-4406-850A-99503CB87081} = {7857275B-7970-4C26-B092-FF62EA890B1E}
- {81AB1B86-AE3C-4E5B-8918-CA6CCED95266} = {DB3D0F2C-1A7F-44B4-B408-B21A56212985}
- {EB097CCA-D4B6-4C99-9EB8-161F26345562} = {81AB1B86-AE3C-4E5B-8918-CA6CCED95266}
- {F196A38B-190C-4B00-813D-DC0B7AD24CB7} = {7857275B-7970-4C26-B092-FF62EA890B1E}
- {024CB70C-3449-4204-9171-A25C6C25783D} = {7857275B-7970-4C26-B092-FF62EA890B1E}
{567A82BE-7E9E-4D95-AF45-4EE8D57FE16D} = {A972EC5B-FC61-4964-A6FF-F9633EB75DFD}
{82BD8133-F1D4-4383-BC4F-12EFAE1AFF91} = {567A82BE-7E9E-4D95-AF45-4EE8D57FE16D}
- {A9B2E87D-540F-4B4C-A4AA-EF3BDDC4171C} = {FAB6FAA7-ADF4-4B65-9831-0C819915E6E1}
- {A382B448-A1F3-4D87-A674-736D2987E613} = {81AB1B86-AE3C-4E5B-8918-CA6CCED95266}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {030B5641-B206-46BB-BF71-36FF009088FA}
EndGlobalSection
GlobalSection(SharedMSBuildProjectFiles) = preSolution
- build\cppversion\version.vcxitems*{024cb70c-3449-4204-9171-a25c6c25783d}*SharedItemsImports = 5
- build\cppversion\version.vcxitems*{092ac740-da01-4872-8e93-b9557dad6be5}*SharedItemsImports = 5
- build\cppversion\version.vcxitems*{13f1f098-262b-432d-977c-f710e6826c5c}*SharedItemsImports = 5
build\cppversion\version.vcxitems*{60e0fd98-5396-436d-bab7-187a853a5dc6}*SharedItemsImports = 5
- build\cppversion\version.vcxitems*{8a0ad1a7-29e1-47e1-9579-91f2b460518f}*SharedItemsImports = 5
- build\cppversion\version.vcxitems*{caac0cdf-9ab8-4f43-a3eb-38d785af5725}*SharedItemsImports = 5
EndGlobalSection
EndGlobal
diff --git a/Directory.Build.props b/Directory.Build.props
index e887dc5493..fe01fa7fc2 100644
--- a/Directory.Build.props
+++ b/Directory.Build.props
@@ -14,6 +14,7 @@
$(Platform)
false
Debug;Release;Debug_FailFast
+ 10.0.22621.34
DevHome;
DevHome.Experiments-->DevHome;
DevHome.ExtensionLibrary-->DevHome;
- DevHome.DevInsights-->DevHome.Service;
DevHome.Settings-->DevHome;
DevHome.SetupFlow-->DevHome;
DevHome.RepositoryManagement-->DevHome
@@ -70,10 +69,6 @@ Dev Home Common also provides telemetry functionality.
This is a special component that acts similarly to a tool but isn't actually a tool. The Settings component, like other tools, consumes the Common project and is used by Dev Home Core. It manages user preferences across all tools and extensions.
-## Service
-
-This is an NT service which runs as local system that provides functionality to various DevHome components. This functionality would typically require elevation and isn't transactional in nature. For items in DevHome that require elevation and are of a transactional nature, helper utilities are launched elevated instead.
-
## Tools
The tools are a set of functionalities that are integrated within Dev Home's codebase. They are designed to provide specific capabilities or features to Dev Home. They live as their own component but run in the same process as Dev Home and can communicate with each other and the core component through Dev Home's API.
diff --git a/docs/sampleConfigurations/Repositories/microsoft/gdk/configuration.dsc.yaml b/docs/sampleConfigurations/Repositories/microsoft/gdk/configuration.dsc.yaml
index 77f910e003..1a1634fe66 100644
--- a/docs/sampleConfigurations/Repositories/microsoft/gdk/configuration.dsc.yaml
+++ b/docs/sampleConfigurations/Repositories/microsoft/gdk/configuration.dsc.yaml
@@ -32,6 +32,6 @@ properties:
module: Microsoft.WinGet.DSC
allowPrerelease: true
settings:
- id: Microsoft.GDK.2303
+ id: Microsoft.Gaming.GDK
source: winget
configurationVersion: 0.2.0
\ No newline at end of file
diff --git a/extensions/GitExtension/FileExplorerGitIntegration/Models/GitConfiguration.cs b/extensions/GitExtension/FileExplorerGitIntegration/Models/GitConfiguration.cs
index d656d0171d..9489d7b1b5 100644
--- a/extensions/GitExtension/FileExplorerGitIntegration/Models/GitConfiguration.cs
+++ b/extensions/GitExtension/FileExplorerGitIntegration/Models/GitConfiguration.cs
@@ -16,7 +16,7 @@ public class GitConfiguration : IDisposable
private string GitExeInstallPath { get; set; } = string.Empty;
- private readonly object _fileLock = new();
+ private static readonly object _fileLock = new();
private readonly ILogger _log = Log.ForContext();
diff --git a/extensions/GitExtension/FileExplorerGitIntegration/Models/GitDetect.cs b/extensions/GitExtension/FileExplorerGitIntegration/Models/GitDetect.cs
index 28b1e0df5b..5ba26c8c46 100644
--- a/extensions/GitExtension/FileExplorerGitIntegration/Models/GitDetect.cs
+++ b/extensions/GitExtension/FileExplorerGitIntegration/Models/GitDetect.cs
@@ -1,6 +1,9 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
+using DevHome.Common.TelemetryEvents.GitExtension;
+using DevHome.Common.TelemetryEvents.SourceControlIntegration;
+using DevHome.Telemetry;
using Microsoft.Win32;
using Microsoft.Windows.DevHome.SDK;
using Serilog;
@@ -13,6 +16,12 @@ public class GitDetect
private readonly ILogger _log = Log.ForContext();
+ private struct DetectInfo
+ {
+ public bool Found;
+ public string Version;
+ }
+
public GitDetect()
{
GitConfiguration = new GitConfiguration(null);
@@ -20,19 +29,21 @@ public GitDetect()
public bool DetectGit()
{
- var gitExeFound = false;
+ var detect = new DetectInfo { Found = false, Version = string.Empty };
+ var status = GitDetectStatus.NotFound;
- if (!gitExeFound)
+ if (!detect.Found)
{
// Check if git.exe is present in PATH environment variable
- gitExeFound = ValidateGitConfigurationPath("git.exe");
- if (gitExeFound)
+ detect = ValidateGitConfigurationPath("git.exe");
+ if (detect.Found)
{
+ status = GitDetectStatus.PathEnvironmentVariable;
GitConfiguration.StoreGitExeInstallPath("git.exe");
}
}
- if (!gitExeFound)
+ if (!detect.Found)
{
// Check execution of git.exe by finding install location in registry keys
string[] registryPaths = { "HKEY_CURRENT_USER\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\Git_is1", "HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\Git_is1" };
@@ -43,25 +54,31 @@ public bool DetectGit()
if (!string.IsNullOrEmpty(gitPath))
{
var paths = FindSubdirectories(gitPath);
- gitExeFound = CheckForExeInPaths(paths);
- if (gitExeFound)
+ detect = CheckForExeInPaths(paths);
+ if (detect.Found)
{
+ status = GitDetectStatus.RegistryProbe;
break;
}
}
}
}
- if (!gitExeFound)
+ if (!detect.Found)
{
// Search for git.exe in common file paths
var programFiles = Environment.GetEnvironmentVariable("ProgramFiles");
var programFilesX86 = Environment.GetEnvironmentVariable("ProgramFiles(x86)");
string[] possiblePaths = { $"{programFiles}\\Git\\bin", $"{programFilesX86}\\Git\\bin", $"{programFiles}\\Git\\cmd", $"{programFilesX86}\\Git\\cmd" };
- gitExeFound = CheckForExeInPaths(possiblePaths);
+ detect = CheckForExeInPaths(possiblePaths);
+ if (detect.Found)
+ {
+ status = GitDetectStatus.ProgramFiles;
+ }
}
- return gitExeFound;
+ TelemetryFactory.Get().Log("GitDetect_Event", LogLevel.Critical, new GitDetectEvent(status, detect.Version));
+ return detect.Found;
}
private string[] FindSubdirectories(string installLocation)
@@ -85,35 +102,35 @@ private string[] FindSubdirectories(string installLocation)
}
}
- private bool CheckForExeInPaths(string[] possiblePaths)
+ private DetectInfo CheckForExeInPaths(string[] possiblePaths)
{
// Iterate through the possible paths to find the git.exe file
foreach (var path in possiblePaths.Where(x => !string.IsNullOrEmpty(x)))
{
var gitPath = Path.Combine(path, "git.exe");
- var isValid = ValidateGitConfigurationPath(gitPath);
+ var detect = ValidateGitConfigurationPath(gitPath);
// If the git.exe file is found, store the install path and log the information
- if (isValid)
+ if (detect.Found)
{
GitConfiguration.StoreGitExeInstallPath(gitPath);
_log.Information("Git Exe Install Path found");
- return true;
+ return detect;
}
}
_log.Debug("Git.exe not found in paths examined");
- return false;
+ return new DetectInfo { Found = false, Version = string.Empty };
}
- public bool ValidateGitConfigurationPath(string path)
+ private DetectInfo ValidateGitConfigurationPath(string path)
{
var result = GitExecute.ExecuteGitCommand(path, string.Empty, "--version");
if (result.Status == ProviderOperationStatus.Success && result.Output != null && result.Output.Contains("git version"))
{
- return true;
+ return new DetectInfo { Found = true, Version = result.Output.Replace("git version", string.Empty).TrimEnd() };
}
- return false;
+ return new DetectInfo { Found = false, Version = string.Empty };
}
}
diff --git a/extensionsdk/Directory.Build.props b/extensionsdk/Directory.Build.props
index 275497c199..3120f6f26e 100644
--- a/extensionsdk/Directory.Build.props
+++ b/extensionsdk/Directory.Build.props
@@ -12,6 +12,7 @@
true
Recommended
$(Platform)
+ 10.0.19041.34
diff --git a/service/DevHome.Service.IDL/DevHome.Service.IDL.vcxproj b/service/DevHome.Service.IDL/DevHome.Service.IDL.vcxproj
deleted file mode 100644
index 89cbbc02f6..0000000000
--- a/service/DevHome.Service.IDL/DevHome.Service.IDL.vcxproj
+++ /dev/null
@@ -1,167 +0,0 @@
-
-
-
-
- Debug
- Win32
-
-
- Release
- Win32
-
-
- Debug
- x64
-
-
- Release
- x64
-
-
-
-
-
-
- 17.0
- Win32Proj
- {17e96025-8251-4d62-bffb-c571f728b66b}
- DevHomeServiceIDL
- 10.0
-
-
-
- DynamicLibrary
- true
- v143
- Unicode
-
-
- DynamicLibrary
- false
- v143
- true
- Unicode
-
-
- DynamicLibrary
- true
- v143
- Unicode
-
-
- DynamicLibrary
- false
- v143
- true
- Unicode
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Level3
- true
- WIN32;_DEBUG;DEVHOMESERVICEIDL_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)
- true
- Use
- pch.h
-
-
- Windows
- true
- false
-
-
- true
- %(IntDir)%(Filename).winmd
- $(WindowsSDK_MetadataFoundationPath);%(AdditionalMetadataDirectories)
- $(ProjectDir)Generated Files
-
-
-
-
- Level3
- true
- true
- true
- WIN32;NDEBUG;DEVHOMESERVICEIDL_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)
- true
- Use
- pch.h
-
-
- Windows
- true
- true
- true
- false
-
-
- true
- %(IntDir)%(Filename).winmd
- $(WindowsSDK_MetadataFoundationPath);%(AdditionalMetadataDirectories)
- $(ProjectDir)Generated Files
-
-
-
-
- Level3
- true
- _DEBUG;DEVHOMESERVICEIDL_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)
- true
-
-
- Windows
- true
- false
-
-
- true
- %(IntDir)%(Filename).winmd
- $(WindowsSDK_MetadataFoundationPath);%(AdditionalMetadataDirectories)
- $(ProjectDir)Generated Files
-
-
-
-
- Level3
- true
- true
- true
- NDEBUG;DEVHOMESERVICEIDL_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)
- true
-
-
- Windows
- true
- true
- true
- false
-
-
- true
- %(IntDir)%(Filename).winmd
- $(WindowsSDK_MetadataFoundationPath);%(AdditionalMetadataDirectories)
- $(ProjectDir)Generated Files
-
-
-
-
-
-
\ No newline at end of file
diff --git a/service/DevHome.Service.Projection/DevHome.Service.Projection.csproj b/service/DevHome.Service.Projection/DevHome.Service.Projection.csproj
deleted file mode 100644
index 89f7a75a98..0000000000
--- a/service/DevHome.Service.Projection/DevHome.Service.Projection.csproj
+++ /dev/null
@@ -1,24 +0,0 @@
-
-
-
- None
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- DevHome.Service
- $(SolutionDir)DevHome.Service.Projection\bin\$(Platform)\$(Configuration)\
-
-
-
diff --git a/service/DevHome.Service/BasicClassWinRTFactory`1.cs b/service/DevHome.Service/BasicClassWinRTFactory`1.cs
deleted file mode 100644
index 5953cc5f1c..0000000000
--- a/service/DevHome.Service/BasicClassWinRTFactory`1.cs
+++ /dev/null
@@ -1,81 +0,0 @@
-// Copyright (c) Microsoft Corporation.
-// Licensed under the MIT License.
-
-using System.Runtime.InteropServices;
-using DevHome.Service;
-using Windows.Win32.Foundation;
-using WinRT;
-
-namespace COMRegistration;
-
-[ComVisible(true)]
-public class BasicClassWinRTFactory : IClassFactory
-where T : new()
-{
- public BasicClassWinRTFactory()
- {
- }
-
- public int CreateInstance(IntPtr pUnkOuter, ref Guid riid, out IntPtr ppvObject)
- {
- ppvObject = IntPtr.Zero;
-
- if (pUnkOuter != IntPtr.Zero)
- {
- Marshal.ThrowExceptionForHR(HRESULT.CLASS_E_NOAGGREGATION);
- }
-
- if (riid == typeof(T).GUID || riid == Guid.Parse(Guids.IUnknown))
- {
- try
- {
- // Create the instance of the WinRT object
- ppvObject = MarshalInspectable.FromManaged(new T());
- }
- catch (Exception)
- {
- // We failed creating an object (possibly due to access denied). If we were just spun up
- // to handle this (failed) activation, shut down our service.
- if (ServiceLifetimeController.CanUnload())
- {
- WindowsBackgroundService.Stop();
- }
-
- throw;
- }
- }
- else
- {
- // The object that ppvObject points to does not support the
- // interface identified by riid.
- Marshal.ThrowExceptionForHR(HRESULT.E_NOINTERFACE);
- }
-
- return 0;
- }
-
- int IClassFactory.LockServer(bool fLock)
- {
- return 0;
- }
-}
-
-internal static class Guids
-{
- public const string IClassFactory = "00000001-0000-0000-C000-000000000046";
- public const string IUnknown = "00000000-0000-0000-C000-000000000046";
-}
-
-// IClassFactory declaration
-[ComImport]
-[ComVisible(false)]
-[InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
-[Guid(Guids.IClassFactory)]
-internal interface IClassFactory
-{
- [PreserveSig]
- int CreateInstance(IntPtr pUnkOuter, ref Guid riid, out IntPtr ppvObject);
-
- [PreserveSig]
- int LockServer(bool fLock);
-}
diff --git a/service/DevHome.Service/ComHelpers.cs b/service/DevHome.Service/ComHelpers.cs
deleted file mode 100644
index df58cb4083..0000000000
--- a/service/DevHome.Service/ComHelpers.cs
+++ /dev/null
@@ -1,146 +0,0 @@
-// Copyright (c) Microsoft Corporation.
-// Licensed under the MIT License.
-
-using System.Diagnostics;
-using System.Runtime.InteropServices;
-using System.Runtime.InteropServices.Marshalling;
-using System.Security.Principal;
-using Microsoft.Win32.SafeHandles;
-using Windows.ApplicationModel;
-using Windows.Win32;
-using Windows.Win32.Foundation;
-using Windows.Win32.Security;
-using Windows.Win32.System.Com;
-using Windows.Win32.System.Rpc;
-using Windows.Win32.System.Threading;
-
-namespace DevHome.Service;
-
-internal sealed class ComHelpers
-{
- [System.Diagnostics.CodeAnalysis.SuppressMessage("Style", "IDE1006:Naming Styles", Justification = "Well-known constant")]
- [System.Diagnostics.CodeAnalysis.SuppressMessage("StyleCop.CSharp.NamingRules", "SA1310:Field names should not contain underscore", Justification = "Well-known constant")]
- [System.Diagnostics.CodeAnalysis.SuppressMessage("StyleCop.CSharp.NamingRules", "SA1306:Field names should begin with lower-case letter", Justification = "Well-known constant")]
- private static readonly Guid CLSID_GlobalOptions = new("0000034B-0000-0000-C000-000000000046");
-
- public static void EnableFastCOMRundown()
- {
- // We need to be careful creating the GlobalOptions object. We can't use the baked in CLR marshaller, as it calls CoInitializeSecurity under
- // the covers... and we need to be able to set these options *before* we call CoInitializeSecurity.
- CoCreateInstanceNoMarshal(CLSID_GlobalOptions, IntPtr.Zero, CLSCTX.CLSCTX_INPROC_SERVER | CLSCTX.CLSCTX_INPROC_HANDLER, typeof(IGlobalOptions).GUID, out IntPtr ptr).ThrowOnFailure();
-
- ComWrappers cw = new StrategyBasedComWrappers();
- IGlobalOptions option2 = (IGlobalOptions)cw.GetOrCreateObjectForComInstance(ptr, CreateObjectFlags.None);
-
- // Enable fast COM rundown
- option2.SetItem((uint)GLOBALOPT_PROPERTIES.COMGLB_RO_SETTINGS, (uint)GLOBALOPT_RO_FLAGS.COMGLB_FAST_RUNDOWN);
-
- // Don't allow exceptions to be handled by COM. Crash the service instead
- option2.SetItem((uint)GLOBALOPT_PROPERTIES.COMGLB_EXCEPTION_HANDLING, (uint)GLOBALOPT_EH_VALUES.COMGLB_EXCEPTION_DONOT_HANDLE_ANY);
- }
-
- public static void InitializeSecurity()
- {
- unsafe
- {
- PInvoke.CoInitializeSecurity((PSECURITY_DESCRIPTOR)null, -1, null, null, RPC_C_AUTHN_LEVEL.RPC_C_AUTHN_LEVEL_NONE, RPC_C_IMP_LEVEL.RPC_C_IMP_LEVEL_IMPERSONATE, null, EOLE_AUTHENTICATION_CAPABILITIES.EOAC_NONE, null);
- }
- }
-
- public static void VerifyCaller(Process caller)
- {
- VerifyCallerIsFromTheSamePackage(caller);
- VerifyCallerIsInTheSameDirectory(caller);
- }
-
- public static Process GetClientProcess()
- {
- unsafe
- {
- uint callerPid = 0;
- RPC_STATUS rpcStatus = PInvoke.I_RpcBindingInqLocalClientPID(null, ref callerPid);
-
- // Unable to figure out our caller
- if (rpcStatus != RPC_STATUS.RPC_S_OK)
- {
- throw new UnauthorizedAccessException();
- }
-
- return Process.GetProcessById((int)callerPid);
- }
- }
-
- public static void VerifyCallerIsInTheSameDirectory(Process callerProcess)
- {
- FileInfo callerFileInfo = new FileInfo(callerProcess.MainModule?.FileName ?? string.Empty);
- FileInfo serverFileInfo = new FileInfo(Process.GetCurrentProcess().MainModule?.FileName ?? string.Empty);
-
- if (!callerFileInfo.Exists || !serverFileInfo.Exists)
- {
- throw new UnauthorizedAccessException();
- }
-
- if (callerFileInfo.DirectoryName != serverFileInfo.DirectoryName)
- {
- throw new UnauthorizedAccessException();
- }
-
- // Our caller is in the same directory that we are
- }
-
- public static void VerifyCallerIsFromTheSamePackage(Process caller)
- {
- unsafe
- {
- string devHomeServicePackage = Package.Current.Id.FullName;
-
- SafeProcessHandle h = new(PInvoke.OpenProcess(PROCESS_ACCESS_RIGHTS.PROCESS_QUERY_LIMITED_INFORMATION, false, (uint)caller.Id), true);
-
- if (h.IsInvalid)
- {
- throw new UnauthorizedAccessException();
- }
-
- bool f = PInvoke.OpenProcessToken(h, TOKEN_ACCESS_MASK.TOKEN_QUERY, out SafeFileHandle token);
-
- if (!f || token.IsInvalid)
- {
- throw new UnauthorizedAccessException();
- }
-
- Span outputBuffer = new char[10000];
- uint packageFullNameLength = 10000;
-
- fixed (char* outBufferPointer = outputBuffer)
- {
- var callerPackageName = new PWSTR(outBufferPointer);
- var res = PInvoke.GetPackageFullNameFromToken(token, ref packageFullNameLength, callerPackageName);
- var callerPackageNameString = new string(callerPackageName);
-
- if (res != WIN32_ERROR.ERROR_SUCCESS || !devHomeServicePackage.Equals(callerPackageNameString, StringComparison.Ordinal))
- {
- throw new UnauthorizedAccessException();
- }
- }
-
- // We're running with the same package identity
- }
- }
-
- [DllImport("ole32.dll", EntryPoint = "CoCreateInstance")]
- public static extern HRESULT CoCreateInstanceNoMarshal(
- [In, MarshalAs(UnmanagedType.LPStruct)] Guid rclsid,
- IntPtr pUnkOuter,
- CLSCTX dwClsContext,
- [In, MarshalAs(UnmanagedType.LPStruct)] Guid riid,
- out IntPtr ppv);
-}
-
-[Guid("0000015B-0000-0000-C000-000000000046")]
-[GeneratedComInterface]
-internal partial interface IGlobalOptions
-{
- void SetItem(uint dwProperty, uint dwValue);
-
- void Query(uint dwProperty, out uint pdwValue);
-}
diff --git a/service/DevHome.Service/DevHome.Service.csproj b/service/DevHome.Service/DevHome.Service.csproj
deleted file mode 100644
index f44057a8d4..0000000000
--- a/service/DevHome.Service/DevHome.Service.csproj
+++ /dev/null
@@ -1,31 +0,0 @@
-
-
-
- enable
- DevHome.Service
- enable
- WinExe
- win-x86;win-x64;win-arm64
- $(SolutionDir)\src\Properties\PublishProfiles\win-$(Platform).pubxml
-
-
-
-
-
-
-
- all
- runtime; build; native; contentfiles; analyzers; buildtransitive
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/service/DevHome.Service/DevHomeService.cs b/service/DevHome.Service/DevHomeService.cs
deleted file mode 100644
index ac6c4344b8..0000000000
--- a/service/DevHome.Service/DevHomeService.cs
+++ /dev/null
@@ -1,97 +0,0 @@
-// Copyright (c) Microsoft Corporation.
-// Licensed under the MIT License.
-
-using System.Diagnostics;
-using System.Runtime.InteropServices;
-using Microsoft.Diagnostics.Tracing.Parsers;
-using Microsoft.Diagnostics.Tracing.Session;
-using Windows.Win32.Foundation;
-
-namespace DevHome.Service.Runtime;
-
-[ComVisible(true)]
-public class DevHomeService : IDevHomeService, IDisposable
-{
- private readonly Process _owner;
-
- public event MissingFileProcessLaunchFailureHandler? MissingFileProcessLaunchFailure;
-
- private TraceEventSession? _etwSession;
-
- public DevHomeService()
- {
- Process myCaller = ComHelpers.GetClientProcess();
- ComHelpers.VerifyCaller(myCaller);
-
- _owner = myCaller;
- _owner.EnableRaisingEvents = true;
-
- // Track our caller process
- ServiceLifetimeController.ServiceStop += ServiceLifetimeController_ServiceStop;
- ServiceLifetimeController.RegisterProcess(_owner);
-
- var crashDumpAnalyzerThread = new Thread(() =>
- {
- KernelEventETWListener();
- });
- crashDumpAnalyzerThread.Name = "KernelEventETWListenerThread";
- crashDumpAnalyzerThread.Start();
-
- _owner.Exited += Owner_Exited;
- }
-
- private void ServiceLifetimeController_ServiceStop()
- {
- // Be sure to stop our ETW session when we exit. It's possible this gets called multiple times
- // if we have multiple instances of our object... that's ok.
- _etwSession?.Stop();
- }
-
- private void Owner_Exited(object? sender, EventArgs e)
- {
- // The owner of our object has exited. We'll stop listening to ETW events from this channel, but keep it open in case there are
- // other listeners of the channel in this process.
- _etwSession?.Source.StopProcessing();
- }
-
- private void KernelEventETWListener()
- {
- _etwSession = new TraceEventSession("DevHome.Service.KernelEventETWListenerSession");
-
- // Enable the kernel provider to look for processes exiting with non-zero exit codes
- _etwSession.EnableKernelProvider(KernelTraceEventParser.Keywords.Process);
-
- _etwSession.Source.Kernel.ProcessStop += data =>
- {
- // Only return data for processes in session 0 or the caller's session (don't let one session spy on another session)
- if (data.SessionID == 0 || data.SessionID == _owner.SessionId)
- {
- if (data.ExitStatus == NTSTATUS.STATUS_DLL_NOT_FOUND || data.ExitStatus == (int)WIN32_ERROR.ERROR_MOD_NOT_FOUND)
- {
- MissingFileProcessLaunchFailureInfo info = default(MissingFileProcessLaunchFailureInfo);
- info.processName = data.ImageFileName;
- info.pid = data.ProcessID;
- info.exitCode = data.ExitStatus;
-
- try
- {
- MissingFileProcessLaunchFailure?.Invoke(info);
- }
- catch (Exception)
- {
- // We don't want to crash the process if the event handler throws an exception
- }
- }
- }
- };
-
- _etwSession.Source.Process();
- }
-
- public void Dispose()
- {
- _etwSession?.Source.StopProcessing();
- _etwSession?.Dispose();
- GC.SuppressFinalize(this);
- }
-}
diff --git a/service/DevHome.Service/NativeMethods.json b/service/DevHome.Service/NativeMethods.json
deleted file mode 100644
index 7cd04b8f2e..0000000000
--- a/service/DevHome.Service/NativeMethods.json
+++ /dev/null
@@ -1,4 +0,0 @@
-{
- "$schema": "https://aka.ms/CsWin32.schema.json",
- "wideCharOnly": true
-}
diff --git a/service/DevHome.Service/NativeMethods.txt b/service/DevHome.Service/NativeMethods.txt
deleted file mode 100644
index 210cef5c3e..0000000000
--- a/service/DevHome.Service/NativeMethods.txt
+++ /dev/null
@@ -1,18 +0,0 @@
-CoInitializeEx
-CoInitializeSecurity
-CoGetCallContext
-CoRegisterClassObject
-CoResumeClassObjects
-GetPackageFullNameFromToken
-I_RpcBindingInqLocalClientPID
-OpenProcess
-OpenProcessToken
-CLASS_E_NOAGGREGATION
-E_ACCESSDENIED
-E_NOINTERFACE
-GLOBALOPT_EH_VALUES
-GLOBALOPT_PROPERTIES
-GLOBALOPT_RO_FLAGS
-STATUS_DLL_NOT_FOUND
-WIN32_ERROR
-
diff --git a/service/DevHome.Service/Program.cs b/service/DevHome.Service/Program.cs
deleted file mode 100644
index 258ef0a98f..0000000000
--- a/service/DevHome.Service/Program.cs
+++ /dev/null
@@ -1,20 +0,0 @@
-// Copyright (c) Microsoft Corporation.
-// Licensed under the MIT License.
-
-using DevHome.Service;
-using DevHome.Service.Runtime;
-
-ComHelpers.EnableFastCOMRundown();
-ComHelpers.InitializeSecurity();
-
-HostApplicationBuilder builder = Host.CreateApplicationBuilder(args);
-builder.Services.AddWindowsService(options =>
-{
- options.ServiceName = "DevHome Service";
-});
-
-builder.Services.AddSingleton();
-builder.Services.AddHostedService();
-
-IHost host = builder.Build();
-host.Run();
diff --git a/service/DevHome.Service/ServiceLifetimeController.cs b/service/DevHome.Service/ServiceLifetimeController.cs
deleted file mode 100644
index 05351be3e4..0000000000
--- a/service/DevHome.Service/ServiceLifetimeController.cs
+++ /dev/null
@@ -1,59 +0,0 @@
-// Copyright (c) Microsoft Corporation.
-// Licensed under the MIT License.
-
-using System.Diagnostics;
-using System.Runtime.InteropServices;
-using COMRegistration;
-using DevHome.Service.Runtime;
-using Windows.Win32;
-using Windows.Win32.Foundation;
-using Windows.Win32.System.Com;
-
-namespace DevHome.Service;
-
-internal delegate void ServiceStopEvent();
-
-internal sealed class ServiceLifetimeController
-{
- private static readonly List _processes = new();
-
- internal static event ServiceStopEvent? ServiceStop;
-
- public static void RegisterProcess(Process p)
- {
- lock (_processes)
- {
- if (!_processes.Contains(p))
- {
- _processes.Add(p);
- p.EnableRaisingEvents = true;
- p.Exited += ProcessExited;
- }
- }
- }
-
- private static void ProcessExited(object? sender, EventArgs e)
- {
- Process? p = sender as Process;
- Debug.Assert(p is not null, "What is this object?");
-
- lock (_processes)
- {
- _processes.Remove(p);
- if (_processes.Count == 0)
- {
- // It's ok to stop the service now
- ServiceStop?.Invoke();
- WindowsBackgroundService.Stop();
- }
- }
- }
-
- public static bool CanUnload()
- {
- lock (_processes)
- {
- return _processes.Count == 0;
- }
- }
-}
diff --git a/service/DevHome.Service/WindowsBackgroundService.cs b/service/DevHome.Service/WindowsBackgroundService.cs
deleted file mode 100644
index c4bd57cbf5..0000000000
--- a/service/DevHome.Service/WindowsBackgroundService.cs
+++ /dev/null
@@ -1,70 +0,0 @@
-// Copyright (c) Microsoft Corporation.
-// Licensed under the MIT License.
-
-using System.Runtime.InteropServices;
-using COMRegistration;
-using DevHome.Service.Runtime;
-using Windows.Win32;
-using Windows.Win32.Foundation;
-using Windows.Win32.System.Com;
-
-namespace DevHome.Service;
-
-public sealed class WindowsBackgroundService() : BackgroundService
-{
- private static readonly ManualResetEventSlim _stopEvent = new(false);
-
- public static void Stop()
- {
- _stopEvent.Set();
- }
-
- protected async override Task ExecuteAsync(CancellationToken stoppingToken)
- {
-#if CANARY_BUILD
- RegisterClass(new Guid("0A920C6E-2569-44D1-A6E4-CE9FA44CD2A7"));
-#elif STABLE_BUILD
- RegisterClass(new Guid("E8D40232-20A1-4F3B-9C0C-AAA6538698C6"));
-#else
- RegisterClass(new Guid("1F98F450-C163-4A99-B257-E1E6CB3E1C57"));
-#endif
-
- try
- {
- await Task.Run(() => _stopEvent.Wait(stoppingToken), stoppingToken);
-
- // If we end up here, it means that internally we decided to terminate the service because
- // we no longer have any clients
- Environment.Exit(0);
- }
- catch (OperationCanceledException)
- {
- // When the stopping token is canceled, for example, a call made from services.msc,
- // we shouldn't exit with a non-zero exit code. In other words, this is expected...
- }
- catch (Exception)
- {
- // Terminates this process and returns an exit code to the operating system.
- // This is required to avoid the 'BackgroundServiceExceptionBehavior', which
- // performs one of two scenarios:
- // 1. When set to "Ignore": will do nothing at all, errors cause zombie services.
- // 2. When set to "StopHost": will cleanly stop the host, and log errors.
- //
- // In order for the Windows Service Management system to leverage configured
- // recovery options, we need to terminate the process with a non-zero exit code.
- Environment.Exit(1);
- }
- }
-
- private readonly List _registrationCookies = new();
-
- public void RegisterClass(Guid clsid)
- where T : new()
- {
- uint cookie;
-
- PInvoke.CoRegisterClassObject(clsid, new BasicClassWinRTFactory(), CLSCTX.CLSCTX_LOCAL_SERVER, REGCLS.REGCLS_MULTIPLEUSE | REGCLS.REGCLS_SUSPENDED, out cookie).ThrowOnFailure();
- _registrationCookies.Add(cookie);
- PInvoke.CoResumeClassObjects().ThrowOnFailure();
- }
-}
diff --git a/service/Devhome.Service.IDL/DevHome.Service.idl b/service/Devhome.Service.IDL/DevHome.Service.idl
deleted file mode 100644
index 8de1060a98..0000000000
--- a/service/Devhome.Service.IDL/DevHome.Service.idl
+++ /dev/null
@@ -1,19 +0,0 @@
-import "inspectable.idl";
-import "windows.foundation.idl";
-
-namespace DevHome.Service
-{
- struct MissingFileProcessLaunchFailureInfo
- {
- String processName;
- Int32 pid;
- Int32 exitCode;
- };
-
- delegate void MissingFileProcessLaunchFailureHandler(MissingFileProcessLaunchFailureInfo failure);
-
- interface IDevHomeService
- {
- event MissingFileProcessLaunchFailureHandler MissingFileProcessLaunchFailure;
- }
-}
\ No newline at end of file
diff --git a/service/Devhome.Service.IDL/Devhome.Service.IDL.vcxproj.filters b/service/Devhome.Service.IDL/Devhome.Service.IDL.vcxproj.filters
deleted file mode 100644
index ad878cbf15..0000000000
--- a/service/Devhome.Service.IDL/Devhome.Service.IDL.vcxproj.filters
+++ /dev/null
@@ -1,22 +0,0 @@
-
-
-
-
- {4FC737F1-C7A5-4376-A066-2A32D752A2FF}
- cpp;c;cc;cxx;c++;cppm;ixx;def;odl;idl;hpj;bat;asm;asmx
-
-
- {93995380-89BD-4b04-88EB-625FBE52EBFB}
- h;hh;hpp;hxx;h++;hm;inl;inc;ipp;xsd
-
-
- {67DA6AB6-F800-4c08-8B7A-83BB121AAD01}
- rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms
-
-
-
-
- Source Files
-
-
-
\ No newline at end of file
diff --git a/settings/DevHome.Settings/DevHome.Settings.csproj b/settings/DevHome.Settings/DevHome.Settings.csproj
index ddb5476d8a..fb4bf5f50a 100644
--- a/settings/DevHome.Settings/DevHome.Settings.csproj
+++ b/settings/DevHome.Settings/DevHome.Settings.csproj
@@ -37,7 +37,6 @@
-
diff --git a/settings/DevHome.Settings/Strings/en-us/Resources.resw b/settings/DevHome.Settings/Strings/en-us/Resources.resw
index 919bd011d9..b0d1acd530 100644
--- a/settings/DevHome.Settings/Strings/en-us/Resources.resw
+++ b/settings/DevHome.Settings/Strings/en-us/Resources.resw
@@ -545,30 +545,6 @@
View logs
Click on this if you want to see Dev Home's logs on your machine.
-
- Quiet background processes
- Name of experimental feature 'Quiet background processes' on the 'Settings -> Experiments' page where you enable it.
-
-
- Quiet background processes allows you to free up resources while developing
- Inline description of the Quiet background processes experimental feature on the 'Settings -> Experiments' page where you enable it.
-
-
- Dev Diagnostics
- Name of experimental feature 'Dev Diagnostics' on the 'Settings -> Experiments' page where you enable it.
-
-
- Dev Diagnostics is a utility to provide deeper insights into your applications
- Inline description of the Dev Diagnostics experimental feature on the 'Settings -> Experiments' page where you enable it.
-
-
- Quickstart Playground
- Locked="{Quickstart Playground}" Title text for the Quickstart Playground feature.
-
-
- Get started in a new devcontainer-based project from a natural language prompt. Enabling this feature installs the Dev Home Azure Extension from the Store.
- Text within a display card that explains what users can do with the Quickstart Playground feature. Users can choose to toggle this feature on or off.
-
File Explorer Source Control Integration
Name of experimental feature 'FileExplorer SourceControl Integration' on the 'Settings -> Experiments' page where you enable it.
@@ -587,6 +563,6 @@
Toggle to allow tester to change the source control provider.
- Show Souce Control Provider
+ Show Source Control Provider
\ No newline at end of file
diff --git a/settings/DevHome.Settings/ViewModels/ExperimentalFeaturesViewModel.cs b/settings/DevHome.Settings/ViewModels/ExperimentalFeaturesViewModel.cs
index ec9528ceab..ba7433dc82 100644
--- a/settings/DevHome.Settings/ViewModels/ExperimentalFeaturesViewModel.cs
+++ b/settings/DevHome.Settings/ViewModels/ExperimentalFeaturesViewModel.cs
@@ -8,7 +8,6 @@
using CommunityToolkit.Mvvm.ComponentModel;
using DevHome.Common.Models;
using DevHome.Common.Services;
-using DevHome.QuietBackgroundProcesses;
using Microsoft.Internal.Windows.DevHome.Helpers.FileExplorer;
namespace DevHome.Settings.ViewModels;
@@ -39,18 +38,6 @@ public ExperimentalFeaturesViewModel(IExperimentationService experimentationServ
///
private bool IsFeaturePresent(ExperimentalFeature experimentalFeature)
{
- if (string.Equals(experimentalFeature.Id, "QuietBackgroundProcessesExperiment", StringComparison.OrdinalIgnoreCase))
- {
- try
- {
- return QuietBackgroundProcessesSessionManager.IsFeaturePresent();
- }
- catch (Exception)
- {
- return false;
- }
- }
-
if (string.Equals(experimentalFeature.Id, "FileExplorerSourceControlIntegration", StringComparison.OrdinalIgnoreCase))
{
try
diff --git a/src/App.xaml.cs b/src/App.xaml.cs
index 3b5a56e6ec..f65485e48d 100644
--- a/src/App.xaml.cs
+++ b/src/App.xaml.cs
@@ -137,7 +137,6 @@ public App()
services.AddSingleton();
services.AddSingleton();
services.AddSingleton();
- services.AddSingleton();
services.AddTransient();
// Core Services
@@ -155,7 +154,6 @@ public App()
services.AddTransient();
services.AddTransient();
services.AddTransient();
- services.AddTransient();
services.AddTransient();
// Settings
diff --git a/src/Assets/WhatsNewPage/DarkTheme/Background.png b/src/Assets/WhatsNewPage/DarkTheme/Background.png
deleted file mode 100644
index 8928371c65..0000000000
Binary files a/src/Assets/WhatsNewPage/DarkTheme/Background.png and /dev/null differ
diff --git a/src/Assets/WhatsNewPage/DarkTheme/DashboardHero.png b/src/Assets/WhatsNewPage/DarkTheme/DashboardHero.png
deleted file mode 100644
index 55332ba7f0..0000000000
Binary files a/src/Assets/WhatsNewPage/DarkTheme/DashboardHero.png and /dev/null differ
diff --git a/src/Assets/WhatsNewPage/DarkTheme/DevDriveHero.png b/src/Assets/WhatsNewPage/DarkTheme/DevDriveHero.png
deleted file mode 100644
index 92a3b9baa1..0000000000
Binary files a/src/Assets/WhatsNewPage/DarkTheme/DevDriveHero.png and /dev/null differ
diff --git a/src/Assets/WhatsNewPage/DarkTheme/DevIdHero.png b/src/Assets/WhatsNewPage/DarkTheme/DevIdHero.png
deleted file mode 100644
index fafd5597b6..0000000000
Binary files a/src/Assets/WhatsNewPage/DarkTheme/DevIdHero.png and /dev/null differ
diff --git a/src/Assets/WhatsNewPage/DarkTheme/Extensions.png b/src/Assets/WhatsNewPage/DarkTheme/Extensions.png
deleted file mode 100644
index 8140bbee4e..0000000000
Binary files a/src/Assets/WhatsNewPage/DarkTheme/Extensions.png and /dev/null differ
diff --git a/src/Assets/WhatsNewPage/DarkTheme/ExtensionsBig.png b/src/Assets/WhatsNewPage/DarkTheme/ExtensionsBig.png
deleted file mode 100644
index d94b9f89ec..0000000000
Binary files a/src/Assets/WhatsNewPage/DarkTheme/ExtensionsBig.png and /dev/null differ
diff --git a/src/Assets/WhatsNewPage/LightTheme/Background.png b/src/Assets/WhatsNewPage/LightTheme/Background.png
deleted file mode 100644
index 222e0e46d0..0000000000
Binary files a/src/Assets/WhatsNewPage/LightTheme/Background.png and /dev/null differ
diff --git a/src/Assets/WhatsNewPage/LightTheme/DashboardHero.png b/src/Assets/WhatsNewPage/LightTheme/DashboardHero.png
deleted file mode 100644
index 9b7bafbc97..0000000000
Binary files a/src/Assets/WhatsNewPage/LightTheme/DashboardHero.png and /dev/null differ
diff --git a/src/Assets/WhatsNewPage/LightTheme/DevDriveHero.png b/src/Assets/WhatsNewPage/LightTheme/DevDriveHero.png
deleted file mode 100644
index f95181790b..0000000000
Binary files a/src/Assets/WhatsNewPage/LightTheme/DevDriveHero.png and /dev/null differ
diff --git a/src/Assets/WhatsNewPage/LightTheme/DevIdHero.png b/src/Assets/WhatsNewPage/LightTheme/DevIdHero.png
deleted file mode 100644
index 9a4a165862..0000000000
Binary files a/src/Assets/WhatsNewPage/LightTheme/DevIdHero.png and /dev/null differ
diff --git a/src/Assets/WhatsNewPage/LightTheme/Extensions.png b/src/Assets/WhatsNewPage/LightTheme/Extensions.png
deleted file mode 100644
index cf2060174f..0000000000
Binary files a/src/Assets/WhatsNewPage/LightTheme/Extensions.png and /dev/null differ
diff --git a/src/Assets/WhatsNewPage/LightTheme/ExtensionsBig.png b/src/Assets/WhatsNewPage/LightTheme/ExtensionsBig.png
deleted file mode 100644
index 608ff6f9ba..0000000000
Binary files a/src/Assets/WhatsNewPage/LightTheme/ExtensionsBig.png and /dev/null differ
diff --git a/src/DevHome.csproj b/src/DevHome.csproj
index 44174b692d..0d92f72493 100644
--- a/src/DevHome.csproj
+++ b/src/DevHome.csproj
@@ -57,10 +57,6 @@
-
-
-
-
@@ -86,9 +82,6 @@
-
-
-
@@ -96,11 +89,6 @@
-
-
-
-
-
@@ -109,7 +97,6 @@
-
@@ -143,30 +130,6 @@
true
-
-
- <_DevHomeInternal_CppPlatform>$(Platform)
- <_DevHomeInternal_CppPlatform Condition="'$(Platform)' == 'x86'">Win32
- $(DevHomeInternal_Win32RuntimePath)$(_DevHomeInternal_CppPlatform)\
-
-
-
- PreserveNewest
-
-
- PreserveNewest
-
-
- PreserveNewest
-
-
- PreserveNewest
-
-
- PreserveNewest
-
-
-
@@ -180,11 +143,6 @@
-
-
- PreserveNewest
-
-
diff --git a/src/Models/ExtensionWrapper.cs b/src/Models/ExtensionWrapper.cs
index 4ee23c2f58..7ecc0c5f5f 100644
--- a/src/Models/ExtensionWrapper.cs
+++ b/src/Models/ExtensionWrapper.cs
@@ -27,7 +27,6 @@ public class ExtensionWrapper : IExtensionWrapper
[typeof(ISettingsProvider)] = ProviderType.Settings,
[typeof(IFeaturedApplicationsProvider)] = ProviderType.FeaturedApplications,
[typeof(IComputeSystemProvider)] = ProviderType.ComputeSystem,
- [typeof(IQuickStartProjectProvider)] = ProviderType.QuickStartProject,
[typeof(ILocalRepositoryProvider)] = ProviderType.LocalRepository,
};
diff --git a/src/Models/WhatsNewCard.cs b/src/Models/WhatsNewCard.cs
deleted file mode 100644
index 0a24671b9b..0000000000
--- a/src/Models/WhatsNewCard.cs
+++ /dev/null
@@ -1,88 +0,0 @@
-// Copyright (c) Microsoft Corporation.
-// Licensed under the MIT License.
-
-using Microsoft.UI.Xaml;
-
-namespace DevHome.Models;
-
-public class WhatsNewCard
-{
- public int Priority
- {
- get; set;
- }
-
- public string? Title
- {
- get; set;
- }
-
- public string? Description
- {
- get; set;
- }
-
- public string? LightThemeImage
- {
- get; set;
- }
-
- public string? DarkThemeImage
- {
- get; set;
- }
-
- public string? LightThemeImageBig
- {
- get; set;
- }
-
- public string? DarkThemeImageBig
- {
- get; set;
- }
-
- public string? ButtonText
- {
- get; set;
- }
-
- public string? PageKey
- {
- get; set;
- }
-
- public string? Link
- {
- get; set;
- }
-
- public bool ShouldShowLink { get; set; } = true;
-
- public bool? ShouldShowIcon
- {
- get; set;
- }
-
- public bool? IsBig
- {
- get; set;
- }
-
- public string? AutomationId
- {
- get; set;
- }
-
- public Visibility HasLinkAndShouldShowIt(string? link, bool shouldShowLink)
- {
- if (link != null && shouldShowLink)
- {
- return Visibility.Visible;
- }
- else
- {
- return Visibility.Collapsed;
- }
- }
-}
diff --git a/src/NavConfig.jsonc b/src/NavConfig.jsonc
index f83e7a23b8..22e5c4d86b 100644
--- a/src/NavConfig.jsonc
+++ b/src/NavConfig.jsonc
@@ -55,31 +55,6 @@
]
},
"experimentalFeatures": [
- {
- "identity": "QuietBackgroundProcessesExperiment",
- "enabledByDefault": false,
- "needsFeaturePresenceCheck": true,
- "buildTypeOverrides": [
- {
- "buildType": "dev",
- "enabledByDefault": true,
- "visible": true
- },
- {
- "buildType": "canary",
- "enabledByDefault": true,
- "visible": true
- },
- {
- "buildType": "stable",
- "enabledByDefault": false,
- "visible": true
- }
- ],
- "openPage": {
- "key": "DevHome.Customization.ViewModels.MainPageViewModel"
- }
- },
{
"identity": "FileExplorerSourceControlIntegration",
"enabledByDefault": false,
@@ -106,55 +81,6 @@
"parameter": "ShowFileExplorer"
}
},
- {
- "identity": "QuickstartPlayground",
- "enabledByDefault": false,
- "buildTypeOverrides": [
- {
- "buildType": "dev",
- "enabledByDefault": true,
- "visible": true
- },
- {
- "buildType": "canary",
- "enabledByDefault": false,
- "visible": true
- },
- {
- "buildType": "stable",
- "enabledByDefault": false,
- "visible": true
- }
- ],
- "openPage": {
- "key": "DevHome.SetupFlow.ViewModels.SetupFlowViewModel",
- "parameter": "StartQuickstartPlayground"
- }
- },
- {
- "identity": "DevDiagnosticsExperiment",
- "enabledByDefault": false,
- "buildTypeOverrides": [
- {
- "buildType": "dev",
- "enabledByDefault": true,
- "visible": true
- },
- {
- "buildType": "canary",
- "enabledByDefault": true,
- "visible": true
- },
- {
- "buildType": "stable",
- "enabledByDefault": false,
- "visible": true
- }
- ],
- "openPage": {
- "key": "DevHome.Utilities.ViewModels.UtilitiesMainPageViewModel"
- }
- },
{
"identity": "RepositoryManagementExperiment",
"enabledByDefault": false,
@@ -174,10 +100,7 @@
"enabledByDefault": false,
"visible": false
}
- ],
- "openPage": {
- "key": "DevHome.RepositoryManagement.ViewModels.RepositoryManagementMainPageView"
- }
+ ]
},
{
"identity": "RepositoryManagementSourceControlSelector",
diff --git a/src/Package-Can.appxmanifest b/src/Package-Can.appxmanifest
index 70f084ee5b..f397ca5c18 100644
--- a/src/Package-Can.appxmanifest
+++ b/src/Package-Can.appxmanifest
@@ -31,23 +31,6 @@
-
-
-
- DevHome.QuietBackgroundProcesses.Server.exe
- singleInstance
-
-
-
-
-
-
- DevHome.QuietBackgroundProcesses.ElevatedServer.exe
- singleInstance
-
-
-
-
com.microsoft.devhome
@@ -333,34 +316,6 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
@@ -402,19 +357,6 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/src/Package-Dev.appxmanifest b/src/Package-Dev.appxmanifest
index 86de2ed19e..da54a1a284 100644
--- a/src/Package-Dev.appxmanifest
+++ b/src/Package-Dev.appxmanifest
@@ -31,23 +31,6 @@
-
-
-
- DevHome.QuietBackgroundProcesses.Server.exe
- singleInstance
-
-
-
-
-
-
- DevHome.QuietBackgroundProcesses.ElevatedServer.exe
- singleInstance
-
-
-
-
com.microsoft.devhome
@@ -333,34 +316,6 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
@@ -402,19 +357,6 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/src/Package.appxmanifest b/src/Package.appxmanifest
index ae5e122fdf..f826b9d69e 100644
--- a/src/Package.appxmanifest
+++ b/src/Package.appxmanifest
@@ -31,23 +31,6 @@
-
-
-
- DevHome.QuietBackgroundProcesses.Server.exe
- singleInstance
-
-
-
-
-
-
- DevHome.QuietBackgroundProcesses.ElevatedServer.exe
- singleInstance
-
-
-
-
com.microsoft.devhome
@@ -335,23 +318,6 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
@@ -391,19 +357,6 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/src/Program.cs b/src/Program.cs
index 815f20c7ed..2eb981d7ac 100644
--- a/src/Program.cs
+++ b/src/Program.cs
@@ -70,7 +70,7 @@ private static async Task DecideRedirection()
// Currently DevHome supports one set of command line arguments, most useful when debugging different apps within the Dev Home package.
//
// For example:
- // --utilitylaunch DevHome.DevDiagnostics.Exe --utilityLaunchArgs "--application problemapp2"
+ // --utilitylaunch DevHome.MyUtility.Exe --utilityLaunchArgs "--application problemapp2"
//
// --utilityLaunch is the name of the utility to launch
// --utilityLaunchArgs are the arguments to pass to the utility. This is optional, but be sure to include the quotes if you have spaces in the arguments.
diff --git a/src/Properties/launchsettings.json b/src/Properties/launchsettings.json
index d27fcc6a29..b4ad332680 100644
--- a/src/Properties/launchsettings.json
+++ b/src/Properties/launchsettings.json
@@ -7,16 +7,6 @@
},
"DevHome (Unpackaged)": {
"commandName": "Project"
- },
- "DevDiagnostics (Package)": {
- "commandName": "MsixPackage",
- "commandLineArgs": "--utilitylaunch DevHome.DevDiagnostics.Exe ",
- "nativeDebugging": true
- },
- "IfeoTool (Packaged)": {
- "commandName": "MsixPackage",
- "commandLineArgs": "--utilitylaunch DevHome.IfeoTool.Exe ",
- "nativeDebugging": true
}
}
}
\ No newline at end of file
diff --git a/src/Services/PageService.cs b/src/Services/PageService.cs
index 834d413e8a..59bc2a70c5 100644
--- a/src/Services/PageService.cs
+++ b/src/Services/PageService.cs
@@ -26,7 +26,7 @@ public class PageService : IPageService
private readonly Dictionary _pages = new();
- public PageService(ILocalSettingsService localSettingsService, IExperimentationService experimentationService, IQuickstartSetupService quickstartSetupService)
+ public PageService(ILocalSettingsService localSettingsService, IExperimentationService experimentationService)
{
// Configure top-level pages from registered tools
var assemblies = AppDomain.CurrentDomain.GetAssemblies();
@@ -46,13 +46,11 @@ where assembly.GetName().Name == tool.Assembly
this.ConfigureCustomizationPages();
// Configure footer pages
- Configure();
this.ConfigureExtensionLibraryPages();
this.ConfigureSettingsPages();
// Configure Experimental Feature pages
ExperimentalFeature.LocalSettingsService = localSettingsService;
- ExperimentalFeature.QuickstartSetupService = quickstartSetupService;
foreach (var experimentalFeature in App.NavConfig.ExperimentFeatures ?? Array.Empty())
{
var enabledByDefault = experimentalFeature.EnabledByDefault;
diff --git a/src/Strings/en-us/Resources.resw b/src/Strings/en-us/Resources.resw
index a724f7de7b..d2d5a36b83 100644
--- a/src/Strings/en-us/Resources.resw
+++ b/src/Strings/en-us/Resources.resw
@@ -129,36 +129,6 @@
All files
Text for a dropdown option in a file picker dialog to show all files in a directory
-
- After you install an extension that connects one of your developer accounts to Dev Home, sign in to that account.
-
-
- Introducing Dev Home
-
-
- Optimize performance with a Dev Drive—Dev Home sets it up for you.
-
-
- Create a Dev Drive
-
-
- Set up your machine, monitor your workflows, and access development utilities all from one centralized location.
-
-
- Get the info you need in one place—add widgets to track issues, pull requests, and system performance.
-
-
- Monitor projects in your dashboard
-
-
- Connect your developer account
-
-
- Keep up with pull requests, checks, merges, and more.
-
-
- Get timely notifications
-
Monitor and track your coding tasks, workflows, system performance, and more on a customizable dashboard.
@@ -180,9 +150,6 @@
Dev Home is getting things ready for you...
-
- Your development control center
-
Feedback
@@ -192,24 +159,6 @@
Dev Home (Preview)
-
- Pin widgets
-
-
- Create Dev Drive
-
-
- Learn more
-
-
- Connect accounts
-
-
- Get started
-
-
- Introducing Dev Home
-
Dev Home (Dev)
The display name for core widgets provider
@@ -234,18 +183,6 @@
Administrator: Dev Home (Preview)
Name of app when run as administrator
-
- Explore extensions
- Button text on extensions card on "whats new" page
-
-
- Extensions help you get more out of Dev Home. For example, get recommendations for other repositories to add when setting up your machine in Dev Home and add other widgets to your dashboard.
- Description of extensions card on "whats new" page
-
-
- Explore Dev Home extensions
- Title of extensions card on "whats new" page
-
CPU
Short name for the machine's Central Processing Unit.
@@ -349,4 +286,10 @@
SSH Keychain widget preview image
+
+ Dev Home is blocked
+
+
+ Check with your IT or System Administrator for support.
+
\ No newline at end of file
diff --git a/src/ViewModels/ShellViewModel.cs b/src/ViewModels/ShellViewModel.cs
index 52bd05383e..8853a6a8fe 100644
--- a/src/ViewModels/ShellViewModel.cs
+++ b/src/ViewModels/ShellViewModel.cs
@@ -35,6 +35,9 @@ public partial class ShellViewModel : ObservableObject
[ObservableProperty]
private InfoBarModel _shellInfoBarModel = new();
+ [ObservableProperty]
+ private bool _isDevHomeGPOEnabled;
+
public ShellViewModel(
INavigationService navigationService,
INavigationViewService navigationViewService,
@@ -53,12 +56,18 @@ public ShellViewModel(
screenReaderService.AnnouncementTextChanged += OnAnnouncementTextChanged;
}
- public async Task OnLoaded()
+ public void OnLoaded()
{
var activationKind = AppInstance.GetCurrent().GetActivatedEventArgs().Kind;
Log.Information($"Activated with kind {activationKind}");
TelemetryFactory.Get().Log("DevHome_Shell_Loaded_Event", LogLevel.Critical, new DevHomeShellLoadedEvent(activationKind));
+ IsDevHomeGPOEnabled = GPOHelper.GetConfiguredEnabledDevHomeValue();
+ if (!IsDevHomeGPOEnabled)
+ {
+ return;
+ }
+
switch (activationKind)
{
case ExtendedActivationKind.File:
@@ -68,8 +77,7 @@ public async Task OnLoaded()
break;
case ExtendedActivationKind.Launch:
default:
- var isNotFirstRun = await _localSettingsService.ReadSettingAsync(WellKnownSettingsKeys.IsNotFirstRun);
- NavigationService.NavigateTo(isNotFirstRun ? NavigationService.DefaultPage : typeof(WhatsNewViewModel).FullName!);
+ NavigationService.NavigateTo(NavigationService.DefaultPage);
break;
}
}
diff --git a/src/ViewModels/WhatsNewViewModel.cs b/src/ViewModels/WhatsNewViewModel.cs
deleted file mode 100644
index f9ec7211e6..0000000000
--- a/src/ViewModels/WhatsNewViewModel.cs
+++ /dev/null
@@ -1,119 +0,0 @@
-// Copyright (c) Microsoft Corporation.
-// Licensed under the MIT License.
-
-using System.Collections.ObjectModel;
-using CommunityToolkit.Mvvm.ComponentModel;
-using CommunityToolkit.Mvvm.Input;
-using DevHome.Common.Services;
-using DevHome.Models;
-
-namespace DevHome.ViewModels;
-
-public partial class WhatsNewViewModel : ObservableObject
-{
- public ObservableCollection Source { get; } = new ObservableCollection();
-
- public ObservableCollection BigSource { get; } = new ObservableCollection();
-
- public int NumberOfBigCards { get; set; }
-
- private readonly INavigationService _navigationService;
-
- public WhatsNewViewModel(INavigationService navigationService)
- {
- _navigationService = navigationService;
- }
-
- public void AddCard(WhatsNewCard card)
- {
- Source.Add(card);
- }
-
- public void AddBigCard(WhatsNewCard card)
- {
- BigSource.Add(card);
- }
-
- // When the width is too small, the big cards should go into the normal sized cards collection.
- // To do this, we first merge all the cards together in a List, then we sort them by priority,
- // and finally throw them back in the normal sized cards collection.
- public void SwitchToSmallerView()
- {
- if (BigSource.Count == 0)
- {
- return;
- }
-
- lock (Source)
- {
- lock (BigSource)
- {
- var cards = new List();
- foreach (var card in BigSource)
- {
- cards.Add(card);
- }
-
- BigSource.Clear();
-
- foreach (var card in Source)
- {
- cards.Add(card);
- }
-
- Source.Clear();
-
- cards.Sort((card1, card2) => card1.Priority - card2.Priority);
-
- foreach (var card in cards)
- {
- Source.Add(card);
- }
- }
- }
- }
-
- // When the widget is large enough for the big cards, we get all the big cards from
- // the normal sized cards collection, order by priority, and throw them back into
- // the big cards collection.
- public void SwitchToLargerView()
- {
- if (BigSource.Count != 0)
- {
- return;
- }
-
- lock (Source)
- {
- lock (BigSource)
- {
- var cards = new List();
- foreach (var card in Source)
- {
- if (card.IsBig == true)
- {
- cards.Add(card);
- }
- }
-
- foreach (var card in cards)
- {
- Source.Remove(card);
- }
-
- cards.Sort((card1, card2) => card1.Priority - card2.Priority);
-
- foreach (var card in cards)
- {
- BigSource.Add(card);
- }
- }
- }
- }
-
- [RelayCommand]
- private void HeaderButtonNavigate()
- {
- _navigationService.NavigateTo(typeof(SetupFlow.ViewModels.SetupFlowViewModel).FullName!);
- }
-}
diff --git a/src/Views/ShellPage.xaml b/src/Views/ShellPage.xaml
index 472dd4f2ce..d52fe57698 100644
--- a/src/Views/ShellPage.xaml
+++ b/src/Views/ShellPage.xaml
@@ -6,7 +6,11 @@
xmlns:behaviors="using:DevHome.Common.Behaviors"
xmlns:i="using:Microsoft.Xaml.Interactivity"
xmlns:windows="using:DevHome.Common.Windows"
+ xmlns:converters="using:CommunityToolkit.WinUI.Converters"
Loaded="OnLoaded">
+
+
+
@@ -30,7 +34,8 @@
OpenPaneLength="350"
ExpandedModeThresholdWidth="1280"
DisplayModeChanged="NavigationViewControl_DisplayModeChanged"
- Header="{x:Bind ((ContentControl)ViewModel.Selected).Content, Mode=OneWay}">
+ Header="{x:Bind ((ContentControl)ViewModel.Selected).Content, Mode=OneWay}"
+ Visibility="{x:Bind ViewModel.IsDevHomeGPOEnabled, Mode=OneWay}">
@@ -62,12 +67,6 @@
-
-
-
-
-
@@ -121,6 +120,21 @@
+
+
+
+
+
diff --git a/src/Views/ShellPage.xaml.cs b/src/Views/ShellPage.xaml.cs
index b9832fb07c..9fa1dbeef2 100644
--- a/src/Views/ShellPage.xaml.cs
+++ b/src/Views/ShellPage.xaml.cs
@@ -38,7 +38,7 @@ public ShellPage(ShellViewModel viewModel)
PointerPressed += OnPointerPressed;
}
- private async void OnLoaded(object sender, Microsoft.UI.Xaml.RoutedEventArgs e)
+ private void OnLoaded(object sender, Microsoft.UI.Xaml.RoutedEventArgs e)
{
TitleBarHelper.UpdateTitleBar(App.MainWindow, ActualTheme);
@@ -47,7 +47,7 @@ private async void OnLoaded(object sender, Microsoft.UI.Xaml.RoutedEventArgs e)
KeyboardAccelerators.Add(BuildKeyboardAccelerator(VirtualKey.Right, VirtualKeyModifiers.Menu));
KeyboardAccelerators.Add(BuildKeyboardAccelerator(VirtualKey.GoForward));
- await ViewModel.OnLoaded();
+ ViewModel.OnLoaded();
}
private void OnActualThemeChanged(FrameworkElement sender, object args)
diff --git a/src/Views/WhatsNewPage.xaml b/src/Views/WhatsNewPage.xaml
deleted file mode 100644
index 069f853d16..0000000000
--- a/src/Views/WhatsNewPage.xaml
+++ /dev/null
@@ -1,321 +0,0 @@
-
-
-
-
-
-
- /Assets/WhatsNewPage/LightTheme/Background.png
- #005FB8
-
-
- /Assets/WhatsNewPage/DarkTheme/Background.png
- #60CDFF
-
-
- /Assets/WhatsNewPage/DarkTheme/Background.png
- #60CDFF
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/src/Views/WhatsNewPage.xaml.cs b/src/Views/WhatsNewPage.xaml.cs
deleted file mode 100644
index 7b66dab6d6..0000000000
--- a/src/Views/WhatsNewPage.xaml.cs
+++ /dev/null
@@ -1,147 +0,0 @@
-// Copyright (c) Microsoft Corporation.
-// Licensed under the MIT License.
-
-using DevHome.Common.Contracts;
-using DevHome.Common.Extensions;
-using DevHome.Common.Helpers;
-using DevHome.Common.Services;
-using DevHome.Common.TelemetryEvents;
-using DevHome.Common.TelemetryEvents.DeveloperId;
-using DevHome.Common.Views;
-using DevHome.Models;
-using DevHome.SetupFlow.Utilities;
-using DevHome.Telemetry;
-using DevHome.ViewModels;
-using Microsoft.UI.Xaml;
-using Microsoft.UI.Xaml.Controls;
-using Windows.System;
-
-namespace DevHome.Views;
-
-public sealed partial class WhatsNewPage : ToolPage
-{
- private readonly Uri _devDrivePageKeyUri = new("ms-settings:disksandvolumes");
- private readonly Uri _devDriveLearnMoreLinkUri = new("https://go.microsoft.com/fwlink/?linkid=2236041");
- private const string DevDriveLinkResourceKey = "WhatsNewPage_DevDriveCard/Link";
-
- public WhatsNewViewModel ViewModel { get; }
-
- public WhatsNewPage()
- {
- ViewModel = Application.Current.GetService();
- InitializeComponent();
- }
-
- private async void OnLoaded(object sender, Microsoft.UI.Xaml.RoutedEventArgs e)
- {
- await Application.Current.GetService().SaveSettingAsync(WellKnownSettingsKeys.IsNotFirstRun, true);
-
- var whatsNewCards = FeaturesContainer.Resources
- .Where((item) => item.Value.GetType() == typeof(WhatsNewCard))
- .Select(card => card.Value as WhatsNewCard)
- .OrderBy(card => card?.Priority ?? 0);
-
- foreach (var card in whatsNewCards)
- {
- if (card is null)
- {
- continue;
- }
-
- // When the Dev Drive feature is not enabled don't show the learn more uri link, but instead move the learn more text into the button content.
- if (string.Equals(card.PageKey, _devDrivePageKeyUri.AbsoluteUri, StringComparison.OrdinalIgnoreCase))
- {
- if (!DevDriveUtil.IsDevDriveFeatureEnabled)
- {
- card.ButtonText = Application.Current.GetService().GetLocalized(DevDriveLinkResourceKey);
- card.ShouldShowLink = false;
- }
- }
- else
- {
- card.ShouldShowIcon = false;
- }
-
- ViewModel.AddCard(card);
- }
-
- var whatsNewBigCards = BigFeaturesContainer.Resources
- .Where((item) => item.Value.GetType() == typeof(WhatsNewCard))
- .Select(card => card.Value as WhatsNewCard)
- .OrderBy(card => card?.Priority ?? 0);
-
- foreach (var card in whatsNewBigCards)
- {
- if (card is null)
- {
- continue;
- }
-
- ViewModel.AddBigCard(card);
- }
-
- ViewModel.NumberOfBigCards = whatsNewBigCards.Count();
-
- MoveBigCardsIfNeeded(this.ActualWidth);
-
- TelemetryFactory.Get().Log(
- "Page_Loaded_Event",
- LogLevel.Critical,
- new PageLoadedEvent(GetType().Name));
- }
-
- private async void Button_ClickAsync(object sender, RoutedEventArgs e)
- {
- var btn = sender as Button;
-
- if (btn?.DataContext is not string pageKey)
- {
- return;
- }
-
- if (pageKey.Equals(_devDrivePageKeyUri.AbsoluteUri, StringComparison.OrdinalIgnoreCase))
- {
- // Only launch the disks and volumes settings page when the Dev Drive feature is enabled.
- // Otherwise redirect the user to the Dev Drive support page to learn more about the feature.
- // Critical level approved by subhasan
- TelemetryFactory.Get().Log(
- "LaunchDisksAndVolumesSettingsPageTriggered",
- LogLevel.Critical,
- new DisksAndVolumesSettingsPageTriggeredEvent(source: "WhatsNewPageView"));
- await Launcher.LaunchUriAsync(DevDriveUtil.IsDevDriveFeatureEnabled ? _devDrivePageKeyUri : _devDriveLearnMoreLinkUri);
- }
- else
- {
- if (pageKey.Equals(typeof(Settings.ViewModels.AccountsViewModel).FullName, StringComparison.OrdinalIgnoreCase))
- {
- TelemetryFactory.Get().Log(
- "EntryPoint_DevId_Event",
- LogLevel.Critical,
- new EntryPointEvent(EntryPointEvent.EntryPoint.WhatsNewPage));
- }
-
- var navigationService = Application.Current.GetService();
- navigationService.NavigateTo(pageKey!);
- }
- }
-
- public void OnSizeChanged(object sender, SizeChangedEventArgs args)
- {
- if (sender as Page == this)
- {
- MoveBigCardsIfNeeded(args.NewSize.Width);
- }
- }
-
- private void MoveBigCardsIfNeeded(double newWidth)
- {
- if (newWidth < 786)
- {
- ViewModel.SwitchToSmallerView();
- }
- else
- {
- ViewModel.SwitchToLargerView();
- }
- }
-}
diff --git a/src/gpo/assets/DevHome.admx b/src/gpo/assets/DevHome.admx
new file mode 100644
index 0000000000..e540dc25f8
--- /dev/null
+++ b/src/gpo/assets/DevHome.admx
@@ -0,0 +1,32 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/gpo/assets/en-US/DevHome.adml b/src/gpo/assets/en-US/DevHome.adml
new file mode 100644
index 0000000000..e6414b8468
--- /dev/null
+++ b/src/gpo/assets/en-US/DevHome.adml
@@ -0,0 +1,29 @@
+
+
+
+ Dev Home
+ Dev Home
+
+
+ Microsoft Dev Home
+
+ Dev Home version 0.1900.* or later
+
+ This policy configures the enabled state for Dev Home.
+
+If you enable this setting, Dev Home will be always enabled and the user won't be able to disable it.
+
+If you disable this setting, Dev Home will be always disabled and the user won't be able to enable it.
+
+If you don't configure this setting, users are able to enable or disable Dev Home.
+
+This policy will override any enabled state policies for individual Dev Home features.
+
+
+ Configure Dev Home enabled state
+
+
+
+
+
diff --git a/telemetry/DevHome.Telemetry.Native/DevHome.Telemetry.Native.targets b/telemetry/DevHome.Telemetry.Native/DevHome.Telemetry.Native.targets
deleted file mode 100644
index 5a844cc25f..0000000000
--- a/telemetry/DevHome.Telemetry.Native/DevHome.Telemetry.Native.targets
+++ /dev/null
@@ -1,4 +0,0 @@
-
-
-
-
diff --git a/telemetry/DevHome.Telemetry.Native/DevHome.Telemetry.Native.vcxproj b/telemetry/DevHome.Telemetry.Native/DevHome.Telemetry.Native.vcxproj
deleted file mode 100644
index 3c1f4df143..0000000000
--- a/telemetry/DevHome.Telemetry.Native/DevHome.Telemetry.Native.vcxproj
+++ /dev/null
@@ -1,193 +0,0 @@
-
-
-
- C++
-
-
-
-
-
- Debug_FailFast
- Win32
-
-
- Debug_FailFast
- x64
-
-
- Debug
- Win32
-
-
- Release
- Win32
-
-
- Debug
- x64
-
-
- Release
- x64
-
-
-
-
-
-
-
-
-
-
- 17.0
- Win32Proj
- {8eb52f7d-d216-49ff-bf16-de06e4695950}
- DevHomeTelemetryNative
- 10.0
- $(CppOutDir)
-
-
-
- StaticLibrary
- true
- v143
- Unicode
-
-
- StaticLibrary
- true
- v143
- Unicode
-
-
- StaticLibrary
- false
- v143
- true
- Unicode
-
-
- StaticLibrary
- true
- v143
- Unicode
-
-
- StaticLibrary
- true
- v143
- Unicode
-
-
- StaticLibrary
- false
- v143
- true
- Unicode
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Level3
- true
- WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)
- true
-
-
- Console
- true
-
-
-
-
- Level3
- true
- WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)
- true
-
-
- Console
- true
-
-
-
-
- Level3
- true
- true
- true
- WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)
- true
-
-
- Console
- true
- true
- true
-
-
-
-
- Level3
- true
- _DEBUG;_CONSOLE;%(PreprocessorDefinitions)
- true
-
-
- Console
- true
-
-
-
-
- Level3
- true
- _DEBUG;_CONSOLE;%(PreprocessorDefinitions)
- true
-
-
- Console
- true
-
-
-
-
- Level3
- true
- true
- true
- NDEBUG;_CONSOLE;%(PreprocessorDefinitions)
- true
-
-
- Console
- true
- true
- true
-
-
-
-
\ No newline at end of file
diff --git a/telemetry/DevHome.Telemetry.Native/inc/DevHomeTelemetryProvider.h b/telemetry/DevHome.Telemetry.Native/inc/DevHomeTelemetryProvider.h
deleted file mode 100644
index 794b3f0247..0000000000
--- a/telemetry/DevHome.Telemetry.Native/inc/DevHomeTelemetryProvider.h
+++ /dev/null
@@ -1,117 +0,0 @@
-// Copyright (c) Microsoft Corporation.
-// Licensed under the MIT License.
-
-#pragma once
-
-//#include
-#include
-#include
-
-#define __WIL_TRACELOGGING_CONFIG_H
-#include
-
-#define DEFINE_CRITICAL_DATA_EVENT_PARAM10( \
- EventId, VarType1, varName1, VarType2, varName2, VarType3, varName3, VarType4, varName4, VarType5, varName5, VarType6, varName6, VarType7, varName7, VarType8, varName8, VarType9, varName9, VarType10, varName10) \
- DEFINE_TRACELOGGING_EVENT_PARAM10( \
- EventId, \
- VarType1, \
- varName1, \
- VarType2, \
- varName2, \
- VarType3, \
- varName3, \
- VarType4, \
- varName4, \
- VarType5, \
- varName5, \
- VarType6, \
- varName6, \
- VarType7, \
- varName7, \
- VarType8, \
- varName8, \
- VarType9, \
- varName9, \
- VarType10, \
- varName10, \
- TraceLoggingKeyword(MICROSOFT_KEYWORD_CRITICAL_DATA))
-
-// [uuid(2e74ff65-bbda-5e80-4c0a-bd8320d4223b)]
-class DevHomeTelemetryProvider : public wil::TraceLoggingProvider
-{
- IMPLEMENT_TRACELOGGING_CLASS(DevHomeTelemetryProvider, "Microsoft.Windows.DevHome", (0x2e74ff65, 0xbbda, 0x5e80, 0x4c, 0x0a, 0xbd, 0x83, 0x20, 0xd4, 0x22, 0x3b));
-
-public:
-
- // Activity for quiet session
- BEGIN_COMPLIANT_CRITICAL_DATA_ACTIVITY_CLASS_WITH_LEVEL(
- QuietBackgroundProcesses_ElevatedServer_Session,
- PDT_ProductAndServicePerformance,
- WINEVENT_LEVEL_LOG_ALWAYS);
-
- DEFINE_ACTIVITY_START(bool isPlacebo, uint64_t expectedDuration)
- {
- TraceLoggingClassWriteStart(
- QuietBackgroundProcesses_ElevatedServer_Session,
- TraceLoggingValue(isPlacebo, "isPlacebo"),
- TraceLoggingValue(expectedDuration, "expectedDuration"));
- }
- DEFINE_ACTIVITY_STOP(bool manuallyStopped, uint64_t actualDuration)
- {
- TraceLoggingClassWriteStop(
- QuietBackgroundProcesses_ElevatedServer_Session,
- TraceLoggingValue(manuallyStopped, "manuallyStopped"),
- TraceLoggingValue(actualDuration, "actualDuration"));
- }
- END_ACTIVITY_CLASS();
-
-
- // Activity for process metrics
- BEGIN_COMPLIANT_CRITICAL_DATA_ACTIVITY_CLASS_WITH_LEVEL(
- QuietBackgroundProcesses_PerformanceMetrics,
- PDT_ProductAndServicePerformance,
- WINEVENT_LEVEL_LOG_ALWAYS);
-
- DEFINE_ACTIVITY_START(uint32_t quietSessionVersion, uint64_t samplingPeriodInMs, uint64_t totalCpuUsageInMicroseconds)
- {
- TraceLoggingClassWriteStart(QuietBackgroundProcesses_PerformanceMetrics,
- TraceLoggingValue(quietSessionVersion, "quietSessionVersion"),
- TraceLoggingValue(samplingPeriodInMs, "samplingPeriodInMs"),
- TraceLoggingValue(totalCpuUsageInMicroseconds, "totalCpuUsageInMicroseconds")
- );
- }
-
- DEFINE_CRITICAL_DATA_EVENT_PARAM4(
- QuietBackgroundProcesses_ComputerInfo,
- DWORD, processorCount,
- PCWSTR, processor,
- PCWSTR, motherboard,
- DWORD, ram);
-
- DEFINE_CRITICAL_DATA_EVENT_PARAM10(
- QuietBackgroundProcesses_SessionCategoryMetrics,
- int, numProcesses_unknown,
- int, numProcesses_user,
- int, numProcesses_system,
- int, numProcesses_developer,
- int, numProcesses_background,
- int, totalCpuTimesByCategory_unknown,
- int, totalCpuTimesByCategory_user,
- int, totalCpuTimesByCategory_system,
- int, totalCpuTimesByCategory_developer,
- int, totalCpuTimesByCategory_background);
-
- DEFINE_CRITICAL_DATA_EVENT_PARAM10(
- QuietBackgroundProcesses_ProcessInfo,
- int, reason,
- bool, isInSystem32,
- PCWSTR, processName,
- uint32_t, category,
- PCWSTR, packageFullName,
- int, sampleCount,
- double, maxPercent,
- uint32_t, samplesAboveThreshold,
- double, sigma4Deviation,
- int, totalCpuTimeInMicroseconds);
- END_ACTIVITY_CLASS();
-};
diff --git a/telemetry/DevHome.Telemetry.Native/inc/MicrosoftTelemetry.h b/telemetry/DevHome.Telemetry.Native/inc/MicrosoftTelemetry.h
deleted file mode 100644
index 3fd155032d..0000000000
--- a/telemetry/DevHome.Telemetry.Native/inc/MicrosoftTelemetry.h
+++ /dev/null
@@ -1,87 +0,0 @@
-/* ++
-
-Copyright (c) Microsoft Corporation. All rights reserved.
-Licensed under the MIT License. See LICENSE in the project root for license information.
-
-Module Name:
-
- TraceLoggingConfig.h
-
-Abstract:
-
- Macro definitions used by this project's TraceLogging ETW providers:
-
- - Configuration macros that select the ETW Provider Groups to be used by
- this project.
- - Constants for tags that are commonly used in Microsoft's
- TraceLogging-based ETW.
-
- Different versions of this file use different definitions for the
- TraceLoggingOption configuration macros. The definitions in this file are
- empty. As a result, providers using this configuration file will not join
- any ETW Provider Groups and will not be given any special treatment by
- group-sensitive ETW listeners.
-
-Environment:
-
- User mode or kernel mode.
-
---*/
-
-#pragma once
-
-// Configuration macro for use in TRACELOGGING_DEFINE_PROVIDER. The definition
-// in this file configures the provider as a normal (non-telemetry) provider.
-#define TraceLoggingOptionMicrosoftTelemetry() \
- // Empty definition for TraceLoggingOptionMicrosoftTelemetry
-
-// Configuration macro for use in TRACELOGGING_DEFINE_PROVIDER. The definition
-// in this file configures the provider as a normal (non-telemetry) provider.
-#define TraceLoggingOptionWindowsCoreTelemetry() \
- // Empty definition for TraceLoggingOptionWindowsCoreTelemetry
-
-// Event privacy tags. Use the PDT macro values for the tag parameter, e.g.:
-// TraceLoggingWrite(...,
-// TelemetryPrivacyDataTag(PDT_BrowsingHistory | PDT_ProductAndServiceUsage),
-// ...);
-#define TelemetryPrivacyDataTag(tag) TraceLoggingUInt64((tag), "PartA_PrivTags")
-#define PDT_BrowsingHistory 0x0000000000000002u
-#define PDT_DeviceConnectivityAndConfiguration 0x0000000000000800u
-#define PDT_InkingTypingAndSpeechUtterance 0x0000000000020000u
-#define PDT_ProductAndServicePerformance 0x0000000001000000u
-#define PDT_ProductAndServiceUsage 0x0000000002000000u
-#define PDT_SoftwareSetupAndInventory 0x0000000080000000u
-
-// Event categories specified via keywords, e.g.:
-// TraceLoggingWrite(...,
-// TraceLoggingKeyword(MICROSOFT_KEYWORD_MEASURES),
-// ...);
-#define MICROSOFT_KEYWORD_CRITICAL_DATA 0x0000800000000000 // Bit 47
-#define MICROSOFT_KEYWORD_MEASURES 0x0000400000000000 // Bit 46
-#define MICROSOFT_KEYWORD_TELEMETRY 0x0000200000000000 // Bit 45
-#define MICROSOFT_KEYWORD_RESERVED_44 0x0000100000000000 // Bit 44 (reserved for future assignment)
-
-// Event categories specified via event tags, e.g.:
-// TraceLoggingWrite(...,
-// TraceLoggingEventTag(MICROSOFT_EVENTTAG_REALTIME_LATENCY),
-// ...);
-#define MICROSOFT_EVENTTAG_DROP_USER_IDS 0x00008000
-#define MICROSOFT_EVENTTAG_AGGREGATE 0x00010000
-#define MICROSOFT_EVENTTAG_DROP_PII_EXCEPT_IP 0x00020000
-#define MICROSOFT_EVENTTAG_COSTDEFERRED_LATENCY 0x00040000
-#define MICROSOFT_EVENTTAG_CORE_DATA 0x00080000
-#define MICROSOFT_EVENTTAG_INJECT_XTOKEN 0x00100000
-#define MICROSOFT_EVENTTAG_REALTIME_LATENCY 0x00200000
-#define MICROSOFT_EVENTTAG_NORMAL_LATENCY 0x00400000
-#define MICROSOFT_EVENTTAG_CRITICAL_PERSISTENCE 0x00800000
-#define MICROSOFT_EVENTTAG_NORMAL_PERSISTENCE 0x01000000
-#define MICROSOFT_EVENTTAG_DROP_PII 0x02000000
-#define MICROSOFT_EVENTTAG_HASH_PII 0x04000000
-#define MICROSOFT_EVENTTAG_MARK_PII 0x08000000
-
-// Field categories specified via field tags, e.g.:
-// TraceLoggingWrite(...,
-// TraceLoggingString(szUser, "UserName", "User's name", MICROSOFT_FIELDTAG_HASH_PII),
-// ...);
-#define MICROSOFT_FIELDTAG_DROP_PII 0x04000000
-#define MICROSOFT_FIELDTAG_HASH_PII 0x08000000
diff --git a/telemetry/DevHome.Telemetry.Native/packages.config b/telemetry/DevHome.Telemetry.Native/packages.config
deleted file mode 100644
index 6b8deb9c96..0000000000
--- a/telemetry/DevHome.Telemetry.Native/packages.config
+++ /dev/null
@@ -1,3 +0,0 @@
-
-
-
\ No newline at end of file
diff --git a/test/TestingScenarios/DevHome.md b/test/TestingScenarios/DevHome.md
index b45a7e3dd5..0c4a4964ff 100644
--- a/test/TestingScenarios/DevHome.md
+++ b/test/TestingScenarios/DevHome.md
@@ -5,8 +5,3 @@ Please manually verify these scenarios. This is required for all PRs that affec
Please make sure to verify all these scenarios.
1. User can install Dev Home
-1. On first launch from new installation, user is brought to the "Introducing Dev Home" page
-
-### Introducing Dev Home page
-1. User can click all "learn more" links on the Introducing Dev Home page
-1. User can resize the window and card sizes are responsive
diff --git a/tools/Customization/DevHome.Customization/DevHome.Customization.csproj b/tools/Customization/DevHome.Customization/DevHome.Customization.csproj
index 6e9bd9ccbc..dec29dd8be 100644
--- a/tools/Customization/DevHome.Customization/DevHome.Customization.csproj
+++ b/tools/Customization/DevHome.Customization/DevHome.Customization.csproj
@@ -18,7 +18,6 @@
-
diff --git a/tools/Customization/DevHome.Customization/Extensions/ServiceExtensions.cs b/tools/Customization/DevHome.Customization/Extensions/ServiceExtensions.cs
index c5e53584c6..071d76d6ad 100644
--- a/tools/Customization/DevHome.Customization/Extensions/ServiceExtensions.cs
+++ b/tools/Customization/DevHome.Customization/Extensions/ServiceExtensions.cs
@@ -4,7 +4,6 @@
using DevHome.Customization.ViewModels;
using DevHome.Customization.ViewModels.DevDriveInsights;
using DevHome.Customization.Views;
-using DevHome.QuietBackgroundProcesses.UI.ViewModels;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;
@@ -25,9 +24,7 @@ public static IServiceCollection AddWindowsCustomization(this IServiceCollection
ActivatorUtilities.CreateInstance(sp, cacheLocation, environmentVariable, exampleDevDriveLocation, existingDevDriveLetters, relatedEnvironmentVariablesToBeSet, relatedCacheDirectories));
services.AddSingleton();
- services.AddTransient();
-
- services.AddTransient();
+ services.AddTransient();
services.AddSingleton();
services.AddTransient();
diff --git a/tools/Customization/DevHome.Customization/Strings/en-us/Resources.resw b/tools/Customization/DevHome.Customization/Strings/en-us/Resources.resw
index b8789b3a87..950ea8de92 100644
--- a/tools/Customization/DevHome.Customization/Strings/en-us/Resources.resw
+++ b/tools/Customization/DevHome.Customization/Strings/en-us/Resources.resw
@@ -441,9 +441,9 @@
Enable File Explorer Version Control Integration
The header for the settings card that allows user to enable or disable File Explorer Version Control Integration
-
+
File Explorer + Version Control
- The text for the File Explorer Settings toggle
+ Header text for a group of toggle controls to configure File Explorer Version Control Integration
See version control columns for enhanced repositories like "Code Status", "Last Change Date", "Last Change Message"
@@ -477,7 +477,7 @@
An exception was thrown while obtaining the repository from the local repository provider:
An error message when an exception is thrown while obtaining the repository from the local repository provider
-
+
Failed to register repository root folder with File Explorer
An error message when the repository root folder cannot be registered with File Explorer
@@ -489,4 +489,16 @@
More Options
Text for the more options button on the setting card for the Add Repositories UI
+
+ More Options
+ Tool tip for the more options button on the setting card for the Add Repositories UI
+
+
+ File Explorer + Version Control
+ Narrator text for a group of toggle controls to configure File Explorer Version Control Integration
+
+
+ Add repositories
+ Narrator text for the Add Repositories user experience in File Explorer source control integration
+
\ No newline at end of file
diff --git a/tools/Customization/DevHome.Customization/ViewModels/FileExplorerViewModel.cs b/tools/Customization/DevHome.Customization/ViewModels/FileExplorerViewModel.cs
index 28bee5d872..77516af617 100644
--- a/tools/Customization/DevHome.Customization/ViewModels/FileExplorerViewModel.cs
+++ b/tools/Customization/DevHome.Customization/ViewModels/FileExplorerViewModel.cs
@@ -2,12 +2,12 @@
// Licensed under the MIT License.
using System;
-using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.Threading.Tasks;
using CommunityToolkit.Mvvm.ComponentModel;
using CommunityToolkit.Mvvm.Input;
+using CommunityToolkit.WinUI.Controls;
using DevHome.Common.Contracts;
using DevHome.Common.Extensions;
using DevHome.Common.Models;
@@ -158,7 +158,7 @@ public bool ShowRepositoryStatus
}
[RelayCommand]
- public async Task AddFolderClick()
+ public async Task AddFolderClick(object sender)
{
StorageFolder? repoRootFolder = null;
if (IsFeatureEnabled)
@@ -187,6 +187,7 @@ await Task.Run(async () =>
}
});
RefreshTrackedRepositories();
+ AdjustFocus(sender);
}
return repoRootFolder == null ? string.Empty : repoRootFolder.Path;
@@ -292,4 +293,24 @@ public async void OnToggledRepositoryStatusSettingAsync(bool value)
await LocalSettingsService!.SaveSettingAsync("ShowRepositoryStatus", value);
}
+
+ private void AdjustFocus(object sender)
+ {
+ var addRepositoryCard = sender as SettingsCard;
+ if (addRepositoryCard != null)
+ {
+ addRepositoryCard.IsTabStop = true;
+ _log.Debug($"AddRepositoryCard IsEnabled: {addRepositoryCard.IsEnabled}");
+ _log.Debug($"AddRepositoryCard Visibility: {addRepositoryCard.Visibility}");
+ bool isFocusSet = addRepositoryCard.Focus(FocusState.Keyboard);
+ _log.Information($"Set focus to add reposiotry card result: {isFocusSet}");
+ }
+ }
+
+ public void UnassignSourceControlProviderFromRepository(string repositoryRootPath)
+ {
+ ExtraFolderPropertiesWrapper.Unregister(repositoryRootPath);
+ RepoTracker.ModifySourceControlProviderForTrackedRepository(_unassigned, repositoryRootPath);
+ RefreshTrackedRepositories();
+ }
}
diff --git a/tools/Customization/DevHome.Customization/Views/AddRepositoriesView.xaml b/tools/Customization/DevHome.Customization/Views/AddRepositoriesView.xaml
index 6c22bf4474..ac085ce1f6 100644
--- a/tools/Customization/DevHome.Customization/Views/AddRepositoriesView.xaml
+++ b/tools/Customization/DevHome.Customization/Views/AddRepositoriesView.xaml
@@ -5,21 +5,25 @@
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
- xmlns:ctControls="using:CommunityToolkit.WinUI.Controls"
- xmlns:viewmodels="using:DevHome.Customization.ViewModels"
+ xmlns:ctControls="using:CommunityToolkit.WinUI.Controls"
mc:Ignorable="d">
-
-
+
+ Command="{x:Bind ViewModel.AddFolderClickCommand}"
+ CommandParameter="{Binding ElementName=AddRepositoriesCard}"/>
+ Margin="{ThemeResource SettingsCardMargin}">
+ behaviors:NavigationViewHeaderBehavior.HeaderContext="{x:Bind ViewModel}"
+ HighContrastAdjustment="None">
diff --git a/tools/Customization/DevHome.Customization/Views/MainPageView.xaml b/tools/Customization/DevHome.Customization/Views/MainPageView.xaml
index 1b8e3a7097..530e6f7501 100644
--- a/tools/Customization/DevHome.Customization/Views/MainPageView.xaml
+++ b/tools/Customization/DevHome.Customization/Views/MainPageView.xaml
@@ -7,8 +7,7 @@
xmlns:ui="using:CommunityToolkit.WinUI"
xmlns:i="using:Microsoft.Xaml.Interactivity"
xmlns:ic="using:Microsoft.Xaml.Interactions.Core"
- xmlns:views="using:DevHome.Customization.Views"
- xmlns:quietviews="using:DevHome.QuietBackgroundProcesses.UI.Views">
+ xmlns:views="using:DevHome.Customization.Views">
@@ -61,9 +60,6 @@
-
-
-
diff --git a/tools/Customization/DevHome.Customization/Views/VersionControlIntegrationSettingsView.xaml b/tools/Customization/DevHome.Customization/Views/VersionControlIntegrationSettingsView.xaml
index e4a91a8a09..7c61a655ff 100644
--- a/tools/Customization/DevHome.Customization/Views/VersionControlIntegrationSettingsView.xaml
+++ b/tools/Customization/DevHome.Customization/Views/VersionControlIntegrationSettingsView.xaml
@@ -11,9 +11,10 @@
xmlns:i="using:Microsoft.Xaml.Interactivity"
mc:Ignorable="d">
-
+
-
-
-
-
-
-
-
-
-
- False
-
-
- False
-
-
- False
-
-
- False
-
-
- False
-
-
- False
-
-
- False
-
-
- False
-
-
- False
-
-
- Default
-
-
- True
-
-
- False
-
-
- True
-
-
-
-
- DevHome.DevDiagnostics
- DevEnv
-
-
-
-
- 0
-
-
- True
-
-
- 0
-
-
- True
-
-
- True
-
-
-
-
\ No newline at end of file
diff --git a/tools/DevDiagnostics/DevHome.DevDiagnostics/Assets/LargeTile.scale-100.png b/tools/DevDiagnostics/DevHome.DevDiagnostics/Assets/LargeTile.scale-100.png
deleted file mode 100644
index 7f7823934c..0000000000
Binary files a/tools/DevDiagnostics/DevHome.DevDiagnostics/Assets/LargeTile.scale-100.png and /dev/null differ
diff --git a/tools/DevDiagnostics/DevHome.DevDiagnostics/Assets/LargeTile.scale-125.png b/tools/DevDiagnostics/DevHome.DevDiagnostics/Assets/LargeTile.scale-125.png
deleted file mode 100644
index 28bceaa2ee..0000000000
Binary files a/tools/DevDiagnostics/DevHome.DevDiagnostics/Assets/LargeTile.scale-125.png and /dev/null differ
diff --git a/tools/DevDiagnostics/DevHome.DevDiagnostics/Assets/LargeTile.scale-150.png b/tools/DevDiagnostics/DevHome.DevDiagnostics/Assets/LargeTile.scale-150.png
deleted file mode 100644
index 03d2363b88..0000000000
Binary files a/tools/DevDiagnostics/DevHome.DevDiagnostics/Assets/LargeTile.scale-150.png and /dev/null differ
diff --git a/tools/DevDiagnostics/DevHome.DevDiagnostics/Assets/LargeTile.scale-200.png b/tools/DevDiagnostics/DevHome.DevDiagnostics/Assets/LargeTile.scale-200.png
deleted file mode 100644
index 1f6bc2af3f..0000000000
Binary files a/tools/DevDiagnostics/DevHome.DevDiagnostics/Assets/LargeTile.scale-200.png and /dev/null differ
diff --git a/tools/DevDiagnostics/DevHome.DevDiagnostics/Assets/LargeTile.scale-400.png b/tools/DevDiagnostics/DevHome.DevDiagnostics/Assets/LargeTile.scale-400.png
deleted file mode 100644
index 78be0d717f..0000000000
Binary files a/tools/DevDiagnostics/DevHome.DevDiagnostics/Assets/LargeTile.scale-400.png and /dev/null differ
diff --git a/tools/DevDiagnostics/DevHome.DevDiagnostics/Assets/SmallTile.scale-100.png b/tools/DevDiagnostics/DevHome.DevDiagnostics/Assets/SmallTile.scale-100.png
deleted file mode 100644
index 420b465f0b..0000000000
Binary files a/tools/DevDiagnostics/DevHome.DevDiagnostics/Assets/SmallTile.scale-100.png and /dev/null differ
diff --git a/tools/DevDiagnostics/DevHome.DevDiagnostics/Assets/SmallTile.scale-125.png b/tools/DevDiagnostics/DevHome.DevDiagnostics/Assets/SmallTile.scale-125.png
deleted file mode 100644
index f27efc06b8..0000000000
Binary files a/tools/DevDiagnostics/DevHome.DevDiagnostics/Assets/SmallTile.scale-125.png and /dev/null differ
diff --git a/tools/DevDiagnostics/DevHome.DevDiagnostics/Assets/SmallTile.scale-150.png b/tools/DevDiagnostics/DevHome.DevDiagnostics/Assets/SmallTile.scale-150.png
deleted file mode 100644
index c03b608186..0000000000
Binary files a/tools/DevDiagnostics/DevHome.DevDiagnostics/Assets/SmallTile.scale-150.png and /dev/null differ
diff --git a/tools/DevDiagnostics/DevHome.DevDiagnostics/Assets/SmallTile.scale-200.png b/tools/DevDiagnostics/DevHome.DevDiagnostics/Assets/SmallTile.scale-200.png
deleted file mode 100644
index 8ab3da0a8d..0000000000
Binary files a/tools/DevDiagnostics/DevHome.DevDiagnostics/Assets/SmallTile.scale-200.png and /dev/null differ
diff --git a/tools/DevDiagnostics/DevHome.DevDiagnostics/Assets/SmallTile.scale-400.png b/tools/DevDiagnostics/DevHome.DevDiagnostics/Assets/SmallTile.scale-400.png
deleted file mode 100644
index 3e57fa8dfd..0000000000
Binary files a/tools/DevDiagnostics/DevHome.DevDiagnostics/Assets/SmallTile.scale-400.png and /dev/null differ
diff --git a/tools/DevDiagnostics/DevHome.DevDiagnostics/Assets/SplashScreen.scale-100.png b/tools/DevDiagnostics/DevHome.DevDiagnostics/Assets/SplashScreen.scale-100.png
deleted file mode 100644
index da80d9b5b6..0000000000
Binary files a/tools/DevDiagnostics/DevHome.DevDiagnostics/Assets/SplashScreen.scale-100.png and /dev/null differ
diff --git a/tools/DevDiagnostics/DevHome.DevDiagnostics/Assets/SplashScreen.scale-125.png b/tools/DevDiagnostics/DevHome.DevDiagnostics/Assets/SplashScreen.scale-125.png
deleted file mode 100644
index 42babcca91..0000000000
Binary files a/tools/DevDiagnostics/DevHome.DevDiagnostics/Assets/SplashScreen.scale-125.png and /dev/null differ
diff --git a/tools/DevDiagnostics/DevHome.DevDiagnostics/Assets/SplashScreen.scale-150.png b/tools/DevDiagnostics/DevHome.DevDiagnostics/Assets/SplashScreen.scale-150.png
deleted file mode 100644
index c6dcc19da1..0000000000
Binary files a/tools/DevDiagnostics/DevHome.DevDiagnostics/Assets/SplashScreen.scale-150.png and /dev/null differ
diff --git a/tools/DevDiagnostics/DevHome.DevDiagnostics/Assets/SplashScreen.scale-200.png b/tools/DevDiagnostics/DevHome.DevDiagnostics/Assets/SplashScreen.scale-200.png
deleted file mode 100644
index 8bfb455657..0000000000
Binary files a/tools/DevDiagnostics/DevHome.DevDiagnostics/Assets/SplashScreen.scale-200.png and /dev/null differ
diff --git a/tools/DevDiagnostics/DevHome.DevDiagnostics/Assets/SplashScreen.scale-400.png b/tools/DevDiagnostics/DevHome.DevDiagnostics/Assets/SplashScreen.scale-400.png
deleted file mode 100644
index e85774d789..0000000000
Binary files a/tools/DevDiagnostics/DevHome.DevDiagnostics/Assets/SplashScreen.scale-400.png and /dev/null differ
diff --git a/tools/DevDiagnostics/DevHome.DevDiagnostics/Assets/Square150x150Logo.scale-100.png b/tools/DevDiagnostics/DevHome.DevDiagnostics/Assets/Square150x150Logo.scale-100.png
deleted file mode 100644
index ab2e624ba3..0000000000
Binary files a/tools/DevDiagnostics/DevHome.DevDiagnostics/Assets/Square150x150Logo.scale-100.png and /dev/null differ
diff --git a/tools/DevDiagnostics/DevHome.DevDiagnostics/Assets/Square150x150Logo.scale-125.png b/tools/DevDiagnostics/DevHome.DevDiagnostics/Assets/Square150x150Logo.scale-125.png
deleted file mode 100644
index fdd6dc63d6..0000000000
Binary files a/tools/DevDiagnostics/DevHome.DevDiagnostics/Assets/Square150x150Logo.scale-125.png and /dev/null differ
diff --git a/tools/DevDiagnostics/DevHome.DevDiagnostics/Assets/Square150x150Logo.scale-150.png b/tools/DevDiagnostics/DevHome.DevDiagnostics/Assets/Square150x150Logo.scale-150.png
deleted file mode 100644
index ed17ab3a8f..0000000000
Binary files a/tools/DevDiagnostics/DevHome.DevDiagnostics/Assets/Square150x150Logo.scale-150.png and /dev/null differ
diff --git a/tools/DevDiagnostics/DevHome.DevDiagnostics/Assets/Square150x150Logo.scale-200.png b/tools/DevDiagnostics/DevHome.DevDiagnostics/Assets/Square150x150Logo.scale-200.png
deleted file mode 100644
index 1767372d7f..0000000000
Binary files a/tools/DevDiagnostics/DevHome.DevDiagnostics/Assets/Square150x150Logo.scale-200.png and /dev/null differ
diff --git a/tools/DevDiagnostics/DevHome.DevDiagnostics/Assets/Square150x150Logo.scale-400.png b/tools/DevDiagnostics/DevHome.DevDiagnostics/Assets/Square150x150Logo.scale-400.png
deleted file mode 100644
index 5275a4b3f7..0000000000
Binary files a/tools/DevDiagnostics/DevHome.DevDiagnostics/Assets/Square150x150Logo.scale-400.png and /dev/null differ
diff --git a/tools/DevDiagnostics/DevHome.DevDiagnostics/Assets/Square44x44Logo.altform-lightunplated_targetsize-16.png b/tools/DevDiagnostics/DevHome.DevDiagnostics/Assets/Square44x44Logo.altform-lightunplated_targetsize-16.png
deleted file mode 100644
index 60132fb3d5..0000000000
Binary files a/tools/DevDiagnostics/DevHome.DevDiagnostics/Assets/Square44x44Logo.altform-lightunplated_targetsize-16.png and /dev/null differ
diff --git a/tools/DevDiagnostics/DevHome.DevDiagnostics/Assets/Square44x44Logo.altform-lightunplated_targetsize-24.png b/tools/DevDiagnostics/DevHome.DevDiagnostics/Assets/Square44x44Logo.altform-lightunplated_targetsize-24.png
deleted file mode 100644
index f29f79118d..0000000000
Binary files a/tools/DevDiagnostics/DevHome.DevDiagnostics/Assets/Square44x44Logo.altform-lightunplated_targetsize-24.png and /dev/null differ
diff --git a/tools/DevDiagnostics/DevHome.DevDiagnostics/Assets/Square44x44Logo.altform-lightunplated_targetsize-256.png b/tools/DevDiagnostics/DevHome.DevDiagnostics/Assets/Square44x44Logo.altform-lightunplated_targetsize-256.png
deleted file mode 100644
index f589e72d23..0000000000
Binary files a/tools/DevDiagnostics/DevHome.DevDiagnostics/Assets/Square44x44Logo.altform-lightunplated_targetsize-256.png and /dev/null differ
diff --git a/tools/DevDiagnostics/DevHome.DevDiagnostics/Assets/Square44x44Logo.altform-lightunplated_targetsize-32.png b/tools/DevDiagnostics/DevHome.DevDiagnostics/Assets/Square44x44Logo.altform-lightunplated_targetsize-32.png
deleted file mode 100644
index e38b3ca8cf..0000000000
Binary files a/tools/DevDiagnostics/DevHome.DevDiagnostics/Assets/Square44x44Logo.altform-lightunplated_targetsize-32.png and /dev/null differ
diff --git a/tools/DevDiagnostics/DevHome.DevDiagnostics/Assets/Square44x44Logo.altform-lightunplated_targetsize-48.png b/tools/DevDiagnostics/DevHome.DevDiagnostics/Assets/Square44x44Logo.altform-lightunplated_targetsize-48.png
deleted file mode 100644
index 9aa8f49122..0000000000
Binary files a/tools/DevDiagnostics/DevHome.DevDiagnostics/Assets/Square44x44Logo.altform-lightunplated_targetsize-48.png and /dev/null differ
diff --git a/tools/DevDiagnostics/DevHome.DevDiagnostics/Assets/Square44x44Logo.altform-unplated_targetsize-16.png b/tools/DevDiagnostics/DevHome.DevDiagnostics/Assets/Square44x44Logo.altform-unplated_targetsize-16.png
deleted file mode 100644
index 60132fb3d5..0000000000
Binary files a/tools/DevDiagnostics/DevHome.DevDiagnostics/Assets/Square44x44Logo.altform-unplated_targetsize-16.png and /dev/null differ
diff --git a/tools/DevDiagnostics/DevHome.DevDiagnostics/Assets/Square44x44Logo.altform-unplated_targetsize-256.png b/tools/DevDiagnostics/DevHome.DevDiagnostics/Assets/Square44x44Logo.altform-unplated_targetsize-256.png
deleted file mode 100644
index f589e72d23..0000000000
Binary files a/tools/DevDiagnostics/DevHome.DevDiagnostics/Assets/Square44x44Logo.altform-unplated_targetsize-256.png and /dev/null differ
diff --git a/tools/DevDiagnostics/DevHome.DevDiagnostics/Assets/Square44x44Logo.altform-unplated_targetsize-32.png b/tools/DevDiagnostics/DevHome.DevDiagnostics/Assets/Square44x44Logo.altform-unplated_targetsize-32.png
deleted file mode 100644
index e38b3ca8cf..0000000000
Binary files a/tools/DevDiagnostics/DevHome.DevDiagnostics/Assets/Square44x44Logo.altform-unplated_targetsize-32.png and /dev/null differ
diff --git a/tools/DevDiagnostics/DevHome.DevDiagnostics/Assets/Square44x44Logo.altform-unplated_targetsize-48.png b/tools/DevDiagnostics/DevHome.DevDiagnostics/Assets/Square44x44Logo.altform-unplated_targetsize-48.png
deleted file mode 100644
index 9aa8f49122..0000000000
Binary files a/tools/DevDiagnostics/DevHome.DevDiagnostics/Assets/Square44x44Logo.altform-unplated_targetsize-48.png and /dev/null differ
diff --git a/tools/DevDiagnostics/DevHome.DevDiagnostics/Assets/Square44x44Logo.scale-100.png b/tools/DevDiagnostics/DevHome.DevDiagnostics/Assets/Square44x44Logo.scale-100.png
deleted file mode 100644
index 3c445b04bf..0000000000
Binary files a/tools/DevDiagnostics/DevHome.DevDiagnostics/Assets/Square44x44Logo.scale-100.png and /dev/null differ
diff --git a/tools/DevDiagnostics/DevHome.DevDiagnostics/Assets/Square44x44Logo.scale-125.png b/tools/DevDiagnostics/DevHome.DevDiagnostics/Assets/Square44x44Logo.scale-125.png
deleted file mode 100644
index 512d69599b..0000000000
Binary files a/tools/DevDiagnostics/DevHome.DevDiagnostics/Assets/Square44x44Logo.scale-125.png and /dev/null differ
diff --git a/tools/DevDiagnostics/DevHome.DevDiagnostics/Assets/Square44x44Logo.scale-150.png b/tools/DevDiagnostics/DevHome.DevDiagnostics/Assets/Square44x44Logo.scale-150.png
deleted file mode 100644
index 6daef98824..0000000000
Binary files a/tools/DevDiagnostics/DevHome.DevDiagnostics/Assets/Square44x44Logo.scale-150.png and /dev/null differ
diff --git a/tools/DevDiagnostics/DevHome.DevDiagnostics/Assets/Square44x44Logo.scale-200.png b/tools/DevDiagnostics/DevHome.DevDiagnostics/Assets/Square44x44Logo.scale-200.png
deleted file mode 100644
index 25777bb656..0000000000
Binary files a/tools/DevDiagnostics/DevHome.DevDiagnostics/Assets/Square44x44Logo.scale-200.png and /dev/null differ
diff --git a/tools/DevDiagnostics/DevHome.DevDiagnostics/Assets/Square44x44Logo.scale-400.png b/tools/DevDiagnostics/DevHome.DevDiagnostics/Assets/Square44x44Logo.scale-400.png
deleted file mode 100644
index 5f10001ee2..0000000000
Binary files a/tools/DevDiagnostics/DevHome.DevDiagnostics/Assets/Square44x44Logo.scale-400.png and /dev/null differ
diff --git a/tools/DevDiagnostics/DevHome.DevDiagnostics/Assets/Square44x44Logo.targetsize-16.png b/tools/DevDiagnostics/DevHome.DevDiagnostics/Assets/Square44x44Logo.targetsize-16.png
deleted file mode 100644
index 5aeb64d8d8..0000000000
Binary files a/tools/DevDiagnostics/DevHome.DevDiagnostics/Assets/Square44x44Logo.targetsize-16.png and /dev/null differ
diff --git a/tools/DevDiagnostics/DevHome.DevDiagnostics/Assets/Square44x44Logo.targetsize-24.png b/tools/DevDiagnostics/DevHome.DevDiagnostics/Assets/Square44x44Logo.targetsize-24.png
deleted file mode 100644
index 00b0c53247..0000000000
Binary files a/tools/DevDiagnostics/DevHome.DevDiagnostics/Assets/Square44x44Logo.targetsize-24.png and /dev/null differ
diff --git a/tools/DevDiagnostics/DevHome.DevDiagnostics/Assets/Square44x44Logo.targetsize-24_altform-unplated.png b/tools/DevDiagnostics/DevHome.DevDiagnostics/Assets/Square44x44Logo.targetsize-24_altform-unplated.png
deleted file mode 100644
index f29f79118d..0000000000
Binary files a/tools/DevDiagnostics/DevHome.DevDiagnostics/Assets/Square44x44Logo.targetsize-24_altform-unplated.png and /dev/null differ
diff --git a/tools/DevDiagnostics/DevHome.DevDiagnostics/Assets/Square44x44Logo.targetsize-256.png b/tools/DevDiagnostics/DevHome.DevDiagnostics/Assets/Square44x44Logo.targetsize-256.png
deleted file mode 100644
index c7535bb2f0..0000000000
Binary files a/tools/DevDiagnostics/DevHome.DevDiagnostics/Assets/Square44x44Logo.targetsize-256.png and /dev/null differ
diff --git a/tools/DevDiagnostics/DevHome.DevDiagnostics/Assets/Square44x44Logo.targetsize-32.png b/tools/DevDiagnostics/DevHome.DevDiagnostics/Assets/Square44x44Logo.targetsize-32.png
deleted file mode 100644
index 3ced4d93e8..0000000000
Binary files a/tools/DevDiagnostics/DevHome.DevDiagnostics/Assets/Square44x44Logo.targetsize-32.png and /dev/null differ
diff --git a/tools/DevDiagnostics/DevHome.DevDiagnostics/Assets/Square44x44Logo.targetsize-48.png b/tools/DevDiagnostics/DevHome.DevDiagnostics/Assets/Square44x44Logo.targetsize-48.png
deleted file mode 100644
index 9c040bd0ef..0000000000
Binary files a/tools/DevDiagnostics/DevHome.DevDiagnostics/Assets/Square44x44Logo.targetsize-48.png and /dev/null differ
diff --git a/tools/DevDiagnostics/DevHome.DevDiagnostics/Assets/StoreLogo.scale-100.png b/tools/DevDiagnostics/DevHome.DevDiagnostics/Assets/StoreLogo.scale-100.png
deleted file mode 100644
index 9ed62f1cd4..0000000000
Binary files a/tools/DevDiagnostics/DevHome.DevDiagnostics/Assets/StoreLogo.scale-100.png and /dev/null differ
diff --git a/tools/DevDiagnostics/DevHome.DevDiagnostics/Assets/StoreLogo.scale-125.png b/tools/DevDiagnostics/DevHome.DevDiagnostics/Assets/StoreLogo.scale-125.png
deleted file mode 100644
index 47bb056390..0000000000
Binary files a/tools/DevDiagnostics/DevHome.DevDiagnostics/Assets/StoreLogo.scale-125.png and /dev/null differ
diff --git a/tools/DevDiagnostics/DevHome.DevDiagnostics/Assets/StoreLogo.scale-150.png b/tools/DevDiagnostics/DevHome.DevDiagnostics/Assets/StoreLogo.scale-150.png
deleted file mode 100644
index 5eb33fef2b..0000000000
Binary files a/tools/DevDiagnostics/DevHome.DevDiagnostics/Assets/StoreLogo.scale-150.png and /dev/null differ
diff --git a/tools/DevDiagnostics/DevHome.DevDiagnostics/Assets/StoreLogo.scale-200.png b/tools/DevDiagnostics/DevHome.DevDiagnostics/Assets/StoreLogo.scale-200.png
deleted file mode 100644
index a5da4cb5ad..0000000000
Binary files a/tools/DevDiagnostics/DevHome.DevDiagnostics/Assets/StoreLogo.scale-200.png and /dev/null differ
diff --git a/tools/DevDiagnostics/DevHome.DevDiagnostics/Assets/StoreLogo.scale-400.png b/tools/DevDiagnostics/DevHome.DevDiagnostics/Assets/StoreLogo.scale-400.png
deleted file mode 100644
index 40c96bb280..0000000000
Binary files a/tools/DevDiagnostics/DevHome.DevDiagnostics/Assets/StoreLogo.scale-400.png and /dev/null differ
diff --git a/tools/DevDiagnostics/DevHome.DevDiagnostics/Assets/Wide310x150Logo.scale-100.png b/tools/DevDiagnostics/DevHome.DevDiagnostics/Assets/Wide310x150Logo.scale-100.png
deleted file mode 100644
index 1090229375..0000000000
Binary files a/tools/DevDiagnostics/DevHome.DevDiagnostics/Assets/Wide310x150Logo.scale-100.png and /dev/null differ
diff --git a/tools/DevDiagnostics/DevHome.DevDiagnostics/Assets/Wide310x150Logo.scale-125.png b/tools/DevDiagnostics/DevHome.DevDiagnostics/Assets/Wide310x150Logo.scale-125.png
deleted file mode 100644
index 475780def2..0000000000
Binary files a/tools/DevDiagnostics/DevHome.DevDiagnostics/Assets/Wide310x150Logo.scale-125.png and /dev/null differ
diff --git a/tools/DevDiagnostics/DevHome.DevDiagnostics/Assets/Wide310x150Logo.scale-150.png b/tools/DevDiagnostics/DevHome.DevDiagnostics/Assets/Wide310x150Logo.scale-150.png
deleted file mode 100644
index 4c80207119..0000000000
Binary files a/tools/DevDiagnostics/DevHome.DevDiagnostics/Assets/Wide310x150Logo.scale-150.png and /dev/null differ
diff --git a/tools/DevDiagnostics/DevHome.DevDiagnostics/Assets/Wide310x150Logo.scale-200.png b/tools/DevDiagnostics/DevHome.DevDiagnostics/Assets/Wide310x150Logo.scale-200.png
deleted file mode 100644
index da80d9b5b6..0000000000
Binary files a/tools/DevDiagnostics/DevHome.DevDiagnostics/Assets/Wide310x150Logo.scale-200.png and /dev/null differ
diff --git a/tools/DevDiagnostics/DevHome.DevDiagnostics/Assets/Wide310x150Logo.scale-400.png b/tools/DevDiagnostics/DevHome.DevDiagnostics/Assets/Wide310x150Logo.scale-400.png
deleted file mode 100644
index 8bfb455657..0000000000
Binary files a/tools/DevDiagnostics/DevHome.DevDiagnostics/Assets/Wide310x150Logo.scale-400.png and /dev/null differ
diff --git a/tools/DevDiagnostics/DevHome.DevDiagnostics/Contracts/ViewModels/INavigationAware.cs b/tools/DevDiagnostics/DevHome.DevDiagnostics/Contracts/ViewModels/INavigationAware.cs
deleted file mode 100644
index 1567971786..0000000000
--- a/tools/DevDiagnostics/DevHome.DevDiagnostics/Contracts/ViewModels/INavigationAware.cs
+++ /dev/null
@@ -1,12 +0,0 @@
-// Copyright (c) Microsoft Corporation.
-// Licensed under the MIT License.
-
-namespace DevHome.DevDiagnostics.Contracts.ViewModels;
-
-// Similar to DevHome.Contracts.ViewModels.INavigationAware
-public interface INavigationAware
-{
- void OnNavigatedTo(object parameter);
-
- void OnNavigatedFrom();
-}
diff --git a/tools/DevDiagnostics/DevHome.DevDiagnostics/Controls/AddToolControl.xaml b/tools/DevDiagnostics/DevHome.DevDiagnostics/Controls/AddToolControl.xaml
deleted file mode 100644
index e721e39e1d..0000000000
--- a/tools/DevDiagnostics/DevHome.DevDiagnostics/Controls/AddToolControl.xaml
+++ /dev/null
@@ -1,183 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/tools/DevDiagnostics/DevHome.DevDiagnostics/Controls/AddToolControl.xaml.cs b/tools/DevDiagnostics/DevHome.DevDiagnostics/Controls/AddToolControl.xaml.cs
deleted file mode 100644
index 90352225cf..0000000000
--- a/tools/DevDiagnostics/DevHome.DevDiagnostics/Controls/AddToolControl.xaml.cs
+++ /dev/null
@@ -1,514 +0,0 @@
-// Copyright (c) Microsoft Corporation.
-// Licensed under the MIT License.
-
-using System;
-using System.Collections.Generic;
-using System.Collections.ObjectModel;
-using System.ComponentModel;
-using System.Globalization;
-using System.IO;
-using System.Linq;
-using System.Runtime.InteropServices;
-using System.Text;
-using System.Threading.Tasks;
-using DevHome.Common.Extensions;
-using DevHome.DevDiagnostics.Helpers;
-using DevHome.DevDiagnostics.Models;
-using IWshRuntimeLibrary;
-using Microsoft.UI.Xaml;
-using Microsoft.UI.Xaml.Controls;
-using Microsoft.UI.Xaml.Input;
-using Microsoft.UI.Xaml.Media.Imaging;
-using Serilog;
-using Windows.ApplicationModel;
-using Windows.Management.Deployment;
-using Windows.Win32;
-using Windows.Win32.UI.Controls.Dialogs;
-
-namespace DevHome.DevDiagnostics.Controls;
-
-public sealed partial class AddToolControl : UserControl, INotifyPropertyChanged
-{
- private static readonly ILogger _log = Log.ForContext("SourceContext", nameof(AddToolControl));
-
- private readonly string _invalidToolInfo = CommonHelper.GetLocalizedString("InvalidToolInfoMessage");
- private readonly string _messageCloseText = CommonHelper.GetLocalizedString("MessageCloseText");
- private readonly string _executablesFilter = CommonHelper.GetLocalizedString("FileDialogFilterExecutables");
- private readonly string _batchFilesFilter = CommonHelper.GetLocalizedString("FileDialogFilterBatchFiles");
- private readonly string _commandFilesFilter = CommonHelper.GetLocalizedString("FileDialogFilterCommandFiles");
- private readonly string _mmcFilesFilter = CommonHelper.GetLocalizedString("FileDialogFilterMmcFiles");
- private readonly string _powershellFilter = CommonHelper.GetLocalizedString("FileDialogFilterPowershell");
- private readonly string _allFilesFilter = CommonHelper.GetLocalizedString("FileDialogFilterAllFiles");
-
- private readonly char[] _fileDialogFilter;
- private readonly ExternalToolsHelper _externalTools;
-
- // We have 3 sets of operations, and we arbitrarily divide the progress timing into 3 equal segments.
- private const int ShortcutProcessingEndIndex = 33;
- private const int PackageProcessingEndIndex = 67;
-
- private InstalledAppInfo? _selectedApp;
- private List? _shortcuts;
- private List? _packages;
- private List _allApps = [];
- private int _itemCount;
-
- public ObservableCollection SortedApps { get; set; } = [];
-
- public event PropertyChangedEventHandler? PropertyChanged;
-
- private bool _isLoading;
-
- public bool IsLoading
- {
- get => _isLoading;
- set
- {
- _isLoading = value;
- PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(nameof(IsLoading)));
- }
- }
-
- private int _progressPercentage;
-
- public int ProgressPercentage
- {
- get => _progressPercentage;
- set
- {
- _progressPercentage = value;
- PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(nameof(ProgressPercentage)));
- }
- }
-
- public AddToolControl()
- {
- _fileDialogFilter = CreateFileDialogFilter().ToCharArray();
-
- _externalTools = Application.Current.GetService();
-
- InitializeComponent();
- LoadingProgressTextRing.DataContext = this;
- }
-
- private string CreateFileDialogFilter()
- {
- var sb = new StringBuilder();
- sb.Append(CultureInfo.InvariantCulture, $"{_executablesFilter} (*.exe)\0*.exe\0");
- sb.Append(CultureInfo.InvariantCulture, $"{_batchFilesFilter} (*.bat)\0*.bat\0");
- sb.Append(CultureInfo.InvariantCulture, $"{_commandFilesFilter} (*.cmd)\0*.cmd\0");
- sb.Append(CultureInfo.InvariantCulture, $"{_mmcFilesFilter} (*.msc)\0*.msc\0");
- sb.Append(CultureInfo.InvariantCulture, $"{_powershellFilter} (*.ps1)\0*.ps1\0");
- sb.Append(CultureInfo.InvariantCulture, $"{_allFilesFilter} (*.*)\0*.*\0\0");
- return sb.ToString();
- }
-
- private void ToolBrowseButton_Click(object sender, RoutedEventArgs e)
- {
- HandleBrowseButton();
- }
-
- private void HandleBrowseButton()
- {
- // WinUI3's OpenFileDialog does not work if we're running elevated. So we have to use the old Win32 API.
- var fileName = string.Empty;
- var barWindow = Application.Current.GetService().DBarWindow;
-
- unsafe
- {
- fixed (char* file = new char[255], pFilter = _fileDialogFilter)
- {
- var openfile = new OPENFILENAMEW
- {
- lStructSize = (uint)Marshal.SizeOf(),
- lpstrFile = new Windows.Win32.Foundation.PWSTR(file),
- lpstrFilter = pFilter,
- nFilterIndex = 1,
- nMaxFile = 255,
- hwndOwner = barWindow?.ThisHwnd ?? Windows.Win32.Foundation.HWND.Null,
- };
-
- if (PInvoke.GetOpenFileName(ref openfile))
- {
- fileName = new string(openfile.lpstrFile);
- }
- }
- }
-
- if (!string.IsNullOrEmpty(fileName))
- {
- ToolPathTextBox.Text = fileName;
- ToolNameTextBox.Text = Path.GetFileNameWithoutExtension(fileName);
- }
-
- return;
- }
-
- private void OkButton_Click(object sender, RoutedEventArgs e)
- {
- var tool = GetCurrentToolDefinition();
- if (tool is null)
- {
- return;
- }
-
- _externalTools.AddExternalTool(tool);
- var toolRegisteredMessage = CommonHelper.GetLocalizedString("ToolRegisteredMessage", ToolNameTextBox.Text);
- WindowHelper.ShowTimedMessageDialog(this, toolRegisteredMessage, _messageCloseText);
- ClearValues();
- }
-
- private void ClearValues()
- {
- ToolNameTextBox.Text = string.Empty;
- ToolPathTextBox.Text = string.Empty;
- LaunchRadio.IsChecked = true;
- ArgumentsTextBox.Text = string.Empty;
- IsPinnedToggleSwitch.IsOn = true;
- _selectedApp = null;
- }
-
- private ExternalTool? GetCurrentToolDefinition()
- {
- if (string.IsNullOrEmpty(ToolNameTextBox.Text) || string.IsNullOrEmpty(ToolPathTextBox.Text))
- {
- WindowHelper.ShowTimedMessageDialog(this, _invalidToolInfo, _messageCloseText);
- return null;
- }
-
- var activationType = ToolActivationType.Launch;
- if (ProtocolRadio.IsChecked ?? false)
- {
- activationType = ToolActivationType.Protocol;
- }
- else if (_selectedApp is not null && _selectedApp.IsMsix)
- {
- activationType = ToolActivationType.Msix;
- }
-
- ToolType toolType = ToolType.Unknown;
-
- if (ToolTypeMenuItemDumpAnalyzer.IsChecked)
- {
- toolType |= ToolType.DumpAnalyzer;
- }
-
- return new(
- ToolNameTextBox.Text,
- ToolPathTextBox.Text,
- activationType,
- ArgumentsTextBox.Text,
- OutputRegularExpressionTextBox.Text,
- _selectedApp?.AppUserModelId ?? string.Empty,
- _selectedApp?.IconFilePath ?? string.Empty,
- toolType,
- IsPinnedToggleSwitch.IsOn);
- }
-
- private void CancelButton_Click(object sender, RoutedEventArgs e)
- {
- ClearValues();
- }
-
- private void RefreshAppListButton_Click(object sender, RoutedEventArgs e)
- {
- RefreshAppList();
- }
-
- public async void RefreshAppList()
- {
- RefreshAppListButton.IsEnabled = false;
-
- _allApps.Clear();
- SortedApps.Clear();
-
- _itemCount = GetShortcuts();
- if (_itemCount == 0)
- {
- _log.Error("Error getting _shortcuts");
- }
-
- var packageCount = GetPackages();
- if (packageCount == 0)
- {
- _log.Error("Error getting _packages");
- }
-
- _itemCount += packageCount;
- if (_itemCount == 0)
- {
- _log.Error("Error getting list of installed apps");
- return;
- }
-
- // We get most of the data on a background thread, which
- // reports intermittent progress.
- IsLoading = true;
- var progress = new Progress(percent =>
- {
- // Update the progress report.
- LoadingProgressTextRing.Value = percent;
- });
-
- await ProcessItemsAsync(progress);
-
- foreach (var app in _allApps)
- {
- SortedApps.Add(app);
- }
-
- IsLoading = false;
- RefreshAppListButton.IsEnabled = true;
- }
-
- private int GetShortcuts()
- {
- int count;
-
- // Search for .lnk files in the per-user and all-users Start Menu Programs directories.
- // %APPDATA%\Microsoft\Windows\Start Menu\Programs
- var startMenuProgramsPath =
- Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.StartMenu), "Programs");
-
- // %ProgramData%\Microsoft\Windows\Start Menu\Programs
- var commonStartMenuProgramsPath =
- Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.CommonStartMenu), "Programs");
-
- _shortcuts = [];
- if (Directory.Exists(startMenuProgramsPath))
- {
- _shortcuts.AddRange(Directory.GetFiles(startMenuProgramsPath, "*.lnk", SearchOption.AllDirectories));
- }
-
- if (Directory.Exists(commonStartMenuProgramsPath))
- {
- _shortcuts.AddRange(Directory.GetFiles(commonStartMenuProgramsPath, "*.lnk", SearchOption.AllDirectories));
- }
-
- count = _shortcuts?.Count ?? 0;
- return count;
- }
-
- private int GetPackages()
- {
- var count = 0;
- var packageManager = new PackageManager();
- _packages = packageManager.FindPackagesForUserWithPackageTypes(string.Empty, PackageTypes.Main).ToList();
- if (_packages is not null)
- {
- count = _packages.Count;
- }
-
- return count;
- }
-
- private async Task ProcessItemsAsync(IProgress progress)
- {
- // Process all the shortcut files.
- var currentCount = 0;
- for (var i = 0; i < _shortcuts?.Count; i++)
- {
- await Task.Run(() => ProcessShortcut(_shortcuts[i]));
-
- // Report progress.
- currentCount++;
- var percentComplete = (i + 1) * ShortcutProcessingEndIndex / _itemCount;
- progress.Report(percentComplete);
- }
-
- for (var j = 0; j < _packages?.Count; j++)
- {
- await Task.Run(() => ProcessPackage(_packages[j]));
-
- // Report progress.
- currentCount++;
- var percentComplete = ShortcutProcessingEndIndex + ((j + 1) * ShortcutProcessingEndIndex / _itemCount);
- progress.Report(percentComplete);
- }
-
- _allApps = _allApps.OrderBy(app => app.Name).ToList();
-
- // We get the icon data on the UI thread, because BitmapImages must be created on the UI thread.
- for (var k = 0; k < _allApps.Count; k++)
- {
- var app = _allApps[k];
- if (app.IsMsix)
- {
- if (app.AppPackage is not null)
- {
- try
- {
- // The package might be in a bad state, and accessing its
- // properties might throw an exception.
- app.Icon = new BitmapImage(app.AppPackage.Logo);
- app.IconFilePath = app.AppPackage.Logo.LocalPath;
- }
- catch
- {
- _log.Error("Error getting icon from package");
- }
- }
- }
- else
- {
- if (!string.IsNullOrEmpty(app.TargetPath))
- {
- app.Icon = WindowHelper.GetBitmapImageFromFile(app.TargetPath);
- }
- }
-
- currentCount++;
- var percentComplete = PackageProcessingEndIndex + ((k + 1) * ShortcutProcessingEndIndex / _itemCount);
- progress.Report(percentComplete);
-
- // Yield to make sure the UI thread can update the progress output.
- await Task.Delay(1);
- }
- }
-
- public void ProcessShortcut(string filePath)
- {
- var appName = Path.GetFileNameWithoutExtension(filePath);
-
- // Exclude Microsoft Virtual Desktop _shortcuts.
- if (appName.Contains("Microsoft Virtual Desktop", StringComparison.OrdinalIgnoreCase))
- {
- return;
- }
-
- var wshShell = new WshShell();
- if (wshShell.CreateShortcut(filePath) is not IWshShortcut shortcut)
- {
- _log.Error("Error getting shortcut");
- return;
- }
-
- // Proceed with using the shortcut object.
- var targetPath = shortcut.TargetPath;
-
- // Exclude _shortcuts that point to empty targets or filesystem folders.
- if (string.IsNullOrEmpty(targetPath) || Directory.Exists(targetPath))
- {
- return;
- }
-
- // Exclude *.chm, *.url, *.html, *.ico targets.
- var extension = Path.GetExtension(targetPath);
- if (extension.Equals(".chm", StringComparison.OrdinalIgnoreCase)
- || extension.Equals(".url", StringComparison.OrdinalIgnoreCase)
- || extension.Equals(".html", StringComparison.OrdinalIgnoreCase)
- || extension.Equals(".ico", StringComparison.OrdinalIgnoreCase))
- {
- return;
- }
-
- // Add the app for this shortcut to the list.
- _allApps.Add(new InstalledAppInfo
- {
- Name = appName,
- ShortcutFilePath = filePath,
- TargetPath = targetPath,
- });
- }
-
- public void ProcessPackage(Package package)
- {
- var op = package.GetAppListEntriesAsync();
- var task = op.AsTask();
- task.Wait();
- var entries = task.Result;
-
- // We only get the icon for apps that have an AppListEntry,
- // because the others are not likely to be activatable from the UI.
- if (entries.Count > 0)
- {
- // We only get the icon for the first AppListEntry, ignoring MAPs.
- // Note we use Package.Logo, not AppListEntry.DisplayInfo.GetLogo
- // because the latter doesn't get consistently-sized icons.
- var appListEntry = entries[0];
-
- // Add the app for this package to the list.
- _allApps.Add(new InstalledAppInfo
- {
- Name = package.DisplayName,
- AppUserModelId = appListEntry.AppUserModelId,
- AppPackage = package,
- });
- }
- }
-
- private void AppsListView_SelectionChanged(object sender, SelectionChangedEventArgs e)
- {
- if (AppsListView.SelectedItem is InstalledAppInfo app)
- {
- _selectedApp = app;
- if (!string.IsNullOrEmpty(app.TargetPath))
- {
- ToolPathTextBox.Text = app.TargetPath;
- }
- else if (!string.IsNullOrEmpty(app.AppUserModelId))
- {
- ToolPathTextBox.Text = app.AppUserModelId;
- }
-
- ToolNameTextBox.Text = app.Name;
- }
- else
- {
- _selectedApp = null;
- ToolPathTextBox.Text = string.Empty;
- ToolNameTextBox.Text = string.Empty;
- }
- }
-
- private void ToolPathTextBox_KeyDown(object sender, KeyRoutedEventArgs e)
- {
- var isError = false;
- if (e.Key == Windows.System.VirtualKey.Enter || e.Key == Windows.System.VirtualKey.Tab)
- {
- e.Handled = true;
- var filePath = ToolPathTextBox.Text;
- if (string.IsNullOrEmpty(filePath))
- {
- isError = true;
- }
- else
- {
- // If they copy/pasted from Explorer, the path will be in quotes.
- filePath = filePath.Replace("\"", string.Empty);
- if (string.IsNullOrEmpty(filePath))
- {
- isError = true;
- }
- else
- {
- // Ensure the textbox contains an unquoted path.
- ToolPathTextBox.Text = filePath;
- try
- {
- // Validate the path.
- var fullPath = Path.GetFullPath(filePath);
- if (Path.IsPathRooted(fullPath) && System.IO.File.Exists(fullPath))
- {
- ToolNameTextBox.Text = Path.GetFileNameWithoutExtension(filePath);
- }
- else
- {
- isError = true;
- }
- }
- catch (Exception ex)
- {
- isError = true;
- _log.Error(ex, "Error validating file path");
- }
- }
- }
- }
-
- if (isError)
- {
- WindowHelper.ShowTimedMessageDialog(this, _invalidToolInfo, _messageCloseText);
- }
- }
-}
diff --git a/tools/DevDiagnostics/DevHome.DevDiagnostics/Controls/ClipboardMonitorControl.xaml b/tools/DevDiagnostics/DevHome.DevDiagnostics/Controls/ClipboardMonitorControl.xaml
deleted file mode 100644
index d65bdc5413..0000000000
--- a/tools/DevDiagnostics/DevHome.DevDiagnostics/Controls/ClipboardMonitorControl.xaml
+++ /dev/null
@@ -1,44 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/tools/DevDiagnostics/DevHome.DevDiagnostics/Controls/ClipboardMonitorControl.xaml.cs b/tools/DevDiagnostics/DevHome.DevDiagnostics/Controls/ClipboardMonitorControl.xaml.cs
deleted file mode 100644
index 9b695ae8a0..0000000000
--- a/tools/DevDiagnostics/DevHome.DevDiagnostics/Controls/ClipboardMonitorControl.xaml.cs
+++ /dev/null
@@ -1,17 +0,0 @@
-// Copyright (c) Microsoft Corporation.
-// Licensed under the MIT License.
-
-using DevHome.DevDiagnostics.ViewModels;
-using Microsoft.UI.Xaml.Controls;
-
-namespace DevHome.DevDiagnostics.Controls;
-
-public sealed partial class ClipboardMonitorControl : UserControl
-{
- private readonly ClipboardMonitorControlViewModel _viewModel = new();
-
- public ClipboardMonitorControl()
- {
- this.InitializeComponent();
- }
-}
diff --git a/tools/DevDiagnostics/DevHome.DevDiagnostics/Controls/DDSeparator.xaml b/tools/DevDiagnostics/DevHome.DevDiagnostics/Controls/DDSeparator.xaml
deleted file mode 100644
index 53321338aa..0000000000
--- a/tools/DevDiagnostics/DevHome.DevDiagnostics/Controls/DDSeparator.xaml
+++ /dev/null
@@ -1,31 +0,0 @@
-
-
-
-
-
-
-
-
diff --git a/tools/DevDiagnostics/DevHome.DevDiagnostics/Controls/DDSeparator.xaml.cs b/tools/DevDiagnostics/DevHome.DevDiagnostics/Controls/DDSeparator.xaml.cs
deleted file mode 100644
index d8ade0f86c..0000000000
--- a/tools/DevDiagnostics/DevHome.DevDiagnostics/Controls/DDSeparator.xaml.cs
+++ /dev/null
@@ -1,38 +0,0 @@
-// Copyright (c) Microsoft Corporation.
-// Licensed under the MIT License.
-
-using Microsoft.UI.Xaml;
-using Microsoft.UI.Xaml.Controls;
-
-namespace DevHome.DevDiagnostics.Controls;
-
-public sealed partial class DDSeparator : UserControl
-{
- private Orientation _orientation = Orientation.Vertical;
-
- public Orientation Orientation
- {
- get => _orientation;
-
- set
- {
- _orientation = value;
-
- if (value == Orientation.Vertical)
- {
- SeparatorRectangleVertical.Visibility = Visibility.Visible;
- SeparatorRectangleHorizontal.Visibility = Visibility.Collapsed;
- }
- else
- {
- SeparatorRectangleHorizontal.Visibility = Visibility.Visible;
- SeparatorRectangleVertical.Visibility = Visibility.Collapsed;
- }
- }
- }
-
- public DDSeparator()
- {
- InitializeComponent();
- }
-}
diff --git a/tools/DevDiagnostics/DevHome.DevDiagnostics/Controls/EditToolsControl.xaml b/tools/DevDiagnostics/DevHome.DevDiagnostics/Controls/EditToolsControl.xaml
deleted file mode 100644
index 70bc5e7933..0000000000
--- a/tools/DevDiagnostics/DevHome.DevDiagnostics/Controls/EditToolsControl.xaml
+++ /dev/null
@@ -1,55 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/tools/DevDiagnostics/DevHome.DevDiagnostics/Controls/EditToolsControl.xaml.cs b/tools/DevDiagnostics/DevHome.DevDiagnostics/Controls/EditToolsControl.xaml.cs
deleted file mode 100644
index d8e8f351bb..0000000000
--- a/tools/DevDiagnostics/DevHome.DevDiagnostics/Controls/EditToolsControl.xaml.cs
+++ /dev/null
@@ -1,55 +0,0 @@
-// Copyright (c) Microsoft Corporation.
-// Licensed under the MIT License.
-
-using System.Collections.Generic;
-using DevHome.Common.Extensions;
-using DevHome.DevDiagnostics.Helpers;
-using Microsoft.UI.Xaml;
-using Microsoft.UI.Xaml.Controls;
-
-namespace DevHome.DevDiagnostics.Controls;
-
-public sealed partial class EditToolsControl : UserControl
-{
- private readonly ExternalToolsHelper _externalTools;
-
- public EditToolsControl()
- {
- _externalTools = Application.Current.GetService();
- InitializeComponent();
- EnableUnregisterButton();
- }
-
- private void UnregisterToolButton_Click(object sender, RoutedEventArgs e)
- {
- List toolsToRemove = new();
-
- // First, grab all the tools we want to remove. The grid seems to have some unexpected behavior
- // with its list of selected items when you start removing them.
- foreach (var item in ToolsDataGrid.SelectedItems)
- {
- if (item is ExternalTool tool)
- {
- toolsToRemove.Add(tool);
- }
- }
-
- // And now remove all of the tools
- foreach (var tool in toolsToRemove)
- {
- _externalTools.RemoveExternalTool(tool);
- }
-
- EnableUnregisterButton();
- }
-
- private void EnableUnregisterButton()
- {
- UnregisterToolButton.IsEnabled = ToolsDataGrid.SelectedItems?.Count > 0;
- }
-
- private void ToolsDataGrid_SelectionChanged(object sender, SelectionChangedEventArgs e)
- {
- EnableUnregisterButton();
- }
-}
diff --git a/tools/DevDiagnostics/DevHome.DevDiagnostics/Controls/ElevatedButtonControl.xaml b/tools/DevDiagnostics/DevHome.DevDiagnostics/Controls/ElevatedButtonControl.xaml
deleted file mode 100644
index fda9e35db2..0000000000
--- a/tools/DevDiagnostics/DevHome.DevDiagnostics/Controls/ElevatedButtonControl.xaml
+++ /dev/null
@@ -1,19 +0,0 @@
-
-
-
-
-
-
-
diff --git a/tools/DevDiagnostics/DevHome.DevDiagnostics/Controls/ElevatedButtonControl.xaml.cs b/tools/DevDiagnostics/DevHome.DevDiagnostics/Controls/ElevatedButtonControl.xaml.cs
deleted file mode 100644
index 58cbbbc002..0000000000
--- a/tools/DevDiagnostics/DevHome.DevDiagnostics/Controls/ElevatedButtonControl.xaml.cs
+++ /dev/null
@@ -1,55 +0,0 @@
-// Copyright (c) Microsoft Corporation.
-// Licensed under the MIT License.
-using System;
-using System.Collections.Generic;
-using System.ComponentModel;
-using System.IO;
-using System.Linq;
-using System.Runtime.InteropServices.WindowsRuntime;
-using Microsoft.UI.Xaml;
-using Microsoft.UI.Xaml.Controls;
-using Microsoft.UI.Xaml.Controls.Primitives;
-using Microsoft.UI.Xaml.Data;
-using Microsoft.UI.Xaml.Input;
-using Microsoft.UI.Xaml.Media;
-using Microsoft.UI.Xaml.Navigation;
-using Windows.Foundation;
-using Windows.Foundation.Collections;
-
-namespace DevHome.DevDiagnostics.Controls;
-
-public sealed partial class ElevatedButtonControl : UserControl, INotifyPropertyChanged
-{
- public event PropertyChangedEventHandler? PropertyChanged;
-
- private System.Windows.Input.ICommand? _command;
-
- public System.Windows.Input.ICommand? Command
- {
- get => _command;
-
- set
- {
- _command = value;
- PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(nameof(Command)));
- }
- }
-
- private string _text = string.Empty;
-
- public string Text
- {
- get => _text;
-
- set
- {
- _text = value;
- PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(nameof(Text)));
- }
- }
-
- public ElevatedButtonControl()
- {
- this.InitializeComponent();
- }
-}
diff --git a/tools/DevDiagnostics/DevHome.DevDiagnostics/Controls/ExpandedViewControl.xaml b/tools/DevDiagnostics/DevHome.DevDiagnostics/Controls/ExpandedViewControl.xaml
deleted file mode 100644
index d196aec834..0000000000
--- a/tools/DevDiagnostics/DevHome.DevDiagnostics/Controls/ExpandedViewControl.xaml
+++ /dev/null
@@ -1,102 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/tools/DevDiagnostics/DevHome.DevDiagnostics/Controls/ExpandedViewControl.xaml.cs b/tools/DevDiagnostics/DevHome.DevDiagnostics/Controls/ExpandedViewControl.xaml.cs
deleted file mode 100644
index f1f58f2f33..0000000000
--- a/tools/DevDiagnostics/DevHome.DevDiagnostics/Controls/ExpandedViewControl.xaml.cs
+++ /dev/null
@@ -1,40 +0,0 @@
-// Copyright (c) Microsoft Corporation.
-// Licensed under the MIT License.
-
-using System;
-using DevHome.DevDiagnostics.ViewModels;
-using Microsoft.UI.Xaml.Controls;
-using Microsoft.UI.Xaml.Input;
-
-namespace DevHome.DevDiagnostics.Controls;
-
-public sealed partial class ExpandedViewControl : UserControl
-{
- private readonly ExpandedViewControlViewModel _viewModel = new();
-
- public ExpandedViewControl()
- {
- InitializeComponent();
- _viewModel.NavigationService.Frame = PageFrame;
- }
-
- public Frame GetPageFrame()
- {
- return PageFrame;
- }
-
- public void NavigateTo(Type viewModelType)
- {
- _viewModel.NavigateTo(viewModelType);
- }
-
- public void NavigateToSettings(string viewModelType)
- {
- _viewModel.NavigateToSettings(viewModelType);
- }
-
- private void GridSplitter_PointerPressed(object sender, PointerRoutedEventArgs e)
- {
- e.Handled = true;
- }
-}
diff --git a/tools/DevDiagnostics/DevHome.DevDiagnostics/Controls/ExternalToolsManagementButton.cs b/tools/DevDiagnostics/DevHome.DevDiagnostics/Controls/ExternalToolsManagementButton.cs
deleted file mode 100644
index 460873e693..0000000000
--- a/tools/DevDiagnostics/DevHome.DevDiagnostics/Controls/ExternalToolsManagementButton.cs
+++ /dev/null
@@ -1,263 +0,0 @@
-// Copyright (c) Microsoft Corporation.
-// Licensed under the MIT License.
-
-using System;
-using System.Collections.Specialized;
-using System.ComponentModel;
-using System.Diagnostics;
-using System.Linq;
-using DevHome.Common.Extensions;
-using DevHome.DevDiagnostics.Helpers;
-using Microsoft.UI.Xaml;
-using Microsoft.UI.Xaml.Controls;
-using Microsoft.UI.Xaml.Media;
-
-namespace DevHome.DevDiagnostics.Controls;
-
-internal sealed class ExternalToolsManagementButton : AppBarButton
-{
- private const string UnregisterButtonGlyph = "\uECC9";
-
- private readonly Microsoft.UI.Dispatching.DispatcherQueue _dispatcher;
- private readonly string _pinMenuItemText = CommonHelper.GetLocalizedString("PinMenuItemText");
- private readonly string _unpinMenuItemText = CommonHelper.GetLocalizedString("UnpinMenuItemRawText");
- private readonly string _unregisterMenuItemText = CommonHelper.GetLocalizedString("UnregisterMenuItemRawText");
- private readonly ExternalToolsHelper _externalTools;
-
- public event EventHandler? ExternalToolLaunchRequest;
-
- public ExternalToolsManagementButton()
- {
- _dispatcher = Microsoft.UI.Dispatching.DispatcherQueue.GetForCurrentThread();
- _externalTools = Application.Current.GetService();
-
- InitializeExternalTools();
- }
-
- private void InitializeExternalTools()
- {
- if (_externalTools.AllExternalTools.Count > 0)
- {
- var flyout = new MenuFlyout();
- this.ContextFlyout = flyout;
-
- foreach (var tool in _externalTools.AllExternalTools)
- {
- AddExternalToolToContextMenu(flyout, tool);
- tool.PropertyChanged += ExternalToolItem_PropertyChanged;
- }
- }
-
- // We have to cast to INotifyCollectionChanged explicitly because the CollectionChanged
- // event in ReadOnlyObservableCollection is protected.
- ((INotifyCollectionChanged)_externalTools.AllExternalTools).CollectionChanged += ExternalTools_CollectionChanged;
- }
-
- private void ExternalTools_CollectionChanged(object? sender, NotifyCollectionChangedEventArgs e)
- {
- _dispatcher.TryEnqueue(() =>
- {
- if (e.Action == NotifyCollectionChangedAction.Add && e.NewItems is not null)
- {
- foreach (ExternalTool tool in e.NewItems)
- {
- // If this button doens't have a flyout, create one
- if (this.ContextFlyout is not MenuFlyout flyout)
- {
- flyout = new MenuFlyout();
- this.ContextFlyout = flyout;
- }
-
- AddExternalToolToContextMenu(flyout, tool);
-
- // Listen for tool changes
- tool.PropertyChanged += ExternalToolItem_PropertyChanged;
- }
- }
- else if (e.Action == NotifyCollectionChangedAction.Remove && e.OldItems is not null)
- {
- foreach (ExternalTool tool in e.OldItems)
- {
- tool.PropertyChanged -= ExternalToolItem_PropertyChanged;
-
- // If this button doens't have a flyout, create one
- if (this.ContextFlyout is MenuFlyout flyout)
- {
- RemoveExternalToolFromContextMenu(flyout, tool);
-
- // If we've removed all the items from the flyout, remove the flyout
- if (flyout.Items.Count == 0)
- {
- this.ContextFlyout = null;
- }
- }
- }
- }
- });
- }
-
- private void AddExternalToolToContextMenu(MenuFlyout menuFlyout, ExternalTool tool)
- {
- menuFlyout.Items.Add(CreateContextMenuItemForTool(tool));
- }
-
- private void RemoveExternalToolFromContextMenu(MenuFlyout menuFlyout, ExternalTool tool)
- {
- foreach (var menuItem in menuFlyout.Items.Where(x => x.Tag == tool))
- {
- tool.PropertyChanged -= ExternalToolItem_PropertyChanged;
- menuFlyout.Items.Remove(menuItem);
- break;
- }
- }
-
- // This creates a Menu Flyout item for an external tool. It also creates a sub-menu item for pinning/unpinning
- // and unregistering the tool.
- private MenuFlyoutItem CreateContextMenuItemForTool(ExternalTool tool)
- {
- var imageIcon = tool.GetIcon();
-
- var menuItem = new MenuFlyoutItem
- {
- Text = tool.Name,
- Tag = tool,
- Icon = imageIcon,
- };
- menuItem.Click += ExternalToolMenuItem_Click;
-
- var pinMenuSubItemItem = new MenuFlyoutItem
- {
- Text = _pinMenuItemText,
- Icon = GetFontIcon(CommonHelper.PinGlyph),
- Tag = tool,
- };
- pinMenuSubItemItem.Click += ExternalToolPinUnpin_Click;
-
- var unPinMenuSubItemItem = new MenuFlyoutItem
- {
- Text = _unpinMenuItemText,
- Icon = GetFontIcon(CommonHelper.UnpinGlyph),
- Tag = tool,
- };
- unPinMenuSubItemItem.Click += ExternalToolPinUnpin_Click;
-
- var unRegisterMenuSubItemItem = new MenuFlyoutItem
- {
- Text = _unregisterMenuItemText,
- Icon = GetFontIcon(UnregisterButtonGlyph),
- Tag = tool,
- };
- unRegisterMenuSubItemItem.Click += UnregisterMenuItem_Click;
-
- var menuSubItemFlyout = new MenuFlyout();
-
- menuSubItemFlyout.Items.Add(pinMenuSubItemItem);
- menuSubItemFlyout.Items.Add(unPinMenuSubItemItem);
- menuSubItemFlyout.Items.Add(unRegisterMenuSubItemItem);
-
- if (tool.IsPinned)
- {
- pinMenuSubItemItem.Visibility = Visibility.Collapsed;
- }
- else
- {
- unPinMenuSubItemItem.Visibility = Visibility.Collapsed;
- }
-
- menuItem.ContextFlyout = menuSubItemFlyout;
-
- return menuItem;
- }
-
- private void ExternalToolItem_PropertyChanged(object? sender, PropertyChangedEventArgs e)
- {
- if (sender is not ExternalTool tool)
- {
- Debug.Assert(false, "Why are we getting notified of a tool property change without a tool?");
- return;
- }
-
- _dispatcher.TryEnqueue(() =>
- {
- MenuFlyout? flyout = this.ContextFlyout as MenuFlyout;
- Debug.Assert(flyout is not null, "Why does this button not have a menu flyout?. It should have been populated in CreateContextMenuItemForTool");
-
- // Update the submenu item for this tool
- foreach (MenuFlyoutItem menuItem in flyout.Items.Where(x => x.Tag == tool))
- {
- // Update the name if it's changed
- menuItem.Text = tool.Name;
-
- var imageIcon = tool.GetIcon();
-
- menuItem.Icon = imageIcon;
-
- var menuSubItemFlyout = menuItem.ContextFlyout as MenuFlyout;
- Debug.Assert(menuSubItemFlyout != null, "It's expected this menuItem has a sub flyout. See CreateContextMenuItemForTool");
-
- var pinSubItemItem = menuSubItemFlyout.Items[0] as MenuFlyoutItem;
- Debug.Assert(pinSubItemItem != null, "The subflyout should have 2 items. The first is to pin the tool. See CreateContextMenuItemForTool");
-
- var unPinSubItemItem = menuSubItemFlyout.Items[1] as MenuFlyoutItem;
- Debug.Assert(unPinSubItemItem != null, "The second flyout should be to unpin the tool. See CreateContextMenuItemForTool");
-
- // Toggle the visibily of the pin and unpin menu items based on the pinned state of the tool
- pinSubItemItem.Visibility = tool.IsPinned ? Visibility.Collapsed : Visibility.Visible;
- unPinSubItemItem.Visibility = tool.IsPinned ? Visibility.Visible : Visibility.Collapsed;
- break;
- }
- });
- }
-
- public void ExternalToolMenuItem_Click(object sender, RoutedEventArgs e)
- {
- if (sender is MenuFlyoutItem clickedMenuItem && clickedMenuItem.Tag is ExternalTool tool)
- {
- ExternalToolLaunchRequest?.Invoke(this, tool);
- }
- }
-
- private void ExternalToolPinUnpin_Click(object sender, RoutedEventArgs e)
- {
- ExternalTool tool = GetToolFromSender(sender);
- tool.IsPinned = !tool.IsPinned;
- HideFlyout(sender);
- }
-
- public void UnregisterMenuItem_Click(object sender, RoutedEventArgs e)
- {
- ExternalTool tool = GetToolFromSender(sender);
- tool.UnregisterTool();
-
- HideFlyout(sender);
- }
-
- private ExternalTool GetToolFromSender(object sender)
- {
- MenuFlyoutItem? clickedMenuItem = sender as MenuFlyoutItem;
- Debug.Assert(clickedMenuItem != null, "Why is this null? This should be a MenuFlyoutItem");
-
- ExternalTool? tool = clickedMenuItem.Tag as ExternalTool;
- Debug.Assert(tool != null, "The menuflyout items should have external tools as their tag. See CreateContextMenuItemForTool");
-
- return tool;
- }
-
- private void HideFlyout(object sender)
- {
- this.ContextFlyout.Hide();
- }
-
- private FontIcon GetFontIcon(string s)
- {
- var fontFamily = (FontFamily)Application.Current.Resources["SymbolThemeFontFamily"];
-
- var icon = new FontIcon
- {
- FontFamily = fontFamily,
- Glyph = s,
- };
-
- return icon;
- }
-}
diff --git a/tools/DevDiagnostics/DevHome.DevDiagnostics/Controls/InsightForMissingFileProcessTerminationControl.xaml b/tools/DevDiagnostics/DevHome.DevDiagnostics/Controls/InsightForMissingFileProcessTerminationControl.xaml
deleted file mode 100644
index cc5a627354..0000000000
--- a/tools/DevDiagnostics/DevHome.DevDiagnostics/Controls/InsightForMissingFileProcessTerminationControl.xaml
+++ /dev/null
@@ -1,24 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/tools/DevDiagnostics/DevHome.DevDiagnostics/Controls/InsightForMissingFileProcessTerminationControl.xaml.cs b/tools/DevDiagnostics/DevHome.DevDiagnostics/Controls/InsightForMissingFileProcessTerminationControl.xaml.cs
deleted file mode 100644
index 06de27283f..0000000000
--- a/tools/DevDiagnostics/DevHome.DevDiagnostics/Controls/InsightForMissingFileProcessTerminationControl.xaml.cs
+++ /dev/null
@@ -1,47 +0,0 @@
-// Copyright (c) Microsoft Corporation.
-// Licensed under the MIT License.
-using System.ComponentModel;
-using DevHome.DevDiagnostics.Helpers;
-using Microsoft.UI.Xaml.Controls;
-
-namespace DevHome.DevDiagnostics.Controls;
-
-public sealed partial class InsightForMissingFileProcessTerminationControl : UserControl, INotifyPropertyChanged
-{
- public event PropertyChangedEventHandler? PropertyChanged;
-
- public string ElevationButtonTextString { get; } = CommonHelper.GetLocalizedString("InsightsMissingFileEnableLoaderSnapsButtonLabel");
-
- public string ElevationButtonToolTipString { get; } = CommonHelper.GetLocalizedString("InsightsMissingFileEnableLoaderSnapsButtonToolTip");
-
- private string _text = string.Empty;
-
- public string Text
- {
- get => _text;
-
- set
- {
- _text = value;
- PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(nameof(Text)));
- }
- }
-
- private System.Windows.Input.ICommand? _command;
-
- public System.Windows.Input.ICommand? Command
- {
- get => _command;
-
- set
- {
- _command = value;
- PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(nameof(Command)));
- }
- }
-
- public InsightForMissingFileProcessTerminationControl()
- {
- this.InitializeComponent();
- }
-}
diff --git a/tools/DevDiagnostics/DevHome.DevDiagnostics/Controls/InsightSimpleTextControl.xaml b/tools/DevDiagnostics/DevHome.DevDiagnostics/Controls/InsightSimpleTextControl.xaml
deleted file mode 100644
index 9a201b4d8c..0000000000
--- a/tools/DevDiagnostics/DevHome.DevDiagnostics/Controls/InsightSimpleTextControl.xaml
+++ /dev/null
@@ -1,14 +0,0 @@
-
-
-
-
-
-
-
diff --git a/tools/DevDiagnostics/DevHome.DevDiagnostics/Controls/InsightSimpleTextControl.xaml.cs b/tools/DevDiagnostics/DevHome.DevDiagnostics/Controls/InsightSimpleTextControl.xaml.cs
deleted file mode 100644
index fd81e65983..0000000000
--- a/tools/DevDiagnostics/DevHome.DevDiagnostics/Controls/InsightSimpleTextControl.xaml.cs
+++ /dev/null
@@ -1,29 +0,0 @@
-// Copyright (c) Microsoft Corporation.
-// Licensed under the MIT License.
-using System.ComponentModel;
-using Microsoft.UI.Xaml.Controls;
-
-namespace DevHome.DevDiagnostics.Controls;
-
-public sealed partial class InsightSimpleTextControl : UserControl, INotifyPropertyChanged
-{
- private string _description = string.Empty;
-
- public event PropertyChangedEventHandler? PropertyChanged;
-
- public string Description
- {
- get => _description;
-
- set
- {
- _description = value;
- PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(nameof(Description)));
- }
- }
-
- public InsightSimpleTextControl()
- {
- this.InitializeComponent();
- }
-}
diff --git a/tools/DevDiagnostics/DevHome.DevDiagnostics/Controls/ProcessSelectionButton.cs b/tools/DevDiagnostics/DevHome.DevDiagnostics/Controls/ProcessSelectionButton.cs
deleted file mode 100644
index 7b21082ae4..0000000000
--- a/tools/DevDiagnostics/DevHome.DevDiagnostics/Controls/ProcessSelectionButton.cs
+++ /dev/null
@@ -1,68 +0,0 @@
-// Copyright (c) Microsoft Corporation.
-// Licensed under the MIT License.
-
-using System.Diagnostics;
-using DevHome.DevDiagnostics.Helpers;
-using DevHome.DevDiagnostics.Models;
-using Microsoft.UI.Input;
-using Microsoft.UI.Xaml.Controls;
-using Microsoft.UI.Xaml.Input;
-
-namespace DevHome.DevDiagnostics.Controls;
-
-public class ProcessSelectionButton : AppBarButton
-{
- public ProcessSelectionButton()
- {
- }
-
- protected override void OnPointerEntered(PointerRoutedEventArgs e)
- {
- base.OnPointerEntered(e);
-
- // When the mouse cursor is over the button, change to the default cursor.
- ResetCursor();
- }
-
- protected override void OnPointerExited(PointerRoutedEventArgs e)
- {
- base.OnPointerExited(e);
-
- // When the mouse cursor leaves the button, change the cursor to the cross.
- ChangeCursor();
- }
-
- protected override void OnPointerReleased(PointerRoutedEventArgs e)
- {
- base.OnPointerReleased(e);
-
- // Were we showing the select cursor?
- if (ProtectedCursor == null)
- {
- return;
- }
-
- Process? p;
- Windows.Win32.Foundation.HWND hwnd;
-
- // Grab the window under the cursor and attach to that process.
- WindowHelper.GetAppInfoUnderMouseCursor(out p, out hwnd);
- if (p != null)
- {
- WindowHelper.TranslateUWPProcess(hwnd, ref p);
- TargetAppData.Instance.SetNewAppData(p, hwnd);
- }
-
- ResetCursor();
- }
-
- public void ChangeCursor()
- {
- ProtectedCursor = InputSystemCursor.Create(InputSystemCursorShape.Cross);
- }
-
- public void ResetCursor()
- {
- ProtectedCursor = null;
- }
-}
diff --git a/tools/DevDiagnostics/DevHome.DevDiagnostics/Controls/ProgressTextRing.xaml b/tools/DevDiagnostics/DevHome.DevDiagnostics/Controls/ProgressTextRing.xaml
deleted file mode 100644
index 5d0c456db6..0000000000
--- a/tools/DevDiagnostics/DevHome.DevDiagnostics/Controls/ProgressTextRing.xaml
+++ /dev/null
@@ -1,34 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
diff --git a/tools/DevDiagnostics/DevHome.DevDiagnostics/Controls/ProgressTextRing.xaml.cs b/tools/DevDiagnostics/DevHome.DevDiagnostics/Controls/ProgressTextRing.xaml.cs
deleted file mode 100644
index 067036e7d5..0000000000
--- a/tools/DevDiagnostics/DevHome.DevDiagnostics/Controls/ProgressTextRing.xaml.cs
+++ /dev/null
@@ -1,74 +0,0 @@
-// Copyright (c) Microsoft Corporation.
-// Licensed under the MIT License.
-
-using System.ComponentModel;
-using Microsoft.UI.Xaml;
-using Microsoft.UI.Xaml.Controls;
-
-namespace DevHome.DevDiagnostics.Controls;
-
-public sealed partial class ProgressTextRing : UserControl, INotifyPropertyChanged
-{
- public ProgressTextRing()
- {
- InitializeComponent();
- }
-
- public static readonly DependencyProperty IsActiveProperty =
- DependencyProperty.Register(nameof(IsActive), typeof(bool), typeof(ProgressTextRing), new PropertyMetadata(false, OnIsActivePropertyChanged));
-
- public bool IsActive
- {
- get => (bool)GetValue(IsActiveProperty);
- set => SetValue(IsActiveProperty, value);
- }
-
- private static void OnIsActivePropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
- {
- var control = (ProgressTextRing)d;
- control.OnPropertyChanged(nameof(TextBlockVisibility));
- }
-
- public static readonly DependencyProperty DiameterProperty =
- DependencyProperty.Register(nameof(Diameter), typeof(double), typeof(ProgressTextRing), new PropertyMetadata(0.0, OnDiameterPropertyChanged));
-
- public double Diameter
- {
- get => (double)GetValue(DiameterProperty);
- set => SetValue(DiameterProperty, value);
- }
-
- private static void OnDiameterPropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
- {
- var control = (ProgressTextRing)d;
- control.OnPropertyChanged(nameof(TextBlockFontSize));
- }
-
- public static readonly DependencyProperty ValueProperty =
- DependencyProperty.Register(nameof(Value), typeof(double), typeof(ProgressTextRing), new PropertyMetadata(0.0, OnValuePropertyChanged));
-
- public double Value
- {
- get => (double)GetValue(ValueProperty);
- set => SetValue(ValueProperty, value);
- }
-
- private static void OnValuePropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
- {
- var control = (ProgressTextRing)d;
- control.OnPropertyChanged(nameof(PercentageText));
- }
-
- private Visibility TextBlockVisibility => IsActive ? Visibility.Visible : Visibility.Collapsed;
-
- private double TextBlockFontSize => FontSize > 0 ? FontSize : Diameter / 3.6;
-
- public string PercentageText => $"{Value}%";
-
- public event PropertyChangedEventHandler? PropertyChanged;
-
- private void OnPropertyChanged(string propertyName)
- {
- PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
- }
-}
diff --git a/tools/DevDiagnostics/DevHome.DevDiagnostics/DD.ico b/tools/DevDiagnostics/DevHome.DevDiagnostics/DD.ico
deleted file mode 100644
index 84014e6192..0000000000
Binary files a/tools/DevDiagnostics/DevHome.DevDiagnostics/DD.ico and /dev/null differ
diff --git a/tools/DevDiagnostics/DevHome.DevDiagnostics/DDApp.xaml b/tools/DevDiagnostics/DevHome.DevDiagnostics/DDApp.xaml
deleted file mode 100644
index d8c6f41a9e..0000000000
--- a/tools/DevDiagnostics/DevHome.DevDiagnostics/DDApp.xaml
+++ /dev/null
@@ -1,68 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- 0,0,0,4
- 0,8,0,8
- -12,0,0,0
-
- 12
- 12,0
- XamlAutoFontFamily
- 20
-
- SemiBold
-
-
-
-
diff --git a/tools/DevDiagnostics/DevHome.DevDiagnostics/DDApp.xaml.cs b/tools/DevDiagnostics/DevHome.DevDiagnostics/DDApp.xaml.cs
deleted file mode 100644
index 424ad44c90..0000000000
--- a/tools/DevDiagnostics/DevHome.DevDiagnostics/DDApp.xaml.cs
+++ /dev/null
@@ -1,150 +0,0 @@
-// Copyright (c) Microsoft Corporation.
-// Licensed under the MIT License.
-
-using System;
-using DevHome.Common.Extensions;
-using DevHome.Common.Services;
-using DevHome.DevDiagnostics.Helpers;
-using DevHome.DevDiagnostics.Models;
-using DevHome.DevDiagnostics.Pages;
-using DevHome.DevDiagnostics.Services;
-using DevHome.DevDiagnostics.Telemetry;
-using DevHome.DevDiagnostics.TelemetryEvents;
-using DevHome.DevDiagnostics.ViewModels;
-using DevHome.Service;
-using DevHome.Telemetry;
-using Microsoft.Extensions.DependencyInjection;
-using Microsoft.Extensions.Hosting;
-using Microsoft.UI.Xaml;
-using Windows.Storage;
-
-namespace DevHome.DevDiagnostics;
-
-public partial class App : Application, IApp
-{
- // The .NET Generic Host provides dependency injection, configuration, logging, and other services.
- // https://docs.microsoft.com/dotnet/core/extensions/generic-host
- // https://docs.microsoft.com/dotnet/core/extensions/dependency-injection
- // https://docs.microsoft.com/dotnet/core/extensions/configuration
- // https://docs.microsoft.com/dotnet/core/extensions/logging
- public IHost Host { get; }
-
- public T GetService()
- where T : class => Host.GetService();
-
- public Microsoft.UI.Dispatching.DispatcherQueue? UIDispatcher { get; }
-
- public App()
- {
- UnhandledException += App_UnhandledException;
-
- InitializeComponent();
-
- UIDispatcher = Microsoft.UI.Dispatching.DispatcherQueue.GetForCurrentThread();
-
- Host = Microsoft.Extensions.Hosting.Host.CreateDefaultBuilder()
- .ConfigureServices((context, services) =>
- {
- // Services
- services.AddSingleton();
- services.AddSingleton();
- services.AddSingleton();
- services.AddSingleton();
- services.AddSingleton();
- services.AddSingleton();
- services.AddSingleton();
- services.AddSingleton();
- services.AddSingleton();
- services.AddSingleton(CommonHelper.GetDevHomeService());
- services.AddSingleton();
-
- // Window
- services.AddSingleton();
-
- // Views and ViewModels
- services.AddSingleton();
- services.AddSingleton();
- services.AddSingleton();
- services.AddSingleton();
- services.AddSingleton();
- services.AddSingleton();
- services.AddSingleton();
- services.AddSingleton();
- services.AddSingleton();
- services.AddSingleton();
- services.AddSingleton();
- services.AddSingleton();
- services.AddSingleton();
- services.AddSingleton();
- services.AddSingleton();
- services.AddSingleton();
-
- // Settings sub-pages and viewmodels.
- services.AddTransient();
- services.AddTransient();
- services.AddTransient();
- services.AddTransient();
- services.AddTransient();
- services.AddTransient();
- services.AddTransient();
- services.AddTransient();
- }).Build();
-
- // Provide an explicit implementationInstance otherwise AddSingleton does not create a new instance immediately.
- // It will lazily init when the first component requires it but the hotkey helper needs to be registered immediately.
- Application.Current.GetService();
-
- // And start up the listener for process load failures immediately
- Application.Current.GetService();
- }
-
- private void App_UnhandledException(object sender, Microsoft.UI.Xaml.UnhandledExceptionEventArgs e)
- {
- // https://docs.microsoft.com/windows/windows-app-sdk/api/winrt/microsoft.ui.xaml.application.unhandledexception.
- Serilog.Log.Fatal(e.Exception, $"Unhandled exception: {e.Message}");
- Serilog.Log.CloseAndFlush();
-
- // We are very likely in a bad and unrecoverable state, so ensure we crash w/ the exception info.
- Environment.FailFast(e.Message, e.Exception);
- }
-
- internal static bool IsFeatureEnabled()
- {
- var isEnabled = false;
-
- ApplicationData.Current.LocalSettings.Values.TryGetValue($"ExperimentalFeature_DevDiagnosticsExperiment", out var isEnabledObj);
- if (isEnabledObj is not null && isEnabledObj is string isEnabledValue)
- {
- isEnabled = isEnabledValue == "true";
- }
- else
- {
-#if DEBUG
- // Override on debug builds to be enabled by default
- isEnabled = true;
-#endif
- }
-
- return isEnabled;
- }
-
- internal static ITelemetry Logger => TelemetryFactory.Get();
-
- internal static void LogTimeTaken(string eventName, uint timeTakenMilliseconds, Guid? relatedActivityId = null) => Logger.LogTimeTaken(eventName, timeTakenMilliseconds, relatedActivityId);
-
- internal static void LogCritical(string eventName, bool isError = false, Guid? relatedActivityId = null) => Logger.LogCritical(eventName, isError, relatedActivityId);
-
- internal static void Log(string eventName, LogLevel level, T data, Guid? relatedActivityId = null)
- where T : EventBase
- {
- Logger.Log(eventName, level, data, relatedActivityId ?? null);
- }
-
- internal static void LogError(string eventName, LogLevel level, T data, Guid? relatedActivityId = null)
- where T : EventBase
- {
- Logger.LogError(eventName, level, data, relatedActivityId);
- }
-
- internal static void Log(string eventName, LogLevel level, Guid? relatedActivityId = null) => Logger.Log(eventName, level, new UsageEventData(), relatedActivityId);
-}
diff --git a/tools/DevDiagnostics/DevHome.DevDiagnostics/DevHome.DevDiagnostics.csproj b/tools/DevDiagnostics/DevHome.DevDiagnostics/DevHome.DevDiagnostics.csproj
deleted file mode 100644
index ece6715789..0000000000
--- a/tools/DevDiagnostics/DevHome.DevDiagnostics/DevHome.DevDiagnostics.csproj
+++ /dev/null
@@ -1,243 +0,0 @@
-
-
-
- WinExe
- DevHome.DevDiagnostics
- app.manifest
- win-x86;win-x64;win-arm64
- Properties\PublishProfiles\win-$(Platform).pubxml
- true
- false
- enable
- 12.0
- DevHome.DevDiagnostics.Program
- true
- false
- $(DefineConstants);DISABLE_XAML_GENERATED_MAIN
-
-
-
- 10.0.19041.0
- DD.ico
- DD.ico
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- MSBuild:Compile
- $(DefaultXamlRuntime)
-
-
-
-
-
-
-
-
-
-
- PreserveNewest
-
-
- PreserveNewest
-
-
-
-
-
-
-
-
-
-
-
- all
- runtime; build; native; contentfiles; analyzers; buildtransitive
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- tlbimp
- 0
- 1
- f935dc20-1cf0-11d0-adb9-00c04fd58a0b
- 0
- false
- true
-
-
-
-
-
-
-
-
-
-
-
-
-
- True
- True
- Settings.settings
-
-
-
-
- MSBuild:Compile
-
-
- MSBuild:Compile
-
-
- MSBuild:Compile
-
-
- MSBuild:Compile
-
-
- MSBuild:Compile
-
-
- MSBuild:Compile
-
-
- MSBuild:Compile
-
-
- MSBuild:Compile
-
-
- MSBuild:Compile
-
-
- MSBuild:Compile
-
-
- MSBuild:Compile
-
-
- Always
-
-
- MSBuild:Compile
-
-
- MSBuild:Compile
-
-
- MSBuild:Compile
-
-
- MSBuild:Compile
-
-
- MSBuild:Compile
-
-
- MSBuild:Compile
-
-
- MSBuild:Compile
-
-
- MSBuild:Compile
-
-
- MSBuild:Compile
-
-
- MSBuild:Compile
-
-
- SettingsSingleFileGenerator
- Settings.Designer.cs
-
-
- MSBuild:Compile
-
-
- MSBuild:Compile
-
-
-
-
- 7
-
-
- 7
-
-
- 7
-
-
- 7
-
-
- 7
-
-
- 7
-
-
- 7
-
-
- 7
-
-
- 7
-
-
diff --git a/tools/DevDiagnostics/DevHome.DevDiagnostics/Helpers/ClipboardMonitorInternalTool.cs b/tools/DevDiagnostics/DevHome.DevDiagnostics/Helpers/ClipboardMonitorInternalTool.cs
deleted file mode 100644
index 2488aca796..0000000000
--- a/tools/DevDiagnostics/DevHome.DevDiagnostics/Helpers/ClipboardMonitorInternalTool.cs
+++ /dev/null
@@ -1,71 +0,0 @@
-// Copyright (c) Microsoft Corporation.
-// Licensed under the MIT License.
-
-using DevHome.Common.Extensions;
-using DevHome.DevDiagnostics.Properties;
-using DevHome.DevDiagnostics.Views;
-using Microsoft.UI.Xaml;
-using Microsoft.UI.Xaml.Controls;
-using Microsoft.UI.Xaml.Media;
-using Windows.Graphics;
-
-namespace DevHome.DevDiagnostics.Helpers;
-
-public class ClipboardMonitorInternalTool : Tool
-{
- private const string ClipboardButtonText = "\uf0e3"; // ClipboardList
- private static readonly string _clipboardMonitorToolName = CommonHelper.GetLocalizedString("ClipboardMonitorName");
-
- private ClipboardMonitoringWindow? _clipboardMonitoringWindow;
-
- public ClipboardMonitorInternalTool()
- : base(_clipboardMonitorToolName, ToolType.Unknown, Settings.Default.IsClipboardMonitorToolPinned)
- {
- }
-
- public override IconElement GetIcon()
- {
- return new FontIcon
- {
- Glyph = ClipboardButtonText,
- FontFamily = (FontFamily)Application.Current.Resources["SymbolThemeFontFamily"],
- };
- }
-
- internal override void InvokeTool(ToolLaunchOptions options)
- {
- if (_clipboardMonitoringWindow is null || _clipboardMonitoringWindow.AppWindow is null)
- {
- _clipboardMonitoringWindow = new ClipboardMonitoringWindow();
-
- // Add this window to the list of related windows for the BarWindow,
- // so that we can ensure that any BarWindow theme changes are also propagated to this window.
- var barWindow = Application.Current.GetService().DBarWindow;
- barWindow?.AddRelatedWindow(_clipboardMonitoringWindow);
- }
-
- if (options.ParentWindow is not null)
- {
- RectInt32 rect;
- rect.X = options.ParentWindow.AppWindow.Position.X;
- rect.Y = options.ParentWindow.AppWindow.Position.Y + 100;
- rect.Width = options.ParentWindow.AppWindow.Size.Width;
- rect.Height = _clipboardMonitoringWindow.AppWindow.Size.Height;
-
- _clipboardMonitoringWindow.AppWindow.MoveAndResize(rect);
- }
-
- _clipboardMonitoringWindow.Activate();
- }
-
- protected override void OnIsPinnedChange(bool newValue)
- {
- Settings.Default.IsClipboardMonitorToolPinned = newValue;
- Settings.Default.Save();
- }
-
- public override void UnregisterTool()
- {
- // Ignore this command for now until we have a way for the user to discover unregistered internal tools
- }
-}
diff --git a/tools/DevDiagnostics/DevHome.DevDiagnostics/Helpers/CommonHelper.cs b/tools/DevDiagnostics/DevHome.DevDiagnostics/Helpers/CommonHelper.cs
deleted file mode 100644
index 75c46b0e53..0000000000
--- a/tools/DevDiagnostics/DevHome.DevDiagnostics/Helpers/CommonHelper.cs
+++ /dev/null
@@ -1,208 +0,0 @@
-// Copyright (c) Microsoft Corporation.
-// Licensed under the MIT License.
-
-using System;
-using System.ComponentModel;
-using System.Diagnostics;
-using System.Globalization;
-using System.IO;
-using System.Linq;
-using System.Management;
-using System.Runtime.InteropServices;
-using DevHome.Common.Extensions;
-using DevHome.Common.Services;
-using DevHome.Service;
-using Microsoft.UI.Xaml;
-using Serilog;
-using Windows.ApplicationModel;
-using Windows.Wdk.System.Threading;
-using Windows.Win32.Foundation;
-using Windows.Win32.System.Threading;
-using WinRT;
-using PInvokeWdk = Windows.Wdk.PInvoke;
-
-namespace DevHome.DevDiagnostics.Helpers;
-
-internal sealed class CommonHelper
-{
- public const string UnpinGlyph = "\uE77A";
- public const string PinGlyph = "\uE718";
-
- private static readonly ILogger _log = Log.ForContext("SourceContext", nameof(CommonHelper));
-
- internal static string GetLocalizedString(string stringName, params object[] args)
- {
- var stringResource = new StringResource();
- var localizedString = stringResource.GetLocalized(stringName, args);
- Debug.Assert(!string.IsNullOrEmpty(localizedString), stringName + " is empty. Check if " + stringName + " is present in Resources.resw.");
- return localizedString;
- }
-
- internal static void RunAsAdmin(int pid, string pageName)
- {
- var startInfo = new ProcessStartInfo();
- startInfo.WindowStyle = ProcessWindowStyle.Hidden;
-
- var aliasSubDirectoryPath = $"Microsoft\\WindowsApps\\{Package.Current.Id.FamilyName}\\devhome.devdiagnostics.exe";
- var aliasPath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData), aliasSubDirectoryPath);
- startInfo.FileName = aliasPath;
-
- // Pass pid and the page from where the admin request came from
- startInfo.Arguments = $"--pid {pid} --expandWindow {pageName}";
- startInfo.UseShellExecute = true;
- startInfo.Verb = "runas";
-
- var process = new Process();
- process.StartInfo = startInfo;
-
- // Since a UAC prompt will be shown, we need to wait for the process to exit
- // This can also be cancelled by the user which will result in an exception
- try
- {
- process.Start();
-
- // Close the primary window for this instance and exit
- var primaryWindow = Application.Current.GetService();
- primaryWindow.Close();
- }
- catch (Win32Exception ex)
- {
- _log.Error(ex, "Could not run Dev Diagnostics as admin");
- if (ex.NativeErrorCode == (int)WIN32_ERROR.ERROR_CANT_ACCESS_FILE)
- {
- var barWindow = Application.Current.GetService().DBarWindow;
- barWindow?.ShowDialogToEnableAppExecutionAlias();
- }
- else if (ex.NativeErrorCode == (int)WIN32_ERROR.ERROR_CANCELLED)
- {
- _log.Error(ex, "UAC to run Dev Diagnostics as admin was denied");
- }
- }
- }
-
- public static unsafe int GetParentProcessId(Process process)
- {
- var pbi = default(PROCESS_BASIC_INFORMATION);
- int status = PInvokeWdk.NtQueryInformationProcess((HANDLE)process.Handle, PROCESSINFOCLASS.ProcessBasicInformation, &pbi, (uint)Marshal.SizeOf(pbi), null);
- if (status != 0)
- {
- throw new InvalidOperationException("Failed to query process information.");
- }
-
- return (int)pbi.InheritedFromUniqueProcessId;
- }
-
- public static HWND? TryGetParentProcessHWND()
- {
- try
- {
- using var process = Process.GetCurrentProcess();
- var parentProcessId = GetParentProcessId(process);
- if (parentProcessId != 0)
- {
- using var parentProcess = Process.GetProcessById(parentProcessId);
- return new HWND(parentProcess.MainWindowHandle);
- }
- }
- catch (Exception ex)
- {
- _log.Error(ex, "Failed to get parent process HWND");
- }
-
- return null;
- }
-
- public static string GetCommandLine(Process process)
- {
- var activationArgs = string.Empty;
- try
- {
- using var searcher = new ManagementObjectSearcher(
- $"SELECT CommandLine FROM Win32_Process WHERE ProcessId = {process.Id}");
- if (searcher is null)
- {
- return activationArgs;
- }
-
- using var objects = searcher.Get();
- if (objects is null)
- {
- return activationArgs;
- }
-
- var obj = objects.Cast().FirstOrDefault();
- if (obj is not null)
- {
- activationArgs = obj["CommandLine"]?.ToString() ?? string.Empty;
- }
- }
- catch (Exception ex)
- {
- _log.Error(ex, "Failed to get command line for process {ProcessId}", process.Id);
- }
-
- return activationArgs;
- }
-
- private static readonly Int32Converter _converter = new();
-
- public static int? ParseStringToInt(string value)
- {
- int? valueAsInt;
-
- try
- {
- if (_converter.IsValid(value))
- {
- // Int32Converter.ConvertFromString() does a pretty good job of parsing numbers, except when given a hex
- // number that isn't prefixed with 0x. If it fails, try parsing it using int.Parse().
- valueAsInt = (int?)_converter.ConvertFromString(value);
- }
- else
- {
- valueAsInt = int.Parse(value, NumberStyles.HexNumber, CultureInfo.CurrentCulture);
- }
- }
- catch
- {
- return null;
- }
-
- return valueAsInt;
- }
-
- public static int MulDiv(int number, int numerator, int denominator)
- {
- return (int)((((long)number * numerator) + (denominator >> 1)) / denominator);
- }
-
- public static IDevHomeService GetDevHomeService()
- {
- try
- {
- var serverClass = new DevHomeServer();
- var serverPtr = Marshal.GetIUnknownForObject(serverClass);
- var server = MarshalInterface.FromAbi(serverPtr);
- return server;
- }
- catch (Exception ex)
- {
- _log.Error(ex, "Failed to get DevHomeService");
-
- // We shouldn't treat our inability to connect to the NT service as fatal. We should still be able to run, with reduced functionality.
-
- // Return a "dummy" service that does nothing, so that we don't need to have multiple checks in the code to see if we have a service or not
- return new StandInDevHomeService();
- }
- }
-
- [ComImport]
- #if CANARY_BUILD
- [Guid("0A920C6E-2569-44D1-A6E4-CE9FA44CD2A7")]
- #elif STABLE_BUILD
- [Guid("E8D40232-20A1-4F3B-9C0C-AAA6538698C6")]
- #else
- [Guid("1F98F450-C163-4A99-B257-E1E6CB3E1C57")]
- #endif
- public class DevHomeServer;
-}
diff --git a/tools/DevDiagnostics/DevHome.DevDiagnostics/Helpers/CommonInterop.cs b/tools/DevDiagnostics/DevHome.DevDiagnostics/Helpers/CommonInterop.cs
deleted file mode 100644
index 1c961d3cbc..0000000000
--- a/tools/DevDiagnostics/DevHome.DevDiagnostics/Helpers/CommonInterop.cs
+++ /dev/null
@@ -1,21 +0,0 @@
-// Copyright (c) Microsoft Corporation.
-// Licensed under the MIT License.
-
-using System.Runtime.InteropServices;
-using Windows.Win32.Foundation;
-using Windows.Win32.UI.WindowsAndMessaging;
-
-namespace DevHome.DevDiagnostics.Helpers;
-
-internal sealed class CommonInterop
-{
- // CSWin32 will not produce these methods for x86 so we need to define them here.
- [DllImport("user32.dll", ExactSpelling = true, EntryPoint = "SetWindowLongPtrW", SetLastError = true)]
- internal static extern nint SetWindowLongPtr64(HWND hWnd, WINDOW_LONG_PTR_INDEX nIndex, nint dwNewLong);
-
- [DllImport("user32.dll", ExactSpelling = true, EntryPoint = "GetWindowLongPtrW", SetLastError = true)]
- internal static extern nint GetWindowLongPtr64(HWND hWnd, WINDOW_LONG_PTR_INDEX nIndex);
-
- [DllImport("user32.dll", ExactSpelling = true, EntryPoint = "GetClassLongPtrW", SetLastError = true)]
- internal static extern nint GetClassLongPtr64(HWND hWnd, GET_CLASS_LONG_INDEX nIndex);
-}
diff --git a/tools/DevDiagnostics/DevHome.DevDiagnostics/Helpers/CountToVisibilityConverter.cs b/tools/DevDiagnostics/DevHome.DevDiagnostics/Helpers/CountToVisibilityConverter.cs
deleted file mode 100644
index 0b2d6757f0..0000000000
--- a/tools/DevDiagnostics/DevHome.DevDiagnostics/Helpers/CountToVisibilityConverter.cs
+++ /dev/null
@@ -1,22 +0,0 @@
-// Copyright (c) Microsoft Corporation.
-// Licensed under the MIT License.
-
-using System;
-using Microsoft.UI.Xaml;
-using Microsoft.UI.Xaml.Data;
-
-namespace DevHome.DevDiagnostics.Helpers;
-
-public class CountToVisibilityConverter : IValueConverter
-{
- public object Convert(object value, Type targetType, object parameter, string language)
- {
- var count = (int)value;
- return count > 0 ? Visibility.Collapsed : Visibility.Visible;
- }
-
- public object ConvertBack(object value, Type targetType, object parameter, string language)
- {
- throw new NotImplementedException();
- }
-}
diff --git a/tools/DevDiagnostics/DevHome.DevDiagnostics/Helpers/DebugMonitor.cs b/tools/DevDiagnostics/DevHome.DevDiagnostics/Helpers/DebugMonitor.cs
deleted file mode 100644
index b8d5f89602..0000000000
--- a/tools/DevDiagnostics/DevHome.DevDiagnostics/Helpers/DebugMonitor.cs
+++ /dev/null
@@ -1,153 +0,0 @@
-// Copyright (c) Microsoft Corporation.
-// Licensed under the MIT License.
-
-using System;
-using System.Collections.Generic;
-using System.Collections.ObjectModel;
-using System.Diagnostics;
-using System.IO;
-using System.IO.MemoryMappedFiles;
-using System.Text;
-using System.Threading;
-using DevHome.DevDiagnostics.Models;
-
-namespace DevHome.DevDiagnostics.Helpers;
-
-public sealed class DebugMonitor : IDisposable
-{
- private readonly Process targetProcess;
- private readonly ObservableCollection output;
- private readonly EventWaitHandle stopEvent;
- private readonly string errorMessageText = CommonHelper.GetLocalizedString("WinLogsAlreadyRunningErrorMessage");
-
- private const string MutexName = "DevHome.PI.DebugMonitor.SingletonMutex";
- private const string StopEventName = "DebugMonitorStopEvent";
- private const string DBWinBufferReadyName = "DBWIN_BUFFER_READY";
- private const string DBWinDataReadyName = "DBWIN_DATA_READY";
- private const string DBWinBufferName = "DBWIN_BUFFER";
-
- private static readonly List IgnoreLogList = [];
-
- public DebugMonitor(Process targetProcess, ObservableCollection output)
- {
- this.targetProcess = targetProcess;
- this.targetProcess.Exited += TargetProcess_Exited;
- this.output = output;
-
- stopEvent = new EventWaitHandle(false, EventResetMode.AutoReset, StopEventName);
- }
-
- public void Start()
- {
- stopEvent.Reset();
-
- // Don't initiate if debugger is attached. It makes debugging very slow.
- if (Debugger.IsAttached)
- {
- return;
- }
-
- // Check for multiple instances. It is possible to have multiple debug monitors listen on OutputDebugString,
- // but the message would be randomly distributed among all running instances.
- using var singletonMutex = new Mutex(false, MutexName, out var createdNew);
- if (!createdNew)
- {
- throw new InvalidOperationException($"Failed to get the {MutexName} mutex.");
- }
-
- bool isNewBufferReadyEvent;
- using var bufferReadyEvent = new EventWaitHandle(false, EventResetMode.AutoReset, DBWinBufferReadyName, out isNewBufferReadyEvent);
- bool isNewDataReadyEvent;
- using var dataReadyEvent = new EventWaitHandle(false, EventResetMode.AutoReset, DBWinDataReadyName, out isNewDataReadyEvent);
-
- // Don't initiate if there is an existing OutputDebugString monitor running
- if (!isNewBufferReadyEvent || !isNewDataReadyEvent)
- {
- WinLogsEntry entry = new(DateTime.Now, WinLogCategory.Error, errorMessageText, WinLogsHelper.DebugOutputLogsName);
- output.Add(entry);
- return;
- }
-
- using var memoryMappedFile = MemoryMappedFile.CreateNew(DBWinBufferName, 4096);
- while (true)
- {
- bufferReadyEvent.Set();
- var waitResult = WaitHandle.WaitAny(new[] { stopEvent, dataReadyEvent });
-
- // Stop listenting to OutputDebugString if the debugger is attached. It makes debugging very slow.
- if (Debugger.IsAttached)
- {
- break;
- }
-
- // Stop event is triggered.
- if (waitResult == 0)
- {
- break;
- }
-
- if (waitResult == 1)
- {
- var timeGenerated = DateTime.Now;
-
- // The first DWORD of the shared memory buffer contains
- // the process ID of the client that sent the debug string.
- using var viewStream = memoryMappedFile.CreateViewStream(0, 0, MemoryMappedFileAccess.Read);
- using BinaryReader binaryReader = new BinaryReader(viewStream);
- var pid = binaryReader.ReadUInt32();
-
- if (pid == targetProcess.Id)
- {
- // Get the message from the stream.
- var stringBuilder = new StringBuilder();
- while (binaryReader.PeekChar() != '\0')
- {
- stringBuilder.Append(binaryReader.ReadChar());
- }
-
- var entryMessage = stringBuilder.ToString();
-
- if (!string.IsNullOrWhiteSpace(entryMessage))
- {
- var hasIgnoreLog = false;
- foreach (var ignoreLog in IgnoreLogList)
- {
- if (entryMessage.Contains(ignoreLog))
- {
- hasIgnoreLog = true;
- }
- }
-
- if (!hasIgnoreLog)
- {
- WinLogsEntry entry = new(timeGenerated, WinLogCategory.Debug, entryMessage, WinLogsHelper.DebugOutputLogsName);
- output.Add(entry);
- }
- }
- }
- }
- }
- }
-
- public void Stop()
- {
- if (!stopEvent.SafeWaitHandle.IsClosed)
- {
- stopEvent.Set();
- }
- }
-
- public void Dispose()
- {
- stopEvent.Close();
- stopEvent.Dispose();
-
- GC.SuppressFinalize(this);
- }
-
- private void TargetProcess_Exited(object? sender, EventArgs e)
- {
- Stop();
- Dispose();
- }
-}
diff --git a/tools/DevDiagnostics/DevHome.DevDiagnostics/Helpers/ETWHelper.cs b/tools/DevDiagnostics/DevHome.DevDiagnostics/Helpers/ETWHelper.cs
deleted file mode 100644
index 54166dc491..0000000000
--- a/tools/DevDiagnostics/DevHome.DevDiagnostics/Helpers/ETWHelper.cs
+++ /dev/null
@@ -1,187 +0,0 @@
-// Copyright (c) Microsoft Corporation.
-// Licensed under the MIT License.
-
-using System;
-using System.Collections.Generic;
-using System.Collections.ObjectModel;
-using System.Diagnostics;
-using System.Globalization;
-using System.Linq;
-using System.Security.Principal;
-using DevHome.DevDiagnostics.Models;
-using Microsoft.Diagnostics.Tracing;
-using Microsoft.Diagnostics.Tracing.Session;
-using Serilog;
-
-namespace DevHome.DevDiagnostics.Helpers;
-
-internal sealed class ETWHelper : IDisposable
-{
- private static readonly ILogger _log = Log.ForContext("SourceContext", nameof(ETWHelper));
- private readonly Process _targetProcess;
- private readonly ObservableCollection _output;
-
- private static readonly List _providerList = ["1AFF6089-E863-4D36-BDFD-3581F07440BE" /*COM Tracelog*/];
- private TraceEventSession? _session;
-
- // From: https://learn.microsoft.com/windows-server/identity/ad-ds/manage/understand-security-identifiers
- private const string PerformanceLogUsersSid = "S-1-5-32-559";
-
- public const string AddUserToPerformanceLogUsersSid = @"
- Add-LocalGroupMember -Sid S-1-5-32-559 -Member ([System.Security.Principal.WindowsIdentity]::GetCurrent().Name)
- # Check if the last command succeeded
- if ($?)
- {
- # User added to the Performance Log Users group.
- exit 0
- }
- exit 1
- ";
-
- public ETWHelper(Process targetProcess, ObservableCollection output)
- {
- _targetProcess = targetProcess;
- _targetProcess.Exited += TargetProcess_Exited;
- _output = output;
- }
-
- public void Start()
- {
- var isUserInPerformanceLogUsersGroup = IsUserInPerformanceLogUsersGroup();
-
- if (!isUserInPerformanceLogUsersGroup)
- {
- isUserInPerformanceLogUsersGroup = TryAddUserToPerformanceLogUsersGroup();
- }
-
- if (isUserInPerformanceLogUsersGroup)
- {
- var sessionName = "DevHomePITrace" + Process.GetCurrentProcess().SessionId;
-
- // Stop and dispose any existing session
- _session = TraceEventSession.GetActiveSession(sessionName);
- if (_session is not null)
- {
- _session.Stop();
- _session.Dispose();
- }
-
- try
- {
- using (_session = new TraceEventSession(sessionName))
- {
- // Filter the provider events based on processId
- var providerOptions = new TraceEventProviderOptions { ProcessIDFilter = [_targetProcess.Id] };
- foreach (var provider in _providerList)
- {
- _session.EnableProvider(provider, TraceEventLevel.Always, options: providerOptions);
- }
-
- _session.Source.Dynamic.All += EventsHandler;
- _session.Source.UnhandledEvents += UnHandledEventsHandler;
- _session.Source.Process();
- }
- }
- catch (Exception ex)
- {
- Stop();
- WinLogsEntry entry = new(DateTime.Now, WinLogCategory.Error, ex.Message, WinLogsHelper.EtwLogsName);
- _output.Add(entry);
- }
- }
- }
-
- public void Stop()
- {
- _session?.Stop();
- }
-
- public void Dispose()
- {
- _session?.Dispose();
- GC.SuppressFinalize(this);
- }
-
- private void EventsHandler(TraceEvent traceEvent)
- {
- ETWEventHandler(traceEvent.ProcessID, traceEvent.TimeStamp, traceEvent.Level, traceEvent.ToString(CultureInfo.CurrentCulture));
- }
-
- private void UnHandledEventsHandler(TraceEvent traceEvent)
- {
- var errorMessage = CommonHelper.GetLocalizedString("UnhandledTraceEventErrorMessage", traceEvent.Dump());
- ETWEventHandler(traceEvent.ProcessID, traceEvent.TimeStamp, traceEvent.Level, errorMessage);
- }
-
- private void ETWEventHandler(int processId, DateTime timeStamp, TraceEventLevel level, string message)
- {
- if (processId != _targetProcess.Id)
- {
- return;
- }
-
- var category = WinLogsHelper.ConvertTraceEventLevelToWinLogCategory(level);
- var entry = new WinLogsEntry(timeStamp, category, message, WinLogsHelper.EtwLogsName);
- _output.Add(entry);
- }
-
- private void TargetProcess_Exited(object? sender, EventArgs e)
- {
- Stop();
- Dispose();
- }
-
- public static bool IsUserInPerformanceLogUsersGroup()
- {
- WindowsIdentity processUserIdentity = WindowsIdentity.GetCurrent();
- var isPerformanceLogSidFound = processUserIdentity.Groups?.Any(sid => sid.Value == PerformanceLogUsersSid);
- return isPerformanceLogSidFound ?? false;
- }
-
- public static bool TryAddUserToPerformanceLogUsersGroup()
- {
- WindowsIdentity processUserIdentity = WindowsIdentity.GetCurrent();
- var userName = processUserIdentity.Name;
- if (userName is null)
- {
- _log.Error("Unable to get the current user name");
- return false;
- }
-
- var startInfo = new ProcessStartInfo();
- startInfo.WindowStyle = ProcessWindowStyle.Hidden;
- startInfo.FileName = $"powershell.exe";
-
- // Add the user to the Performance Log Users group
- startInfo.Arguments = $"-ExecutionPolicy Bypass -Command \"{AddUserToPerformanceLogUsersSid}\"";
- startInfo.UseShellExecute = true;
- startInfo.Verb = "runas";
-
- var process = new Process();
- process.StartInfo = startInfo;
-
- // Since a UAC prompt will be shown, we need to wait for the process to exit
- // This can also be cancelled by the user which will result in an exception
- try
- {
- process.Start();
- process.WaitForExit();
-
- if (process.ExitCode == 0)
- {
- return true;
- }
- else
- {
- _log.Error("Unable to add the user to the Performance Log Users group");
- return false;
- }
- }
- catch (Exception ex)
- {
- _log.Error(ex, "UAC to add the user to the Performance Log Users group was denied");
- }
-
- return false;
- }
-}
diff --git a/tools/DevDiagnostics/DevHome.DevDiagnostics/Helpers/EnumStringConverter.cs b/tools/DevDiagnostics/DevHome.DevDiagnostics/Helpers/EnumStringConverter.cs
deleted file mode 100644
index 08825d09fb..0000000000
--- a/tools/DevDiagnostics/DevHome.DevDiagnostics/Helpers/EnumStringConverter.cs
+++ /dev/null
@@ -1,35 +0,0 @@
-// Copyright (c) Microsoft Corporation.
-// Licensed under the MIT License.
-
-using System;
-using System.Text.Json;
-using System.Text.Json.Serialization;
-
-namespace DevHome.DevDiagnostics.Helpers;
-
-#pragma warning disable SA1649 // File name should match first type name
-public class EnumStringConverter : JsonConverter
-#pragma warning restore SA1649 // File name should match first type name
- where TEnum : struct
-{
- public override TEnum Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
- {
- if (reader.TokenType != JsonTokenType.String)
- {
- throw new JsonException();
- }
-
- var enumString = reader.GetString();
- if (Enum.TryParse(enumString, ignoreCase: true, out TEnum result))
- {
- return result;
- }
-
- throw new JsonException($"Unable to convert \"{enumString}\" to enum type {typeof(TEnum)}.");
- }
-
- public override void Write(Utf8JsonWriter writer, TEnum value, JsonSerializerOptions options)
- {
- writer.WriteStringValue(value.ToString());
- }
-}
diff --git a/tools/DevDiagnostics/DevHome.DevDiagnostics/Helpers/ErrorLookupHelper.cs b/tools/DevDiagnostics/DevHome.DevDiagnostics/Helpers/ErrorLookupHelper.cs
deleted file mode 100644
index 9f1a240dcd..0000000000
--- a/tools/DevDiagnostics/DevHome.DevDiagnostics/Helpers/ErrorLookupHelper.cs
+++ /dev/null
@@ -1,90 +0,0 @@
-// Copyright (c) Microsoft Corporation.
-// Licensed under the MIT License.
-
-using System.Collections.Generic;
-using System.Globalization;
-using System.IO;
-using System.Linq;
-using System.Reflection;
-using Microsoft.Data.Sqlite;
-using Serilog;
-
-namespace DevHome.DevDiagnostics.Helpers;
-
-internal sealed class ErrorLookupHelper
-{
- private static readonly ILogger _log = Log.ForContext("SourceContext", nameof(ErrorLookupHelper));
-
- private static SqliteConnectionStringBuilder? _dbConnectionString;
-
- private static SqliteConnectionStringBuilder DbConnectionString
- {
- get
- {
- if (_dbConnectionString == null)
- {
- _dbConnectionString = new SqliteConnectionStringBuilder();
- var path = Path.GetDirectoryName(Assembly.GetEntryAssembly()?.Location);
- var dbPath = Path.Combine(path ?? string.Empty, "errors.db");
-
- _dbConnectionString.DataSource = dbPath;
- _dbConnectionString.Mode = SqliteOpenMode.ReadOnly;
- }
-
- return _dbConnectionString;
- }
- }
-
- public static AppError[]? LookupError(int error)
- {
- try
- {
- using SqliteConnection connection = new(DbConnectionString.ConnectionString);
- connection.Open();
- AppError[]? errors = LookupErrors(connection, error);
- connection.Close();
- return errors;
- }
- catch
- {
- _log.Error("Failed to look up errors: {AppError}", error.ToString(CultureInfo.CurrentCulture));
- }
-
- return null;
- }
-
- private static AppError[]? LookupErrors(SqliteConnection connection, int hresult)
- {
- // Look up a solution for an error.
- SqliteCommand errorCommand = connection.CreateCommand();
- errorCommand.CommandText = @"select Name, Help from tblErrors WHERE code=@code";
-
- SqliteParameter errorParam = new("@code", hresult.ToString(CultureInfo.CurrentCulture));
- errorCommand.Parameters.Add(errorParam);
- SqliteDataReader errorReader = errorCommand.ExecuteReader();
- IList errors = [];
-
- while (errorReader.Read())
- {
- AppError error = new()
- {
- Code = hresult,
- Name = errorReader.GetString(0),
- Help = errorReader.GetString(1),
- };
- errors.Add(error);
- }
-
- errorReader.Close();
- return errors.ToArray();
- }
-}
-
-public class AppError
-{
- public int Code { get; set; }
-
- public string Name { get; set; } = string.Empty;
-
- public string Help { get; set; } = string.Empty;
-}
diff --git a/tools/DevDiagnostics/DevHome.DevDiagnostics/Helpers/EventViewerHelper.cs b/tools/DevDiagnostics/DevHome.DevDiagnostics/Helpers/EventViewerHelper.cs
deleted file mode 100644
index a086bff6c3..0000000000
--- a/tools/DevDiagnostics/DevHome.DevDiagnostics/Helpers/EventViewerHelper.cs
+++ /dev/null
@@ -1,82 +0,0 @@
-// Copyright (c) Microsoft Corporation.
-// Licensed under the MIT License.
-
-using System;
-using System.Collections.ObjectModel;
-using System.Diagnostics;
-using System.Diagnostics.Eventing.Reader;
-using DevHome.DevDiagnostics.Models;
-
-namespace DevHome.DevDiagnostics.Helpers;
-
-internal sealed class EventViewerHelper : IDisposable
-{
- private readonly Process targetProcess;
- private readonly ObservableCollection output;
- private readonly EventLogWatcher? eventLogWatcher;
-
- public EventViewerHelper(Process targetProcess, ObservableCollection output)
- {
- this.targetProcess = targetProcess;
- this.targetProcess.Exited += TargetProcess_Exited;
- this.output = output;
-
- try
- {
- // Subscribe for Application events matching the processName.
- var filterQuery = "*[System[Provider[@Name=\"" + targetProcess.ProcessName + "\"]]]";
- EventLogQuery subscriptionQuery = new("Application", PathType.LogName, filterQuery);
- eventLogWatcher = new EventLogWatcher(subscriptionQuery);
- eventLogWatcher.EventRecordWritten += new EventHandler(EventLogEventRead);
- }
- catch (EventLogReadingException)
- {
- var message = CommonHelper.GetLocalizedString("UnableToStartEventViewerErrorMessage");
- WinLogsEntry entry = new(DateTime.Now, WinLogCategory.Error, message, WinLogsHelper.EventViewerName);
- output.Add(entry);
- }
- }
-
- public void Start()
- {
- if (eventLogWatcher is not null)
- {
- eventLogWatcher.Enabled = true;
- }
- }
-
- public void Stop()
- {
- if (eventLogWatcher is not null)
- {
- eventLogWatcher.Enabled = false;
- }
- }
-
- public void Dispose()
- {
- if (eventLogWatcher is not null)
- {
- eventLogWatcher.Dispose();
- }
-
- GC.SuppressFinalize(this);
- }
-
- public void EventLogEventRead(object? obj, EventRecordWrittenEventArgs eventArg)
- {
- if (eventArg.EventRecord != null)
- {
- WinLogCategory category = WinLogsHelper.ConvertStandardEventLevelToWinLogCategory(eventArg.EventRecord.Level);
- var message = eventArg.EventRecord.FormatDescription();
- WinLogsEntry entry = new(eventArg.EventRecord.TimeCreated, category, message, WinLogsHelper.EventViewerName);
- output.Add(entry);
- }
- }
-
- private void TargetProcess_Exited(object? sender, EventArgs e)
- {
- Stop();
- Dispose();
- }
-}
diff --git a/tools/DevDiagnostics/DevHome.DevDiagnostics/Helpers/ExpanderBehavior.cs b/tools/DevDiagnostics/DevHome.DevDiagnostics/Helpers/ExpanderBehavior.cs
deleted file mode 100644
index ce4e018812..0000000000
--- a/tools/DevDiagnostics/DevHome.DevDiagnostics/Helpers/ExpanderBehavior.cs
+++ /dev/null
@@ -1,39 +0,0 @@
-// Copyright (c) Microsoft Corporation.
-// Licensed under the MIT License.
-
-using DevHome.DevDiagnostics.Models;
-using Microsoft.UI.Xaml.Controls;
-using Microsoft.Xaml.Interactivity;
-
-namespace DevHome.DevDiagnostics.Helpers;
-
-public class ExpanderBehavior : Behavior
-{
- protected override void OnAttached()
- {
- base.OnAttached();
- AssociatedObject.Expanding += AssociatedObject_Expanding;
- AssociatedObject.Collapsed += OnCollapsed;
- }
-
- private void AssociatedObject_Expanding(Expander sender, ExpanderExpandingEventArgs args)
- {
- if (AssociatedObject.DataContext is Insight insight && !insight.HasBeenRead)
- {
- insight.HasBeenRead = true;
- insight.BadgeOpacity = 0;
- }
- }
-
- private void OnCollapsed(Expander sender, ExpanderCollapsedEventArgs args)
- {
- // Do nothing: once we've set HasBeenRead to true, we don't change it again.
- }
-
- protected override void OnDetaching()
- {
- base.OnDetaching();
- AssociatedObject.Expanding -= AssociatedObject_Expanding;
- AssociatedObject.Collapsed -= OnCollapsed;
- }
-}
diff --git a/tools/DevDiagnostics/DevHome.DevDiagnostics/Helpers/ExternalTool.cs b/tools/DevDiagnostics/DevHome.DevDiagnostics/Helpers/ExternalTool.cs
deleted file mode 100644
index 2ad181d4dd..0000000000
--- a/tools/DevDiagnostics/DevHome.DevDiagnostics/Helpers/ExternalTool.cs
+++ /dev/null
@@ -1,313 +0,0 @@
-// Copyright (c) Microsoft Corporation.
-// Licensed under the MIT License.
-
-using System;
-using System.Collections.Generic;
-using System.Diagnostics;
-using System.Globalization;
-using System.IO;
-using System.Runtime.InteropServices;
-using System.Text;
-using System.Text.Json.Serialization;
-using System.Text.RegularExpressions;
-using System.Threading.Tasks;
-using DevHome.Common.Extensions;
-using Microsoft.UI.Xaml;
-using Microsoft.UI.Xaml.Controls;
-using Serilog;
-using Windows.System;
-using Windows.Win32;
-using Windows.Win32.Foundation;
-using Windows.Win32.System.Com;
-using Windows.Win32.UI.WindowsAndMessaging;
-using static DevHome.DevDiagnostics.Helpers.WindowHelper;
-
-namespace DevHome.DevDiagnostics.Helpers;
-
-public enum ToolActivationType
-{
- Protocol,
- Msix,
- Launch,
-}
-
-public partial class ExternalTool : Tool
-{
- private static readonly ILogger _log = Log.ForContext("SourceContext", nameof(ExternalTool));
- private readonly string _errorTitleText = CommonHelper.GetLocalizedString("ToolLaunchErrorTitle");
-
- private readonly string _errorMessageText = CommonHelper.GetLocalizedString("ToolLaunchErrorMessage");
-
- public string ID { get; private set; }
-
- public string Executable { get; private set; }
-
- [JsonConverter(typeof(EnumStringConverter))]
- public ToolActivationType ActivationType { get; private set; } = ToolActivationType.Launch;
-
- public string Arguments { get; private set; }
-
- public string ExtraInfo { get; private set; }
-
- public string AppUserModelId { get; private set; }
-
- public string IconFilePath { get; private set; }
-
- public ExternalTool(
- string name,
- string executable,
- ToolActivationType activationType,
- string arguments = "",
- string extraInfo = "",
- string appUserModelId = "",
- string iconFilePath = "",
- ToolType type = ToolType.Unknown,
- bool isPinned = false)
- : base(name, type, isPinned)
- {
- Executable = executable;
- ActivationType = activationType;
- Arguments = arguments;
- ExtraInfo = extraInfo;
- AppUserModelId = appUserModelId;
- IconFilePath = iconFilePath;
-
- ID = Guid.NewGuid().ToString();
-
- if (!string.IsNullOrEmpty(executable))
- {
- GetIcons();
- }
- }
-
- private async void GetIcons()
- {
- try
- {
- if (!string.IsNullOrEmpty(IconFilePath))
- {
- ToolIconSource = await GetSoftwareBitmapSourceFromImageFilePath(IconFilePath);
- }
- else
- {
- var softwareBitmap = GetSoftwareBitmapFromExecutable(Executable);
- if (softwareBitmap is not null)
- {
- ToolIconSource = await GetSoftwareBitmapSourceFromSoftwareBitmapAsync(softwareBitmap);
- }
- }
- }
- catch (Exception ex)
- {
- _log.Error(ex, "Failed to get tool image");
- }
- }
-
- public override IconElement GetIcon()
- {
- return new ImageIcon
- {
- Source = ToolIconSource,
- };
- }
-
- internal async override void InvokeTool(ToolLaunchOptions options)
- {
- try
- {
- await InvokeToolInternal(options);
- }
- catch (Exception ex)
- {
- _log.Error(ex, "Tool launched failed");
-
- var builder = new StringBuilder();
- builder.AppendLine(ex.Message);
- if (ex.InnerException is not null)
- {
- builder.AppendLine(ex.InnerException.Message);
- }
-
- var errorMessage = string.Format(CultureInfo.CurrentCulture, builder.ToString(), Executable);
- PInvoke.MessageBox(HWND.Null, errorMessage, _errorTitleText, MESSAGEBOX_STYLE.MB_ICONERROR);
- }
- }
-
- internal void ValidateOptions(ToolLaunchOptions options)
- {
- // We can only get stdout if we're launching the process via CreateProcess.
- if (options.RedirectStandardOut && ActivationType != ToolActivationType.Launch)
- {
- throw new InvalidOperationException("Can only redirect StandardOut with a CreateProcess launch");
- }
- }
-
- private string CreateCommandLine(ToolLaunchOptions options)
- {
- var commandLineArgs = string.Empty;
- if (!string.IsNullOrEmpty(Arguments))
- {
- var argumentVariables = new Dictionary();
- if (options.TargetProcessId.HasValue)
- {
- argumentVariables.Add("pid", options.TargetProcessId.Value.ToString(CultureInfo.InvariantCulture));
- }
-
- if (options.TargetHWnd != HWND.Null)
- {
- argumentVariables.Add("hwnd", ((int)options.TargetHWnd).ToString(CultureInfo.InvariantCulture));
- }
-
- if (Type.HasFlag(ToolType.DumpAnalyzer) && options.CommandLineParams is not null)
- {
- argumentVariables.Add("crashDumpPath", options.CommandLineParams);
- }
-
- commandLineArgs = ReplaceKnownVariables(Arguments, argumentVariables);
- }
-
- return commandLineArgs;
- }
-
- internal async Task InvokeToolInternal(ToolLaunchOptions options)
- {
- var process = default(Process);
-
- ValidateOptions(options);
-
- string commandLineArgs = CreateCommandLine(options);
-
- try
- {
- if (ActivationType == ToolActivationType.Protocol)
- {
- // Docs say this returns true if the default app for the URI scheme was launched;
- // false otherwise. However, if there's no registered app for the protocol, it shows
- // the "get an app from the store" dialog, and returns true. So we can't rely on the
- // return value to know if the tool was actually launched.
- var result = await Launcher.LaunchUriAsync(new Uri(commandLineArgs));
- if (result != true)
- {
- // We get here if the user supplied a valid registered protocol, but the app failed to launch.
- var errorMessage = string.Format(
- CultureInfo.InvariantCulture, _errorMessageText, commandLineArgs);
- throw new InvalidOperationException(errorMessage);
- }
-
- // Currently we can't get the process object of the launched app via LaunchUriAsync. If we
- // ever do and want to populate ToolLaunchOptions.LaunchedProcess, we'll need to revisit the async behavior here,
- // as when we return from this function (and our async operation is still ongoing) our callers currently expect to
- // be able to read ToolLaunchOptions.LaunchedProcess immedately... there isn't an indication that they would need to
- // do an await first.
- }
- else
- {
- if (ActivationType == ToolActivationType.Msix)
- {
- process = LaunchPackagedTool(AppUserModelId);
- }
- else
- {
- var finalExecutable = string.Empty;
- var finalArguments = string.Empty;
-
- if (Path.GetExtension(Executable).Equals(".msc", StringComparison.OrdinalIgnoreCase))
- {
- // Note: running most msc files requires elevation.
- finalExecutable = "mmc.exe";
- finalArguments = $"{Executable} {commandLineArgs}";
- }
- else if (Path.GetExtension(Executable).Equals(".ps1", StringComparison.OrdinalIgnoreCase))
- {
- // Note: running powershell scripts might require setting the execution policy.
- finalExecutable = "powershell.exe";
- finalArguments = $"{Executable} {commandLineArgs}";
- }
- else
- {
- finalExecutable = Executable;
- finalArguments = commandLineArgs;
- }
-
- var startInfo = new ProcessStartInfo()
- {
- FileName = finalExecutable,
- Arguments = finalArguments,
-
- // If we want to redirect standard out, we can't use shell execute
- UseShellExecute = !options.RedirectStandardOut,
- RedirectStandardOutput = options.RedirectStandardOut,
- };
- process = Process.Start(startInfo);
- }
- }
- }
- catch (Exception ex)
- {
- // We compose a custom exception because an exception from executing some tools
- // (powershell, mmc) will have lost the target tool information.
- var errorMessage = string.Format(CultureInfo.InvariantCulture, _errorMessageText, Executable);
- throw new InvalidOperationException(errorMessage, ex);
- }
-
- options.LaunchedProcess = process;
- return process;
- }
-
- public static Process? LaunchPackagedTool(string appUserModelId)
- {
- var process = default(Process);
- var clsid = CLSID.ApplicationActivationManager;
- var iid = typeof(IApplicationActivationManager).GUID;
- object obj;
-
- int hr = PInvoke.CoCreateInstance(
- in clsid, null, CLSCTX.CLSCTX_LOCAL_SERVER, in iid, out obj);
-
- if (HResult.Succeeded(hr))
- {
- var appActiveManager = (IApplicationActivationManager)obj;
- uint processId;
- hr = appActiveManager.ActivateApplication(
- appUserModelId, string.Empty, ACTIVATEOPTIONS.None, out processId);
- if (HResult.Succeeded(hr))
- {
- process = Process.GetProcessById((int)processId);
- }
- }
- else
- {
- Marshal.ThrowExceptionForHR(hr);
- }
-
- return process;
- }
-
- private string ReplaceKnownVariables(string input, Dictionary argumentValues)
- {
- // Process the input string to replace any instance of defined variables with "real" values.
- // Eg, replace {pid} with 123, {hwnd} with 456.
- var pattern = @"\{(\w+)\}";
-
- var result = Regex.Replace(input, pattern, match =>
- {
- var variable = match.Groups[1].Value;
-
- // Check if the variable exists in the dictionary; if so, replace it.
- if (argumentValues.TryGetValue(variable, out var replacementValue))
- {
- return replacementValue;
- }
-
- // If the variable is not found, keep it as is.
- return match.Value;
- });
-
- return result;
- }
-
- public override void UnregisterTool()
- {
- Application.Current.GetService().RemoveExternalTool(this);
- }
-}
diff --git a/tools/DevDiagnostics/DevHome.DevDiagnostics/Helpers/ExternalToolCollection.cs b/tools/DevDiagnostics/DevHome.DevDiagnostics/Helpers/ExternalToolCollection.cs
deleted file mode 100644
index b961edad55..0000000000
--- a/tools/DevDiagnostics/DevHome.DevDiagnostics/Helpers/ExternalToolCollection.cs
+++ /dev/null
@@ -1,25 +0,0 @@
-// Copyright (c) Microsoft Corporation.
-// Licensed under the MIT License.
-
-using System.Collections.ObjectModel;
-
-namespace DevHome.DevDiagnostics.Helpers;
-
-public class ExternalToolCollection
-{
- public int Version { get; set; }
-
- public ObservableCollection ExternalTools { get; set; }
-
- public ExternalToolCollection()
- {
- Version = ExternalToolsHelper.ToolsCollectionVersion;
- ExternalTools = [];
- }
-
- public ExternalToolCollection(int version, ObservableCollection tools)
- {
- Version = version;
- ExternalTools = tools;
- }
-}
diff --git a/tools/DevDiagnostics/DevHome.DevDiagnostics/Helpers/ExternalTool_v1.cs b/tools/DevDiagnostics/DevHome.DevDiagnostics/Helpers/ExternalTool_v1.cs
deleted file mode 100644
index 86a143df03..0000000000
--- a/tools/DevDiagnostics/DevHome.DevDiagnostics/Helpers/ExternalTool_v1.cs
+++ /dev/null
@@ -1,50 +0,0 @@
-// Copyright (c) Microsoft Corporation.
-// Licensed under the MIT License.
-
-using System;
-using System.Text.Json.Serialization;
-using CommunityToolkit.Mvvm.ComponentModel;
-
-namespace DevHome.DevDiagnostics.Helpers;
-
-public enum ExternalToolArgType
-{
- None,
- ProcessId,
- Hwnd,
-}
-
-public partial class ExternalTool_v1 : ObservableObject
-{
- public string ID { get; private set; }
-
- public string Name { get; private set; }
-
- public string Executable { get; private set; }
-
- [JsonConverter(typeof(EnumStringConverter))]
- public ExternalToolArgType ArgType { get; private set; } = ExternalToolArgType.None;
-
- public string ArgPrefix { get; private set; }
-
- public string OtherArgs { get; private set; }
-
- public bool IsPinned { get; private set; }
-
- public ExternalTool_v1(
- string name,
- string executable,
- ExternalToolArgType argtype,
- string argprefix = "",
- string otherArgs = "",
- bool isPinned = false)
- {
- Name = name;
- Executable = executable;
- ArgType = argtype;
- ArgPrefix = argprefix;
- OtherArgs = otherArgs;
- IsPinned = isPinned;
- ID = Guid.NewGuid().ToString();
- }
-}
diff --git a/tools/DevDiagnostics/DevHome.DevDiagnostics/Helpers/ExternalToolsHelper.cs b/tools/DevDiagnostics/DevHome.DevDiagnostics/Helpers/ExternalToolsHelper.cs
deleted file mode 100644
index 53e500e9c0..0000000000
--- a/tools/DevDiagnostics/DevHome.DevDiagnostics/Helpers/ExternalToolsHelper.cs
+++ /dev/null
@@ -1,300 +0,0 @@
-// Copyright (c) Microsoft Corporation.
-// Licensed under the MIT License.
-
-using System;
-using System.Collections.ObjectModel;
-using System.Collections.Specialized;
-using System.ComponentModel;
-using System.IO;
-using System.Linq;
-using System.Reflection;
-using System.Text.Json;
-using System.Text.Json.Serialization;
-using DevHome.Common.Helpers;
-using Serilog;
-using Windows.Storage;
-
-namespace DevHome.DevDiagnostics.Helpers;
-
-internal sealed class ExternalToolsHelper
-{
- private readonly JsonSerializerOptions _serializerOptions = new() { WriteIndented = true };
- private readonly string _toolInfoFileName;
-
- private static readonly ILogger _log = Log.ForContext("SourceContext", nameof(ExternalToolsHelper));
-
- private readonly ObservableCollection _filteredExternalTools = [];
-
- private ObservableCollection _allExternalTools = [];
-
- // The ExternalTools menu shows all registered tools.
- public ObservableCollection AllExternalTools
- {
- get => _allExternalTools;
- set
- {
- // We're assigning the collection once, and this also covers the case where we reassign it again:
- // we need to unsubscribe from the old collection's events, subscribe to the new collection's events,
- // and initialize the filtered collection.
- if (_allExternalTools != value)
- {
- if (_allExternalTools != null)
- {
- _allExternalTools.CollectionChanged -= AllExternalTools_CollectionChanged;
- }
-
- _allExternalTools = value;
- if (_allExternalTools != null)
- {
- _allExternalTools.CollectionChanged += AllExternalTools_CollectionChanged;
- }
-
- // Synchronize the filtered collection with this unfiltered one.
- SynchronizeAllFilteredItems();
- }
- }
- }
-
- // The bar shows only the pinned tools.
- public ReadOnlyObservableCollection FilteredExternalTools { get; private set; }
-
- internal static int ToolsCollectionVersion { get; private set; } = 2;
-
- public ExternalToolsHelper()
- {
- string localFolder;
- if (RuntimeHelper.IsMSIX)
- {
- localFolder = ApplicationData.Current.LocalFolder.Path;
- }
- else
- {
- localFolder = Path.GetDirectoryName(Assembly.GetEntryAssembly()?.Location) ?? string.Empty;
- }
-
- // The file should be in this location:
- // %LocalAppData%\Packages\Microsoft.Windows.DevHome_8wekyb3d8bbwe\LocalState\externaltools.json
- _toolInfoFileName = Path.Combine(localFolder, "externaltools.json");
- AllExternalTools = new(_allExternalTools);
- FilteredExternalTools = new(_filteredExternalTools);
-
- Init();
- }
-
- private void Init()
- {
- _allExternalTools.Clear();
- if (File.Exists(_toolInfoFileName))
- {
- var jsonData = File.ReadAllText(_toolInfoFileName);
- try
- {
- var toolCollection = JsonSerializer.Deserialize(jsonData);
- var existingData = toolCollection?.ExternalTools ?? [];
- foreach (var toolItem in existingData)
- {
- _allExternalTools.Add(toolItem);
- toolItem.PropertyChanged += ToolItem_PropertyChanged;
- }
- }
- catch (Exception ex)
- {
- _log.Error(ex, $"Failed to parse {_toolInfoFileName}, attempting migration");
- MigrateOldTools(jsonData);
- }
- }
- }
-
- private void MigrateOldTools(string jsonData)
- {
- try
- {
- var oldFormatData = JsonSerializer.Deserialize(jsonData) ?? [];
- foreach (var oldTool in oldFormatData)
- {
- var arguments = string.Empty;
- if (oldTool.ArgType == ExternalToolArgType.ProcessId)
- {
- arguments = $" {oldTool.ArgPrefix}{{pid}} {oldTool.OtherArgs}";
- }
- else if (oldTool.ArgType == ExternalToolArgType.Hwnd)
- {
- arguments = $" {oldTool.ArgPrefix}{{hwnd}} {oldTool.OtherArgs}";
- }
- else
- {
- arguments = oldTool.OtherArgs;
- }
-
- var newTool = new ExternalTool(
- oldTool.Name,
- oldTool.Executable,
- ToolActivationType.Launch,
- arguments,
- string.Empty,
- string.Empty,
- string.Empty,
- ToolType.Unknown,
- oldTool.IsPinned);
-
- _allExternalTools.Add(newTool);
- newTool.PropertyChanged += ToolItem_PropertyChanged;
- }
-
- // Write out the updated data with the new file format.
- WriteToolsJsonFile();
- }
- catch (Exception ex)
- {
- _log.Error(ex, "Failed to migrate old tools");
- }
- }
-
- private void ToolItem_PropertyChanged(object? sender, PropertyChangedEventArgs e)
- {
- // The user can change the IsPinned property of a tool, to pin or unpin it on the bar.
- if (sender is ExternalTool tool && string.Equals(e.PropertyName, nameof(ExternalTool.IsPinned), StringComparison.Ordinal))
- {
- if (tool.IsPinned)
- {
- if (!_filteredExternalTools.Contains(tool))
- {
- _filteredExternalTools.Add(tool);
- }
- }
- else
- {
- _filteredExternalTools.Remove(tool);
- }
- }
-
- // Only update the JSON file if the property is not attributed [JsonIgnore].
- if (!IsJsonIgnoreProperty(e.PropertyName))
- {
- WriteToolsJsonFile();
- }
- }
-
- private bool IsJsonIgnoreProperty(string? propertyName)
- {
- if (string.IsNullOrEmpty(propertyName))
- {
- return false;
- }
-
- var property = typeof(T).GetProperty(propertyName);
- if (property is not null)
- {
- var jsonIgnoreAttribute = property.GetCustomAttributes(typeof(JsonIgnoreAttribute), false).FirstOrDefault();
- return jsonIgnoreAttribute is not null;
- }
-
- return false;
- }
-
- public ExternalTool AddExternalTool(ExternalTool tool)
- {
- _allExternalTools.Add(tool);
- WriteToolsJsonFile();
- return tool;
- }
-
- public void RemoveExternalTool(ExternalTool tool)
- {
- if (_allExternalTools.Remove(tool))
- {
- WriteToolsJsonFile();
- }
- }
-
- private void WriteToolsJsonFile()
- {
- var toolCollection = new ExternalToolCollection(ToolsCollectionVersion, _allExternalTools);
- var updatedJson = JsonSerializer.Serialize(toolCollection, _serializerOptions);
-
- try
- {
- File.WriteAllText(_toolInfoFileName, updatedJson);
- }
- catch (Exception ex)
- {
- _log.Error(ex, "WriteToolsJsonFile unable to write to file");
- }
- }
-
- private void AllExternalTools_CollectionChanged(object? sender, NotifyCollectionChangedEventArgs e)
- {
- // Whenever the "all tools" collection changes, we need to synchronize the filtered collection.
- switch (e.Action)
- {
- case NotifyCollectionChangedAction.Add:
- if (e.NewItems is not null)
- {
- foreach (ExternalTool newItem in e.NewItems)
- {
- if (newItem.IsPinned)
- {
- _filteredExternalTools.Add(newItem);
- }
-
- newItem.PropertyChanged += ToolItem_PropertyChanged;
- }
- }
-
- break;
-
- case NotifyCollectionChangedAction.Remove:
- if (e.OldItems is not null)
- {
- foreach (ExternalTool oldItem in e.OldItems)
- {
- oldItem.PropertyChanged -= ToolItem_PropertyChanged;
- _filteredExternalTools.Remove(oldItem);
- }
- }
-
- break;
-
- case NotifyCollectionChangedAction.Replace:
- if (e.OldItems is not null)
- {
- foreach (ExternalTool oldItem in e.OldItems)
- {
- oldItem.PropertyChanged -= ToolItem_PropertyChanged;
- _filteredExternalTools.Remove(oldItem);
- }
- }
-
- if (e.NewItems is not null)
- {
- foreach (ExternalTool newItem in e.NewItems)
- {
- if (newItem.IsPinned)
- {
- _filteredExternalTools.Add(newItem);
- }
-
- newItem.PropertyChanged += ToolItem_PropertyChanged;
- }
- }
-
- break;
-
- case NotifyCollectionChangedAction.Reset:
- SynchronizeAllFilteredItems();
- break;
- }
- }
-
- private void SynchronizeAllFilteredItems()
- {
- _filteredExternalTools.Clear();
- foreach (var item in AllExternalTools)
- {
- if (item.IsPinned)
- {
- _filteredExternalTools.Add(item);
- }
- }
- }
-}
diff --git a/tools/DevDiagnostics/DevHome.DevDiagnostics/Helpers/HotKeyHelper.cs b/tools/DevDiagnostics/DevHome.DevDiagnostics/Helpers/HotKeyHelper.cs
deleted file mode 100644
index 416ea03965..0000000000
--- a/tools/DevDiagnostics/DevHome.DevDiagnostics/Helpers/HotKeyHelper.cs
+++ /dev/null
@@ -1,74 +0,0 @@
-// Copyright (c) Microsoft Corporation.
-// Licensed under the MIT License.
-
-using System;
-using Microsoft.UI.Xaml;
-using Windows.System;
-using Windows.Win32;
-using Windows.Win32.Foundation;
-using Windows.Win32.UI.Input.KeyboardAndMouse;
-using WinUIEx.Messaging;
-
-namespace DevHome.DevDiagnostics.Helpers;
-
-// Note: instead of making this class disposable, we're disposing the WindowMessageMonitor in
-// UnregisterHotKey, and MainWindow calls this in its Closing event handler.
-#pragma warning disable CA1001 // Types that own disposable fields should be disposable
-public class HotKeyHelper// : IDisposable
-#pragma warning restore CA1001 // Types that own disposable fields should be disposable
-{
- internal ushort HotkeyID { get; private set; }
-
- private const string NoWindowHandleException = "Cannot get window handle: are you doing this too early?";
- private readonly HWND _windowHandle;
- private readonly Action _onHotKeyPressed;
- private readonly WindowMessageMonitor _windowMessageMonitor;
-
- public HotKeyHelper(Window handlerWindow, Action hotKeyHandler)
- {
- _onHotKeyPressed = hotKeyHandler;
-
- // Create a unique Id for this class in this instance.
- var atomName = $"{Environment.CurrentManagedThreadId:X8}{GetType().FullName}";
- HotkeyID = PInvoke.GlobalAddAtom(atomName);
-
- // Set up the window message hook to listen for hot keys.
- _windowHandle = (HWND)WinRT.Interop.WindowNative.GetWindowHandle(handlerWindow);
- if (_windowHandle.IsNull)
- {
- throw new InvalidOperationException(NoWindowHandleException);
- }
-
- _windowMessageMonitor = new WindowMessageMonitor(_windowHandle);
- _windowMessageMonitor.WindowMessageReceived += OnWindowMessageReceived;
- }
-
- private void OnWindowMessageReceived(object? sender, WindowMessageEventArgs e)
- {
- if (e.Message.MessageId == PInvoke.WM_HOTKEY)
- {
- var keyId = (int)e.Message.WParam;
- if (keyId == HotkeyID)
- {
- _onHotKeyPressed?.Invoke((int)e.Message.LParam);
- e.Handled = true;
- }
- }
- }
-
- internal void RegisterHotKey(VirtualKey key, HOT_KEY_MODIFIERS modifiers)
- {
- PInvoke.RegisterHotKey(_windowHandle, HotkeyID, modifiers, (uint)key);
- }
-
- internal void UnregisterHotKey()
- {
- if (HotkeyID != 0)
- {
- _ = PInvoke.UnregisterHotKey(_windowHandle, HotkeyID);
- PInvoke.GlobalDeleteAtom(HotkeyID);
- _windowMessageMonitor.Dispose();
- HotkeyID = 0;
- }
- }
-}
diff --git a/tools/DevDiagnostics/DevHome.DevDiagnostics/Helpers/IApplicationActivationManager.cs b/tools/DevDiagnostics/DevHome.DevDiagnostics/Helpers/IApplicationActivationManager.cs
deleted file mode 100644
index d971435d16..0000000000
--- a/tools/DevDiagnostics/DevHome.DevDiagnostics/Helpers/IApplicationActivationManager.cs
+++ /dev/null
@@ -1,39 +0,0 @@
-// Copyright (c) Microsoft Corporation.
-// Licensed under the MIT License.
-
-using System;
-using System.Runtime.InteropServices;
-
-namespace DevHome.DevDiagnostics.Helpers;
-
-[ComImport]
-[Guid("2E941141-7F97-4756-BA1D-9DECDE894A3D")]
-[InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
-public interface IApplicationActivationManager
-{
- int ActivateApplication(
- [In] string appUserModelId,
- [In] string arguments,
- [In] ACTIVATEOPTIONS options,
- [Out] out uint processId);
-}
-
-public enum ACTIVATEOPTIONS
-{
- None = 0x00000000,
- DesignMode = 0x00000001,
- NoErrorUI = 0x00000002,
- NoSplashScreen = 0x00000004,
-}
-
-public static class CLSID
-{
- public static readonly Guid ApplicationActivationManager = new("45BA127D-10A8-46EA-8AB7-56EA9078943C");
-}
-
-public static class HResult
-{
- public static bool Succeeded(int hr) => hr >= 0;
-
- public static bool Failed(int hr) => hr < 0;
-}
diff --git a/tools/DevDiagnostics/DevHome.DevDiagnostics/Helpers/ImageOptionsInternalTool.cs b/tools/DevDiagnostics/DevHome.DevDiagnostics/Helpers/ImageOptionsInternalTool.cs
deleted file mode 100644
index bb6de355a1..0000000000
--- a/tools/DevDiagnostics/DevHome.DevDiagnostics/Helpers/ImageOptionsInternalTool.cs
+++ /dev/null
@@ -1,108 +0,0 @@
-// Copyright (c) Microsoft Corporation.
-// Licensed under the MIT License.
-
-using System;
-using System.ComponentModel;
-using System.Diagnostics;
-using System.IO;
-using DevHome.DevDiagnostics.Models;
-using DevHome.DevDiagnostics.Properties;
-using Microsoft.UI.Xaml;
-using Microsoft.UI.Xaml.Controls;
-using Microsoft.UI.Xaml.Media;
-using Serilog;
-using Windows.ApplicationModel;
-
-namespace DevHome.DevDiagnostics.Helpers;
-
-public class ImageOptionsInternalTool : Tool
-{
- private const string ButtonText = "\ue9d5"; // Checklist icon
- private static readonly string _toolName = CommonHelper.GetLocalizedString("ImageOptionsName");
- private static readonly ILogger _log = Log.ForContext("SourceContext", nameof(ExternalTool));
-
- public ImageOptionsInternalTool()
- : base(_toolName, ToolType.Unknown, Settings.Default.IsImageOptionsToolPinned, false)
- {
- TargetAppData.Instance.PropertyChanged += TargetApp_PropertyChanged;
- }
-
- private void TargetApp_PropertyChanged(object? sender, PropertyChangedEventArgs e)
- {
- if (e.PropertyName != nameof(TargetAppData.Instance.TargetProcess))
- {
- return;
- }
-
- var process = TargetAppData.Instance.TargetProcess;
- try
- {
- if (process is not null && process.MainModule is not null)
- {
- IsEnabled = true;
- }
- else
- {
- IsEnabled = false;
- }
- }
- catch (Win32Exception ex)
- {
- if (ex.NativeErrorCode == (int)Windows.Win32.Foundation.WIN32_ERROR.ERROR_ACCESS_DENIED)
- {
- IsEnabled = false;
- }
- }
- }
-
- public override IconElement GetIcon()
- {
- return new FontIcon
- {
- Glyph = ButtonText,
- FontFamily = (FontFamily)Application.Current.Resources["SymbolThemeFontFamily"],
- };
- }
-
- internal override void InvokeTool(ToolLaunchOptions options)
- {
- if (TargetAppData.Instance.TargetProcess == null || TargetAppData.Instance.TargetProcess.MainModule == null)
- {
- return;
- }
-
- try
- {
- var fileInfo = new FileInfo(Environment.ProcessPath ?? string.Empty);
- Directory.SetCurrentDirectory(fileInfo.DirectoryName ?? string.Empty);
-
- var aliasRoot = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData), $"Microsoft\\WindowsApps\\{Package.Current.Id.FamilyName}");
-
- var startInfo = new ProcessStartInfo()
- {
- FileName = Path.Combine(aliasRoot, "DevHome.IfeoTool.exe"),
- Arguments = TargetAppData.Instance.TargetProcess.MainModule.ModuleName,
- UseShellExecute = true,
- WorkingDirectory = fileInfo.DirectoryName,
- Verb = "runas",
- };
-
- var process = Process.Start(startInfo);
- }
- catch (Exception ex)
- {
- _log.Error(ex.Message);
- }
- }
-
- protected override void OnIsPinnedChange(bool newValue)
- {
- Settings.Default.IsImageOptionsToolPinned = newValue;
- Settings.Default.Save();
- }
-
- public override void UnregisterTool()
- {
- // Ignore this command for now until we have a way for the user to discover unregistered internal tools
- }
-}
diff --git a/tools/DevDiagnostics/DevHome.DevDiagnostics/Helpers/InsightsHelper.cs b/tools/DevDiagnostics/DevHome.DevDiagnostics/Helpers/InsightsHelper.cs
deleted file mode 100644
index 4a998f6e9c..0000000000
--- a/tools/DevDiagnostics/DevHome.DevDiagnostics/Helpers/InsightsHelper.cs
+++ /dev/null
@@ -1,214 +0,0 @@
-// Copyright (c) Microsoft Corporation.
-// Licensed under the MIT License.
-
-using System;
-using System.Collections.Generic;
-using System.ComponentModel;
-using System.Text.RegularExpressions;
-using System.Threading.Tasks;
-using DevHome.DevDiagnostics.Models;
-using Microsoft.UI.Dispatching;
-using Serilog;
-
-namespace DevHome.DevDiagnostics.Helpers;
-
-internal sealed partial class InsightsHelper
-{
- private static readonly ILogger _log = Log.ForContext("SourceContext", nameof(InsightsHelper));
-
- // TODO: Add more patterns for different insights.
- // TODO: Insights patterns should be in a database of some kind.
- // TODO: Pattern texts should be extracted from localized windows builds.
- [GeneratedRegex(
- @"The process cannot access the file '(.+?)' because it is being used by another process",
- RegexOptions.IgnoreCase, "en-US")]
- private static partial Regex LockedFileErrorRegex();
-
- // TODO The following are examples of a simple pattern where we map error code to some help text.
- // This is temporary: longer-term, we should update the errors.db
- // to map the error code to a description, plus any existing documented solution options.
- [GeneratedRegex(@"0xc0000409", RegexOptions.IgnoreCase, "en-US")]
- private static partial Regex BufferOverflowErrorRegex();
-
- [GeneratedRegex(@"0xc0000005", RegexOptions.IgnoreCase, "en-US")]
- private static partial Regex MemoryErrorRegex();
-
- private static readonly List _regexList = [];
-
- static InsightsHelper()
- {
- _regexList.Add(new InsightRegex(InsightType.LockedFile, LockedFileErrorRegex()));
- _regexList.Add(new InsightRegex(InsightType.Security, BufferOverflowErrorRegex()));
- _regexList.Add(new InsightRegex(InsightType.MemoryViolation, MemoryErrorRegex()));
- }
-
- internal static async Task FindPattern(string errorText, DispatcherQueue dispatcher)
- {
- SimpleTextInsight? newInsight = null;
-
- foreach (var insightRegex in _regexList)
- {
- var match = insightRegex.Regex.Match(errorText);
- if (match.Success)
- {
- var tcs = new TaskCompletionSource();
- dispatcher.TryEnqueue(() =>
- {
- try
- {
- newInsight = new SimpleTextInsight
- {
- InsightType = insightRegex.InsightType,
- };
- tcs.SetResult(true);
- }
- catch (Exception ex)
- {
- tcs.SetException(ex);
- }
- });
-
- await tcs.Task;
-
- if (newInsight is null)
- {
- return null;
- }
-
- // Once we flesh out our error database, we should have a more structured way to
- // handle different types of insights, rather than a switch statement.
- switch (insightRegex.InsightType)
- {
- case InsightType.LockedFile:
- {
- // Extract the file path from the matched group.
- var pattern = string.Empty;
- if (match.Groups != null && match.Groups.Count > 1)
- {
- pattern = match.Groups[1].Value;
- }
-
- newInsight.Title = CommonHelper.GetLocalizedString("LockedFileInsightTitle");
- var processName = GetLockingProcess(pattern);
- if (!string.IsNullOrEmpty(processName))
- {
- newInsight.Description =
- CommonHelper.GetLocalizedString("LockedFileInsightSpecificDescription", pattern, processName);
- }
- else
- {
- newInsight.Description =
- CommonHelper.GetLocalizedString("LockedFileInsightUnknownDescription", pattern);
- }
- }
-
- break;
-
- case InsightType.Security:
- {
- var hexValue = match.Value;
- var intConverter = new Int32Converter();
- var errorAsInt = (int?)intConverter.ConvertFromString(hexValue);
- if (errorAsInt is not null)
- {
- var errors = ErrorLookupHelper.LookupError((int)errorAsInt);
- if (errors is not null && errors.Length > 0)
- {
- var error = errors[0];
- {
- newInsight.Description =
- CommonHelper.GetLocalizedString("GenericInsightDescription", error.Name, error.Help);
- }
- }
- }
-
- newInsight.Title = CommonHelper.GetLocalizedString("SecurityInsightTitle");
- }
-
- break;
-
- case InsightType.MemoryViolation:
- {
- var hexValue = match.Value;
- var intConverter = new Int32Converter();
- var errorAsInt = (int?)intConverter.ConvertFromString(hexValue);
- if (errorAsInt is not null)
- {
- var errors = ErrorLookupHelper.LookupError((int)errorAsInt);
- if (errors is not null && errors.Length > 0)
- {
- var error = errors[0];
- {
- if (IsPythonCtypesError(errorText, out var description))
- {
- newInsight.Description = description;
- }
- else
- {
- newInsight.Description =
- CommonHelper.GetLocalizedString("GenericInsightDescription", error.Name, error.Help);
- }
- }
- }
- }
-
- newInsight.Title = CommonHelper.GetLocalizedString("MemoryInsightTitle");
- }
-
- break;
-
- default:
- break;
- }
-
- break;
- }
- }
-
- return newInsight;
- }
-
- // This is an example of an error that requires additional runtime processing to
- // determine the locking process, so it cannot be handled in the error database alone.
- private static string GetLockingProcess(string lockedFilePath)
- {
- var lockingProcess = string.Empty;
-
- try
- {
- // Determines if the specified file is locked by another process.
- _ = RestartManagerHelper.GetLockingProcesses(lockedFilePath, out var processes);
- if (processes != null && processes.Count > 0)
- {
- var process = processes[0];
- lockingProcess = process.ProcessName;
- }
- }
- catch (Exception ex)
- {
- _log.Debug(ex, "Unable to determine if process is locked.");
- }
-
- return lockingProcess;
- }
-
- // We're special-casing Python ctypes errors here, just to exercise this type of issue
- // pattern, but longer-term this should be handled by some data relationship in the errors.db.
- private static bool IsPythonCtypesError(string errorText, out string description)
- {
- var result = false;
- description = string.Empty;
- var appPathPattern = @"Faulting application path: .*\\python\.exe";
- var modulePathPattern = @"Faulting module path: .*\\_ctypes\.pyd";
- var hasAppPath = Regex.IsMatch(errorText, appPathPattern);
- var hasModulePath = Regex.IsMatch(errorText, modulePathPattern);
-
- if (hasAppPath && hasModulePath)
- {
- description = CommonHelper.GetLocalizedString("PythonCtypesDescription");
- result = true;
- }
-
- return result;
- }
-}
diff --git a/tools/DevDiagnostics/DevHome.DevDiagnostics/Helpers/InternalToolsHelper.cs b/tools/DevDiagnostics/DevHome.DevDiagnostics/Helpers/InternalToolsHelper.cs
deleted file mode 100644
index 219beaead2..0000000000
--- a/tools/DevDiagnostics/DevHome.DevDiagnostics/Helpers/InternalToolsHelper.cs
+++ /dev/null
@@ -1,24 +0,0 @@
-// Copyright (c) Microsoft Corporation.
-// Licensed under the MIT License.
-
-using System.Collections.Generic;
-using System.Collections.ObjectModel;
-
-namespace DevHome.DevDiagnostics.Helpers;
-
-internal sealed class InternalToolsHelper
-{
- private readonly List _allInternalTools;
-
- public ReadOnlyCollection AllInternalTools => _allInternalTools.AsReadOnly();
-
- public InternalToolsHelper()
- {
- // All internal tools should be in this list
- _allInternalTools = new List
- {
- new ClipboardMonitorInternalTool(),
- new ImageOptionsInternalTool(),
- };
- }
-}
diff --git a/tools/DevDiagnostics/DevHome.DevDiagnostics/Helpers/LoaderSnapAssistantTool.cs b/tools/DevDiagnostics/DevHome.DevDiagnostics/Helpers/LoaderSnapAssistantTool.cs
deleted file mode 100644
index 2420a192e7..0000000000
--- a/tools/DevDiagnostics/DevHome.DevDiagnostics/Helpers/LoaderSnapAssistantTool.cs
+++ /dev/null
@@ -1,260 +0,0 @@
-// Copyright (c) Microsoft Corporation.
-// Licensed under the MIT License.
-
-using System;
-using System.Collections.Generic;
-using System.Diagnostics;
-using System.Globalization;
-using System.IO;
-using System.Linq;
-using System.Threading;
-using CommunityToolkit.Mvvm.Input;
-using DevHome.Common.Extensions;
-using DevHome.DevDiagnostics.Controls;
-using DevHome.DevDiagnostics.Models;
-using DevHome.DevDiagnostics.Services;
-using DevHome.DevDiagnostics.TelemetryEvents;
-using DevHome.Service;
-using DevHome.Telemetry;
-using Microsoft.Diagnostics.Tracing;
-using Microsoft.Diagnostics.Tracing.Session;
-using Microsoft.UI.Xaml;
-using Microsoft.Win32;
-using Serilog;
-
-namespace DevHome.DevDiagnostics.Helpers;
-
-public class LoaderSnapAssistantTool
-{
- private const string LoaderSnapsIdentifyNoLogsTelemetryName = "LoaderSnapsIdentifyNoLogs";
- private const string LoaderSnapsIdentifyLogsTelemetryName = "LoaderSnapsIdentifyLogs";
-
- private const string WindowsImageETWProvider = "2cb15d1d-5fc1-11d2-abe1-00a0c911f518"; /*EP_Microsoft-Windows-ImageLoad*/
- private const uint LoaderSnapsFlag = 0x80; /* ETW_UMGL_LDR_SNAPS_FLAG */
- private const string LoaderSnapsETWOpCode = "Opcode(215)";
- private const string LoaderSnapsETWErrorLine = "LdrpProcessWork - ERROR: Unable to load";
-
- private readonly DDInsightsService _insightsService;
- private readonly IDevHomeService _devHomeService;
- private readonly Microsoft.UI.Dispatching.DispatcherQueue _dispatcher;
-
- private struct LoaderSnapFailure
- {
- public int Pid { get; set; }
-
- public string? ErrorLog { get; set; }
-
- public string? ImageName { get; set; }
- }
-
- private readonly Dictionary _loaderSnapFailures = new();
-
- [Flags]
- private enum TraceFlags
- {
- HeapTracing = 1,
- CritSecTracing = 2,
- LoaderSnaps = 4,
- }
-
- public LoaderSnapAssistantTool()
- {
- _dispatcher = Microsoft.UI.Dispatching.DispatcherQueue.GetForCurrentThread();
- Debug.Assert(_dispatcher is not null, "Be sure to create this object on the UI thread");
- _insightsService = Application.Current.GetService();
- _devHomeService = Application.Current.GetService();
- Init();
- }
-
- private void Init()
- {
- var crashDumpAnalyzerThread = new Thread(LoaderSnapETWListener);
- crashDumpAnalyzerThread.Name = "LoaderSnapAssistantThread";
- crashDumpAnalyzerThread.Start();
-
- _devHomeService.MissingFileProcessLaunchFailure += info =>
- {
- if (!IsLoaderSnapLoggingEnabledForImage(info.processName))
- {
- App.Log(LoaderSnapsIdentifyNoLogsTelemetryName, LogLevel.Measure);
-
- _dispatcher.TryEnqueue(() =>
- {
- var insight = new InsightPossibleLoaderIssue();
- insight.Title = CommonHelper.GetLocalizedString("InsightProcessExitMissingDependenciesTitle");
- insight.Text = string.Format(CultureInfo.CurrentCulture, CommonHelper.GetLocalizedString("InsightProcessExitMissingDependencies"), info.processName, info.pid, info.exitCode);
- insight.ImageFileName = info.processName;
- _insightsService.AddInsight(insight);
- });
- }
- else
- {
- lock (_loaderSnapFailures)
- {
- if (_loaderSnapFailures.TryGetValue(info.pid, out LoaderSnapFailure loadersnapError))
- {
- // We had previously received information about this app's loader snap issue but were waiting for the image name.
- // We can raise the notification now
- _loaderSnapFailures.Remove(info.pid);
- loadersnapError.ImageName = info.processName;
- RaiseLoaderSnapInsight(loadersnapError);
- }
- else
- {
- // We haven't received the loader snap failure yet. Store the process name, and we'll raise the insight
- // when we receive the loader snap logs
- LoaderSnapFailure failure = default(LoaderSnapFailure);
- failure.Pid = info.pid;
- failure.ImageName = info.processName;
- _loaderSnapFailures.Add(info.pid, failure);
- }
- }
- }
- };
- }
-
- private void LoaderSnapETWListener()
- {
- using TraceEventSession session = new TraceEventSession("LoaderSnapAssistantSession");
- session.StopOnDispose = true;
-
- // Enable the loader snaps provider
- session.EnableProvider(WindowsImageETWProvider, TraceEventLevel.Error, LoaderSnapsFlag);
-
- // We don't care about a lot of the ETW data that is coming in, so we just hook up the All event and ignore it
- session.Source.Dynamic.All += data => { };
-
- // None of the loadersnap events are handled by the TraceEventParser, so we need to handle them ourselves
- session.Source.UnhandledEvents += UnHandledEventsHandler;
- session.Source.Process();
- }
-
- private void UnHandledEventsHandler(TraceEvent traceEvent)
- {
- if (traceEvent.EventName.Contains(LoaderSnapsETWOpCode))
- {
- byte[] loaderSnapData = traceEvent.EventData();
- string s = System.Text.Encoding.Unicode.GetString(loaderSnapData.Skip(10).ToArray());
-
- // The loader snap data has embedded nulls in its string. Get rid of the embedded nulls that signify newlines, and
- // for the remaining ones, swap them out for colons
- s = s.Replace("\n\0", string.Empty);
- s = s.Replace("\0", ": ");
- if (s.Contains(LoaderSnapsETWErrorLine))
- {
- lock (_loaderSnapFailures)
- {
- if (_loaderSnapFailures.TryGetValue(traceEvent.ProcessID, out LoaderSnapFailure loadersnapError))
- {
- // We had previously received information about this app's loader snap issue but were waiting for the image name.
- // We can raise the notification now
- _loaderSnapFailures.Remove(traceEvent.ProcessID);
- loadersnapError.ErrorLog = s;
- RaiseLoaderSnapInsight(loadersnapError);
- }
- else
- {
- // At this point, we don't have the faulting process's executable name. Wait until we get the callback
- // from our service that tells of the process termination, and then we'll raise the insight.
- LoaderSnapFailure failure = default(LoaderSnapFailure);
- failure.Pid = traceEvent.ProcessID;
- failure.ErrorLog = s;
- _loaderSnapFailures.Add(traceEvent.ProcessID, failure);
- }
- }
- }
- }
- }
-
- private void RaiseLoaderSnapInsight(LoaderSnapFailure failure)
- {
- App.Log(LoaderSnapsIdentifyLogsTelemetryName, LogLevel.Measure);
-
- _dispatcher.TryEnqueue(() =>
- {
- var insight = new SimpleTextInsight();
- insight.Title = string.Format(CultureInfo.CurrentCulture, CommonHelper.GetLocalizedString("InsightProcessExitMissingDependenciesIdentifiedTitle"), failure.ImageName, failure.Pid);
- Debug.Assert(!string.IsNullOrEmpty(failure.ErrorLog), "We should have an error log");
- insight.Description = failure.ErrorLog;
- _insightsService.AddInsight(insight);
- });
- }
-
- private bool IsLoaderSnapLoggingEnabledForImage(string imageFileName)
- {
- // Check if the following registry key exists
- // Computer\HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\imageFileName
- // TracingFlags = 0x4
- RegistryKey? key = Registry.LocalMachine.OpenSubKey(@"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\" + imageFileName, false);
-
- if (key is null)
- {
- return false;
- }
-
- if (key.GetValue("TracingFlags") is not int tracingFlags)
- {
- return false;
- }
-
- if (!((TraceFlags)tracingFlags).HasFlag(TraceFlags.LoaderSnaps))
- {
- return false;
- }
-
- return true;
- }
-}
-
-public class InsightPossibleLoaderIssue : Insight
-{
- private const string LoaderSnapsEnableLogsTelemetryName = "LoaderSnapsEnableLogs";
-
- private static readonly ILogger _log = Log.ForContext("SourceContext", nameof(ExternalTool));
- private readonly InsightForMissingFileProcessTerminationControl _mycontrol = new();
- private string _text = string.Empty;
-
- internal string Text
- {
- get => _text;
-
- set
- {
- _text = value;
- _mycontrol.Text = value;
- }
- }
-
- internal string ImageFileName { get; set; } = string.Empty;
-
- internal InsightPossibleLoaderIssue()
- {
- _mycontrol.Command = new RelayCommand(ConfigureLoaderSnaps);
- CustomControl = _mycontrol;
- }
-
- public void ConfigureLoaderSnaps()
- {
- App.Log(LoaderSnapsEnableLogsTelemetryName, LogLevel.Measure);
-
- try
- {
- FileInfo fileInfo = new FileInfo(Environment.ProcessPath ?? string.Empty);
-
- var startInfo = new ProcessStartInfo()
- {
- FileName = "EnableLoaderSnaps.exe",
- Arguments = ImageFileName,
- UseShellExecute = true,
- WorkingDirectory = fileInfo.DirectoryName,
- Verb = "runas",
- };
-
- var process = Process.Start(startInfo);
- }
- catch (Exception ex)
- {
- _log.Error(ex.Message);
- }
- }
-}
diff --git a/tools/DevDiagnostics/DevHome.DevDiagnostics/Helpers/RestartManagerHelper.cs b/tools/DevDiagnostics/DevHome.DevDiagnostics/Helpers/RestartManagerHelper.cs
deleted file mode 100644
index ee0848d783..0000000000
--- a/tools/DevDiagnostics/DevHome.DevDiagnostics/Helpers/RestartManagerHelper.cs
+++ /dev/null
@@ -1,110 +0,0 @@
-// Copyright (c) Microsoft Corporation.
-// Licensed under the MIT License.
-
-using System;
-using System.Collections.Generic;
-using System.Diagnostics;
-using Windows.Win32;
-using Windows.Win32.Foundation;
-using Windows.Win32.System.RestartManager;
-
-namespace DevHome.DevDiagnostics.Helpers;
-
-internal static class RestartManagerHelper
-{
- // Find out what process(es) have a lock on the specified file.
- internal static WIN32_ERROR GetLockingProcesses(string filePath, out List processes)
- {
- var key = Guid.NewGuid().ToString();
- processes = [];
-
- // Start a Restart Manager session.
- var result = WIN32_ERROR.ERROR_SUCCESS;
- uint handle;
- unsafe
- {
- fixed (char* p = key)
- {
- PInvoke.RmStartSession(out handle, p);
- }
- }
-
- if (result != 0)
- {
- return result;
- }
-
- try
- {
- uint pnProcInfo = 0;
- var lpdwRebootReasons = (uint)RM_REBOOT_REASON.RmRebootReasonNone;
-
- unsafe
- {
- fixed (char* p = filePath)
- {
- var filePathStr = new PCWSTR(p);
- var resources = new ReadOnlySpan(&filePathStr, 1);
- var uniqueProcesses = default(Span);
- var serviceNames = default(ReadOnlySpan);
-
- // Specify the given file as a resource to be managed by the Restart Manager.
- result = PInvoke.RmRegisterResources(handle, resources, uniqueProcesses, serviceNames);
- if (result != 0)
- {
- return result;
- }
- }
- }
-
- // Note: there's a race here - the first call to RmGetList returns the count of processes,
- // but when we call RmGetList again to get them this number might have changed.
- unsafe
- {
- result = PInvoke.RmGetList(handle, out var pnProcInfoNeeded, ref pnProcInfo, null, out lpdwRebootReasons);
- if (result == WIN32_ERROR.ERROR_MORE_DATA)
- {
- var processInfo = new RM_PROCESS_INFO[pnProcInfoNeeded];
-
- fixed (RM_PROCESS_INFO* processArrayPtr = processInfo)
- {
- pnProcInfo = pnProcInfoNeeded;
-
- // Get the list of running processes that are using the given resource (file).
- result = PInvoke.RmGetList(handle, out pnProcInfoNeeded, ref pnProcInfo, processArrayPtr, out lpdwRebootReasons);
- if (result == 0)
- {
- // Enumerate all of the returned PIDS, get a Process for each one, and add it to the list.
- processes = new List((int)pnProcInfo);
- for (var i = 0; i < pnProcInfo; i++)
- {
- try
- {
- processes.Add(Process.GetProcessById((int)processInfo[i].Process.dwProcessId));
- }
- catch (ArgumentException)
- {
- // The process might have died before we got to look at it.
- }
- }
- }
- else
- {
- return result;
- }
- }
- }
- else if (result != 0)
- {
- return result;
- }
- }
- }
- finally
- {
- _ = PInvoke.RmEndSession(handle);
- }
-
- return 0;
- }
-}
diff --git a/tools/DevDiagnostics/DevHome.DevDiagnostics/Helpers/ServicingHelper.cs b/tools/DevDiagnostics/DevHome.DevDiagnostics/Helpers/ServicingHelper.cs
deleted file mode 100644
index 8631521bfc..0000000000
--- a/tools/DevDiagnostics/DevHome.DevDiagnostics/Helpers/ServicingHelper.cs
+++ /dev/null
@@ -1,51 +0,0 @@
-// Copyright (c) Microsoft Corporation.
-// Licensed under the MIT License.
-
-using System;
-using Microsoft.UI.Xaml;
-using Windows.Win32;
-using Windows.Win32.Foundation;
-using WinUIEx.Messaging;
-
-namespace DevHome.DevDiagnostics.Helpers;
-
-// Note: instead of making this class disposable, we're disposing the WindowMessageMonitor in
-// UnregisterHotKey, and MainWindow calls this in its Closing event handler.
-#pragma warning disable CA1001 // Types that own disposable fields should be disposable
-public class ServicingHelper
-#pragma warning restore CA1001 // Types that own disposable fields should be disposable
-{
- private const string NoWindowHandleException = "Cannot get window handle: are you doing this too early?";
- private readonly HWND _windowHandle;
- private readonly WindowMessageMonitor _windowMessageMonitor;
- private readonly Action _onSessionEnd;
-
- public ServicingHelper(Window handlerWindow, Action handleSessionEnd)
- {
- _onSessionEnd = handleSessionEnd;
-
- // Set up the window message hook to listen for session end messages.
- _windowHandle = (HWND)WinRT.Interop.WindowNative.GetWindowHandle(handlerWindow);
- if (_windowHandle.IsNull)
- {
- throw new InvalidOperationException(NoWindowHandleException);
- }
-
- _windowMessageMonitor = new WindowMessageMonitor(_windowHandle);
- _windowMessageMonitor.WindowMessageReceived += OnWindowMessageReceived;
- }
-
- private void OnWindowMessageReceived(object? sender, WindowMessageEventArgs e)
- {
- if (e.Message.MessageId == PInvoke.WM_ENDSESSION)
- {
- _onSessionEnd?.Invoke();
- e.Handled = true;
- }
- }
-
- internal void Unregister()
- {
- _windowMessageMonitor?.Dispose();
- }
-}
diff --git a/tools/DevDiagnostics/DevHome.DevDiagnostics/Helpers/StandInDevHomeService.cs b/tools/DevDiagnostics/DevHome.DevDiagnostics/Helpers/StandInDevHomeService.cs
deleted file mode 100644
index 181ac4a78a..0000000000
--- a/tools/DevDiagnostics/DevHome.DevDiagnostics/Helpers/StandInDevHomeService.cs
+++ /dev/null
@@ -1,22 +0,0 @@
-// Copyright (c) Microsoft Corporation.
-// Licensed under the MIT License.
-
-// This is the stand-in service that is used when DevHome's NT service is not available. It's basically a dummy object that can
-// be used so the rest of DevHome can still function without the service.
-using DevHome.Service;
-
-namespace DevHome.DevDiagnostics.Helpers;
-
-internal sealed class StandInDevHomeService : IDevHomeService
-{
- // Let folks subscribe to this event, but it will never be raised.
- public event MissingFileProcessLaunchFailureHandler? MissingFileProcessLaunchFailure
- {
- add { }
- remove { }
- }
-
- public StandInDevHomeService()
- {
- }
-}
diff --git a/tools/DevDiagnostics/DevHome.DevDiagnostics/Helpers/Tool.cs b/tools/DevDiagnostics/DevHome.DevDiagnostics/Helpers/Tool.cs
deleted file mode 100644
index 631666e4b0..0000000000
--- a/tools/DevDiagnostics/DevHome.DevDiagnostics/Helpers/Tool.cs
+++ /dev/null
@@ -1,114 +0,0 @@
-// Copyright (c) Microsoft Corporation.
-// Licensed under the MIT License.
-
-using System;
-using System.Diagnostics;
-using System.Text.Json.Serialization;
-using CommunityToolkit.Mvvm.ComponentModel;
-using CommunityToolkit.Mvvm.Input;
-using DevHome.Common.Extensions;
-using DevHome.DevDiagnostics.Models;
-using Microsoft.UI.Xaml;
-using Microsoft.UI.Xaml.Controls;
-using Microsoft.UI.Xaml.Media;
-using Windows.Win32.Foundation;
-
-namespace DevHome.DevDiagnostics.Helpers;
-
-public abstract partial class Tool : ObservableObject
-{
- [ObservableProperty]
- private bool _isPinned;
-
- [ObservableProperty]
- [property: JsonIgnore]
- private string _pinGlyph;
-
- [ObservableProperty]
- [property: JsonIgnore]
- private ImageSource? _toolIconSource;
-
- [ObservableProperty]
- [property: JsonIgnore]
- private bool _isEnabled;
-
- public string Name { get; private set; }
-
- [JsonConverter(typeof(EnumStringConverter))]
- public ToolType Type { get; private set; }
-
- public Tool(string name, ToolType type, bool isPinned, bool isEnabled = true)
- {
- Name = name;
- Type = type;
- IsPinned = isPinned;
- PinGlyph = IsPinned ? CommonHelper.UnpinGlyph : CommonHelper.PinGlyph;
- IsEnabled = isEnabled;
- }
-
- public abstract IconElement GetIcon();
-
- partial void OnIsPinnedChanged(bool oldValue, bool newValue)
- {
- PinGlyph = newValue ? CommonHelper.UnpinGlyph : CommonHelper.PinGlyph;
- OnIsPinnedChange(newValue);
- }
-
- protected virtual void OnIsPinnedChange(bool newValue)
- {
- }
-
- [property: JsonIgnore]
- [RelayCommand]
- public void TogglePinnedState()
- {
- IsPinned = !IsPinned;
- }
-
- public void Invoke(ToolLaunchOptions options)
- {
- InvokeTool(options);
- }
-
- [property: JsonIgnore]
- [RelayCommand]
- public void Invoke()
- {
- ToolLaunchOptions options = new();
- options.TargetProcessId = TargetAppData.Instance.TargetProcess?.Id;
- options.TargetHWnd = TargetAppData.Instance.HWnd;
-
- var barWindow = Application.Current.GetService().DBarWindow;
- options.ParentWindow = barWindow;
-
- InvokeTool(options);
- }
-
- internal virtual void InvokeTool(ToolLaunchOptions options) => throw new NotImplementedException();
-
- [property: JsonIgnore]
- [RelayCommand]
- public abstract void UnregisterTool();
-}
-
-[Flags]
-public enum ToolType
-{
- Unknown = 0,
- DumpAnalyzer = 1,
-}
-
-public class ToolLaunchOptions
-{
- public Window? ParentWindow { get; set; }
-
- public bool RedirectStandardOut { get; set; } /* = false; */
-
- public string? CommandLineParams { get; set; }
-
- public int? TargetProcessId { get; set; }
-
- internal HWND TargetHWnd { get; set; }
-
- public Process? LaunchedProcess { get; set; }
-}
diff --git a/tools/DevDiagnostics/DevHome.DevDiagnostics/Helpers/WERUtils.cs b/tools/DevDiagnostics/DevHome.DevDiagnostics/Helpers/WERUtils.cs
deleted file mode 100644
index a489c5ad35..0000000000
--- a/tools/DevDiagnostics/DevHome.DevDiagnostics/Helpers/WERUtils.cs
+++ /dev/null
@@ -1,118 +0,0 @@
-// Copyright (c) Microsoft Corporation.
-// Licensed under the MIT License.
-
-using System.Diagnostics;
-using Microsoft.Win32;
-
-namespace DevHome.DevDiagnostics.Helpers;
-
-internal sealed class WERUtils
-{
- internal const string LocalWERRegistryKey = "SOFTWARE\\Microsoft\\Windows\\Windows Error Reporting\\LocalDumps";
-
- // Check to see if global local WER collection is enabled
- // See https://learn.microsoft.com/windows/win32/wer/collecting-user-mode-dumps
- // for more details
- internal static bool IsGlobalCollectionEnabled()
- {
- var key = Registry.LocalMachine.OpenSubKey(LocalWERRegistryKey, false);
-
- return IsCollectionEnabledForKey(key);
- }
-
- // See if local WER collection is enabled for a specific app
- internal static bool IsCollectionEnabledForApp(string appName)
- {
- var key = Registry.LocalMachine.OpenSubKey(LocalWERRegistryKey, false);
-
- // If the local dump key doesn't exist, then app collection is disabled
- if (key is null)
- {
- return false;
- }
-
- var appKey = key.OpenSubKey(appName, false);
-
- // If the app key doesn't exist, per-app collection isn't enabled. Check the global setting
- if (appKey is null)
- {
- return IsGlobalCollectionEnabled();
- }
-
- return IsCollectionEnabledForKey(appKey);
- }
-
- internal static bool IsCollectionEnabledForKey(RegistryKey? key)
- {
- // If the key doesn't exist, then collection is disabled
- if (key is null)
- {
- return false;
- }
-
- // If the key exists, but dumpcount is set to 0, it's also disabled
- if (key.GetValue("DumpCount") is int dumpCount && dumpCount == 0)
- {
- return false;
- }
-
- // Collection is enabled enabled, but if we're not getting full memory dumps, so cabs may not be
- // useful. In this case, report that collection is disabled.
- var dumpType = key.GetValue("DumpType") as int?;
- if (dumpType is null || dumpType != 2)
- {
- return false;
- }
-
- // Otherwise it's enabled
- return true;
- }
-
- // This changes the registry keys necessary to allow local WER collection for a specific app
- internal static void EnableCollectionForApp(string appname)
- {
- var globalKey = Registry.LocalMachine.OpenSubKey(LocalWERRegistryKey, true);
-
- if (globalKey is null)
- {
- // Need to create the key, and set the global dump collection count to 0 to prevent all apps from generating local dumps
- globalKey = Registry.LocalMachine.CreateSubKey(LocalWERRegistryKey);
- globalKey.SetValue("DumpCount", 0);
- }
-
- Debug.Assert(globalKey is not null, "Global key is null");
-
- var appKey = globalKey.CreateSubKey(appname);
- Debug.Assert(appKey is not null, "App key is null");
-
- // If dumpcount doesn't exist or is set to 0, set the default value to get cabs
- if (appKey.GetValue("DumpCount") is not int dumpCount || dumpCount == 0)
- {
- appKey.SetValue("DumpCount", 10);
- }
-
- // Make sure the cabs being collected are useful. Go for the full dumps instead of the mini dumps
- appKey.SetValue("DumpType", 2);
- return;
- }
-
- // This changes the registry keys necessary to disable local WER collection for a specific app
- internal static void DisableCollectionForApp(string appname)
- {
- var globalKey = Registry.LocalMachine.OpenSubKey(LocalWERRegistryKey, true);
-
- if (globalKey is null)
- {
- // Local collection isn't enabled
- return;
- }
-
- var appKey = globalKey.CreateSubKey(appname);
- Debug.Assert(appKey is not null, "App key is null");
-
- // Set the DumpCount value to 0 to disable collection
- appKey.SetValue("DumpCount", 0);
-
- return;
- }
-}
diff --git a/tools/DevDiagnostics/DevHome.DevDiagnostics/Helpers/WinLogsHelper.cs b/tools/DevDiagnostics/DevHome.DevDiagnostics/Helpers/WinLogsHelper.cs
deleted file mode 100644
index 8250cd4e90..0000000000
--- a/tools/DevDiagnostics/DevHome.DevDiagnostics/Helpers/WinLogsHelper.cs
+++ /dev/null
@@ -1,269 +0,0 @@
-// Copyright (c) Microsoft Corporation.
-// Licensed under the MIT License.
-
-using System;
-using System.Collections.ObjectModel;
-using System.Collections.Specialized;
-using System.Diagnostics;
-using System.Diagnostics.Eventing.Reader;
-using System.Threading;
-using DevHome.Common.Extensions;
-using DevHome.DevDiagnostics.Models;
-using Microsoft.Diagnostics.Tracing;
-using Microsoft.UI.Xaml;
-
-namespace DevHome.DevDiagnostics.Helpers;
-
-public class WinLogsHelper : IDisposable
-{
- public const string EtwLogsName = "ETW Logs";
- public const string DebugOutputLogsName = "DebugOutput";
- public const string EventViewerName = "EventViewer";
- public const string WERName = "WER";
-
- private readonly ETWHelper etwHelper;
- private readonly DebugMonitor debugMonitor;
- private readonly EventViewerHelper eventViewerHelper;
- private readonly ObservableCollection output;
- private readonly Process targetProcess;
- private readonly WERHelper _werHelper;
-
- private Thread? etwThread;
- private Thread? debugMonitorThread;
- private Thread? eventViewerThread;
-
- public WinLogsHelper(Process targetProcess, ObservableCollection output)
- {
- this.targetProcess = targetProcess;
- this.output = output;
-
- // Initialize ETW logs
- etwHelper = new ETWHelper(targetProcess, output);
-
- // Initialize DebugMonitor
- debugMonitor = new DebugMonitor(targetProcess, output);
-
- // Initialize EventViewer
- eventViewerHelper = new EventViewerHelper(targetProcess, output);
-
- _werHelper = Application.Current.GetService();
- }
-
- public void Start(bool isEtwEnabled, bool isDebugOutputEnabled, bool isEventViewerEnabled, bool isWEREnabled)
- {
- if (isEtwEnabled)
- {
- StartETWLogsThread();
- }
-
- if (isDebugOutputEnabled)
- {
- StartDebugOutputsThread();
- }
-
- if (isEventViewerEnabled)
- {
- StartEventViewerThread();
- }
-
- if (isWEREnabled)
- {
- ((INotifyCollectionChanged)_werHelper.WERReports).CollectionChanged += WEREvents_CollectionChanged;
- }
- }
-
- public void Stop()
- {
- // Stop ETW logs
- StopETWLogsThread();
-
- // Stop Debug Outputs
- StopDebugOutputsThread();
-
- // Stop Event Viewer
- StopEventViewerThread();
-
- // Stop WER
- ((INotifyCollectionChanged)_werHelper.WERReports).CollectionChanged -= WEREvents_CollectionChanged;
- }
-
- public void Dispose()
- {
- etwHelper.Dispose();
- debugMonitor.Dispose();
- eventViewerHelper.Dispose();
- GC.SuppressFinalize(this);
- }
-
- private void StartETWLogsThread()
- {
- // Stop and close existing thread if any
- StopETWLogsThread();
-
- // Start a new thread
- etwThread = new Thread(() =>
- {
- etwHelper.Start();
- });
- etwThread.Name = EtwLogsName + " Thread";
- etwThread.Start();
- }
-
- private void StopETWLogsThread()
- {
- etwHelper.Stop();
-
- if (Thread.CurrentThread != etwThread)
- {
- etwThread?.Join();
- }
- }
-
- private void StartDebugOutputsThread()
- {
- // Stop and close existing thread if any
- StopDebugOutputsThread();
-
- // Start a new thread
- debugMonitorThread = new Thread(() =>
- {
- // Start Debug Outputs
- debugMonitor.Start();
- });
- debugMonitorThread.Name = DebugOutputLogsName + " Thread";
- debugMonitorThread.Start();
- }
-
- private void StopDebugOutputsThread()
- {
- debugMonitor.Stop();
-
- if (Thread.CurrentThread != debugMonitorThread)
- {
- debugMonitorThread?.Join();
- }
- }
-
- private void StartEventViewerThread()
- {
- // Stop and close existing thread if any
- StopEventViewerThread();
-
- // Start a new thread
- eventViewerThread = new Thread(() =>
- {
- // Start EventViewer logs
- eventViewerHelper.Start();
- });
- eventViewerThread.Name = EventViewerName + " Thread";
- eventViewerThread.Start();
- }
-
- private void StopEventViewerThread()
- {
- eventViewerHelper.Stop();
-
- if (Thread.CurrentThread != eventViewerThread)
- {
- eventViewerThread?.Join();
- }
- }
-
- private void WEREvents_CollectionChanged(object? sender, NotifyCollectionChangedEventArgs e)
- {
- if (e.Action == NotifyCollectionChangedAction.Add && e.NewItems != null)
- {
- foreach (WERReport report in e.NewItems)
- {
- var filePath = report.Executable ?? string.Empty;
-
- // Filter WER events based on the process we're targeting
- if (filePath.Contains(targetProcess.ProcessName, StringComparison.OrdinalIgnoreCase))
- {
- WinLogsEntry entry = new(report.TimeStamp, WinLogCategory.Error, report.Description, WinLogsHelper.WERName);
- output.Add(entry);
- }
- }
- }
- }
-
- public void LogStateChanged(WinLogsTool logType, bool isEnabled)
- {
- if (isEnabled)
- {
- switch (logType)
- {
- case WinLogsTool.ETWLogs:
- StartETWLogsThread();
- break;
- case WinLogsTool.DebugOutput:
- StartDebugOutputsThread();
- break;
- case WinLogsTool.EventViewer:
- StartEventViewerThread();
- break;
- case WinLogsTool.WER:
- ((INotifyCollectionChanged)_werHelper.WERReports).CollectionChanged += WEREvents_CollectionChanged;
- break;
- }
- }
- else
- {
- switch (logType)
- {
- case WinLogsTool.ETWLogs:
- StopETWLogsThread();
- break;
- case WinLogsTool.DebugOutput:
- StopDebugOutputsThread();
- break;
- case WinLogsTool.EventViewer:
- StopEventViewerThread();
- break;
- case WinLogsTool.WER:
- ((INotifyCollectionChanged)_werHelper.WERReports).CollectionChanged -= WEREvents_CollectionChanged;
- break;
- }
- }
- }
-
- public static WinLogCategory ConvertTraceEventLevelToWinLogCategory(TraceEventLevel level)
- {
- var category = WinLogCategory.Information;
-
- switch (level)
- {
- case TraceEventLevel.Error:
- case TraceEventLevel.Critical:
- category = WinLogCategory.Error;
- break;
- case TraceEventLevel.Warning:
- category = WinLogCategory.Warning;
- break;
- }
-
- return category;
- }
-
- public static WinLogCategory ConvertStandardEventLevelToWinLogCategory(byte? level)
- {
- var category = WinLogCategory.Information;
-
- if (level.HasValue)
- {
- StandardEventLevel standardEventLevel = (StandardEventLevel)level.Value;
- switch (standardEventLevel)
- {
- case StandardEventLevel.Error:
- case StandardEventLevel.Critical:
- category = WinLogCategory.Error;
- break;
- case StandardEventLevel.Warning:
- category = WinLogCategory.Warning;
- break;
- }
- }
-
- return category;
- }
-}
diff --git a/tools/DevDiagnostics/DevHome.DevDiagnostics/Helpers/WindowHelper.cs b/tools/DevDiagnostics/DevHome.DevDiagnostics/Helpers/WindowHelper.cs
deleted file mode 100644
index 204a4a2431..0000000000
--- a/tools/DevDiagnostics/DevHome.DevDiagnostics/Helpers/WindowHelper.cs
+++ /dev/null
@@ -1,770 +0,0 @@
-// Copyright (c) Microsoft Corporation.
-// Licensed under the MIT License.
-
-using System;
-using System.Collections.Specialized;
-using System.Diagnostics;
-using System.Drawing;
-using System.IO;
-using System.Runtime.InteropServices;
-using System.Runtime.InteropServices.WindowsRuntime;
-using System.Threading.Tasks;
-using Microsoft.UI.Xaml;
-using Microsoft.UI.Xaml.Controls;
-using Microsoft.UI.Xaml.Media;
-using Microsoft.UI.Xaml.Media.Imaging;
-using Microsoft.Win32.SafeHandles;
-using Serilog;
-using Windows.Devices.Display;
-using Windows.Devices.Enumeration;
-using Windows.Foundation;
-using Windows.Graphics;
-using Windows.Graphics.Imaging;
-using Windows.Storage.Streams;
-using Windows.Win32;
-using Windows.Win32.Foundation;
-using Windows.Win32.Graphics.Dwm;
-using Windows.Win32.Graphics.Gdi;
-using Windows.Win32.System.SystemInformation;
-using Windows.Win32.System.Threading;
-using Windows.Win32.UI.Accessibility;
-using Windows.Win32.UI.Shell.Common;
-using Windows.Win32.UI.WindowsAndMessaging;
-
-namespace DevHome.DevDiagnostics.Helpers;
-
-public class WindowHelper
-{
- private static readonly ILogger _log = Log.ForContext("SourceContext", nameof(WindowHelper));
-
- private static nint GetClassLongPtr(HWND hWnd, GET_CLASS_LONG_INDEX nIndex)
- {
- if (IntPtr.Size == 8)
- {
- return CommonInterop.GetClassLongPtr64(hWnd, nIndex);
- }
- else
- {
- return (nint)PInvoke.GetClassLong(hWnd, nIndex);
- }
- }
-
- private static nint SetWindowLongPtr(HWND hWnd, WINDOW_LONG_PTR_INDEX nIndex, nint newLong)
- {
- if (IntPtr.Size == 8)
- {
- return CommonInterop.SetWindowLongPtr64(hWnd, nIndex, newLong);
- }
- else
- {
- return (nint)PInvoke.SetWindowLong(hWnd, nIndex, (int)newLong);
- }
- }
-
- private static nint GetWindowLongPtr(HWND hWnd, WINDOW_LONG_PTR_INDEX nIndex)
- {
- if (IntPtr.Size == 8)
- {
- return CommonInterop.GetWindowLongPtr64(hWnd, nIndex);
- }
- else
- {
- return PInvoke.GetWindowLong(hWnd, nIndex);
- }
- }
-
- private static unsafe BOOL EnumProc(HWND hWnd, LPARAM data)
- {
-#pragma warning disable CS8500 // This takes the address of, gets the size of, or declares a pointer to a managed type
- var enumData = (EnumWindowsData*)data.Value;
-#pragma warning restore CS8500 // This takes the address of, gets the size of, or declares a pointer to a managed type
-
- // The caller should've set this, but we'll make sure here.
- enumData->OutHwnd = HWND.Null;
-
- // Skip this one if the window doesn't include WS_VISIBLE, or if it's minimized.
- if (!PInvoke.IsWindowVisible(hWnd))
- {
- return true;
- }
-
- if (PInvoke.IsIconic(hWnd))
- {
- return true;
- }
-
- // Skip toolwindows.
- var extendedStyle = GetWindowLongPtr(hWnd, WINDOW_LONG_PTR_INDEX.GWL_EXSTYLE);
- var isToolWindow = (extendedStyle & (long)WINDOW_EX_STYLE.WS_EX_TOOLWINDOW)
- == (long)WINDOW_EX_STYLE.WS_EX_TOOLWINDOW;
- if (isToolWindow)
- {
- return true;
- }
-
- // Skip dialogs.
- if (PInvoke.GetAncestor(hWnd, GET_ANCESTOR_FLAGS.GA_ROOTOWNER) != hWnd)
- {
- return true;
- }
-
- PInvoke.GetWindowRect(hWnd, out var windowRect);
- var screenBounds = GetMonitorRectForWindow(hWnd);
- var isOnAnyScreen =
- windowRect.left < screenBounds.right && windowRect.right > screenBounds.left &&
- windowRect.top < screenBounds.bottom && windowRect.bottom > screenBounds.top &&
- windowRect.right - windowRect.left > 1 && windowRect.bottom - windowRect.top > 1;
- if (!isOnAnyScreen)
- {
- return true;
- }
-
- unsafe
- {
- // Exclude system/shell windows.
- var className = stackalloc char[256];
- var classNameLength = PInvoke.GetClassName(hWnd, className, 256);
- if (classNameLength == 0)
- {
- return true;
- }
-
- string classNameString = new(className, 0, classNameLength);
- if (classNameString == "Progman" || classNameString == "Shell_TrayWnd" ||
- classNameString == "WorkerW" || classNameString == "SHELLDLL_DefView" ||
- classNameString == "IME")
- {
- return true;
- }
-
- // Exclude cloaked windows.
- var cloakedVal = 0;
- var hRes = PInvoke.DwmGetWindowAttribute(
- hWnd, DWMWINDOWATTRIBUTE.DWMWA_CLOAKED, &cloakedVal, sizeof(int));
- if (hRes != 0)
- {
- cloakedVal = 0;
- }
-
- if (cloakedVal != 0)
- {
- return true;
- }
-
- // Skip any windows that are on our exclusion list.
- var excludedProcesses = enumData->ExcludedProcesses;
- if (excludedProcesses != null && !IsAcceptableWindow(hWnd, excludedProcesses))
- {
- return true;
- }
- }
-
- // Skip popups, unless they're for UWP apps or for dialog-based MFC apps.
- var windowStyle = (WINDOW_STYLE)GetWindowLongPtr(hWnd, WINDOW_LONG_PTR_INDEX.GWL_STYLE);
- var isPopup = (windowStyle & WINDOW_STYLE.WS_POPUP) == WINDOW_STYLE.WS_POPUP;
-
- // Dialog-based MFC apps will have WS_POPUP but also WS_OVERLAPPED.
- var isOverlapped = (windowStyle & WINDOW_STYLE.WS_OVERLAPPED) == WINDOW_STYLE.WS_OVERLAPPED;
-
- if (isPopup)
- {
- var isUwpApp = IsProcessName(hWnd, "applicationframehost");
- if (isUwpApp)
- {
- // NOTE: We could use SHGetPropertyStoreForWindow + PKEY_AppUserModel_ID
- // to get the appid for the app.
- // Found a visible UWP window, stop enumerating.
- enumData->OutHwnd = hWnd;
- return false;
- }
- else if (isOverlapped)
- {
- // This is a top-level popup, most likely a dialog-based MFC app.
- enumData->OutHwnd = hWnd;
- return false;
- }
-
- return true;
- }
-
- // Found a window, stop enumerating.
- enumData->OutHwnd = hWnd;
- return false;
- }
-
- private static Rectangle GetScreenBounds()
- {
- Rectangle rectangle = default;
-
- // Can't use async in EnumProc.
- var deviceInfoOp = DeviceInformation.FindAllAsync(DisplayMonitor.GetDeviceSelector());
- deviceInfoOp.AsTask().Wait();
- var displayList = deviceInfoOp.GetResults();
- if (displayList == null || displayList.Count == 0)
- {
- return rectangle;
- }
-
- var winSize = default(SizeInt32);
- var displayOp = DisplayMonitor.FromInterfaceIdAsync(displayList[0].Id);
- displayOp.AsTask().Wait();
- var monitorInfo = displayOp.GetResults();
- if (monitorInfo == null)
- {
- winSize.Width = 800;
- winSize.Height = 1200;
- }
- else
- {
- winSize.Height = monitorInfo.NativeResolutionInRawPixels.Height;
- winSize.Width = monitorInfo.NativeResolutionInRawPixels.Width;
- }
-
- rectangle.Width = winSize.Width;
- rectangle.Height = winSize.Height;
-
- return rectangle;
- }
-
- public static RectInt32 GetRect(Rect bounds, double scale)
- {
- return new RectInt32(
- _X: (int)Math.Round(bounds.X * scale),
- _Y: (int)Math.Round(bounds.Y * scale),
- _Width: (int)Math.Round(bounds.Width * scale),
- _Height: (int)Math.Round(bounds.Height * scale));
- }
-
- internal static unsafe string GetWindowTitle(HWND hWnd)
- {
- var length = PInvoke.GetWindowTextLength(hWnd);
- var windowText = stackalloc char[length];
- _ = PInvoke.GetWindowText(hWnd, windowText, length);
- return new string(windowText);
- }
-
- internal static IntPtr LoadDefaultAppIcon()
- {
- IntPtr icon = PInvoke.LoadIcon(HINSTANCE.Null, PInvoke.IDI_APPLICATION);
- return icon;
- }
-
- internal static Bitmap? GetAppIcon(HWND hWnd)
- {
- try
- {
- // Try getting the big icon first.
- IntPtr hIcon = default;
- hIcon = PInvoke.SendMessage(hWnd, PInvoke.WM_GETICON, PInvoke.ICON_BIG, IntPtr.Zero);
-
- // If that failed, try getting the small icon (or the system-provided default).
- if (hIcon == IntPtr.Zero)
- {
- hIcon = PInvoke.SendMessage(hWnd, PInvoke.WM_GETICON, PInvoke.ICON_SMALL2, IntPtr.Zero);
- if (hIcon == IntPtr.Zero)
- {
- hIcon = (nint)GetClassLongPtr(hWnd, GET_CLASS_LONG_INDEX.GCL_HICON);
- }
- }
-
- if (hIcon != IntPtr.Zero)
- {
- return new Bitmap(Icon.FromHandle(hIcon).ToBitmap(), 24, 24);
- }
- else
- {
- return null;
- }
- }
- catch (Exception)
- {
- return null;
- }
- }
-
- public static async Task GetWinUI3BitmapSourceFromGdiBitmap(Bitmap bmp)
- {
- var softwareBitmap = GetSoftwareBitmapFromGdiBitmap(bmp);
- var source = new SoftwareBitmapSource();
- await source.SetBitmapAsync(softwareBitmap);
- return source;
- }
-
- public static SoftwareBitmap? GetSoftwareBitmapFromExecutable(string executable)
- {
- SoftwareBitmap? softwareBitmap = null;
- var toolIcon = Icon.ExtractAssociatedIcon(executable);
-
- // Fall back to Windows default app icon.
- toolIcon ??= Icon.FromHandle(LoadDefaultAppIcon());
-
- if (toolIcon is not null)
- {
- softwareBitmap = GetSoftwareBitmapFromGdiBitmap(toolIcon.ToBitmap());
- }
-
- return softwareBitmap;
- }
-
- public static SoftwareBitmap GetSoftwareBitmapFromGdiBitmap(Bitmap bmp)
- {
- // Get pixels as an array of bytes.
- var data = bmp.LockBits(
- new Rectangle(0, 0, bmp.Width, bmp.Height),
- System.Drawing.Imaging.ImageLockMode.ReadOnly,
- bmp.PixelFormat);
- var bytes = new byte[data.Stride * data.Height];
- Marshal.Copy(data.Scan0, bytes, 0, bytes.Length);
- bmp.UnlockBits(data);
-
- // Get WinRT SoftwareBitmap.
- var softwareBitmap = new SoftwareBitmap(
- BitmapPixelFormat.Bgra8,
- bmp.Width,
- bmp.Height,
- BitmapAlphaMode.Premultiplied);
- softwareBitmap.CopyFromBuffer(bytes.AsBuffer());
-
- return softwareBitmap;
- }
-
- public static async Task GetSoftwareBitmapSourceFromSoftwareBitmapAsync(SoftwareBitmap softwareBitmap)
- {
- var softwareBitmapSource = new SoftwareBitmapSource();
- await softwareBitmapSource.SetBitmapAsync(softwareBitmap);
- return softwareBitmapSource;
- }
-
- internal static BitmapImage? GetBitmapImageFromFile(string filePath)
- {
- BitmapImage? bitmapImage = null;
- try
- {
- // Creating a BitmapImage must be done on the UI thread.
- bitmapImage = new BitmapImage();
- var icon = Icon.ExtractAssociatedIcon(filePath);
- if (icon is not null)
- {
- using var bitmap = icon.ToBitmap();
- using var stream = new MemoryStream();
- bitmap.Save(stream, System.Drawing.Imaging.ImageFormat.Png);
-
- stream.Seek(0, SeekOrigin.Begin);
- var randomAccessStream = new InMemoryRandomAccessStream();
- var outputStream = randomAccessStream.GetOutputStreamAt(0);
- var writer = new DataWriter(outputStream);
- writer.WriteBytes(stream.ToArray());
- writer.StoreAsync().GetResults();
- randomAccessStream.Seek(0);
-
- bitmapImage.SetSource(randomAccessStream);
- }
- }
- catch (Exception ex)
- {
- _log.Error($"Error creating BitmapImage from filePath: {ex.Message}");
- }
-
- return bitmapImage;
- }
-
- internal static async Task GetSoftwareBitmapSourceFromImageFilePath(string iconFilePath)
- {
- SoftwareBitmapSource? softwareBitmapSource = null;
-
- try
- {
- var fileStream = File.OpenRead(iconFilePath);
- var decoder = await BitmapDecoder.CreateAsync(fileStream.AsRandomAccessStream());
- var softwareBitmap = await decoder.GetSoftwareBitmapAsync();
-
- // SoftwareBitmapSource.SetBitmapAsync only supports SoftwareBitmap with
- // bgra8 pixel format and pre-multiplied or no alpha.
- if (softwareBitmap.BitmapPixelFormat != BitmapPixelFormat.Bgra8
- || softwareBitmap.BitmapAlphaMode == BitmapAlphaMode.Straight)
- {
- softwareBitmap = SoftwareBitmap.Convert(
- softwareBitmap, BitmapPixelFormat.Bgra8, BitmapAlphaMode.Premultiplied);
- }
-
- softwareBitmapSource = new SoftwareBitmapSource();
- await softwareBitmapSource.SetBitmapAsync(softwareBitmap);
- }
- catch (Exception ex)
- {
- _log.Error($"Error creating SoftwareBitmapSource from file path: {ex.Message}");
- }
-
- return softwareBitmapSource;
- }
-
- internal static unsafe uint GetProcessIdFromWindow(HWND hWnd)
- {
- uint processID = 0;
- _ = PInvoke.GetWindowThreadProcessId(hWnd, &processID);
- return processID;
- }
-
- internal static void TranslateUWPProcess(HWND hWnd, ref Process process)
- {
- if (process.ProcessName.Equals("ApplicationFrameHost", StringComparison.OrdinalIgnoreCase))
- {
- var processId = GetProcessIdFromUWPWindow(hWnd);
- if (processId != 0)
- {
- process = Process.GetProcessById((int)processId);
- }
- }
- }
-
- internal static unsafe uint GetProcessIdFromUWPWindow(HWND hWnd)
- {
- UWPProcessFinder processFinder = new();
- PInvoke.EnumChildWindows(hWnd, processFinder.EnumChildWindowsProc, IntPtr.Zero);
- return processFinder.UWPProcessId;
- }
-
- private sealed class UWPProcessFinder
- {
- public uint UWPProcessId { get; private set; }
-
- public unsafe BOOL EnumChildWindowsProc(HWND hWnd, LPARAM data)
- {
- var className = stackalloc char[256];
- var classNameLength = PInvoke.GetClassName(hWnd, className, 256);
- if (classNameLength > 0)
- {
- string classNameString = new(className, 0, classNameLength);
- if (classNameString.StartsWith("Windows.UI.Core.", StringComparison.OrdinalIgnoreCase))
- {
- uint hWndProcessId = 0;
- _ = PInvoke.GetWindowThreadProcessId(hWnd, &hWndProcessId);
- UWPProcessId = hWndProcessId;
- return false;
- }
- }
-
- return true;
- }
- }
-
- internal static HWINEVENTHOOK WatchWindowPositionEvents(WINEVENTPROC procDelegate, uint processID)
- {
- var eventHook = PInvoke.SetWinEventHook(
- PInvoke.EVENT_OBJECT_DESTROY,
- PInvoke.EVENT_OBJECT_LOCATIONCHANGE,
- HMODULE.Null,
- procDelegate,
- processID,
- 0,
- PInvoke.WINEVENT_OUTOFCONTEXT | PInvoke.WINEVENT_SKIPOWNPROCESS);
- return eventHook;
- }
-
- internal static HWINEVENTHOOK WatchWindowForegroundEvents(WINEVENTPROC procDelegate)
- {
- var eventHook = PInvoke.SetWinEventHook(
- PInvoke.EVENT_SYSTEM_FOREGROUND,
- PInvoke.EVENT_SYSTEM_FOREGROUND,
- HMODULE.Null,
- procDelegate,
- 0,
- 0,
- PInvoke.WINEVENT_OUTOFCONTEXT | PInvoke.WINEVENT_SKIPOWNPROCESS);
- return eventHook;
- }
-
- internal static HWINEVENTHOOK WatchWindowFocusEvents(WINEVENTPROC procDelegate, uint processID)
- {
- var eventHook = PInvoke.SetWinEventHook(
- PInvoke.EVENT_OBJECT_FOCUS,
- PInvoke.EVENT_OBJECT_FOCUS,
- HMODULE.Null,
- procDelegate,
- processID,
- 0,
- PInvoke.WINEVENT_OUTOFCONTEXT | PInvoke.WINEVENT_SKIPOWNPROCESS);
- return eventHook;
- }
-
- internal sealed class EnumWindowsData
- {
- public HWND OutHwnd { get; set; }
-
- public StringCollection? ExcludedProcesses { get; set; }
-
- public EnumWindowsData()
- {
- OutHwnd = HWND.Null;
- }
- }
-
- internal static unsafe HWND FindVisibleForegroundWindow(StringCollection excludedProcesses)
- {
- EnumWindowsData data = new() { ExcludedProcesses = excludedProcesses };
-#pragma warning disable CS8500 // This takes the address of, gets the size of, or declares a pointer to a managed type
- LPARAM lparamData = new((nint)(&data));
-#pragma warning restore CS8500 // This takes the address of, gets the size of, or declares a pointer to a managed type
- PInvoke.EnumWindows(EnumProc, lparamData);
- return data.OutHwnd;
- }
-
- internal static bool IsAcceptableWindow(HWND hWnd, StringCollection excludedProcesses)
- {
- if (excludedProcesses != null && excludedProcesses.Count > 0)
- {
- foreach (var processName in excludedProcesses)
- {
- if (processName != null && IsProcessName(hWnd, processName))
- {
- return false;
- }
- }
- }
-
- return true;
- }
-
- internal static unsafe bool IsProcessName(HWND hWnd, string name)
- {
- uint processId = 0;
- _ = PInvoke.GetWindowThreadProcessId(hWnd, &processId);
- var process = Process.GetProcessById((int)processId);
- if (string.Equals(process.ProcessName, name, StringComparison.OrdinalIgnoreCase))
- {
- return true;
- }
-
- return false;
- }
-
- internal static string GetProcessName(uint processId)
- {
- var process = Process.GetProcessById((int)processId);
- return process.ProcessName;
- }
-
- internal static void SetWindowExTransparent(HWND hwnd)
- {
- var extendedStyle = (WINDOW_EX_STYLE)PInvoke.GetWindowLong(hwnd, WINDOW_LONG_PTR_INDEX.GWL_EXSTYLE);
- _ = PInvoke.SetWindowLong(hwnd, WINDOW_LONG_PTR_INDEX.GWL_EXSTYLE, (int)(extendedStyle | WINDOW_EX_STYLE.WS_EX_TRANSPARENT));
- }
-
- internal static void SetWindowExNotTransparent(HWND hwnd)
- {
- var extendedStyle = (WINDOW_EX_STYLE)PInvoke.GetWindowLong(hwnd, WINDOW_LONG_PTR_INDEX.GWL_EXSTYLE);
- _ = PInvoke.SetWindowLong(hwnd, WINDOW_LONG_PTR_INDEX.GWL_EXSTYLE, (int)(extendedStyle & ~WINDOW_EX_STYLE.WS_EX_TRANSPARENT));
- }
-
- internal static T? FindParentControl(DependencyObject child)
- where T : DependencyObject
- {
- var parentObject = VisualTreeHelper.GetParent(child);
- if (parentObject == null)
- {
- return null;
- }
-
- if (parentObject is T parent)
- {
- return parent;
- }
- else
- {
- return FindParentControl(parentObject);
- }
- }
-
- private static RECT GetWorkAreaRect()
- {
- RECT rect = default;
- unsafe
- {
- PInvoke.SystemParametersInfo(SYSTEM_PARAMETERS_INFO_ACTION.SPI_GETWORKAREA, 0, &rect, 0);
- }
-
- return rect;
- }
-
- internal static RECT GetMonitorRectForWindow(HWND hWnd)
- {
- var monitor = PInvoke.MonitorFromWindow(hWnd, MONITOR_FROM_FLAGS.MONITOR_DEFAULTTONEAREST);
- var monitorInfo = new MONITORINFO { cbSize = (uint)Marshal.SizeOf(typeof(MONITORINFO)) };
- PInvoke.GetMonitorInfo(monitor, ref monitorInfo);
- var screenBounds = monitorInfo.rcMonitor;
- return screenBounds;
- }
-
- internal static double GetDpiScaleForWindow(HWND hWnd)
- {
- var monitor = PInvoke.MonitorFromWindow(hWnd, MONITOR_FROM_FLAGS.MONITOR_DEFAULTTONEAREST);
- PInvoke.GetScaleFactorForMonitor(monitor, out DEVICE_SCALE_FACTOR scaleFactor).ThrowOnFailure();
- return (double)scaleFactor / 100;
- }
-
- internal static void GetAppInfoUnderMouseCursor(out Process? process, out HWND hwnd)
- {
- process = null;
-
- // Grab the window under the cursor and attach to that process
- PInvoke.GetCursorPos(out var pt);
- hwnd = PInvoke.WindowFromPoint(pt);
-
- if (hwnd != HWND.Null)
- {
- // Walk up until we get the topmost parent window
- HWND hwndParent = PInvoke.GetParent(hwnd);
-
- while (hwndParent != HWND.Null)
- {
- hwnd = hwndParent;
- hwndParent = PInvoke.GetParent(hwnd);
- }
-
- var processID = WindowHelper.GetProcessIdFromWindow(hwnd);
-
- if (processID != 0)
- {
- process = Process.GetProcessById((int)processID);
- }
- }
- }
-
- // Only one ContentDialog can be shown at a time, so we have to keep track of the current one.
- private static ContentDialog? ContentDialog { get; set; }
-
- internal static async void ShowTimedMessageDialog(FrameworkElement frameworkElement, string message, string closeButtonText)
- {
- if (ContentDialog is not null)
- {
- ContentDialog.Hide();
- ContentDialog = null;
- }
-
- ContentDialog = new ContentDialog
- {
- XamlRoot = frameworkElement.XamlRoot,
- RequestedTheme = frameworkElement.ActualTheme,
- Content = message,
- CloseButtonText = closeButtonText,
- };
-
- var timer = new DispatcherTimer
- {
- Interval = TimeSpan.FromSeconds(3),
- };
- timer.Tick += (s, e) =>
- {
- timer.Stop();
- if (ContentDialog is null)
- {
- return;
- }
-
- ContentDialog.Hide();
- ContentDialog = null;
- };
-
- try
- {
- ContentDialog.Opened += (s, e) => timer.Start();
- ContentDialog.Closed += (s, e) =>
- {
- timer.Stop();
- ContentDialog = null;
- };
- await ContentDialog.ShowAsync();
- }
- catch (Exception ex)
- {
- _log.Error(ex, "Error showing timed message dialog");
- }
- }
-
- internal enum CpuArchitecture
- {
- X86,
- X64,
- ARM,
- ARM64,
- Unknown,
- }
-
- internal static CpuArchitecture GetTargetArchitecture(IMAGE_FILE_MACHINE target)
- {
- return target switch
- {
- IMAGE_FILE_MACHINE.IMAGE_FILE_MACHINE_I386 => CpuArchitecture.X86,
- IMAGE_FILE_MACHINE.IMAGE_FILE_MACHINE_AMD64 => CpuArchitecture.X64,
- IMAGE_FILE_MACHINE.IMAGE_FILE_MACHINE_ARM => CpuArchitecture.ARM,
- IMAGE_FILE_MACHINE.IMAGE_FILE_MACHINE_ARM64 => CpuArchitecture.ARM64,
- _ => CpuArchitecture.Unknown,
- };
- }
-
- internal static string GetAppArchitecture(SafeProcessHandle handle, string moduleName)
- {
- var cpuArchitecture = CommonHelper.GetLocalizedString("CpuArchitecture_Unknown");
-
- try
- {
- unsafe
- {
- IMAGE_FILE_MACHINE processInfo;
- IMAGE_FILE_MACHINE machineInfo;
- var isWow64Result = PInvoke.IsWow64Process2(handle, out processInfo, &machineInfo);
- if (isWow64Result)
- {
- var processArchitecture = GetTargetArchitecture(processInfo);
- var machineArchitecture = GetTargetArchitecture(machineInfo);
-
- // "Unknown" means this is not a WOW64 process.
- if (processArchitecture == CpuArchitecture.Unknown)
- {
- if (machineArchitecture == CpuArchitecture.X64)
- {
- // If this is an x64 machine and it's not a WOW64 process, it's an x64 process.
- cpuArchitecture = CommonHelper.GetLocalizedString("CpuArchitecture_X64onX64");
- }
- else
- {
- // If this is not an x64 machine, we need to get the process architecture from the process itself.
- var processMachineInfo = default(PROCESS_MACHINE_INFORMATION);
- var getProcInfoResult
- = PInvoke.GetProcessInformation(
- handle,
- PROCESS_INFORMATION_CLASS.ProcessMachineTypeInfo,
- &processMachineInfo,
- (uint)Marshal.SizeOf());
- if (getProcInfoResult)
- {
- // Report the process architecture and the machine architecture.
- processArchitecture = GetTargetArchitecture(processMachineInfo.ProcessMachine);
- cpuArchitecture = CommonHelper.GetLocalizedString(
- "CpuArchitecture_ProcessOnMachine", processArchitecture, machineArchitecture);
- }
- else
- {
- // If we can't get the process architecture, just report the machine architecture.
- cpuArchitecture = CommonHelper.GetLocalizedString(
- "CpuArchitecture_UnknownOnMachine", machineArchitecture);
- }
- }
- }
- else
- {
- // This is a WOW64 process, so report the process architecture and the machine architecture.
- cpuArchitecture = CommonHelper.GetLocalizedString(
- "CpuArchitecture_ProcessOnMachine", processArchitecture, machineArchitecture);
- }
- }
- }
- }
- catch (Exception ex)
- {
- _log.Error(ex, "Error getting app architecture");
- }
-
- return cpuArchitecture;
- }
-}
diff --git a/tools/DevDiagnostics/DevHome.DevDiagnostics/Helpers/WindowHooker`1.cs b/tools/DevDiagnostics/DevHome.DevDiagnostics/Helpers/WindowHooker`1.cs
deleted file mode 100644
index 0e44c2b8b9..0000000000
--- a/tools/DevDiagnostics/DevHome.DevDiagnostics/Helpers/WindowHooker`1.cs
+++ /dev/null
@@ -1,86 +0,0 @@
-// Copyright (c) Microsoft Corporation.
-// Licensed under the MIT License.
-
-using System;
-using System.Diagnostics;
-using System.Globalization;
-using System.Runtime.InteropServices;
-using Serilog;
-using Windows.Win32;
-using Windows.Win32.Foundation;
-using Windows.Win32.UI.WindowsAndMessaging;
-
-namespace DevHome.DevDiagnostics.Helpers;
-
-internal abstract class WindowHooker
-{
- private static nint SetWindowLongPtr(HWND hWnd, WINDOW_LONG_PTR_INDEX nIndex, nint newLong)
- {
- if (IntPtr.Size == 8)
- {
- return CommonInterop.SetWindowLongPtr64(hWnd, nIndex, newLong);
- }
- else
- {
- return (nint)PInvoke.SetWindowLong(hWnd, nIndex, (int)newLong);
- }
- }
-
- protected static readonly ILogger Log = Serilog.Log.ForContext("SourceContext", nameof(T));
-
- private readonly WNDPROC windowProcHook;
-
- private HWND listenerHwnd;
-
- private WNDPROC? originalWndProc;
-
- protected HWND ListenerHwnd { get => listenerHwnd; set => listenerHwnd = value; }
-
- internal WindowHooker()
- {
- windowProcHook = CustomWndProc;
- }
-
- public virtual void Start(HWND listeningWindow)
- {
- if (ListenerHwnd != HWND.Null)
- {
- // No-OP if we're already running
- Debug.Assert(ListenerHwnd == listeningWindow, "Why are we trying to start with a different hwnd?");
- return;
- }
-
- ArgumentNullException.ThrowIfNull(listeningWindow, nameof(listeningWindow));
-
- var wndproc = SetWindowLongPtr(listeningWindow, WINDOW_LONG_PTR_INDEX.GWL_WNDPROC, Marshal.GetFunctionPointerForDelegate(windowProcHook));
- if (wndproc == IntPtr.Zero)
- {
- Log.Error("SetWindowLongPtr failed: {GetLastError}", Marshal.GetLastWin32Error().ToString(CultureInfo.InvariantCulture));
- return;
- }
-
- originalWndProc = Marshal.GetDelegateForFunctionPointer(wndproc);
- ListenerHwnd = listeningWindow;
- }
-
- public virtual void Stop()
- {
- if (ListenerHwnd != HWND.Null)
- {
- Debug.Assert(originalWndProc != null, "Where did the original wndproc go?");
-
- var result = SetWindowLongPtr(ListenerHwnd, WINDOW_LONG_PTR_INDEX.GWL_WNDPROC, Marshal.GetFunctionPointerForDelegate(originalWndProc));
- if (result == IntPtr.Zero)
- {
- Log.Error("SetWindowLongPtr failed: {GetLastError}", Marshal.GetLastWin32Error().ToString(CultureInfo.InvariantCulture));
- }
-
- ListenerHwnd = HWND.Null;
- }
- }
-
- protected virtual LRESULT CustomWndProc(HWND hWnd, uint msg, WPARAM wParam, LPARAM lParam)
- {
- return PInvoke.CallWindowProc(originalWndProc, hWnd, msg, wParam, lParam);
- }
-}
diff --git a/tools/DevDiagnostics/DevHome.DevDiagnostics/Images/DD.ico b/tools/DevDiagnostics/DevHome.DevDiagnostics/Images/DD.ico
deleted file mode 100644
index 84014e6192..0000000000
Binary files a/tools/DevDiagnostics/DevHome.DevDiagnostics/Images/DD.ico and /dev/null differ
diff --git a/tools/DevDiagnostics/DevHome.DevDiagnostics/Models/AppRuntimeInfo.cs b/tools/DevDiagnostics/DevHome.DevDiagnostics/Models/AppRuntimeInfo.cs
deleted file mode 100644
index 3e701eec1a..0000000000
--- a/tools/DevDiagnostics/DevHome.DevDiagnostics/Models/AppRuntimeInfo.cs
+++ /dev/null
@@ -1,133 +0,0 @@
-// Copyright (c) Microsoft Corporation.
-// Licensed under the MIT License.
-
-using System;
-using System.Collections.Generic;
-using System.Diagnostics;
-using System.Linq;
-using System.Management;
-using System.Text.RegularExpressions;
-using CommunityToolkit.Mvvm.ComponentModel;
-using DevHome.DevDiagnostics.Helpers;
-using Microsoft.UI.Xaml;
-using Serilog;
-
-namespace DevHome.DevDiagnostics.Models;
-
-public partial class AppRuntimeInfo : ObservableObject
-{
- private static readonly ILogger _log = Log.ForContext("SourceContext", nameof(AppRuntimeInfo));
-
- private readonly string _unknownText = CommonHelper.GetLocalizedString("UnknownText");
-
- private const string UwpCommandLinePattern = @"^(.*) -ServerName:(.*?)\.AppX(.*?)\.mca$";
-
- [GeneratedRegex(UwpCommandLinePattern)]
- private static partial Regex UwpCommandLineRegex();
-
- [ObservableProperty]
- private int _processId = 0;
-
- [ObservableProperty]
- private int _basePriority = 0;
-
- [ObservableProperty]
- private int _priorityClass = 0;
-
- [ObservableProperty]
- private string _mainModuleFileName = string.Empty;
-
- [ObservableProperty]
- private string _cpuArchitecture = string.Empty;
-
- [ObservableProperty]
- private bool _isPackaged = false;
-
- [ObservableProperty]
- private bool _isRunningAsAdmin = false;
-
- [ObservableProperty]
- private bool _isRunningAsSystem = false;
-
- [ObservableProperty]
- private Visibility _visibility = Visibility.Visible;
-
- [ObservableProperty]
- private string _activationArgs = string.Empty;
-
- [ObservableProperty]
- private PackageInfo _packageInfo = new();
-
- [ObservableProperty]
- private string _identifiedFrameWorkTypes = string.Empty;
-
- private List FrameworkTypes { get; } = [];
-
- public AppRuntimeInfo()
- {
- FrameworkTypes.Add(new FrameworkType("Avalonia.Base.dll", "Avalonia"));
- FrameworkTypes.Add(new FrameworkType("DXCore.dll", "DirectX"));
- FrameworkTypes.Add(new FrameworkType("Microsoft.Maui.dll", "Maui"));
- FrameworkTypes.Add(new FrameworkType("MFC", "MFC", false));
- FrameworkTypes.Add(new FrameworkType("Python.exe", "Python"));
- FrameworkTypes.Add(new FrameworkType("Microsoft.Web.WebView2.Core.dll", "WebView2"));
- FrameworkTypes.Add(new FrameworkType("Microsoft.Windows.SDK.NET.dll", "Windows App SDK"));
- FrameworkTypes.Add(new FrameworkType("System.Windows.Forms.dll", "Windows Forms"));
- FrameworkTypes.Add(new FrameworkType("Microsoft.UI.Xaml.dll", "WinUI 2"));
- FrameworkTypes.Add(new FrameworkType("Microsoft.UI.Xaml.Controls.dll", "WinUI 3"));
- FrameworkTypes.Add(new FrameworkType("PresentationFramework.dll", "WPF"));
- }
-
- public void GetFrameworksAndCommandLine(Process process)
- {
- var identifiedFrameworks = new List();
- var modules = process.Modules;
- foreach (ProcessModule module in modules)
- {
- foreach (var item in FrameworkTypes)
- {
- if (identifiedFrameworks.Contains(item.Name))
- {
- continue;
- }
-
- if (item.IsExactMatch)
- {
- if (module.ModuleName.Equals(item.Determinator, StringComparison.OrdinalIgnoreCase))
- {
- identifiedFrameworks.Add(item.Name);
- }
- }
- else
- {
- if (module.ModuleName.Contains(item.Determinator, StringComparison.OrdinalIgnoreCase))
- {
- identifiedFrameworks.Add(item.Name);
- }
- }
- }
- }
-
- // Both WinUI2 and WinUI3 use Microsoft.UI.Xaml.dll, but only WinUI3 uses Microsoft.UI.Xaml.Controls.dll.
- if (identifiedFrameworks.Contains("WinUI 3"))
- {
- identifiedFrameworks.Remove("WinUI 2");
- }
-
- IdentifiedFrameWorkTypes = string.Join(", ", identifiedFrameworks);
-
- /* The only reliable check for (most) UWP apps is if the command-line matches the known UWP pattern.
- Examples:
- "C:\Program Files\WindowsApps\Microsoft.WindowsAlarms_11.2406.47.0_x64__8wekyb3d8bbwe\Time.exe" -ServerName:App.AppXq8avk61zazpy808ab5ppkf6taqp47km6.mca
- "C:\Program Files\WindowsApps\35455AndrewWhitechapel.uTaskManager_2309.21.1.0_x64__6rjrek5qak82t\uTaskManager.exe" -ServerName:uTaskManager.AppXjaq7n2ahxkbe1kpkhkxqhr5d0s2yr0pb.mca
- "C:\Foo\TestApps\UwpAea\UwpAea\bin\x86\Debug\AppX\UwpAea.exe" -ServerName:Blueberry.Pie.AppXnzm9t7zr5rgagha6146e9rgzyahj42xx.mca
- NOTE: does not handle the case of multi-instance UWP apps.
- */
- ActivationArgs = CommonHelper.GetCommandLine(process);
- if (UwpCommandLineRegex().IsMatch(ActivationArgs))
- {
- IdentifiedFrameWorkTypes += ", UWP";
- ActivationArgs = _unknownText;
- }
- }
-}
diff --git a/tools/DevDiagnostics/DevHome.DevDiagnostics/Models/ClipboardContents.cs b/tools/DevDiagnostics/DevHome.DevDiagnostics/Models/ClipboardContents.cs
deleted file mode 100644
index 325c1dc29c..0000000000
--- a/tools/DevDiagnostics/DevHome.DevDiagnostics/Models/ClipboardContents.cs
+++ /dev/null
@@ -1,26 +0,0 @@
-// Copyright (c) Microsoft Corporation.
-// Licensed under the MIT License.
-
-namespace DevHome.DevDiagnostics.Models;
-
-public class ClipboardContents
-{
- public string Raw { get; set; } = string.Empty;
-
- public string Hex { get; set; } = string.Empty;
-
- public string Dec { get; set; } = string.Empty;
-
- public string Code { get; set; } = string.Empty;
-
- public string Help { get; set; } = string.Empty;
-
- public void Clear()
- {
- Raw = string.Empty;
- Hex = string.Empty;
- Dec = string.Empty;
- Code = string.Empty;
- Help = string.Empty;
- }
-}
diff --git a/tools/DevDiagnostics/DevHome.DevDiagnostics/Models/ClipboardMonitor.cs b/tools/DevDiagnostics/DevHome.DevDiagnostics/Models/ClipboardMonitor.cs
deleted file mode 100644
index 48d5925567..0000000000
--- a/tools/DevDiagnostics/DevHome.DevDiagnostics/Models/ClipboardMonitor.cs
+++ /dev/null
@@ -1,187 +0,0 @@
-// Copyright (c) Microsoft Corporation.
-// Licensed under the MIT License.
-
-using System;
-using System.ComponentModel;
-using System.Globalization;
-using System.Linq;
-using System.Runtime.InteropServices;
-using System.Text.RegularExpressions;
-using System.Threading;
-using DevHome.Common.Extensions;
-using DevHome.DevDiagnostics.Helpers;
-using Microsoft.UI.Xaml;
-using Windows.Win32;
-using Windows.Win32.Foundation;
-
-namespace DevHome.DevDiagnostics.Models;
-
-internal sealed class ClipboardMonitor : WindowHooker, INotifyPropertyChanged
-{
- public static readonly ClipboardMonitor Instance = new();
-
- public ClipboardContents Contents { get; private set; } = new();
-
- public event PropertyChangedEventHandler? PropertyChanged;
-
- internal ClipboardMonitor()
- {
- }
-
- private void ClipboardChanged()
- {
- SafeHandle? h = null;
- ClipboardContents newContents = new();
- try
- {
- var clipboardText = string.Empty;
- PInvoke.OpenClipboard(ListenerHwnd);
- h = PInvoke.GetClipboardData_SafeHandle(13 /* CF_UNICODETEXT */);
- if (!h.IsInvalid)
- {
- unsafe
- {
- var p = PInvoke.GlobalLock(h);
- clipboardText = Marshal.PtrToStringUni((IntPtr)p) ?? string.Empty;
- }
-
- if (clipboardText != string.Empty)
- {
- newContents = ParseClipboardContents(clipboardText);
- }
- }
- }
- finally
- {
- if (h is not null && !h.IsInvalid)
- {
- PInvoke.GlobalUnlock(h);
-
- // You're not suppose to close this handle.
- h.SetHandleAsInvalid();
- }
-
- PInvoke.CloseClipboard();
-
- Contents = newContents;
- OnPropertyChanged(nameof(Contents));
- }
- }
-
- /* TODO This pattern matches the following:
- 100
- 0x100
- 0x80040005
- -2147221499
- -1
- 0xabc
- abc
- ffffffff
- 1de
- cab
- bee
-
- ...but sequences like "cab", "bee", "fed" could be false positives. We need
- more logic to exclude these.
- */
- private static readonly Regex _findNumbersRegex =
- new(
- pattern: @"(?:0[xX][0-9A-Fa-f]+|-?\b(?:\d+|\d*\.\d+)\b|\b[0-9A-Fa-f]+\b)",
- options: RegexOptions.Compiled | RegexOptions.IgnoreCase);
-
- private ClipboardContents ParseClipboardContents(string text)
- {
- ClipboardContents newContents = new();
-
- // If this text contains a number, show it in different number bases.
- var matches = _findNumbersRegex.Matches(text);
-
- foreach (var match in matches.Cast())
- {
- var original = match.ToString();
-
- // Assume the number is easily identifable as either base 10 or base 16... convert to int.
- int? errorAsInt = CommonHelper.ParseStringToInt(original);
-
- if (errorAsInt is null)
- {
- // If this ConvertFromString() function fails due to a bad format, update the above regex to ensure
- // the bad string isn't fed to this function.
- Log.Warning("Failed to parse \" {original} \" to a number", original);
- return newContents;
- }
-
- newContents.Raw = original;
- newContents.Hex = Convert.ToString((int)errorAsInt, 16);
- newContents.Dec = Convert.ToString((int)errorAsInt, 10);
-
- var errors = ErrorLookupHelper.LookupError((int)errorAsInt);
- if (errors is not null)
- {
- foreach (var error in errors)
- {
- // Seperate each error with a space. These errors aren't localized, so we may not need to worry
- // about the space being in the wrong place.
- if (newContents.Code != string.Empty)
- {
- newContents.Code += " ";
- newContents.Help += " ";
- }
-
- newContents.Code += error.Name;
- newContents.Help += error.Help;
- }
- }
-
- break;
- }
-
- return newContents;
- }
-
- public void Start()
- {
- var primaryWindow = Application.Current.GetService();
- Start((HWND)primaryWindow.GetWindowHandle());
- }
-
- public override void Start(HWND hwndUsedForListening)
- {
- base.Start(hwndUsedForListening);
-
- var success = PInvoke.AddClipboardFormatListener(ListenerHwnd);
- if (!success)
- {
- Log.Error("AddClipboardFormatListener failed: {GetLastError}", Marshal.GetLastWin32Error().ToString(CultureInfo.CurrentCulture));
- }
- }
-
- public override void Stop()
- {
- if (ListenerHwnd != HWND.Null)
- {
- PInvoke.RemoveClipboardFormatListener(ListenerHwnd);
-
- base.Stop();
- }
- }
-
- protected override LRESULT CustomWndProc(HWND hWnd, uint msg, WPARAM wParam, LPARAM lParam)
- {
- switch (msg)
- {
- case PInvoke.WM_CLIPBOARDUPDATE:
- {
- ThreadPool.QueueUserWorkItem((o) => ClipboardChanged());
- break;
- }
- }
-
- return base.CustomWndProc(hWnd, msg, wParam, lParam);
- }
-
- private void OnPropertyChanged(string propertyName)
- {
- PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
- }
-}
diff --git a/tools/DevDiagnostics/DevHome.DevDiagnostics/Models/FrameworkType.cs b/tools/DevDiagnostics/DevHome.DevDiagnostics/Models/FrameworkType.cs
deleted file mode 100644
index 6f36a04388..0000000000
--- a/tools/DevDiagnostics/DevHome.DevDiagnostics/Models/FrameworkType.cs
+++ /dev/null
@@ -1,28 +0,0 @@
-// Copyright (c) Microsoft Corporation.
-// Licensed under the MIT License.
-
-using CommunityToolkit.Mvvm.ComponentModel;
-
-namespace DevHome.DevDiagnostics.Models;
-
-public partial class FrameworkType : ObservableObject
-{
- internal bool IsExactMatch { get; private set; } = true;
-
- internal string Determinator
- {
- get; set;
- }
-
- public string Name
- {
- get; set;
- }
-
- public FrameworkType(string determinator, string name, bool isExactMatch = true)
- {
- Determinator = determinator;
- Name = name;
- IsExactMatch = isExactMatch;
- }
-}
diff --git a/tools/DevDiagnostics/DevHome.DevDiagnostics/Models/Insight.cs b/tools/DevDiagnostics/DevHome.DevDiagnostics/Models/Insight.cs
deleted file mode 100644
index 200c5b3ca1..0000000000
--- a/tools/DevDiagnostics/DevHome.DevDiagnostics/Models/Insight.cs
+++ /dev/null
@@ -1,71 +0,0 @@
-// Copyright (c) Microsoft Corporation.
-// Licensed under the MIT License.
-
-using System.Text.RegularExpressions;
-using CommunityToolkit.Mvvm.ComponentModel;
-using DevHome.DevDiagnostics.Controls;
-using Microsoft.UI.Xaml;
-
-namespace DevHome.DevDiagnostics.Models;
-
-public enum InsightType
-{
- Unknown,
- LockedFile,
- AccessDeniedFile,
- AccessDeniedRegistry,
- InvalidPath,
- Security,
- MemoryViolation,
-}
-
-public abstract partial class Insight : ObservableObject
-{
- public string Title { get; set; } = string.Empty;
-
- public InsightType InsightType { get; set; } = InsightType.Unknown;
-
- public UIElement? CustomControl { get; protected set; }
-
- [ObservableProperty]
- private bool _hasBeenRead;
-
- // We show the badge by default, as HasBeenRead is false by default.
- [ObservableProperty]
- private double _badgeOpacity = 1;
-}
-
-public class SimpleTextInsight : Insight
-{
- private readonly InsightSimpleTextControl _mycontrol = new();
- private string _description = string.Empty;
-
- internal string Description
- {
- get => _description;
-
- set
- {
- _description = value;
- _mycontrol.Description = value;
- }
- }
-
- internal SimpleTextInsight()
- {
- CustomControl = _mycontrol;
- }
-}
-
-internal sealed class InsightRegex
-{
- internal InsightType InsightType { get; set; }
-
- internal Regex Regex { get; set; }
-
- internal InsightRegex(InsightType type, Regex regex)
- {
- Regex = regex;
- InsightType = type;
- }
-}
diff --git a/tools/DevDiagnostics/DevHome.DevDiagnostics/Models/InstalledAppInfo.cs b/tools/DevDiagnostics/DevHome.DevDiagnostics/Models/InstalledAppInfo.cs
deleted file mode 100644
index 102bdf2f1e..0000000000
--- a/tools/DevDiagnostics/DevHome.DevDiagnostics/Models/InstalledAppInfo.cs
+++ /dev/null
@@ -1,38 +0,0 @@
-// Copyright (c) Microsoft Corporation.
-// Licensed under the MIT License.
-
-using Microsoft.UI.Xaml.Media.Imaging;
-using Windows.ApplicationModel;
-
-namespace DevHome.DevDiagnostics.Models;
-
-public class InstalledAppInfo
-{
- public string? Name { get; set; }
-
- public BitmapImage? Icon { get; set; }
-
- public string? ShortcutFilePath { get; set; }
-
- public string? TargetPath { get; set; }
-
- public string? AppUserModelId { get; set; }
-
- public Package? AppPackage { get; set; }
-
- public string? IconFilePath { get; set; }
-
- public bool IsMsix
- {
- get => AppUserModelId is not null;
-
- set
- {
- }
- }
-
- public override string ToString()
- {
- return Name ?? base.ToString()!;
- }
-}
diff --git a/tools/DevDiagnostics/DevHome.DevDiagnostics/Models/NavLink.cs b/tools/DevDiagnostics/DevHome.DevDiagnostics/Models/NavLink.cs
deleted file mode 100644
index 5065ccde6e..0000000000
--- a/tools/DevDiagnostics/DevHome.DevDiagnostics/Models/NavLink.cs
+++ /dev/null
@@ -1,30 +0,0 @@
-// Copyright (c) Microsoft Corporation.
-// Licensed under the MIT License.
-
-using System;
-
-namespace DevHome.DevDiagnostics.Models;
-
-public class NavLink
-{
- public string IconText { get; internal set; }
-
- public string ContentText { get; internal set; }
-
- public NavLink(string icon, string title)
- {
- IconText = icon;
- ContentText = title;
- }
-}
-
-public class PageNavLink : NavLink
-{
- public Type? PageViewModel { get; internal set; }
-
- public PageNavLink(string icon, string title, Type? pageViewModel)
- : base(icon, title)
- {
- PageViewModel = pageViewModel;
- }
-}
diff --git a/tools/DevDiagnostics/DevHome.DevDiagnostics/Models/PackageInfo.cs b/tools/DevDiagnostics/DevHome.DevDiagnostics/Models/PackageInfo.cs
deleted file mode 100644
index c9ccfd4da0..0000000000
--- a/tools/DevDiagnostics/DevHome.DevDiagnostics/Models/PackageInfo.cs
+++ /dev/null
@@ -1,39 +0,0 @@
-// Copyright (c) Microsoft Corporation.
-// Licensed under the MIT License.
-
-using CommunityToolkit.Mvvm.ComponentModel;
-
-namespace DevHome.DevDiagnostics.Models;
-
-public partial class PackageInfo : ObservableObject
-{
- [ObservableProperty]
- private string _fullName = string.Empty;
-
- [ObservableProperty]
- private string _version = string.Empty;
-
- [ObservableProperty]
- private string _displayName = string.Empty;
-
- [ObservableProperty]
- private string _installedDate = string.Empty;
-
- [ObservableProperty]
- private string _installedPath = string.Empty;
-
- [ObservableProperty]
- private string _publisher = string.Empty;
-
- [ObservableProperty]
- private bool _isDevelopmentMode = false;
-
- [ObservableProperty]
- private string _signatureKind = string.Empty;
-
- [ObservableProperty]
- private string _status = string.Empty;
-
- [ObservableProperty]
- private string _dependencies = string.Empty;
-}
diff --git a/tools/DevDiagnostics/DevHome.DevDiagnostics/Models/PerfCounters.cs b/tools/DevDiagnostics/DevHome.DevDiagnostics/Models/PerfCounters.cs
deleted file mode 100644
index 0aedc40658..0000000000
--- a/tools/DevDiagnostics/DevHome.DevDiagnostics/Models/PerfCounters.cs
+++ /dev/null
@@ -1,230 +0,0 @@
-// Copyright (c) Microsoft Corporation.
-// Licensed under the MIT License.
-
-using System;
-using System.Collections.Generic;
-using System.ComponentModel;
-using System.Diagnostics;
-using System.Linq;
-using System.Threading;
-using CommunityToolkit.Mvvm.ComponentModel;
-using Serilog;
-
-namespace DevHome.DevDiagnostics.Models;
-
-public partial class PerfCounters : ObservableObject, IDisposable
-{
- private static readonly ILogger _log = Log.ForContext("SourceContext", nameof(PerfCounters));
-
- public static readonly PerfCounters Instance = new();
-
- private const string ProcessCategory = "Process";
- private const string ProcessorCategory = "Processor Information";
- private const string MemoryCategory = "Memory";
- private const string DiskCategory = "PhysicalDisk";
-
- private const string CpuCounterName = "% Processor Time";
- private const string RamCounterName = "Working Set - Private";
- private const string SystemCpuCounterName = "% Processor Utility";
- private const string SystemRamCounterName = "Committed Bytes";
- private const string SystemDiskCounterName = "% Disk Time";
-
- private const string ReadCounterName = "IO Read Bytes/sec";
- private const string WriteCounterName = "IO Write Bytes/sec";
- private const string GpuEngineName = "GPU Engine";
- private const string UtilizationPercentageName = "Utilization Percentage";
-
- private Process? _targetProcess;
- private PerformanceCounter? _cpuCounter;
- private List? _gpuCounters;
- private PerformanceCounter? _ramCounter;
- private PerformanceCounter? _readCounter;
- private PerformanceCounter? _writeCounter;
-
- private PerformanceCounter? _systemCpuCounter;
- private PerformanceCounter? _systemRamCounter;
- private PerformanceCounter? _systemDiskCounter;
-
- private Timer? _timer;
-
- [ObservableProperty]
- private float _cpuUsage;
-
- [ObservableProperty]
- private float _gpuUsage;
-
- [ObservableProperty]
- private float _ramUsageInMB;
-
- [ObservableProperty]
- private float _diskUsage;
-
- [ObservableProperty]
- private float _networkUsage;
-
- [ObservableProperty]
- private float _systemCpuUsage;
-
- [ObservableProperty]
- private float _systemRamUsageInGB;
-
- [ObservableProperty]
- private float _systemDiskUsage;
-
- public PerfCounters()
- {
- TargetAppData.Instance.PropertyChanged += TargetApp_PropertyChanged;
-
- ThreadPool.QueueUserWorkItem((o) =>
- {
- _systemCpuCounter = new PerformanceCounter(ProcessorCategory, SystemCpuCounterName, "_Total", true);
- _systemRamCounter = new PerformanceCounter(MemoryCategory, SystemRamCounterName, true);
- _systemDiskCounter = new PerformanceCounter(DiskCategory, SystemDiskCounterName, "_Total", true);
- UpdateTargetProcess(TargetAppData.Instance.TargetProcess);
- });
- }
-
- private void TargetApp_PropertyChanged(object? sender, PropertyChangedEventArgs e)
- {
- if (e.PropertyName == nameof(TargetAppData.TargetProcess))
- {
- ThreadPool.QueueUserWorkItem((o) => UpdateTargetProcess(TargetAppData.Instance.TargetProcess));
- }
- else if (e.PropertyName == nameof(TargetAppData.HasExited))
- {
- CloseTargetCounters();
- }
- }
-
- private void UpdateTargetProcess(Process? process)
- {
- if (process == _targetProcess)
- {
- // Already tracking this process.
- return;
- }
-
- CloseTargetCounters();
-
- _targetProcess = process;
- if (_targetProcess == null)
- {
- return;
- }
-
- var processName = _targetProcess.ProcessName;
- _cpuCounter = new PerformanceCounter(ProcessCategory, CpuCounterName, processName, true);
- _ramCounter = new PerformanceCounter(ProcessCategory, RamCounterName, processName, true);
- _gpuCounters = GetGpuCounters(_targetProcess.Id);
- _readCounter = new PerformanceCounter(ProcessCategory, ReadCounterName, processName, true);
- _writeCounter = new PerformanceCounter(ProcessCategory, WriteCounterName, processName, true);
- }
-
- public void Start()
- {
- Stop();
- _timer = new Timer(TimerCallback, null, TimeSpan.Zero, TimeSpan.FromSeconds(1));
- }
-
- public void Stop()
- {
- _timer?.Dispose();
- _timer = null;
- }
-
- private void CloseTargetCounters()
- {
- _cpuCounter?.Close();
- _cpuCounter?.Dispose();
- _cpuCounter = null;
- _ramCounter?.Close();
- _ramCounter?.Dispose();
- _ramCounter = null;
-
- foreach (var counter in _gpuCounters ?? Enumerable.Empty())
- {
- counter.Close();
- counter.Dispose();
- }
-
- _gpuCounters?.Clear();
-
- _readCounter?.Close();
- _readCounter?.Dispose();
- _readCounter = null;
- _writeCounter?.Close();
- _writeCounter?.Dispose();
- _writeCounter = null;
- }
-
- public static List GetGpuCounters(int pid)
- {
- var category = new PerformanceCounterCategory(GpuEngineName);
- var counterNames = category.GetInstanceNames();
- var gpuCounters = counterNames
- .Where(counterName => counterName.Contains($"pid_{pid}"))
- .SelectMany(category.GetCounters)
- .Where(counter => counter.CounterName.Equals(UtilizationPercentageName, StringComparison.Ordinal))
- .ToList();
- return gpuCounters;
- }
-
- private void TimerCallback(object? state)
- {
- try
- {
- CpuUsage = _cpuCounter?.NextValue() / Environment.ProcessorCount ?? 0;
- GpuUsage = GetGpuUsage(_gpuCounters);
-
- // Report app memory usage in MB
- RamUsageInMB = _ramCounter?.NextValue() / (1024 * 1024) ?? 0;
-
- var readBytesPerSec = _readCounter?.NextValue() ?? 0;
- var writeBytesPerSec = _writeCounter?.NextValue() ?? 0;
- var totalDiskBytesPerSec = readBytesPerSec + writeBytesPerSec;
- DiskUsage = totalDiskBytesPerSec / (1024 * 1024);
-
- SystemCpuUsage = _systemCpuCounter?.NextValue() ?? 0;
-
- // Report system memory usage in GB
- SystemRamUsageInGB = _systemRamCounter?.NextValue() / (1024 * 1024 * 1024) ?? 0;
- SystemDiskUsage = _systemDiskCounter?.NextValue() ?? 0;
- }
- catch (Exception ex)
- {
- _log.Debug(ex, "Failed to update counters.");
- }
- }
-
- public static float GetGpuUsage(List? gpuCounters)
- {
- float result = 0;
- try
- {
- gpuCounters?.ForEach(x => x.NextValue());
- Thread.Sleep(500);
- result = gpuCounters?.Sum(x => x.NextValue()) ?? 0;
- }
- catch (Exception ex)
- {
- _log.Debug(ex, "Failed to get Gpu usage.");
- }
-
- return result;
- }
-
- public void Dispose()
- {
- _cpuCounter?.Dispose();
- _ramCounter?.Dispose();
- _readCounter?.Dispose();
- _writeCounter?.Dispose();
-
- foreach (var counter in _gpuCounters ?? Enumerable.Empty())
- {
- counter.Dispose();
- }
-
- GC.SuppressFinalize(this);
- }
-}
diff --git a/tools/DevDiagnostics/DevHome.DevDiagnostics/Models/ProcessModuleInfo.cs b/tools/DevDiagnostics/DevHome.DevDiagnostics/Models/ProcessModuleInfo.cs
deleted file mode 100644
index f3cff12e8d..0000000000
--- a/tools/DevDiagnostics/DevHome.DevDiagnostics/Models/ProcessModuleInfo.cs
+++ /dev/null
@@ -1,41 +0,0 @@
-// Copyright (c) Microsoft Corporation.
-// Licensed under the MIT License.
-
-using System.Diagnostics;
-using System.IO;
-
-namespace DevHome.DevDiagnostics.Models;
-
-public class ProcessModuleInfo
-{
- public string ModuleName { get; }
-
- public string FileVersionInfo { get; }
-
- public string FileVersion { get; }
-
- public nint BaseAddress { get; }
-
- public nint EntryPointAddress { get; }
-
- public int ModuleMemorySize { get; }
-
- public ProcessModuleInfo(ProcessModule module)
- {
- ModuleName = module.ModuleName;
- try
- {
- FileVersionInfo = module.FileVersionInfo.ToString();
- FileVersion = module.FileVersionInfo.FileVersion ?? string.Empty;
- }
- catch (FileNotFoundException)
- {
- FileVersionInfo = string.Empty;
- FileVersion = string.Empty;
- }
-
- BaseAddress = module.BaseAddress;
- EntryPointAddress = module.EntryPointAddress;
- ModuleMemorySize = module.ModuleMemorySize;
- }
-}
diff --git a/tools/DevDiagnostics/DevHome.DevDiagnostics/Models/RestoreState.cs b/tools/DevDiagnostics/DevHome.DevDiagnostics/Models/RestoreState.cs
deleted file mode 100644
index 1e1206a6eb..0000000000
--- a/tools/DevDiagnostics/DevHome.DevDiagnostics/Models/RestoreState.cs
+++ /dev/null
@@ -1,21 +0,0 @@
-// Copyright (c) Microsoft Corporation.
-// Licensed under the MIT License.
-
-using Microsoft.UI.Xaml.Controls;
-
-namespace DevHome.DevDiagnostics.Models;
-
-internal sealed class RestoreState
-{
- internal double Left { get; set; }
-
- internal double Top { get; set; }
-
- internal double Width { get; set; }
-
- internal double Height { get; set; }
-
- internal Orientation BarOrientation { get; set; }
-
- internal bool IsLargePanelVisible { get; set; }
-}
diff --git a/tools/DevDiagnostics/DevHome.DevDiagnostics/Models/Setting.cs b/tools/DevDiagnostics/DevHome.DevDiagnostics/Models/Setting.cs
deleted file mode 100644
index 0eeed2d7c9..0000000000
--- a/tools/DevDiagnostics/DevHome.DevDiagnostics/Models/Setting.cs
+++ /dev/null
@@ -1,23 +0,0 @@
-// Copyright (c) Microsoft Corporation.
-// Licensed under the MIT License.
-
-namespace DevHome.DevDiagnostics.Models;
-
-public class Setting
-{
- public string Path { get; }
-
- public string Header { get; }
-
- public string Description { get; }
-
- public string Glyph { get; }
-
- public Setting(string path, string header, string description, string glyph)
- {
- Path = path;
- Header = header;
- Description = description;
- Glyph = glyph;
- }
-}
diff --git a/tools/DevDiagnostics/DevHome.DevDiagnostics/Models/TargetAppData.cs b/tools/DevDiagnostics/DevHome.DevDiagnostics/Models/TargetAppData.cs
deleted file mode 100644
index a42ca63520..0000000000
--- a/tools/DevDiagnostics/DevHome.DevDiagnostics/Models/TargetAppData.cs
+++ /dev/null
@@ -1,170 +0,0 @@
-// Copyright (c) Microsoft Corporation.
-// Licensed under the MIT License.
-
-using System;
-using System.ComponentModel;
-using System.Diagnostics;
-using System.Drawing;
-using System.Security.Principal;
-using CommunityToolkit.Mvvm.ComponentModel;
-using Microsoft.UI.Xaml.Media.Imaging;
-using Microsoft.Win32.SafeHandles;
-using Windows.Win32;
-using Windows.Win32.Foundation;
-using static DevHome.DevDiagnostics.Helpers.WindowHelper;
-
-namespace DevHome.DevDiagnostics.Models;
-
-public partial class TargetAppData : ObservableObject
-{
- public static readonly TargetAppData Instance = new();
-
- public int ProcessId => TargetProcess?.Id ?? 0;
-
- public bool IsRunningAsSystem => TargetProcess?.SessionId == 0;
-
- public string Title { get; private set; } = string.Empty;
-
- public bool IsRunningAsAdmin
- {
- get
- {
- try
- {
- SafeFileHandle processToken;
- var result = PInvoke.OpenProcessToken(TargetProcess?.SafeHandle, Windows.Win32.Security.TOKEN_ACCESS_MASK.TOKEN_QUERY, out processToken);
- if (result != 0)
- {
- var identity = new WindowsIdentity(processToken.DangerousGetHandle());
- return identity?.Owner?.IsWellKnown(WellKnownSidType.BuiltinAdministratorsSid) ?? false;
- }
-
- return false;
- }
- catch (Win32Exception ex)
- {
- if (ex.NativeErrorCode == (int)WIN32_ERROR.ERROR_ACCESS_DENIED)
- {
- return true;
- }
-
- return false;
- }
- }
- }
-
- [ObservableProperty]
- private SoftwareBitmapSource? _icon;
-
- [ObservableProperty]
- private string _appName = string.Empty;
-
- [ObservableProperty]
- [NotifyPropertyChangedFor(nameof(ProcessId))]
- private Process? _targetProcess;
-
- internal HWND HWnd { get; private set; }
-
- [ObservableProperty]
- private bool _hasExited;
-
- private async void GetBitmap(Process process, HWND hWnd)
- {
- try
- {
- Bitmap? bitmap = null;
-
- if (hWnd != HWND.Null)
- {
- // First check if we can get an icon from the HWND
- bitmap = GetAppIcon(hWnd);
- }
-
- if (bitmap is null && process.MainWindowHandle != HWND.Null)
- {
- // If not, try and grab an icon from the process's main window
- bitmap = GetAppIcon((HWND)process.MainWindowHandle);
- }
-
- if (bitmap is null && process.MainModule is not null)
- {
- // Failing that, try and get the icon from the exe
- bitmap = System.Drawing.Icon.ExtractAssociatedIcon(process.MainModule.FileName)?.ToBitmap();
- }
-
- // Failing that, grab the default app icon
- bitmap ??= System.Drawing.Icon.FromHandle(LoadDefaultAppIcon()).ToBitmap();
-
- if (bitmap is not null)
- {
- Icon = await GetWinUI3BitmapSourceFromGdiBitmap(bitmap);
- }
- else
- {
- Icon = null;
- }
- }
- catch
- {
- Icon = null;
- }
-
- return;
- }
-
- private bool IsAppHost(string appName)
- {
- return string.Equals(appName, "ApplicationFrameHost", StringComparison.OrdinalIgnoreCase);
- }
-
- internal void SetNewAppData(Process process, HWND hWnd)
- {
- TargetProcess = process;
- HWnd = hWnd;
-
- // Reset hasExited, but don't trigger the property change event.
-#pragma warning disable MVVMTK0034 // Direct field reference to [ObservableProperty] backing field
- _hasExited = false;
-#pragma warning restore MVVMTK0034 // Direct field reference to [ObservableProperty] backing field
- try
- {
- // These can throw if we don't have permissions to monitor process state.
- TargetProcess.EnableRaisingEvents = true;
- TargetProcess.Exited += TargetProcess_Exited;
- }
- catch
- {
- }
-
- Title = GetWindowTitle(hWnd) ?? TargetProcess.MainWindowTitle;
-
- // Getting the icon will be async
- GetBitmap(process, hWnd);
-
- AppName = IsAppHost(TargetProcess.ProcessName) ? Title : TargetProcess.ProcessName;
-
- OnPropertyChanged(nameof(AppName));
- OnPropertyChanged(nameof(TargetProcess));
- OnPropertyChanged(nameof(HWnd));
- }
-
- internal void ClearAppData()
- {
- Title = string.Empty;
- AppName = string.Empty;
- Icon = null;
- TargetProcess?.Dispose();
- TargetProcess = null;
-
- OnPropertyChanged(nameof(AppName));
- OnPropertyChanged(nameof(TargetProcess));
- OnPropertyChanged(nameof(HWnd));
- OnPropertyChanged(nameof(Icon));
- }
-
- private void TargetProcess_Exited(object? sender, EventArgs e)
- {
- // Change the property, so that we trigger the property change event.
- HasExited = true;
- }
-}
diff --git a/tools/DevDiagnostics/DevHome.DevDiagnostics/Models/ThemeName.cs b/tools/DevDiagnostics/DevHome.DevDiagnostics/Models/ThemeName.cs
deleted file mode 100644
index 0ee4e8891a..0000000000
--- a/tools/DevDiagnostics/DevHome.DevDiagnostics/Models/ThemeName.cs
+++ /dev/null
@@ -1,23 +0,0 @@
-// Copyright (c) Microsoft Corporation.
-// Licensed under the MIT License.
-
-using System.Collections.Generic;
-using Microsoft.UI.Xaml;
-
-namespace DevHome.DevDiagnostics.Models;
-
-public class ThemeName
-{
- public string Name { get; set; } = string.Empty;
-
- public ElementTheme Theme { get; set; }
-
- public ThemeName(string name, ElementTheme theme) => (Name, Theme) = (name, theme);
-
- public static List Themes { get; private set; } =
- [
- new ThemeName("Light", ElementTheme.Light),
- new ThemeName("Dark", ElementTheme.Dark),
- new ThemeName("Default", ElementTheme.Default)
- ];
-}
diff --git a/tools/DevDiagnostics/DevHome.DevDiagnostics/Models/WERAnalysis.cs b/tools/DevDiagnostics/DevHome.DevDiagnostics/Models/WERAnalysis.cs
deleted file mode 100644
index 95563c7f55..0000000000
--- a/tools/DevDiagnostics/DevHome.DevDiagnostics/Models/WERAnalysis.cs
+++ /dev/null
@@ -1,114 +0,0 @@
-// Copyright (c) Microsoft Corporation.
-// Licensed under the MIT License.
-
-using System;
-using System.Diagnostics;
-using System.IO;
-using System.Text.RegularExpressions;
-using DevHome.DevDiagnostics.Helpers;
-using Serilog;
-
-namespace DevHome.DevDiagnostics.Models;
-
-// This class holds the WER analysis from a single dump analysis tool
-public class WERAnalysis
-{
- private static readonly ILogger _log = Log.ForContext("SourceContext", nameof(WERAnalysis));
-
- public Tool AnalysisTool { get; private set; }
-
- public string? Analysis { get; private set; }
-
- public string? FailureBucket { get; private set; }
-
- private readonly string _crashDumpPath;
-
- public WERAnalysis(Tool analysisTool, string crashDumpPath)
- {
- AnalysisTool = analysisTool;
- _crashDumpPath = crashDumpPath;
- }
-
- public void Run()
- {
- // See if we have a cached analysis
- var analysisFilePath = GetCachedResultsFileName();
-
- if (File.Exists(analysisFilePath))
- {
- Analysis = File.ReadAllText(analysisFilePath);
- }
- else
- {
- // Generate the analysis
- ToolLaunchOptions options = new();
- options.CommandLineParams = _crashDumpPath;
- options.RedirectStandardOut = true;
-
- AnalysisTool.Invoke(options);
-
- if (options.LaunchedProcess is not null)
- {
- string output = options.LaunchedProcess.StandardOutput.ReadToEnd();
- Analysis = output;
-
- try
- {
- // Cache these results
- File.WriteAllText(analysisFilePath, output);
- }
- catch (Exception ex)
- {
- // If we can't write the file, we'll just ignore it.
- // We'll just have to re-analyze the next time.
- _log.Warning("Failed to cache analysis results - " + ex.ToString());
- }
- }
- }
-
- if (!string.IsNullOrEmpty(Analysis))
- {
- ExternalTool? debuggerTool = AnalysisTool as ExternalTool;
-
- Debug.Assert(debuggerTool is not null, "We should only be running external tools on dumps");
-
- // Apply the tool's regular expression to get the failure bucket
-
- // From MSDN
- // When using System.Text.RegularExpressions to process untrusted input, pass a time -out value to prevent malicious
- // users from causing a denial - of - service attack. A time-out value specifies how long a pattern - matching method
- // should try to find a match before it times out.
- //
- // Only let the regex run for a max of 30 seconds...
- Regex regex = new(debuggerTool.ExtraInfo, RegexOptions.Compiled, new TimeSpan(0, 0, 30));
- Match match = regex.Match(Analysis);
-
- if (match.Success)
- {
- FailureBucket = match.Groups[1].Value;
- }
- }
- }
-
- private string GetCachedResultsFileName()
- {
- return _crashDumpPath + "." + AnalysisTool.Name + ".analysisresults";
- }
-
- public void RemoveCachedResults()
- {
- var analysisFilePath = GetCachedResultsFileName();
-
- if (File.Exists(analysisFilePath))
- {
- try
- {
- File.Delete(analysisFilePath);
- }
- catch (Exception ex)
- {
- _log.Warning("Failed to delete cache analysis results - " + ex.ToString());
- }
- }
- }
-}
diff --git a/tools/DevDiagnostics/DevHome.DevDiagnostics/Models/WERAnalysisReport.cs b/tools/DevDiagnostics/DevHome.DevDiagnostics/Models/WERAnalysisReport.cs
deleted file mode 100644
index cbe0e34205..0000000000
--- a/tools/DevDiagnostics/DevHome.DevDiagnostics/Models/WERAnalysisReport.cs
+++ /dev/null
@@ -1,79 +0,0 @@
-// Copyright (c) Microsoft Corporation.
-// Licensed under the MIT License.
-
-using System.Collections.Generic;
-using System.Collections.ObjectModel;
-using System.Diagnostics;
-using CommunityToolkit.Mvvm.ComponentModel;
-using DevHome.Common.Extensions;
-using DevHome.DevDiagnostics.Helpers;
-using Microsoft.UI.Xaml;
-
-namespace DevHome.DevDiagnostics.Models;
-
-// This class contains a collection of all of the analysis reports generated by the
-// different tools that are registered as crash analyzers
-public partial class WERAnalysisReport : ObservableObject
-{
- private readonly ExternalToolsHelper _externalTools;
- private readonly Dictionary _toolAnalyses = new();
-
- public WERReport Report { get; }
-
- // While we can have multiple failure buckets (1 from each tool), we have a "chosen" one here
- // that we can bind to for the UI
- [ObservableProperty]
- private string _failureBucket = string.Empty;
-
- public ReadOnlyDictionary ToolAnalyses { get; private set; }
-
- public WERAnalysisReport(WERReport report)
- {
- Report = report;
- ToolAnalyses = new(_toolAnalyses);
- _externalTools = Application.Current.GetService();
- FailureBucket = report.FailureBucket;
- }
-
- public void SetFailureBucketTool(Tool? tool)
- {
- if (tool is null)
- {
- // Resetting to the internal failure bucket
- FailureBucket = Report.FailureBucket;
- return;
- }
-
- if (_toolAnalyses.TryGetValue(tool, out WERAnalysis? analysis))
- {
- FailureBucket = string.IsNullOrEmpty(analysis.FailureBucket) ? string.Empty : analysis.FailureBucket;
- }
- else
- {
- FailureBucket = string.Empty;
- }
- }
-
- public void RunToolAnalysis(Tool tool)
- {
- Debug.Assert(tool.Type.HasFlag(ToolType.DumpAnalyzer), "We should only be running dump analyzers on dumps - Not " + tool.Type);
-
- WERAnalysis analysis = new(tool, Report.CrashDumpPath);
- analysis.Run();
- if (analysis.Analysis is not null)
- {
- _toolAnalyses.Add(tool, analysis);
- }
- }
-
- public void RemoveToolAnalysis(Tool tool)
- {
- Debug.Assert(tool.Type.HasFlag(ToolType.DumpAnalyzer), "We should only be running dump analyzers on dumps - Not " + tool.Type);
-
- if (_toolAnalyses.TryGetValue(tool, out WERAnalysis? analysis))
- {
- analysis.RemoveCachedResults();
- _toolAnalyses.Remove(tool);
- }
- }
-}
diff --git a/tools/DevDiagnostics/DevHome.DevDiagnostics/Models/WERAnalyzer.cs b/tools/DevDiagnostics/DevHome.DevDiagnostics/Models/WERAnalyzer.cs
deleted file mode 100644
index 2ecc366177..0000000000
--- a/tools/DevDiagnostics/DevHome.DevDiagnostics/Models/WERAnalyzer.cs
+++ /dev/null
@@ -1,187 +0,0 @@
-// Copyright (c) Microsoft Corporation.
-// Licensed under the MIT License.
-
-using System;
-using System.Collections.Concurrent;
-using System.Collections.Generic;
-using System.Collections.ObjectModel;
-using System.Collections.Specialized;
-using System.Linq;
-using System.Threading;
-using DevHome.Common.Extensions;
-using DevHome.DevDiagnostics.Helpers;
-using Microsoft.UI.Xaml;
-
-namespace DevHome.DevDiagnostics.Models;
-
-// This class monitors for WER reports and runs analysis on them
-public class WERAnalyzer : IDisposable
-{
- private readonly WERHelper _werHelper;
- private readonly ExternalToolsHelper _externalToolsHelper;
-
- private struct AnalysisRequest
- {
- public WERAnalysisReport Report;
- public Tool Tool;
- }
-
- private readonly BlockingCollection _analysisRequests = new();
-
- private readonly ObservableCollection _werAnalysisReports = [];
-
- public ReadOnlyObservableCollection WERAnalysisReports { get; private set; }
-
- private readonly ObservableCollection _registeredAnalysisTools = [];
-
- public ReadOnlyObservableCollection RegisteredAnalysisTools { get; private set; }
-
- public WERAnalyzer()
- {
- WERAnalysisReports = new(_werAnalysisReports);
- RegisteredAnalysisTools = new(_registeredAnalysisTools);
-
- _externalToolsHelper = Application.Current.GetService();
-
- _werHelper = Application.Current.GetService();
- ((INotifyCollectionChanged)_werHelper.WERReports).CollectionChanged += WER_CollectionChanged;
-
- // Collect all of the tools used for dump analysis
- foreach (Tool tool in _externalToolsHelper.AllExternalTools)
- {
- if (tool.Type.HasFlag(ToolType.DumpAnalyzer))
- {
- _registeredAnalysisTools.Add(tool);
- }
- }
-
- ((INotifyCollectionChanged)_externalToolsHelper.AllExternalTools).CollectionChanged += AllExternalTools_CollectionChanged;
- PopulateCurrentLogs();
-
- // Create a dedicated thread to serially perform all of our crash dump analysis
- var crashDumpAnalyzerThread = new Thread(() =>
- {
- while (!_analysisRequests.IsCompleted)
- {
- if (_analysisRequests.TryTake(out AnalysisRequest request, Timeout.Infinite))
- {
- request.Report.RunToolAnalysis(request.Tool);
- }
- }
- });
- crashDumpAnalyzerThread.Name = "CrashDumpAnalyzerThread";
- crashDumpAnalyzerThread.Start();
- }
-
- private void AllExternalTools_CollectionChanged(object? sender, NotifyCollectionChangedEventArgs e)
- {
- // If we have a new tool, we'll want to perform analysis on the crash dump
- // with it.
- if (e.Action == NotifyCollectionChangedAction.Add && e.NewItems is not null)
- {
- List newAnalysisTools = new();
-
- foreach (Tool tool in e.NewItems)
- {
- if (tool.Type.HasFlag(ToolType.DumpAnalyzer))
- {
- _registeredAnalysisTools.Add(tool);
- newAnalysisTools.Add(tool);
- }
- }
-
- foreach (var report in _werAnalysisReports)
- {
- RunToolAnalysis(report, newAnalysisTools);
- }
- }
-
- // Or if we removed a tool, remove the analysis that it did.
- else if (e.Action == NotifyCollectionChangedAction.Remove && e.OldItems is not null)
- {
- foreach (Tool tool in e.OldItems)
- {
- if (tool.Type.HasFlag(ToolType.DumpAnalyzer))
- {
- _registeredAnalysisTools.Remove(tool);
-
- foreach (var report in _werAnalysisReports)
- {
- report.RemoveToolAnalysis(tool);
- }
- }
- }
- }
- }
-
- private void WER_CollectionChanged(object? sender, NotifyCollectionChangedEventArgs e)
- {
- if (e.Action == NotifyCollectionChangedAction.Add && e.NewItems != null)
- {
- ProcessDumpList(e.NewItems.Cast().ToList());
- }
- }
-
- private void PopulateCurrentLogs()
- {
- ProcessDumpList(_werHelper.WERReports.ToList());
- }
-
- private void ProcessDumpList(List reports)
- {
- List reportsToAnalyze = new();
-
- // First publish all of these reports to our listeners. Then we'll go back and perform
- // analysis on them.
- foreach (var report in reports)
- {
- var reportAnalysis = new WERAnalysisReport(report);
-
- _werAnalysisReports.Add(reportAnalysis);
- reportsToAnalyze.Add(reportAnalysis);
-
- // When the crash dump path changes, we'll want to perform analysis on it.
- report.PropertyChanged += (sender, e) =>
- {
- if (e.PropertyName == nameof(WERReport.CrashDumpPath))
- {
- RunToolAnalysis(reportAnalysis, RegisteredAnalysisTools.ToList());
- }
- };
- }
-
- List tools = RegisteredAnalysisTools.ToList();
- foreach (var reportAnalysis in reportsToAnalyze)
- {
- RunToolAnalysis(reportAnalysis, tools);
- }
- }
-
- private void RunToolAnalysis(WERAnalysisReport report, List tools)
- {
- if (string.IsNullOrEmpty(report.Report.CrashDumpPath))
- {
- // We need a crash dump to perform an analysis
- return;
- }
-
- foreach (Tool tool in tools)
- {
- AnalysisRequest request = new()
- {
- Report = report,
- Tool = tool,
- };
-
- // Queue the request that will be processed on a separate thread
- _analysisRequests.Add(request);
- }
- }
-
- public void Dispose()
- {
- _analysisRequests.CompleteAdding();
- _analysisRequests.Dispose();
- GC.SuppressFinalize(this);
- }
-}
diff --git a/tools/DevDiagnostics/DevHome.DevDiagnostics/Models/WERHelper.cs b/tools/DevDiagnostics/DevHome.DevDiagnostics/Models/WERHelper.cs
deleted file mode 100644
index 57ac2f32d6..0000000000
--- a/tools/DevDiagnostics/DevHome.DevDiagnostics/Models/WERHelper.cs
+++ /dev/null
@@ -1,438 +0,0 @@
-// Copyright (c) Microsoft Corporation.
-// Licensed under the MIT License.
-
-using System;
-using System.Collections.Generic;
-using System.Collections.ObjectModel;
-using System.ComponentModel;
-using System.Diagnostics;
-using System.Diagnostics.Eventing.Reader;
-using System.Globalization;
-using System.IO;
-using System.Threading;
-using DevHome.DevDiagnostics.Helpers;
-using Microsoft.Win32;
-using Serilog;
-
-namespace DevHome.DevDiagnostics.Models;
-
-/*
- * This class is responsible for monitoring the system for WER reports. These reports are generated when an application crashes.
- * Additionally it can be used to enable/disable local WER collection for a specific app. To learn more about local WER collection,
- * check out https://learn.microsoft.com/windows/win32/wer/collecting-user-mode-dumps
- *
- * We learn about WER events from either events in the Application event log or from crash dump files on disk.
- */
-
-internal sealed class WERHelper : IDisposable
-{
- private const string WERSubmissionQuery = "(*[System[Provider[@Name=\"Application Error\"]]] and *[System[EventID=1000]])";
- private const string WERReceiveQuery = "(*[System[Provider[@Name=\"Application Error\"]]] and *[System[EventID=1001]])";
- private const string DefaultDumpPath = "%LOCALAPPDATA%\\CrashDumps";
-
- private static readonly ILogger _log = Log.ForContext("SourceContext", nameof(WERHelper));
-
- private readonly Microsoft.UI.Dispatching.DispatcherQueue _dispatcher;
- private readonly EventLogWatcher _eventLogWatcher;
- private readonly List _filesystemWatchers = [];
- private readonly ObservableCollection _werReports = [];
-
- private List _werLocations = [];
- private bool _isRunning;
-
- public ReadOnlyObservableCollection WERReports { get; private set; }
-
- public WERHelper()
- {
- _dispatcher = Microsoft.UI.Dispatching.DispatcherQueue.GetForCurrentThread();
-
- WERReports = new(_werReports);
-
- // Subscribe for Application events matching the processName.
- EventLogQuery subscriptionQuery = new EventLogQuery("Application", PathType.LogName, WERSubmissionQuery);
- _eventLogWatcher = new EventLogWatcher(subscriptionQuery);
- _eventLogWatcher.EventRecordWritten += new EventHandler(EventLogEventRead);
- }
-
- public void Start()
- {
- if (!_isRunning)
- {
- // We get WER events from both the EventLog and from crash dump files on disk. Spin off threads
- // to look for existing crash dump files and existing event log events.
- ThreadPool.QueueUserWorkItem((o) =>
- {
- _werLocations = GetWERLocations();
- ReadLocalWERReports();
- EnableFileSystemWatchers();
- });
-
- ThreadPool.QueueUserWorkItem((o) =>
- {
- ReadWERReportsFromEventLog();
- });
-
- _eventLogWatcher.Enabled = true;
-
- _isRunning = true;
- }
- }
-
- public void Stop()
- {
- if (_isRunning)
- {
- _eventLogWatcher.Enabled = false;
- _isRunning = false;
- DisableFileSystemWatchers();
- }
- }
-
- public void Dispose()
- {
- _eventLogWatcher.Dispose();
- GC.SuppressFinalize(this);
- }
-
- // Callback that fires when we have a new EventLog message
- public void EventLogEventRead(object? obj, EventRecordWrittenEventArgs eventArg)
- {
- var eventRecord = eventArg.EventRecord;
- if (eventRecord != null)
- {
- if (eventRecord.Id == 1000 && eventRecord.ProviderName.Equals("Application Error", StringComparison.OrdinalIgnoreCase))
- {
- var filePath = eventRecord.Properties[10].Value.ToString() ?? string.Empty;
- var timeGenerated = eventRecord.TimeCreated ?? DateTime.Now;
- var moduleName = eventRecord.Properties[3].Value.ToString() ?? string.Empty;
- var executable = eventRecord.Properties[0].Value.ToString() ?? string.Empty;
- var eventGuid = eventRecord.Properties[12].Value.ToString() ?? string.Empty;
- var description = eventRecord.FormatDescription();
- var pid = eventRecord.Properties[8].Value.ToString() ?? string.Empty;
-
- FindOrCreateWEREntryFromEventLog(filePath, timeGenerated, moduleName, executable, eventGuid, description, pid);
- }
- }
- }
-
- private void ReadWERReportsFromEventLog()
- {
- var query = new EventLogQuery("Application", PathType.LogName, WERSubmissionQuery);
- using var reader = new EventLogReader(query);
- EventRecord? eventRecord;
- while ((eventRecord = reader.ReadEvent()) is not null)
- {
- var filePath = eventRecord.Properties[10].Value.ToString() ?? string.Empty;
- var timeGenerated = eventRecord.TimeCreated ?? DateTime.Now;
- var moduleName = eventRecord.Properties[3].Value.ToString() ?? string.Empty;
- var executable = eventRecord.Properties[0].Value.ToString() ?? string.Empty;
- var eventGuid = eventRecord.Properties[12].Value.ToString() ?? string.Empty;
- var description = eventRecord.FormatDescription();
- var pid = eventRecord.Properties[8].Value.ToString() ?? string.Empty;
-
- FindOrCreateWEREntryFromEventLog(filePath, timeGenerated, moduleName, executable, eventGuid, description, pid);
- }
- }
-
- private void FindOrCreateWEREntryFromEventLog(string filepath, DateTime timeGenerated, string moduleName, string executable, string eventGuid, string description, string processId)
- {
- int? pid = CommonHelper.ParseStringToInt(processId);
-
- // When adding/updating a report, we need to do it on the dispatcher thread
- _dispatcher.TryEnqueue(() =>
- {
- // Do we have an entry for this item already (created from the WER files on disk)
- var werReport = FindMatchingReport(timeGenerated, executable, pid);
-
- var createdReport = false;
-
- if (werReport is null)
- {
- werReport = new WERReport();
- createdReport = true;
- werReport.TimeStamp = timeGenerated;
- werReport.Executable = executable;
- werReport.Pid = pid ?? 0;
- }
-
- // Populate the report
- werReport.FilePath = filepath;
- werReport.Module = moduleName;
- werReport.EventGuid = eventGuid;
- werReport.Description = description;
- werReport.FailureBucket = GenerateFailureBucketFromEventLogDescription(description);
-
- // Don't add the report until it's fully populated so we have as much information as possible for our listeners
- if (createdReport)
- {
- _werReports.Add(werReport);
- }
- });
- }
-
- private void FindOrCreateWEREntryFromLocalDumpFile(string crashDumpFile)
- {
- var timeGenerated = File.GetCreationTime(crashDumpFile);
- FileInfo dumpFileInfo = new(crashDumpFile);
-
- Debug.Assert(dumpFileInfo.Exists, "Why doesn't this file exist?");
-
- // Only look at .dmp files
- if (dumpFileInfo.Extension != ".dmp")
- {
- return;
- }
-
- // The crashdumpFilename has a format of
- // executable.pid.dmp
- // so it could be
- // a.exe.40912.dmp
- // but also
- // a.b.exe.40912.dmp
- // Parse the filename starting from the back
-
- // Find the last dot index
- var dmpExtensionIndex = dumpFileInfo.Name.LastIndexOf('.');
- if (dmpExtensionIndex == -1)
- {
- _log.Information("Unexpected crash dump filename: " + dumpFileInfo.Name);
- return;
- }
-
- // Remove the .dmp. This should give us a string like a.b.exe.40912
- var filenameWithNoDmp = dumpFileInfo.Name.Substring(0, dmpExtensionIndex);
-
- // Find the PID
- var pidIndex = filenameWithNoDmp.LastIndexOf('.');
- if (pidIndex == -1)
- {
- _log.Information("Unexpected crash dump filename: " + crashDumpFile);
- return;
- }
-
- var processID = filenameWithNoDmp.Substring(pidIndex + 1);
-
- // Now peel off the PID. This should give us a.b.exe
- var executableFullPath = filenameWithNoDmp.Substring(0, pidIndex);
-
- FileInfo fileInfo = new(executableFullPath);
-
- string description = string.Empty;
-
- if (dumpFileInfo.Exists)
- {
- description = string.Format(CultureInfo.CurrentCulture, CommonHelper.GetLocalizedString("WERBasicInfo"), dumpFileInfo.Length, dumpFileInfo.CreationTime);
- }
-
- var converter = new Int32Converter();
- var pid = (int?)converter.ConvertFromString(processID);
-
- _dispatcher.TryEnqueue(() =>
- {
- // Do we have an entry for this item already (created from the event log entry)
- var werReport = FindMatchingReport(timeGenerated, fileInfo.Name, pid);
-
- var createdReport = false;
-
- if (werReport is null)
- {
- werReport = new WERReport();
- createdReport = true;
- werReport.TimeStamp = timeGenerated;
- werReport.Executable = fileInfo.Name;
- werReport.Pid = pid ?? 0;
- werReport.Description = description;
- }
-
- // Populate the report
- werReport.CrashDumpPath = crashDumpFile;
-
- // Don't add the report until it's fully populated so we have as much information as possible for our listeners
- if (createdReport)
- {
- _werReports.Add(werReport);
- }
- });
-
- return;
- }
-
- private WERReport? FindMatchingReport(DateTime timestamp, string executable, int? pid)
- {
- Debug.Assert(_dispatcher.HasThreadAccess, "This method should only be called on the dispatcher thread");
- Debug.Assert(timestamp.Kind == DateTimeKind.Local, "TimeGenerated should be in local time");
- var timestampIndex = timestamp.Ticks;
-
- // It's a match if the timestamp is within 2 minute of the event log entry
- var ticksWindow = new TimeSpan(0, 2, 0).Ticks;
-
- WERReport? werReport = null;
-
- // See if we can find a matching entry in the list
- foreach (var report in _werReports)
- {
- if (report.Executable.Equals(executable, StringComparison.OrdinalIgnoreCase) && report.Pid == pid)
- {
- // See if the timestamps are "close enough"
- Debug.Assert(report.TimeStamp.Kind == DateTimeKind.Local, "TimeGenerated should be in local time");
- var ticksDiff = Math.Abs(report.TimeStamp.Ticks - timestampIndex);
-
- if (ticksDiff < ticksWindow)
- {
- werReport = report;
- break;
- }
- }
- }
-
- return werReport;
- }
-
- private string GenerateFailureBucketFromEventLogDescription(string description)
- {
- /* The description can look like this
-
- Faulting application name: DevHome.Diagnostics.exe, version: 1.0.0.0, time stamp: 0x66470000
- Faulting module name: KERNELBASE.dll, version: 10.0.22621.3810, time stamp: 0x10210ca8
- Exception code: 0xe0434352
- Fault offset: 0x000000000005f20c
- Faulting process id: 0x0xa078
- Faulting application start time: 0x0x1dad175bd05dea9
- Faulting application path: E:\devhome\src\bin\x64\Debug\net8.0-windows10.0.22621.0\AppX\DevHome.Diagnostics.exe
- Faulting module path: C:\WINDOWS\System32\KERNELBASE.dll
- Report Id: 7a4cd0a8-f65b-4f27-b250-cc5bd57e39d6
- Faulting package full name: Microsoft.Windows.DevHome.Dev_0.0.0.0_x64__8wekyb3d8bbwe
- Faulting package-relative application ID: DevHome.Diagnostics
-
- Let's create a placeholder failure bucket based on the module name, offset, and exception code. In the above example,
- we'll generate a bucket "KERNELBASE.dll+0x000000000005f20c 0xe0434352"
- */
-
- var lines = description.Split('\n', StringSplitOptions.RemoveEmptyEntries);
- string? moduleName = null;
- string? exceptionCode = null;
- string? faultOffset = null;
-
- foreach (var line in lines)
- {
- if (line.Contains("Fault offset:"))
- {
- faultOffset = line.Substring(line.IndexOf(':') + 1).Trim();
- }
- else if (line.Contains("Exception code:"))
- {
- exceptionCode = line.Substring(line.IndexOf(':') + 1).Trim();
- }
- else if (line.Contains("Faulting module name:"))
- {
- var startIndex = line.IndexOf(':') + 1;
- var endIndex = line.IndexOf(',') - 1;
-
- moduleName = line.Substring(startIndex, endIndex - startIndex + 1).Trim();
- }
- }
-
- if (moduleName is not null && exceptionCode is not null && faultOffset is not null)
- {
- return $"{moduleName}+{faultOffset} {exceptionCode}";
- }
-
- return string.Empty;
- }
-
- private void ReadLocalWERReports()
- {
- foreach (var dumpLocation in _werLocations)
- {
- try
- {
- // Enumerate all of the existing dump files in this location
- foreach (var dumpFile in Directory.EnumerateFiles(dumpLocation, "*.dmp"))
- {
- FindOrCreateWEREntryFromLocalDumpFile(dumpFile);
- }
- }
- catch
- {
- _log.Error("Error enumerating directory " + dumpLocation);
- }
- }
- }
-
- // Generate a list of all of the locations on disk where local WER dumps are stored
- private List GetWERLocations()
- {
- var list = new List();
-
- var key = Registry.LocalMachine.OpenSubKey(WERUtils.LocalWERRegistryKey, false);
-
- if (key is not null)
- {
- var globaldumppath = GetDumpPath(key);
-
- Debug.Assert(globaldumppath is not null, "Global dump path is not set");
- list.Add(globaldumppath);
-
- var subKeys = key.GetSubKeyNames();
- foreach (var subkey in subKeys)
- {
- var dumpPath = GetDumpPath(key.OpenSubKey(subkey));
-
- if (dumpPath is not null)
- {
- // If this item isn't in the list, add it.
- if (!list.Contains(dumpPath))
- {
- list.Add(dumpPath);
- }
- }
- }
- }
-
- return list;
- }
-
- private string? GetDumpPath(RegistryKey? key)
- {
- if (key is not null)
- {
- if (key.GetValue("DumpFolder") is not string dumpFolder)
- {
- // If a dumppath isn't explicitly set, then use the system's default dump path
- dumpFolder = DefaultDumpPath;
- }
-
- return Environment.ExpandEnvironmentVariables(dumpFolder);
- }
-
- return null;
- }
-
- // Enable watchers to catch new WER dumps as they are generated
- private void EnableFileSystemWatchers()
- {
- _filesystemWatchers.Clear();
-
- foreach (var path in _werLocations)
- {
- // If this directory exists, monitor it for new files
- if (Directory.Exists(path))
- {
- var watcher = new FileSystemWatcher(path);
- watcher.Created += (sender, e) =>
- {
- _log.Information($"New dump file: {e.FullPath}");
- FindOrCreateWEREntryFromLocalDumpFile(e.FullPath);
- };
-
- watcher.EnableRaisingEvents = true;
- _filesystemWatchers.Add(watcher);
- }
- }
- }
-
- private void DisableFileSystemWatchers()
- {
- _filesystemWatchers.Clear();
- }
-}
diff --git a/tools/DevDiagnostics/DevHome.DevDiagnostics/Models/WERReport.cs b/tools/DevDiagnostics/DevHome.DevDiagnostics/Models/WERReport.cs
deleted file mode 100644
index f131e9e65f..0000000000
--- a/tools/DevDiagnostics/DevHome.DevDiagnostics/Models/WERReport.cs
+++ /dev/null
@@ -1,46 +0,0 @@
-// Copyright (c) Microsoft Corporation.
-// Licensed under the MIT License.
-
-using System;
-using System.ComponentModel;
-using System.Globalization;
-using System.Runtime.CompilerServices;
-using CommunityToolkit.Mvvm.ComponentModel;
-
-namespace DevHome.DevDiagnostics.Models;
-
-public partial class WERReport : ObservableObject
-{
- [ObservableProperty]
- private DateTime _timeStamp;
-
- public string TimeGenerated => TimeStamp.ToString("yyyy-MM-dd HH:mm:ss.fff", CultureInfo.CurrentCulture);
-
- [ObservableProperty]
- private string _filePath = string.Empty;
-
- [ObservableProperty]
- private string _module = string.Empty;
-
- [ObservableProperty]
- private string _executable = string.Empty;
-
- [ObservableProperty]
- private string _eventGuid = string.Empty;
-
- [ObservableProperty]
- private string _description = string.Empty;
-
- [ObservableProperty]
- private int _pid = 0;
-
- [ObservableProperty]
- private string _crashDumpPath = string.Empty;
-
- [ObservableProperty]
- private string _failureBucket = string.Empty;
-
- public WERReport()
- {
- }
-}
diff --git a/tools/DevDiagnostics/DevHome.DevDiagnostics/Models/WinLogsEntry.cs b/tools/DevDiagnostics/DevHome.DevDiagnostics/Models/WinLogsEntry.cs
deleted file mode 100644
index ac7473553a..0000000000
--- a/tools/DevDiagnostics/DevHome.DevDiagnostics/Models/WinLogsEntry.cs
+++ /dev/null
@@ -1,51 +0,0 @@
-// Copyright (c) Microsoft Corporation.
-// Licensed under the MIT License.
-
-using System;
-using System.Globalization;
-using DevHome.DevDiagnostics.Helpers;
-using Microsoft.UI;
-using Microsoft.UI.Xaml.Media;
-
-namespace DevHome.DevDiagnostics.Models;
-
-public class WinLogsEntry
-{
- public WinLogsEntry(DateTime? time, WinLogCategory category, string message, string toolName)
- {
- TimeGenerated = time ?? DateTime.Now;
- Category = category;
- Message = message;
- Tool = toolName;
- SelectedText = message;
- }
-
- public WinLogCategory Category { get; }
-
- public DateTime TimeGenerated { get; }
-
- public string TimeGeneratedString => TimeGenerated.ToString("yyyy-MM-dd HH:mm:ss.fff", CultureInfo.CurrentCulture);
-
- public string Tool { get; }
-
- public string Message { get; }
-
- public string SelectedText { get; set; }
-}
-
-public enum WinLogCategory
-{
- Information = 0,
- Error,
- Warning,
- Debug,
-}
-
-public enum WinLogsTool
-{
- Unknown = 0,
- ETWLogs,
- DebugOutput,
- EventViewer,
- WER,
-}
diff --git a/tools/DevDiagnostics/DevHome.DevDiagnostics/NativeMethods.json b/tools/DevDiagnostics/DevHome.DevDiagnostics/NativeMethods.json
deleted file mode 100644
index 1175df48bf..0000000000
--- a/tools/DevDiagnostics/DevHome.DevDiagnostics/NativeMethods.json
+++ /dev/null
@@ -1,4 +0,0 @@
-{
- "$schema": "https://aka.ms/CsWin32.schema.json",
- "wideCharOnly": true
-}
\ No newline at end of file
diff --git a/tools/DevDiagnostics/DevHome.DevDiagnostics/NativeMethods.txt b/tools/DevDiagnostics/DevHome.DevDiagnostics/NativeMethods.txt
deleted file mode 100644
index c0ddfcf606..0000000000
--- a/tools/DevDiagnostics/DevHome.DevDiagnostics/NativeMethods.txt
+++ /dev/null
@@ -1,121 +0,0 @@
-AddClipboardFormatListener
-CallWindowProc
-CloseClipboard
-CoCreateInstance
-CombineRgn
-CreateEllipticRgn
-CreateRectRgn
-CreateRoundRectRgn
-DefSubclassProc
-DwmGetWindowAttribute
-DwmSetWindowAttribute
-DwmSetWindowAttribute
-EnumChildWindows
-EnumThreadWindows
-EnumWindows
-GetAncestor
-GetBinaryType
-GetClassLong
-GetClassName
-GetClipboardData
-GetCurrentPackageFullName
-GetCursorPos
-GetDesktopWindow
-GetForegroundWindow
-GetMonitorInfo
-GetMonitorInfo
-GetOpenFileName
-GetParent
-GetProcessInformation
-GetScaleFactorForMonitor
-GetTopWindow
-GetWindowInfo
-GetWindowLong
-GetWindowRect
-GetWindowText
-GetWindowText
-GetWindowTextLength
-GetWindowTextLength
-GetWindowThreadProcessId
-GlobalAddAtom
-GlobalDeleteAtom
-GlobalLock
-GlobalUnlock
-IsIconic
-IsImmersiveProcess
-IsWindow
-IsWindowArranged
-IsWindowVisible
-IsWow64Process2
-IsZoomed
-LoadIcon
-LoadImage
-MessageBox
-MonitorFromWindow
-MoveWindow
-NtQueryInformationProcess
-OpenClipboard
-OpenProcessToken
-RegisterHotKey
-RemoveClipboardFormatListener
-RmRegisterResources
-RmStartSession
-RmGetList
-RmEndSession
-SendMessage
-SetFocus
-SetForegroundWindow
-SetParent
-SetWindowLong
-SetWindowLong
-SetWindowPos
-SetWindowRgn
-SetWindowSubclass
-SetWinEventHook
-ShowWindow
-SystemParametersInfo
-UnhookWinEvent
-UnregisterHotKey
-WaitForSingleObject
-WindowFromPoint
-CF_*
-DEVICE_SCALE_FACTOR
-DWMWA_*
-DWMWINDOWATTRIBUTE
-EVENT_*
-EVENT_OBJECT_DESTROY
-EVENT_OBJECT_LOCATIONCHANGE
-EVENT_SYSTEM_FOREGROUND
-GET_ANCESTOR_FLAGS
-GET_CLASS_LONG_INDEX
-HMONITOR
-HWND_*
-ICON_*
-ICON_*
-ICON_*
-IDI_*
-IMAGE_*
-INVALID_HANDLE_VALUE
-LR_*
-MOD_*
-// MONITOR_DEFAULTTONEAREST
-PROCESS_BASIC_INFORMATION
-PROCESS_INFORMATION_CLASS
-PROCESS_MACHINE_INFORMATION
-RM_APP_TYPE
-RM_UNIQUE_PROCESS
-RM_PROCESS_INFO
-RM_REBOOT_REASON
-SECTION_FLAGS
-SUBCLASSPROC
-SW_*
-VIRTUAL_KEY
-WIN32_ERROR
-WINEVENT_*
-WINEVENT_OUTOFCONTEXT
-WINEVENT_SKIPOWNPROCESS
-WINDOWPOS
-WM_*
-WS_*
-GetProcessImageFileName
-MAX_PATH
diff --git a/tools/DevDiagnostics/DevHome.DevDiagnostics/Pages/AboutPage.xaml b/tools/DevDiagnostics/DevHome.DevDiagnostics/Pages/AboutPage.xaml
deleted file mode 100644
index bd87b1f75a..0000000000
--- a/tools/DevDiagnostics/DevHome.DevDiagnostics/Pages/AboutPage.xaml
+++ /dev/null
@@ -1,47 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/tools/DevDiagnostics/DevHome.DevDiagnostics/Pages/AboutPage.xaml.cs b/tools/DevDiagnostics/DevHome.DevDiagnostics/Pages/AboutPage.xaml.cs
deleted file mode 100644
index 3db304a96d..0000000000
--- a/tools/DevDiagnostics/DevHome.DevDiagnostics/Pages/AboutPage.xaml.cs
+++ /dev/null
@@ -1,20 +0,0 @@
-// Copyright (c) Microsoft Corporation.
-// Licensed under the MIT License.
-
-using DevHome.Common.Extensions;
-using DevHome.DevDiagnostics.ViewModels;
-using Microsoft.UI.Xaml;
-using Microsoft.UI.Xaml.Controls;
-
-namespace DevHome.DevDiagnostics.Pages;
-
-public sealed partial class AboutPage : Page
-{
- public AboutViewModel ViewModel { get; }
-
- public AboutPage()
- {
- ViewModel = Application.Current.GetService();
- InitializeComponent();
- }
-}
diff --git a/tools/DevDiagnostics/DevHome.DevDiagnostics/Pages/AdditionalToolsPage.xaml b/tools/DevDiagnostics/DevHome.DevDiagnostics/Pages/AdditionalToolsPage.xaml
deleted file mode 100644
index ebf5b2360f..0000000000
--- a/tools/DevDiagnostics/DevHome.DevDiagnostics/Pages/AdditionalToolsPage.xaml
+++ /dev/null
@@ -1,46 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/tools/DevDiagnostics/DevHome.DevDiagnostics/Pages/AdditionalToolsPage.xaml.cs b/tools/DevDiagnostics/DevHome.DevDiagnostics/Pages/AdditionalToolsPage.xaml.cs
deleted file mode 100644
index c951b01f70..0000000000
--- a/tools/DevDiagnostics/DevHome.DevDiagnostics/Pages/AdditionalToolsPage.xaml.cs
+++ /dev/null
@@ -1,25 +0,0 @@
-// Copyright (c) Microsoft Corporation.
-// Licensed under the MIT License.
-
-using DevHome.Common.Extensions;
-using DevHome.DevDiagnostics.ViewModels;
-using Microsoft.UI.Xaml;
-using Microsoft.UI.Xaml.Controls;
-
-namespace DevHome.DevDiagnostics.Pages;
-
-public sealed partial class AdditionalToolsPage : Page
-{
- public AdditionalToolsViewModel ViewModel { get; }
-
- public AdditionalToolsPage()
- {
- ViewModel = Application.Current.GetService();
- InitializeComponent();
- }
-
- private void SettingsAddToolCard_Expanded(object sender, System.EventArgs e)
- {
- AddToolPanel.RefreshAppList();
- }
-}
diff --git a/tools/DevDiagnostics/DevHome.DevDiagnostics/Pages/AdvancedSettingsPage.xaml b/tools/DevDiagnostics/DevHome.DevDiagnostics/Pages/AdvancedSettingsPage.xaml
deleted file mode 100644
index aec0de71f0..0000000000
--- a/tools/DevDiagnostics/DevHome.DevDiagnostics/Pages/AdvancedSettingsPage.xaml
+++ /dev/null
@@ -1,67 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/tools/DevDiagnostics/DevHome.DevDiagnostics/Pages/AdvancedSettingsPage.xaml.cs b/tools/DevDiagnostics/DevHome.DevDiagnostics/Pages/AdvancedSettingsPage.xaml.cs
deleted file mode 100644
index b1907edbc3..0000000000
--- a/tools/DevDiagnostics/DevHome.DevDiagnostics/Pages/AdvancedSettingsPage.xaml.cs
+++ /dev/null
@@ -1,77 +0,0 @@
-// Copyright (c) Microsoft Corporation.
-// Licensed under the MIT License.
-
-using System.Text;
-using DevHome.Common.Extensions;
-using DevHome.DevDiagnostics.Properties;
-using DevHome.DevDiagnostics.ViewModels;
-using Microsoft.UI.Xaml;
-using Microsoft.UI.Xaml.Controls;
-
-namespace DevHome.DevDiagnostics.Pages;
-
-public sealed partial class AdvancedSettingsPage : Page
-{
- public AdvancedSettingsViewModel ViewModel { get; }
-
- public AdvancedSettingsPage()
- {
- ViewModel = Application.Current.GetService();
- InitializeComponent();
- }
-
- private void Page_Loaded(object sender, RoutedEventArgs e)
- {
- CpuUsageToggle.IsOn = Settings.Default.IsCpuUsageMonitoringEnabled;
- ShowInsightsToggle.IsOn = Settings.Default.IsInsightsOnStartupEnabled;
- EnableClipboardMonitoringToggle.IsOn = Settings.Default.IsClipboardMonitoringEnabled;
-
- var excludedProcesses = Settings.Default.ExcludedProcesses;
- StringBuilder builder = new();
- foreach (var process in excludedProcesses)
- {
-#pragma warning disable CA1305 // Specify IFormatProvider
- builder.Append($"{process}, ");
-#pragma warning restore CA1305 // Specify IFormatProvider
- }
-
- ExcludedProcessesTextBox.Text = builder.ToString();
- }
-
- private void CpuUsageToggle_Toggled(object sender, RoutedEventArgs e)
- {
- Settings.Default.IsCpuUsageMonitoringEnabled = CpuUsageToggle.IsOn;
- Settings.Default.Save();
- }
-
- private void ShowInsightsToggle_Toggled(object sender, RoutedEventArgs e)
- {
- Settings.Default.IsInsightsOnStartupEnabled = ShowInsightsToggle.IsOn;
- Settings.Default.Save();
- }
-
- private void EnableClipboardMonitoringToggle_Toggled(object sender, RoutedEventArgs e)
- {
- if (Settings.Default.IsClipboardMonitoringEnabled != EnableClipboardMonitoringToggle.IsOn)
- {
- Settings.Default.IsClipboardMonitoringEnabled = EnableClipboardMonitoringToggle.IsOn;
- Settings.Default.Save();
- }
- }
-
- private void ExcludedProcessesButton_Click(object sender, RoutedEventArgs e)
- {
- var excludedProcesses = ExcludedProcessesTextBox.Text;
- if (!string.IsNullOrEmpty(excludedProcesses))
- {
- Settings.Default.ExcludedProcesses.Clear();
- var processes = excludedProcesses.Split(',');
- foreach (var process in processes)
- {
- Settings.Default.ExcludedProcesses.Add(process.Trim());
- }
-
- Settings.Default.Save();
- }
- }
-}
diff --git a/tools/DevDiagnostics/DevHome.DevDiagnostics/Pages/AppDetailsPage.xaml b/tools/DevDiagnostics/DevHome.DevDiagnostics/Pages/AppDetailsPage.xaml
deleted file mode 100644
index 6b2f8f6c5d..0000000000
--- a/tools/DevDiagnostics/DevHome.DevDiagnostics/Pages/AppDetailsPage.xaml
+++ /dev/null
@@ -1,168 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/tools/DevDiagnostics/DevHome.DevDiagnostics/Pages/AppDetailsPage.xaml.cs b/tools/DevDiagnostics/DevHome.DevDiagnostics/Pages/AppDetailsPage.xaml.cs
deleted file mode 100644
index b9f4943fcb..0000000000
--- a/tools/DevDiagnostics/DevHome.DevDiagnostics/Pages/AppDetailsPage.xaml.cs
+++ /dev/null
@@ -1,28 +0,0 @@
-// Copyright (c) Microsoft Corporation.
-// Licensed under the MIT License.
-
-using DevHome.Common.Extensions;
-using DevHome.DevDiagnostics.Telemetry;
-using DevHome.DevDiagnostics.ViewModels;
-using Microsoft.UI.Xaml;
-using Microsoft.UI.Xaml.Controls;
-using Microsoft.UI.Xaml.Navigation;
-
-namespace DevHome.DevDiagnostics.Pages;
-
-public partial class AppDetailsPage : Page
-{
- private AppDetailsPageViewModel ViewModel { get; }
-
- public AppDetailsPage()
- {
- ViewModel = Application.Current.GetService();
- InitializeComponent();
- }
-
- protected override void OnNavigatedTo(NavigationEventArgs e)
- {
- base.OnNavigatedTo(e);
- Application.Current.GetService().SwitchTo(Feature.AppDetails);
- }
-}
diff --git a/tools/DevDiagnostics/DevHome.DevDiagnostics/Pages/InsightsPage.xaml b/tools/DevDiagnostics/DevHome.DevDiagnostics/Pages/InsightsPage.xaml
deleted file mode 100644
index e6e85ba971..0000000000
--- a/tools/DevDiagnostics/DevHome.DevDiagnostics/Pages/InsightsPage.xaml
+++ /dev/null
@@ -1,60 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/tools/DevDiagnostics/DevHome.DevDiagnostics/Pages/InsightsPage.xaml.cs b/tools/DevDiagnostics/DevHome.DevDiagnostics/Pages/InsightsPage.xaml.cs
deleted file mode 100644
index 238fd34e24..0000000000
--- a/tools/DevDiagnostics/DevHome.DevDiagnostics/Pages/InsightsPage.xaml.cs
+++ /dev/null
@@ -1,28 +0,0 @@
-// Copyright (c) Microsoft Corporation.
-// Licensed under the MIT License.
-
-using DevHome.Common.Extensions;
-using DevHome.DevDiagnostics.Telemetry;
-using DevHome.DevDiagnostics.ViewModels;
-using Microsoft.UI.Xaml;
-using Microsoft.UI.Xaml.Controls;
-using Microsoft.UI.Xaml.Navigation;
-
-namespace DevHome.DevDiagnostics.Pages;
-
-public sealed partial class InsightsPage : Page
-{
- private InsightsPageViewModel ViewModel { get; }
-
- public InsightsPage()
- {
- ViewModel = Application.Current.GetService();
- InitializeComponent();
- }
-
- protected override void OnNavigatedTo(NavigationEventArgs e)
- {
- base.OnNavigatedTo(e);
- Application.Current.GetService().SwitchTo(Feature.Insights);
- }
-}
diff --git a/tools/DevDiagnostics/DevHome.DevDiagnostics/Pages/ModulesPage.xaml b/tools/DevDiagnostics/DevHome.DevDiagnostics/Pages/ModulesPage.xaml
deleted file mode 100644
index 4a990a0456..0000000000
--- a/tools/DevDiagnostics/DevHome.DevDiagnostics/Pages/ModulesPage.xaml
+++ /dev/null
@@ -1,78 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/tools/DevDiagnostics/DevHome.DevDiagnostics/Pages/ModulesPage.xaml.cs b/tools/DevDiagnostics/DevHome.DevDiagnostics/Pages/ModulesPage.xaml.cs
deleted file mode 100644
index c2801b0e18..0000000000
--- a/tools/DevDiagnostics/DevHome.DevDiagnostics/Pages/ModulesPage.xaml.cs
+++ /dev/null
@@ -1,34 +0,0 @@
-// Copyright (c) Microsoft Corporation.
-// Licensed under the MIT License.
-
-using DevHome.Common.Extensions;
-using DevHome.DevDiagnostics.Telemetry;
-using DevHome.DevDiagnostics.ViewModels;
-using Microsoft.UI.Xaml;
-using Microsoft.UI.Xaml.Controls;
-using Microsoft.UI.Xaml.Input;
-using Microsoft.UI.Xaml.Navigation;
-
-namespace DevHome.DevDiagnostics.Pages;
-
-public sealed partial class ModulesPage : Page
-{
- private ModulesPageViewModel ViewModel { get; }
-
- public ModulesPage()
- {
- ViewModel = Application.Current.GetService();
- InitializeComponent();
- }
-
- protected override void OnNavigatedTo(NavigationEventArgs e)
- {
- base.OnNavigatedTo(e);
- Application.Current.GetService().SwitchTo(Feature.LoadedModule);
- }
-
- private void GridSplitter_PointerPressed(object sender, PointerRoutedEventArgs e)
- {
- e.Handled = true;
- }
-}
diff --git a/tools/DevDiagnostics/DevHome.DevDiagnostics/Pages/PreferencesPage.xaml b/tools/DevDiagnostics/DevHome.DevDiagnostics/Pages/PreferencesPage.xaml
deleted file mode 100644
index 17d1782466..0000000000
--- a/tools/DevDiagnostics/DevHome.DevDiagnostics/Pages/PreferencesPage.xaml
+++ /dev/null
@@ -1,45 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/tools/DevDiagnostics/DevHome.DevDiagnostics/Pages/PreferencesPage.xaml.cs b/tools/DevDiagnostics/DevHome.DevDiagnostics/Pages/PreferencesPage.xaml.cs
deleted file mode 100644
index bb033b39b1..0000000000
--- a/tools/DevDiagnostics/DevHome.DevDiagnostics/Pages/PreferencesPage.xaml.cs
+++ /dev/null
@@ -1,34 +0,0 @@
-// Copyright (c) Microsoft Corporation.
-// Licensed under the MIT License.
-
-using DevHome.Common.Extensions;
-using DevHome.DevDiagnostics.ViewModels;
-using Microsoft.UI.Xaml;
-using Microsoft.UI.Xaml.Controls;
-
-namespace DevHome.DevDiagnostics.Pages;
-
-public sealed partial class PreferencesPage : Page
-{
- public PreferencesViewModel ViewModel { get; }
-
- public PreferencesPage()
- {
- ViewModel = Application.Current.GetService();
- InitializeComponent();
- }
-
- private void Page_Loaded(object sender, RoutedEventArgs e)
- {
- var selectedTheme = ViewModel.ElementTheme;
- foreach (var item in ThemeSelectionComboBox.Items)
- {
- var comboItem = item as ComboBoxItem;
- if (comboItem?.Tag is ElementTheme tag && tag == selectedTheme)
- {
- ThemeSelectionComboBox.SelectedValue = item;
- break;
- }
- }
- }
-}
diff --git a/tools/DevDiagnostics/DevHome.DevDiagnostics/Pages/ProcessListPage.xaml b/tools/DevDiagnostics/DevHome.DevDiagnostics/Pages/ProcessListPage.xaml
deleted file mode 100644
index a14b6212d4..0000000000
--- a/tools/DevDiagnostics/DevHome.DevDiagnostics/Pages/ProcessListPage.xaml
+++ /dev/null
@@ -1,84 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/tools/DevDiagnostics/DevHome.DevDiagnostics/Pages/ProcessListPage.xaml.cs b/tools/DevDiagnostics/DevHome.DevDiagnostics/Pages/ProcessListPage.xaml.cs
deleted file mode 100644
index 00fdb23744..0000000000
--- a/tools/DevDiagnostics/DevHome.DevDiagnostics/Pages/ProcessListPage.xaml.cs
+++ /dev/null
@@ -1,29 +0,0 @@
-// Copyright (c) Microsoft Corporation.
-// Licensed under the MIT License.
-
-using DevHome.Common.Extensions;
-using DevHome.DevDiagnostics.Telemetry;
-using DevHome.DevDiagnostics.ViewModels;
-using Microsoft.UI.Xaml;
-using Microsoft.UI.Xaml.Controls;
-using Microsoft.UI.Xaml.Navigation;
-
-namespace DevHome.DevDiagnostics.Pages;
-
-public sealed partial class ProcessListPage : Page
-{
- private ProcessListPageViewModel ViewModel { get; }
-
- public ProcessListPage()
- {
- ViewModel = Application.Current.GetService();
- InitializeComponent();
- }
-
- protected override void OnNavigatedTo(NavigationEventArgs e)
- {
- base.OnNavigatedTo(e);
- ViewModel.ResetPage();
- Application.Current.GetService().SwitchTo(Feature.ProcessList);
- }
-}
diff --git a/tools/DevDiagnostics/DevHome.DevDiagnostics/Pages/ResourceUsagePage.xaml b/tools/DevDiagnostics/DevHome.DevDiagnostics/Pages/ResourceUsagePage.xaml
deleted file mode 100644
index 0c9f0a1849..0000000000
--- a/tools/DevDiagnostics/DevHome.DevDiagnostics/Pages/ResourceUsagePage.xaml
+++ /dev/null
@@ -1,61 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/tools/DevDiagnostics/DevHome.DevDiagnostics/Pages/ResourceUsagePage.xaml.cs b/tools/DevDiagnostics/DevHome.DevDiagnostics/Pages/ResourceUsagePage.xaml.cs
deleted file mode 100644
index dff5679f52..0000000000
--- a/tools/DevDiagnostics/DevHome.DevDiagnostics/Pages/ResourceUsagePage.xaml.cs
+++ /dev/null
@@ -1,35 +0,0 @@
-// Copyright (c) Microsoft Corporation.
-// Licensed under the MIT License.
-
-using System;
-using DevHome.Common.Extensions;
-using DevHome.DevDiagnostics.Telemetry;
-using DevHome.DevDiagnostics.ViewModels;
-using Microsoft.UI.Xaml;
-using Microsoft.UI.Xaml.Controls;
-using Microsoft.UI.Xaml.Navigation;
-
-namespace DevHome.DevDiagnostics.Pages;
-
-public sealed partial class ResourceUsagePage : Page, IDisposable
-{
- private ResourceUsagePageViewModel ViewModel { get; }
-
- public ResourceUsagePage()
- {
- ViewModel = Application.Current.GetService();
- InitializeComponent();
- }
-
- protected override void OnNavigatedTo(NavigationEventArgs e)
- {
- base.OnNavigatedTo(e);
- Application.Current.GetService().SwitchTo(Feature.ResourceUsage);
- }
-
- public void Dispose()
- {
- ViewModel.Dispose();
- GC.SuppressFinalize(this);
- }
-}
diff --git a/tools/DevDiagnostics/DevHome.DevDiagnostics/Pages/SettingsPage.xaml b/tools/DevDiagnostics/DevHome.DevDiagnostics/Pages/SettingsPage.xaml
deleted file mode 100644
index 8ca2a7707e..0000000000
--- a/tools/DevDiagnostics/DevHome.DevDiagnostics/Pages/SettingsPage.xaml
+++ /dev/null
@@ -1,43 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/tools/DevDiagnostics/DevHome.DevDiagnostics/Pages/SettingsPage.xaml.cs b/tools/DevDiagnostics/DevHome.DevDiagnostics/Pages/SettingsPage.xaml.cs
deleted file mode 100644
index d333b94d6c..0000000000
--- a/tools/DevDiagnostics/DevHome.DevDiagnostics/Pages/SettingsPage.xaml.cs
+++ /dev/null
@@ -1,18 +0,0 @@
-// Copyright (c) Microsoft Corporation.
-// Licensed under the MIT License.
-
-using DevHome.DevDiagnostics.ViewModels;
-using Microsoft.UI.Xaml.Controls;
-
-namespace DevHome.DevDiagnostics.Pages;
-
-public sealed partial class SettingsPage : Page
-{
- public SettingsPageViewModel ViewModel { get; }
-
- public SettingsPage()
- {
- ViewModel = new SettingsPageViewModel();
- InitializeComponent();
- }
-}
diff --git a/tools/DevDiagnostics/DevHome.DevDiagnostics/Pages/WERPage.xaml b/tools/DevDiagnostics/DevHome.DevDiagnostics/Pages/WERPage.xaml
deleted file mode 100644
index 99db2a5dc9..0000000000
--- a/tools/DevDiagnostics/DevHome.DevDiagnostics/Pages/WERPage.xaml
+++ /dev/null
@@ -1,100 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/tools/DevDiagnostics/DevHome.DevDiagnostics/Pages/WERPage.xaml.cs b/tools/DevDiagnostics/DevHome.DevDiagnostics/Pages/WERPage.xaml.cs
deleted file mode 100644
index 9e15a26c06..0000000000
--- a/tools/DevDiagnostics/DevHome.DevDiagnostics/Pages/WERPage.xaml.cs
+++ /dev/null
@@ -1,145 +0,0 @@
-// Copyright (c) Microsoft Corporation.
-// Licensed under the MIT License.
-
-using System;
-using System.Collections.Specialized;
-using System.Diagnostics;
-using System.Linq;
-using CommunityToolkit.WinUI.UI.Controls;
-using DevHome.Common.Extensions;
-using DevHome.DevDiagnostics.Helpers;
-using DevHome.DevDiagnostics.Models;
-using DevHome.DevDiagnostics.Telemetry;
-using DevHome.DevDiagnostics.ViewModels;
-using Microsoft.UI.Xaml;
-using Microsoft.UI.Xaml.Controls;
-using Microsoft.UI.Xaml.Navigation;
-
-namespace DevHome.DevDiagnostics.Pages;
-
-public sealed partial class WERPage : Page
-{
- private readonly string _bucketUsingThisToolString = CommonHelper.GetLocalizedString("BucketUsingThisToolString");
-
- private WERPageViewModel ViewModel { get; }
-
- public WERPage()
- {
- ViewModel = Application.Current.GetService();
- InitializeComponent();
-
- // Populate selector items for each WER analyizer registered with the system
- foreach (Tool tool in ViewModel.RegisteredAnalysisTools)
- {
- InfoSelector.Items.Add(CreateSelectorBarItemForDebugAnalyzer(tool));
- }
-
- ((INotifyCollectionChanged)ViewModel.RegisteredAnalysisTools).CollectionChanged += RegisteredAnalysisTools_CollectionChanged;
- }
-
- private void RegisteredAnalysisTools_CollectionChanged(object? sender, NotifyCollectionChangedEventArgs e)
- {
- // If we have a new tool, add a new selector item for it
- if (e.Action == NotifyCollectionChangedAction.Add && e.NewItems is not null)
- {
- foreach (Tool tool in e.NewItems)
- {
- InfoSelector.Items.Add(CreateSelectorBarItemForDebugAnalyzer(tool));
- }
- }
-
- // Or if we removed a tool, remove the selector item for it
- else if (e.Action == NotifyCollectionChangedAction.Remove && e.OldItems is not null)
- {
- foreach (Tool tool in e.OldItems)
- {
- foreach (var item in InfoSelector.Items.Where(x => x.Tag == tool))
- {
- InfoSelector.Items.Remove(item);
- break;
- }
- }
- }
- }
-
- private SelectorBarItem CreateSelectorBarItemForDebugAnalyzer(Tool tool)
- {
- SelectorBarItem selectorBarItem = new()
- {
- Text = tool.Name,
- Tag = tool,
- };
-
- MenuFlyout menuFlyout = new();
- MenuFlyoutItem item = new()
- {
- Text = _bucketUsingThisToolString,
- Tag = tool,
- };
- item.Click += (sender, e) =>
- {
- ViewModel.SetBucketingTool(tool);
- };
- menuFlyout.Items.Add(item);
-
- selectorBarItem.ContextFlyout = menuFlyout;
- return selectorBarItem;
- }
-
- protected override void OnNavigatedTo(NavigationEventArgs e)
- {
- base.OnNavigatedTo(e);
- Application.Current.GetService().SwitchTo(Feature.WERReports);
- }
-
- private void SelectorBar_SelectionChanged(SelectorBar sender, SelectorBarSelectionChangedEventArgs args)
- {
- UpdateInfoBox();
- }
-
- private void WERDataGrid_SelectionChanged(object sender, SelectionChangedEventArgs e)
- {
- UpdateInfoBox();
- }
-
- private void UpdateInfoBox()
- {
- if (WERDataGrid.SelectedItem is null)
- {
- WERInfo.Text = string.Empty;
- return;
- }
-
- SelectorBarItem selectedItem = InfoSelector.SelectedItem;
- int currentSelectedIndex = InfoSelector.Items.IndexOf(selectedItem);
- WERAnalysisReport info = (WERAnalysisReport)WERDataGrid.SelectedItem;
-
- if (selectedItem is not null && selectedItem.Tag is Tool tool)
- {
- if (info.ToolAnalyses.TryGetValue(tool, out var analysis))
- {
- WERInfo.Text = analysis.Analysis;
- }
- else
- {
- WERInfo.Text = CommonHelper.GetLocalizedString("WERAnalysisUnavailable");
- }
- }
- else
- {
- Debug.Assert(currentSelectedIndex == 0 || currentSelectedIndex == -1, "Expected only the first item would have a null tag");
- WERInfo.Text = info.Report.Description;
- }
- }
-
- private void HyperlinkButton_Click(object sender, RoutedEventArgs e)
- {
- HyperlinkButton? hyperlinkButton = sender as HyperlinkButton;
- Debug.Assert(hyperlinkButton is not null, "Who called HyperlinkButton_Click that wasn't a hyperlink button?");
-
- WERAnalysisReport? info = hyperlinkButton.Tag as WERAnalysisReport;
- Debug.Assert(info is not null, "This object should have a Tag with a WERDisplayInfo");
-
- ViewModel.OpenCab(info.Report.CrashDumpPath);
- }
-}
diff --git a/tools/DevDiagnostics/DevHome.DevDiagnostics/Pages/WinLogsPage.xaml b/tools/DevDiagnostics/DevHome.DevDiagnostics/Pages/WinLogsPage.xaml
deleted file mode 100644
index 00698560cf..0000000000
--- a/tools/DevDiagnostics/DevHome.DevDiagnostics/Pages/WinLogsPage.xaml
+++ /dev/null
@@ -1,117 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/tools/DevDiagnostics/DevHome.DevDiagnostics/Pages/WinLogsPage.xaml.cs b/tools/DevDiagnostics/DevHome.DevDiagnostics/Pages/WinLogsPage.xaml.cs
deleted file mode 100644
index 4229ee3605..0000000000
--- a/tools/DevDiagnostics/DevHome.DevDiagnostics/Pages/WinLogsPage.xaml.cs
+++ /dev/null
@@ -1,39 +0,0 @@
-// Copyright (c) Microsoft Corporation.
-// Licensed under the MIT License.
-
-using System;
-using System.Collections.ObjectModel;
-using System.Linq;
-using DevHome.Common.Extensions;
-using DevHome.DevDiagnostics.Models;
-using DevHome.DevDiagnostics.Telemetry;
-using DevHome.DevDiagnostics.ViewModels;
-using Microsoft.UI.Xaml;
-using Microsoft.UI.Xaml.Controls;
-using Microsoft.UI.Xaml.Navigation;
-
-namespace DevHome.DevDiagnostics.Pages;
-
-public partial class WinLogsPage : Page, IDisposable
-{
- public WinLogsPageViewModel ViewModel { get; }
-
- public WinLogsPage()
- {
- ViewModel = Application.Current.GetService();
- InitializeComponent();
- DataContext = this;
- }
-
- protected override void OnNavigatedTo(NavigationEventArgs e)
- {
- base.OnNavigatedTo(e);
- Application.Current.GetService().SwitchTo(Feature.WinLogs);
- }
-
- public void Dispose()
- {
- ViewModel.Dispose();
- GC.SuppressFinalize(this);
- }
-}
diff --git a/tools/DevDiagnostics/DevHome.DevDiagnostics/Program.cs b/tools/DevDiagnostics/DevHome.DevDiagnostics/Program.cs
deleted file mode 100644
index f8bd1b44c0..0000000000
--- a/tools/DevDiagnostics/DevHome.DevDiagnostics/Program.cs
+++ /dev/null
@@ -1,251 +0,0 @@
-// Copyright (c) Microsoft Corporation.
-// Licensed under the MIT License.
-
-using System;
-using System.Diagnostics;
-using System.Globalization;
-using System.IO;
-using System.Linq;
-using System.Text.RegularExpressions;
-using System.Threading;
-using System.Threading.Tasks;
-using DevHome.Common.Extensions;
-using DevHome.Common.Helpers;
-using DevHome.DevDiagnostics.Helpers;
-using DevHome.DevDiagnostics.Models;
-using DevHome.Service;
-using Microsoft.Extensions.Configuration;
-using Microsoft.UI.Dispatching;
-using Microsoft.UI.Xaml;
-using Microsoft.Windows.AppLifecycle;
-using Serilog;
-using Windows.ApplicationModel.Activation;
-using WinRT;
-
-namespace DevHome.DevDiagnostics;
-
-public static class Program
-{
- private static App? _app;
- private static bool _firstActivation = true;
-
- [global::System.Runtime.InteropServices.DllImport("Microsoft.ui.xaml.dll")]
- [global::System.Runtime.InteropServices.DefaultDllImportSearchPaths(global::System.Runtime.InteropServices.DllImportSearchPath.SafeDirectories)]
- private static extern void XamlCheckProcessRequirements();
-
- private const string MainInstanceKey = "mainInstance";
-
- private const string ElevatedInstanceKey = "elevatedInstance";
-
- [STAThread]
- public static void Main(string[] args)
- {
- // Set up Logging
- Environment.SetEnvironmentVariable("DEVHOME_LOGS_ROOT", Path.Join(Common.Logging.LogFolderRoot, "DevHome.DevDiagnostics"));
- var configuration = new ConfigurationBuilder()
- .AddJsonFile("appsettings_dd.json")
- .Build();
- Log.Logger = new LoggerConfiguration()
- .ReadFrom.Configuration(configuration)
- .CreateLogger();
-
- var stopEvent = new EventWaitHandle(false, EventResetMode.ManualReset, $"DevHomeDD-{Environment.ProcessId}");
- ThreadPool.QueueUserWorkItem((o) =>
- {
- var waitResult = stopEvent.WaitOne();
-
- _app?.UIDispatcher?.TryEnqueue(() =>
- {
- var primaryWindow = Application.Current.GetService();
- primaryWindow.Close();
- });
- });
-
- try
- {
- XamlCheckProcessRequirements();
-
- WinRT.ComWrappersSupport.InitializeComWrappers();
-
- var isRedirect = DecideRedirection().GetAwaiter().GetResult();
-
- if (!isRedirect)
- {
- Log.Information("Starting application");
- Application.Start((p) =>
- {
- var dispatcherQueue = DispatcherQueue.GetForCurrentThread();
- var context = new DispatcherQueueSynchronizationContext(dispatcherQueue);
- SynchronizationContext.SetSynchronizationContext(context);
- _app = new App();
- OnActivated(null, AppInstance.GetCurrent().GetActivatedEventArgs());
- });
- }
-
- stopEvent.Close();
- stopEvent.Dispose();
- }
- catch (Exception ex)
- {
- Log.Fatal(ex, "Application start-up failed");
- }
- finally
- {
- Log.CloseAndFlush();
- }
- }
-
- private static async Task DecideRedirection()
- {
- var activatedEventArgs = AppInstance.GetCurrent().GetActivatedEventArgs();
- var isElevatedInstancePresent = false;
- var isUnElevatedInstancePresent = false;
- var instanceList = AppInstance.GetInstances();
- foreach (var appInstance in instanceList)
- {
- if (appInstance.Key.Equals(MainInstanceKey, StringComparison.OrdinalIgnoreCase))
- {
- isUnElevatedInstancePresent = true;
- }
- else if (appInstance.Key.Equals(ElevatedInstanceKey, StringComparison.OrdinalIgnoreCase))
- {
- isElevatedInstancePresent = true;
- }
- }
-
- AppInstance instance;
- if (isElevatedInstancePresent)
- {
- // Redirect to the elevated instance if present.
- instance = AppInstance.FindOrRegisterForKey(ElevatedInstanceKey);
- }
- else if (RuntimeHelper.IsCurrentProcessRunningAsAdmin())
- {
- // Wait for unelevated instance to exit
- while (isUnElevatedInstancePresent)
- {
- isUnElevatedInstancePresent = false;
- instanceList = AppInstance.GetInstances();
- foreach (var appInstance in instanceList)
- {
- if (appInstance.Key.Equals(MainInstanceKey, StringComparison.OrdinalIgnoreCase))
- {
- isUnElevatedInstancePresent = true;
- var stopAppInstance = new EventWaitHandle(false, EventResetMode.ManualReset, $"DevHomeDD-{appInstance.ProcessId}");
- stopAppInstance.Set();
- }
- }
- }
-
- // Register the elevated instance key
- instance = AppInstance.FindOrRegisterForKey(ElevatedInstanceKey);
- }
- else
- {
- instance = AppInstance.FindOrRegisterForKey(MainInstanceKey);
- }
-
- var isRedirect = false;
- if (instance.IsCurrent)
- {
- instance.Activated += OnActivated;
- }
- else
- {
- // Redirect the activation (and args) to the registered instance, and exit.
- await instance.RedirectActivationToAsync(activatedEventArgs);
- isRedirect = true;
- }
-
- return isRedirect;
- }
-
- private static void OnActivated(object? sender, Microsoft.Windows.AppLifecycle.AppActivationArguments e)
- {
- var wasFirstActivation = _firstActivation;
- _firstActivation = false;
- var commandLine = string.Empty;
- if (e.Kind == Microsoft.Windows.AppLifecycle.ExtendedActivationKind.Launch)
- {
- commandLine = e.Data.As().Arguments;
- }
- else if (e.Kind == Microsoft.Windows.AppLifecycle.ExtendedActivationKind.StartupTask)
- {
- // Start the app in the background to handle the startup task and register the hotkey
- if (wasFirstActivation && !App.IsFeatureEnabled())
- {
- // Exit the process if PI Expermental feature is not enabled and its the first activation in the process
- Log.Information("Experimental feature is not enabled. Exiting the process.");
- Process.GetCurrentProcess().Kill(false);
- }
-
- // Don't show the bar window for startup task activations.
- return;
- }
-
- // Convert commandLine into a string array. We just can't split based just on spaces, in case there are spaces inclosed in quotes
- // i.e. --application "My App"
- var commandLineArgs = Regex.Matches(commandLine, @"[\""].+?[\""]|[^ ]+").Select(m => m.Value).ToArray();
-
- // TODO: This should be replaced with system.commandline Microsoft.Extensions.Configuration
- // is not intended to be a general purpose commandline parser, but rather only supports /key=value or /key value pairs
- var builder = new ConfigurationBuilder();
- builder.AddCommandLine(commandLineArgs);
- var config = builder.Build();
-
- Process? targetProcess = null;
- var targetApp = config["application"];
- var targetPid = config["pid"];
- var pageToExpand = config["expandWindow"];
-
- try
- {
- if (targetApp != null)
- {
- Debug.Assert(targetApp != string.Empty, "Why is appname empty?");
-
- Process[] processes = Process.GetProcessesByName(targetApp);
- if (processes.Length > 0)
- {
- targetProcess = processes[0];
- }
- }
- else if (targetPid != null)
- {
- var pid = int.Parse(targetPid, CultureInfo.CurrentCulture);
- targetProcess = Process.GetProcessById(pid);
- }
- }
- catch (Exception ex)
- {
- Log.Error(ex, "Failed to find target process {TargetApp} {TargetPid}", targetApp, targetPid);
- }
-
- Debug.Assert(_app != null, "Why is _app null on a redirection?");
-
- // Be sure to set the target app on the UI thread
- _app?.UIDispatcher?.TryEnqueue(() =>
- {
- if (targetProcess != null)
- {
- TargetAppData.Instance.SetNewAppData(targetProcess, Windows.Win32.Foundation.HWND.Null);
- }
-
- // Show the bar window
- var primaryWindow = Application.Current.GetService();
- primaryWindow.ShowBarWindow();
-
- if (pageToExpand != null)
- {
- var barWindow = primaryWindow.DBarWindow;
- Debug.Assert(barWindow is not null, "We show the bar window, so it cannot be null here");
-
- var pageType = Type.GetType($"DevHome.DevDiagnostics.ViewModels.{pageToExpand}");
- if (pageType is not null)
- {
- barWindow.NavigateTo(pageType);
- }
- }
- });
- }
-}
diff --git a/tools/DevDiagnostics/DevHome.DevDiagnostics/Properties/PublishProfiles/win-arm64.pubxml b/tools/DevDiagnostics/DevHome.DevDiagnostics/Properties/PublishProfiles/win-arm64.pubxml
deleted file mode 100644
index 227cf87736..0000000000
--- a/tools/DevDiagnostics/DevHome.DevDiagnostics/Properties/PublishProfiles/win-arm64.pubxml
+++ /dev/null
@@ -1,16 +0,0 @@
-
-
-
-
- FileSystem
- arm64
- win-arm64
- true
- False
- False
- True
- True
-
-
\ No newline at end of file
diff --git a/tools/DevDiagnostics/DevHome.DevDiagnostics/Properties/PublishProfiles/win-x64.pubxml b/tools/DevDiagnostics/DevHome.DevDiagnostics/Properties/PublishProfiles/win-x64.pubxml
deleted file mode 100644
index 19ae2a6b9c..0000000000
--- a/tools/DevDiagnostics/DevHome.DevDiagnostics/Properties/PublishProfiles/win-x64.pubxml
+++ /dev/null
@@ -1,16 +0,0 @@
-
-
-
-
- FileSystem
- x64
- win-x64
- true
- False
- False
- True
- True
-
-
\ No newline at end of file
diff --git a/tools/DevDiagnostics/DevHome.DevDiagnostics/Properties/PublishProfiles/win-x86.pubxml b/tools/DevDiagnostics/DevHome.DevDiagnostics/Properties/PublishProfiles/win-x86.pubxml
deleted file mode 100644
index dace1fa912..0000000000
--- a/tools/DevDiagnostics/DevHome.DevDiagnostics/Properties/PublishProfiles/win-x86.pubxml
+++ /dev/null
@@ -1,16 +0,0 @@
-
-
-
-
- FileSystem
- x86
- win-x86
- true
- False
- False
- True
- True
-
-
\ No newline at end of file
diff --git a/tools/DevDiagnostics/DevHome.DevDiagnostics/Properties/Settings.Designer.cs b/tools/DevDiagnostics/DevHome.DevDiagnostics/Properties/Settings.Designer.cs
deleted file mode 100644
index 8bed57117e..0000000000
--- a/tools/DevDiagnostics/DevHome.DevDiagnostics/Properties/Settings.Designer.cs
+++ /dev/null
@@ -1,256 +0,0 @@
-//------------------------------------------------------------------------------
-//
-// This code was generated by a tool.
-// Runtime Version:4.0.30319.42000
-//
-// Changes to this file may cause incorrect behavior and will be lost if
-// the code is regenerated.
-//
-//------------------------------------------------------------------------------
-
-namespace DevHome.DevDiagnostics.Properties {
-
-
- [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
- [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "17.11.0.0")]
- internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
-
- private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
-
- public static Settings Default {
- get {
- return defaultInstance;
- }
- }
-
- [global::System.Configuration.UserScopedSettingAttribute()]
- [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
- [global::System.Configuration.DefaultSettingValueAttribute("False")]
- public bool IsProcessFilterIncludeConHost {
- get {
- return ((bool)(this["IsProcessFilterIncludeConHost"]));
- }
- set {
- this["IsProcessFilterIncludeConHost"] = value;
- }
- }
-
- [global::System.Configuration.UserScopedSettingAttribute()]
- [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
- [global::System.Configuration.DefaultSettingValueAttribute("False")]
- public bool IsProcessFilterIncludeDllHost {
- get {
- return ((bool)(this["IsProcessFilterIncludeDllHost"]));
- }
- set {
- this["IsProcessFilterIncludeDllHost"] = value;
- }
- }
-
- [global::System.Configuration.UserScopedSettingAttribute()]
- [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
- [global::System.Configuration.DefaultSettingValueAttribute("False")]
- public bool IsProcessFilterIncludeSvcHost {
- get {
- return ((bool)(this["IsProcessFilterIncludeSvcHost"]));
- }
- set {
- this["IsProcessFilterIncludeSvcHost"] = value;
- }
- }
-
- [global::System.Configuration.UserScopedSettingAttribute()]
- [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
- [global::System.Configuration.DefaultSettingValueAttribute("False")]
- public bool IsProcessFilterIncludeEdge {
- get {
- return ((bool)(this["IsProcessFilterIncludeEdge"]));
- }
- set {
- this["IsProcessFilterIncludeEdge"] = value;
- }
- }
-
- [global::System.Configuration.UserScopedSettingAttribute()]
- [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
- [global::System.Configuration.DefaultSettingValueAttribute("False")]
- public bool IsProcessFilterIncludeWebview {
- get {
- return ((bool)(this["IsProcessFilterIncludeWebview"]));
- }
- set {
- this["IsProcessFilterIncludeWebview"] = value;
- }
- }
-
- [global::System.Configuration.UserScopedSettingAttribute()]
- [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
- [global::System.Configuration.DefaultSettingValueAttribute("False")]
- public bool IsProcessFilterIncludeRtb {
- get {
- return ((bool)(this["IsProcessFilterIncludeRtb"]));
- }
- set {
- this["IsProcessFilterIncludeRtb"] = value;
- }
- }
-
- [global::System.Configuration.UserScopedSettingAttribute()]
- [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
- [global::System.Configuration.DefaultSettingValueAttribute("False")]
- public bool IsProcessFilterIncludeWmi {
- get {
- return ((bool)(this["IsProcessFilterIncludeWmi"]));
- }
- set {
- this["IsProcessFilterIncludeWmi"] = value;
- }
- }
-
- [global::System.Configuration.UserScopedSettingAttribute()]
- [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
- [global::System.Configuration.DefaultSettingValueAttribute("False")]
- public bool IsProcessFilterIncludeWudf {
- get {
- return ((bool)(this["IsProcessFilterIncludeWudf"]));
- }
- set {
- this["IsProcessFilterIncludeWudf"] = value;
- }
- }
-
- [global::System.Configuration.UserScopedSettingAttribute()]
- [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
- [global::System.Configuration.DefaultSettingValueAttribute("False")]
- public bool IsProcessFilterIncludeBgTaskHost {
- get {
- return ((bool)(this["IsProcessFilterIncludeBgTaskHost"]));
- }
- set {
- this["IsProcessFilterIncludeBgTaskHost"] = value;
- }
- }
-
- [global::System.Configuration.UserScopedSettingAttribute()]
- [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
- [global::System.Configuration.DefaultSettingValueAttribute("Default")]
- public string CurrentTheme {
- get {
- return ((string)(this["CurrentTheme"]));
- }
- set {
- this["CurrentTheme"] = value;
- }
- }
-
- [global::System.Configuration.UserScopedSettingAttribute()]
- [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
- [global::System.Configuration.DefaultSettingValueAttribute("True")]
- public bool IsCpuUsageMonitoringEnabled {
- get {
- return ((bool)(this["IsCpuUsageMonitoringEnabled"]));
- }
- set {
- this["IsCpuUsageMonitoringEnabled"] = value;
- }
- }
-
- [global::System.Configuration.UserScopedSettingAttribute()]
- [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
- [global::System.Configuration.DefaultSettingValueAttribute("False")]
- public bool IsInsightsOnStartupEnabled {
- get {
- return ((bool)(this["IsInsightsOnStartupEnabled"]));
- }
- set {
- this["IsInsightsOnStartupEnabled"] = value;
- }
- }
-
- [global::System.Configuration.UserScopedSettingAttribute()]
- [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
- [global::System.Configuration.DefaultSettingValueAttribute("True")]
- public bool IsClipboardMonitoringEnabled {
- get {
- return ((bool)(this["IsClipboardMonitoringEnabled"]));
- }
- set {
- this["IsClipboardMonitoringEnabled"] = value;
- }
- }
-
- [global::System.Configuration.UserScopedSettingAttribute()]
- [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
- [global::System.Configuration.DefaultSettingValueAttribute("\r\n\r\n DevHome.DevDiagnostics\r\n DevEnv\r\n")]
- public global::System.Collections.Specialized.StringCollection ExcludedProcesses {
- get {
- return ((global::System.Collections.Specialized.StringCollection)(this["ExcludedProcesses"]));
- }
- set {
- this["ExcludedProcesses"] = value;
- }
- }
-
- [global::System.Configuration.UserScopedSettingAttribute()]
- [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
- [global::System.Configuration.DefaultSettingValueAttribute("0")]
- public double ExpandedWindowHeight {
- get {
- return ((double)(this["ExpandedWindowHeight"]));
- }
- set {
- this["ExpandedWindowHeight"] = value;
- }
- }
-
- [global::System.Configuration.UserScopedSettingAttribute()]
- [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
- [global::System.Configuration.DefaultSettingValueAttribute("True")]
- public bool ApplyAppFilteringToData {
- get {
- return ((bool)(this["ApplyAppFilteringToData"]));
- }
- set {
- this["ApplyAppFilteringToData"] = value;
- }
- }
-
- [global::System.Configuration.UserScopedSettingAttribute()]
- [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
- [global::System.Configuration.DefaultSettingValueAttribute("0")]
- public double WindowWidth {
- get {
- return ((double)(this["WindowWidth"]));
- }
- set {
- this["WindowWidth"] = value;
- }
- }
-
- [global::System.Configuration.UserScopedSettingAttribute()]
- [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
- [global::System.Configuration.DefaultSettingValueAttribute("True")]
- public bool IsClipboardMonitorToolPinned {
- get {
- return ((bool)(this["IsClipboardMonitorToolPinned"]));
- }
- set {
- this["IsClipboardMonitorToolPinned"] = value;
- }
- }
-
- [global::System.Configuration.UserScopedSettingAttribute()]
- [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
- [global::System.Configuration.DefaultSettingValueAttribute("True")]
- public bool IsImageOptionsToolPinned {
- get {
- return ((bool)(this["IsImageOptionsToolPinned"]));
- }
- set {
- this["IsImageOptionsToolPinned"] = value;
- }
- }
- }
-}
diff --git a/tools/DevDiagnostics/DevHome.DevDiagnostics/Properties/Settings.settings b/tools/DevDiagnostics/DevHome.DevDiagnostics/Properties/Settings.settings
deleted file mode 100644
index b343d1786d..0000000000
--- a/tools/DevDiagnostics/DevHome.DevDiagnostics/Properties/Settings.settings
+++ /dev/null
@@ -1,67 +0,0 @@
-
-
-
-
-
- False
-
-
- False
-
-
- False
-
-
- False
-
-
- False
-
-
- False
-
-
- False
-
-
- False
-
-
- False
-
-
- Default
-
-
- True
-
-
- False
-
-
- True
-
-
- <?xml version="1.0" encoding="utf-16"?>
-<ArrayOfString xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
- <string>DevHome.DevDiagnostics</string>
- <string>DevEnv</string>
-</ArrayOfString>
-
-
- 0
-
-
- True
-
-
- 0
-
-
- True
-
-
- True
-
-
-
\ No newline at end of file
diff --git a/tools/DevDiagnostics/DevHome.DevDiagnostics/Properties/launchSettings.json b/tools/DevDiagnostics/DevHome.DevDiagnostics/Properties/launchSettings.json
deleted file mode 100644
index 6b879c1875..0000000000
--- a/tools/DevDiagnostics/DevHome.DevDiagnostics/Properties/launchSettings.json
+++ /dev/null
@@ -1,8 +0,0 @@
-{
- "profiles": {
- "DevHome.PI (Unpackaged)": {
- "commandName": "Project",
- "nativeDebugging": true
- }
- }
-}
\ No newline at end of file
diff --git a/tools/DevDiagnostics/DevHome.DevDiagnostics/Services/DDAppInfoService.cs b/tools/DevDiagnostics/DevHome.DevDiagnostics/Services/DDAppInfoService.cs
deleted file mode 100644
index 1d8cbafed6..0000000000
--- a/tools/DevDiagnostics/DevHome.DevDiagnostics/Services/DDAppInfoService.cs
+++ /dev/null
@@ -1,28 +0,0 @@
-// Copyright (c) Microsoft Corporation.
-// Licensed under the MIT License.
-
-using System;
-using System.IO;
-using System.Reflection;
-using DevHome.Common.Helpers;
-using Windows.ApplicationModel;
-
-namespace DevHome.DevDiagnostics.Services;
-
-public class DDAppInfoService
-{
- public string IconPath { get; } = Path.Combine(AppContext.BaseDirectory, "Images/DD.ico");
-
- public Version GetAppVersion()
- {
- if (RuntimeHelper.IsMSIX)
- {
- var packageVersion = Package.Current.Id.Version;
- return new(packageVersion.Major, packageVersion.Minor, packageVersion.Build, packageVersion.Revision);
- }
- else
- {
- return Assembly.GetExecutingAssembly().GetName().Version!;
- }
- }
-}
diff --git a/tools/DevDiagnostics/DevHome.DevDiagnostics/Services/DDInsightsService.cs b/tools/DevDiagnostics/DevHome.DevDiagnostics/Services/DDInsightsService.cs
deleted file mode 100644
index 4787b951e5..0000000000
--- a/tools/DevDiagnostics/DevHome.DevDiagnostics/Services/DDInsightsService.cs
+++ /dev/null
@@ -1,70 +0,0 @@
-// Copyright (c) Microsoft Corporation.
-// Licensed under the MIT License.
-
-using System;
-using System.Collections.ObjectModel;
-using System.ComponentModel;
-using System.Diagnostics;
-using System.Linq;
-using CommunityToolkit.Mvvm.ComponentModel;
-using DevHome.DevDiagnostics.Models;
-
-namespace DevHome.DevDiagnostics.Services;
-
-public partial class DDInsightsService : ObservableObject
-{
- private Process? _targetProcess;
-
- [ObservableProperty]
- private int _unreadCount;
-
- [ObservableProperty]
- private ObservableCollection _insightsList;
-
- public DDInsightsService()
- {
- TargetAppData.Instance.PropertyChanged += TargetApp_PropertyChanged;
- _insightsList = [];
-
- var process = TargetAppData.Instance.TargetProcess;
- if (process is not null)
- {
- UpdateTargetProcess(process);
- }
- }
-
- public void UpdateTargetProcess(Process process)
- {
- if (_targetProcess != process)
- {
- _targetProcess = process;
- InsightsList.Clear();
- UnreadCount = 0;
- }
- }
-
- private void TargetApp_PropertyChanged(object? sender, PropertyChangedEventArgs e)
- {
- if (e.PropertyName == nameof(TargetAppData.TargetProcess))
- {
- if (TargetAppData.Instance.TargetProcess is not null)
- {
- UpdateTargetProcess(TargetAppData.Instance.TargetProcess);
- }
- }
- }
-
- internal void AddInsight(Insight insight)
- {
- insight.PropertyChanged += (sender, e) =>
- {
- if (e.PropertyName == nameof(Insight.HasBeenRead))
- {
- UnreadCount = InsightsList.Count(insight => !insight.HasBeenRead);
- }
- };
-
- UnreadCount++;
- InsightsList.Add(insight);
- }
-}
diff --git a/tools/DevDiagnostics/DevHome.DevDiagnostics/Services/DDNavigationService.cs b/tools/DevDiagnostics/DevHome.DevDiagnostics/Services/DDNavigationService.cs
deleted file mode 100644
index 1b8eeb1511..0000000000
--- a/tools/DevDiagnostics/DevHome.DevDiagnostics/Services/DDNavigationService.cs
+++ /dev/null
@@ -1,166 +0,0 @@
-// Copyright (c) Microsoft Corporation.
-// Licensed under the MIT License.
-
-using System.Diagnostics.CodeAnalysis;
-using DevHome.Common.Extensions;
-using DevHome.Common.Services;
-using DevHome.DevDiagnostics.Contracts.ViewModels;
-using DevHome.DevDiagnostics.ViewModels;
-using Microsoft.UI.Xaml;
-using Microsoft.UI.Xaml.Controls;
-using Microsoft.UI.Xaml.Navigation;
-
-namespace DevHome.DevDiagnostics.Services;
-
-// Similar to DevHome.Services.NavigationService
-internal sealed class DDNavigationService : INavigationService
-{
- private readonly IPageService pageService;
- private object? lastParameterUsed;
- private Frame? frame;
- private string? defaultPage;
-
- public object? LastParameterUsed => lastParameterUsed;
-
- public event NavigatedEventHandler? Navigated;
-
- public Frame? Frame
- {
- get
- {
- if (frame == null)
- {
- var barWindow = Application.Current.GetService().DBarWindow;
- frame = barWindow?.GetFrame();
- if (frame is not null)
- {
- RegisterFrameEvents();
- }
- }
-
- return frame;
- }
-
- set
- {
- UnregisterFrameEvents();
- frame = value;
- RegisterFrameEvents();
- }
- }
-
- public string DefaultPage
- {
- get => defaultPage ?? typeof(AppDetailsPageViewModel).FullName ?? string.Empty;
- set => defaultPage = value;
- }
-
- [MemberNotNullWhen(true, nameof(Frame), nameof(frame))]
- public bool CanGoBack => Frame != null && Frame.CanGoBack;
-
- [MemberNotNullWhen(true, nameof(Frame), nameof(frame))]
- public bool CanGoForward => Frame != null && Frame.CanGoForward;
-
- public DDNavigationService(IPageService pageService)
- {
- this.pageService = pageService;
- }
-
- private void RegisterFrameEvents()
- {
- if (frame != null)
- {
- frame.Navigated += OnNavigated;
- }
- }
-
- private void UnregisterFrameEvents()
- {
- if (frame != null)
- {
- frame.Navigated -= OnNavigated;
- }
- }
-
- public bool GoBack()
- {
- if (CanGoBack)
- {
- var vmBeforeNavigation = GetPageViewModel(frame);
- frame.GoBack();
- if (vmBeforeNavigation is INavigationAware navigationAware)
- {
- navigationAware.OnNavigatedFrom();
- }
-
- return true;
- }
-
- return false;
- }
-
- public bool GoForward()
- {
- if (CanGoForward)
- {
- var vmBeforeNavigation = GetPageViewModel(frame);
- frame.GoForward();
- if (vmBeforeNavigation is INavigationAware navigationAware)
- {
- navigationAware.OnNavigatedFrom();
- }
-
- return true;
- }
-
- return false;
- }
-
- public bool NavigateTo(string pageKey, object? parameter = null, bool clearNavigation = false)
- {
- var pageType = pageService.GetPageType(pageKey);
-
- if (frame != null && (frame.Content?.GetType() != pageType || (parameter != null && !parameter.Equals(lastParameterUsed))))
- {
- frame.Tag = clearNavigation;
- var vmBeforeNavigation = GetPageViewModel(frame);
- var navigated = frame.Navigate(pageType, parameter);
- if (navigated)
- {
- lastParameterUsed = parameter;
- if (vmBeforeNavigation is INavigationAware navigationAware)
- {
- navigationAware.OnNavigatedFrom();
- }
- }
-
- return navigated;
- }
-
- return false;
- }
-
- private void OnNavigated(object sender, NavigationEventArgs e)
- {
- if (sender is Frame frame)
- {
- var clearNavigation = (bool)frame.Tag;
- if (clearNavigation)
- {
- frame.BackStack.Clear();
- }
-
- if (GetPageViewModel(frame) is INavigationAware navigationAware)
- {
- navigationAware.OnNavigatedTo(e.Parameter);
- }
-
- Navigated?.Invoke(sender, e);
- }
- }
-
- public static object? GetPageViewModel(Frame frame)
- {
- return frame.Content?.GetType().GetProperty("_viewModel")?.GetValue(frame.Content, null);
- }
-}
diff --git a/tools/DevDiagnostics/DevHome.DevDiagnostics/Services/DDPageService.cs b/tools/DevDiagnostics/DevHome.DevDiagnostics/Services/DDPageService.cs
deleted file mode 100644
index 04d4575fed..0000000000
--- a/tools/DevDiagnostics/DevHome.DevDiagnostics/Services/DDPageService.cs
+++ /dev/null
@@ -1,73 +0,0 @@
-// Copyright (c) Microsoft Corporation.
-// Licensed under the MIT License.
-
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using CommunityToolkit.Mvvm.ComponentModel;
-using DevHome.Common.Services;
-using DevHome.DevDiagnostics.Pages;
-using DevHome.DevDiagnostics.ViewModels;
-using Microsoft.UI.Xaml.Controls;
-
-namespace DevHome.DevDiagnostics.Services;
-
-// Similar to DevHome.Services.PageService
-internal sealed class DDPageService : IPageService
-{
- private readonly Dictionary _pages = new();
-
- public DDPageService()
- {
- Configure();
- Configure();
- Configure();
- Configure();
- Configure();
- Configure();
- Configure();
- Configure();
-
- // Settings sub-_pages.
- Configure();
- Configure();
- Configure();
- Configure();
- }
-
- public Type GetPageType(string key)
- {
- Type? pageType;
- lock (_pages)
- {
- if (!_pages.TryGetValue(key, out pageType))
- {
- throw new ArgumentException($"Page not found: {key}. Did you forget to call PageService.Configure?");
- }
- }
-
- return pageType;
- }
-
- public void Configure()
- where T_VM : ObservableObject
- where T_V : Page
- {
- lock (_pages)
- {
- var key = typeof(T_VM).FullName!;
- if (_pages.ContainsKey(key))
- {
- throw new ArgumentException($"The key {key} is already configured in PageService");
- }
-
- var type = typeof(T_V);
- if (_pages.Any(p => p.Value == type))
- {
- throw new ArgumentException($"This type is already configured with key {_pages.First(p => p.Value == type).Key}");
- }
-
- _pages.Add(key, type);
- }
- }
-}
diff --git a/tools/DevDiagnostics/DevHome.DevDiagnostics/Strings/en-us/Resources.resw b/tools/DevDiagnostics/DevHome.DevDiagnostics/Strings/en-us/Resources.resw
deleted file mode 100644
index 71291b0a5a..0000000000
--- a/tools/DevDiagnostics/DevHome.DevDiagnostics/Strings/en-us/Resources.resw
+++ /dev/null
@@ -1,1325 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- text/microsoft-resx
-
-
- 2.0
-
-
- System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
-
-
- System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
-
-
- Minimize
- Tooltip for the minimize button in the BarWindow
-
-
- Maximize
- Tooltip for the maximize button in the BarWindow
-
-
- Pin
- A label for the menu item to pin a tool on the bar.
-
-
- Unregister
- The label for Unregister menu flyout for an icon in the toolbar. This will cause the program to no longer be registered with the bar.
-
-
- Expand the large content panel
- The tooltip for a button which expands the large content panel.
-
-
- Settings
- The tooltip for a button that takes the user to the settings for Dev Diagnostics.
-
-
- External tools: add/remove, configure and launch
- The tooltip for a button that takes the user to the external tools section of Dev Diagnostics.
-
-
- Error
- The title of an error message dialog when something goes wrong.
-
-
- Failed to launch: {0}
- {Locked="{0}"} Text for when there was an error launching an external tool. {0} is the name of an executable(.exe) file.
-
-
- App details
- The contents of a text block referring to details about an application.
-
-
- ID
- The contents of a text block referring to identity (ID) of an application.
-
-
- Base priority
- The contents of a text block referring to base CPU priority of an application.
-
-
- Priority class
- The contents of a text block referring to scheduling priority of an application.
-
-
- Main module
- This refers to the main module of an application like winword.exe or notepad.exe as an example.
-
-
- CPU architecture
- This refers to the CPU architecture of the target process and the host machine.
-
-
- MSIX packaged
- This refers to whether the application is using MSIX packaging technology.
-
-
- Loaded modules
- The contents of a text block referring to loaded application modules.
-
-
- File Version Info
- The contents of a text block referring to version of the module file loaded by an application.
-
-
- Memory Size
- The contents of a text block referring to size in memory of the module.
-
-
- Filter...
- The contents of a combo box that allows editing to filter out elements.
-
-
- BgTaskHost
- {Locked}The contents of a check box that refers to specific process names.
-
-
- ConHost
- {Locked}The contents of a check box that refers to specific process names.
-
-
- DllHost
- {Locked}The contents of a check box that refers to specific process names.
-
-
- SvcHost
- {Locked}The contents of a check box that refers to specific process names.
-
-
- MsEdgeWebView2
- {Locked}The contents of a check box that refers to specific process names.
-
-
- RuntimeBroker
- {Locked}The contents of a check box that refers to specific process names.
-
-
- WmiPrvSe
- {Locked}The contents of a check box that refers to specific process names.
-
-
- WudfHost
- {Locked}The contents of a check box that refers to specific process names.
-
-
- Refresh the process list
- The contents of a button tool tip that will refresh the contents of the list.
-
-
- PID
- Process identifier.
-
-
- Executable
- The name of a process (winword.exe or notepad.exe for example).
-
-
- Resource usage
- The contents of a text block referring to process resource usage information.
-
-
- Is responding
- Refers to whether the application or process is responsive, or if it is stuck.
-
-
- CPU usage
- Refers to how much of the central processing unit (CPU) the process is utilizing.
-
-
- GPU usage
- Refers to how much of the graphical processing unit (GPU) the process is utilizing.
-
-
- Memory usage
- Refers to how much random access memory (RAM) the process is utilizing.
-
-
- Disk usage
- Refers to how much disk storage (hard drive/solid state drive) the process is utilizing.
-
-
- Crash reports
- The contents of a WER crash dumps.
-
-
- Time generated
- The time at which the WER report was generated.
-
-
- Faulting executable
- Refers to the process/application executable which caused the fault which generated the crash report
-
-
- Info about the Windows Error Report
- Refers to the WER diagnostic information about a process crash.
-
-
- Windows logs
- The contents of a text block referring to Windows logs.
-
-
- Event Tracing for Windows (ETW) logs
- Whether to enable Event Trace for Windows (ETW) logs in the log view output.
-
-
- Debug output from the target app
- Tooltip for whether to enable debug output (from OutputDebugString API) in the log view output.
-
-
- Entries from the event log for the target app
- Tooltip for whether to enable event viewer logs in the log view output.
-
-
- Entries from the event log for the target app
- Tooltip for whether the WER report logs are shown in the log view output.
-
-
- Clear the list
- Tooltip for a button that will clear the log list.
-
-
- Time Generated
- The time at which the log was generated.
-
-
- Category
- A header for what category the log entry belongs.
-
-
- Tool
- A header for what tool generated the log entry.
-
-
- Message
- The contents of a log entry.
-
-
- Could not start OutputDebugString monitor since there is one already running.
- An error message indicating that the resource is mutually exclusive due to an instance already running.
-
-
- Tool Name
- The name the user can assign to the tool they are adding.
-
-
- Tool path
- The name the user can assign to the tool they are adding.
-
-
- Browse
- A button to browse the filesystem.
-
-
- Basic arguments
- Refers to arguments that can be passed to a process when it is created
-
-
- None
- Refers to the type of data being shown
-
-
- Prefix (if any)
- Refers to arguments that can be passed to a process when it is created
-
-
- OK
- An affirmative value for a button
-
-
- Cancel
- Cancels the current operation the user is performing
-
-
- Name
- The name of a tool that could be edited.
-
-
- Unregister
- Text on a button for unregistering a tool.
-
-
- Settings
- The contents of a text block refering to settings.
-
-
- Preferences
- The contents of a text block refering to a user's settings preferences.
-
-
- Theme selection
- The contents of a text block refering to an application's color theme.
-
-
- Light
- Refers to a color theme or scheme
-
-
- Dark
- Refers to a color theme or scheme
-
-
- Windows default
- Refers to a color theme or scheme
-
-
- Additional tools
- Refers to tools the user has added.
-
-
- Add a tool to the bar
- Refers to tools a user could add to the bar UI.
-
-
- Edit the configuration for registered tools
- Refers to tools a user could edit that are already registered to the bar UI.
-
-
- Monitor CPU usage for the target app
- Refers tracing central processing unit (CPU) usage of the app the user has selected.
-
-
- Show Insights on start-up
- Refers showing insightful suggestions to the user about the app on startup.
-
-
- Enable Clipboard monitoring
- Refers monitoring the user's clipboard for error messages.
-
-
- Processes to exclude when finding the foreground window. Enter the process names here, comma-separated.
- Refers application process names for example notepad.exe, winword.exe etc, in a comma-separated list.
-
-
- Save
- Saves the data that the user has input.
-
-
- About
- A header for an about page.
-
-
- App Info
- The contents of a text block refering to the main window title.
-
-
- File error
- The contents of a text block refering to the main window title.
-
-
- The Event Log lists several entries where the app has tried to open a file at 'C:\\Temp\\Scratch\\Foo.jpg'. That folder path exists, and you do have permission to access it, but the file specified does not exist in that path. However, I can see that there is a file with that name at a different folder path: 'C:\\Temp\\Foo.jpg' - perhaps this is the one you're looking for.
- The contents of a text label.
-
-
- See more
- The contents of a text label.
-
-
- Resource usage
- The contents of a text label for computer resource usage (CPU/GPU/Disk/Network etc).
-
-
- Over the last 24 hours, this app has exceeded 30% of CPU usage on 247 separate occasions. If the app is doing compute-intensive operations, this might be reasonable, but you should examine your code and your tests to ensure that this is within expected parameters.
- The contents of a text label for computer resource usage (CPU/GPU/Disk/Network etc).
-
-
- See more
- The contents of a text label.
-
-
- Hex
- This refers to a short hand for hexadecimal number notation.
-
-
- Dec
- This refers to a short hand for decimal number notation.
-
-
- Code
- This refers to a short hand for an error code representation of the contents of the clipboard.
-
-
- Is running as Admin
- This refers to whether the application is running as admin
-
-
- Is running as System
- This refers to whether the application is running as System
-
-
- Go to the key insights
- The tooltip for a button that takes the user to the key insights page
-
-
- Process list
- The contents of a text block referring to Process list.
-
-
- {0} (terminated)
- {Locked="{0}"} Text indicating that the process has terminated. {0} is the process name.
-
-
- Insights
- The contents of a text block referring to Insights.
-
-
- Help
- Description of the error code
-
-
- PID: {0}
- {Locked="{0}"} Showing a process identifier. {0} is an integer
-
-
- {0:0.0}% CPU usage
- {Locked="{0:0.0}"} Showing CPU utilization. {0} is a percentage 0-100
-
-
- {0:N2} MB Memory used
- {Locked="{0:N2}"} Showing RAM utilization. MB stands for megabytes. {0} is a number.
-
-
- {0:N0} MB/s Disk utilization
- {Locked="{0:N0}"} Showing disk utilization. MB/s stands for megabytes per second. {0} is a number.
-
-
- cpu: n/a %
- Showing CPU utilization which is not available/applicable.
-
-
- memory: n/a MB
- Showing RAM utilization which is not available/applicable. MB stands for megabytes.
-
-
- dsk: n/a MB/s
- Showing disk utilization which is not available/applicable. MB/s stands for megabytes per second.
-
-
- {0} CPU usage: {1:0.0}%
- {Locked="{0},{1:0.0}"} A notification for CPU usage. {0} is the name of a process (notepad.exe for example). {1} is a percentage
-
-
- GOT UNHANDLED EVENT: {0}
- {Locked="{0}"} An error message when an unhandled trace event is encountered. {0} is a verbose version of the event
-
-
- Could not start EventViewer
- An error message when the program is unable to start the Windows Event Viewer
-
-
- Locked file
- Describes a computer file that is locked for exclusive access
-
-
- The app is trying to access the file '{0}', but this is locked by '{1}'. To fix this, close '{1}'
- {Locked="{0}", "{1}"} A description to help a user that is dealing with a file locked for exclusive access. {0} is a file name. {1} is the name of an executable(.exe) process.
-
-
- The app is trying to access the file '{0}', but this is locked by an unknown process
- {Locked="{0}"} A description to help a user that is dealing with a file locked for exclusive access. {0} is a file name.
-
-
- Could not start WER crash dump monitoring
- Refers to being unable to start monitoring the WER error logs.
-
-
- Preferences
- Refers to a user's settings preferences.
-
-
- Additional tools
- Refers to a additional executable tools the user can add to the product
-
-
- Advanced settings
- Refers to a additional more complex settings.
-
-
- About
- Refers to additional information about the product.
-
-
- {0:0.0}%
- {Locked="{0:0.0}"} Showing CPU utilization. {0} is a percentage 0-100
-
-
- {0:N0} MB/s
- {Locked="{0:N0}"} Showing disk utilization. MB/s stands for megabytes per second. {0} is a number.
-
-
- {0:0.0}%
- {Locked="{0:0.0}"} Showing GPU utilization. {0} is a percentage 0-100
-
-
- {0:N2} MB
- {Locked="{0:N2}"} Showing RAM utilization. MB stands for megabytes. {0} is a number.
-
-
- CPU usage of the attached process.
- Refers to the amount of CPU a process is using, shown in the bar.
-
-
- Process ID of the attached process.
- Refers to the app's PID in the bar
-
-
- {0:0.0}%
- {Locked="{0:0.0}"} Showing Disk utilization. {0} is a percentage 0-100
-
-
- CPU usage of the attached process.
- Refers to the amount of CPU a process is using, shown in the bottom bar.
-
-
- Disk usage of the attached process.
- Refers to the amount of disk usage a process is using, shown in the bottom bar.
-
-
- Memory usage of the attached process.
- Refers to the amount of Memory a process is using, shown in the bottom bar.
-
-
- Process ID of the attached process.
- Refers to the app's PID in the bottom bar
-
-
- {0:N2} GB
- {Locked="{0:N2}"} Showing RAM utilization. GB stands for gigabytes. {0} is a number.
-
-
- Amount of CPU used by the overall system.
- Tooltip for the system CPU usage box in the bar
-
-
- Amount of disk utilization by the overall system.
- Tooltip for the system disk usage box in the bar
-
-
- Amount of committed memory used by the overall system.
- Tooltip for the system memory usage box in the bar
-
-
- Dev Diagnostics
- {Locked}The name of the Dev Diagnostics application
-
-
- Dev Diagnostics
- {Locked}The description of the Dev Diagnostics application
-
-
- Hotkey for Dev Diagnostics
- The description of the startup task for Dev Diagnostics. This shows up in task manager/Windows Settings > Startup Apps.
-
-
- Is Python
- This refers to whether the application is a Python app.
-
-
- Memory violation
- Describes an issue related to a memory access violation.
-
-
- This is a Python app that is using the ctypes foreign function library. This provides C-compatible data types, and allows calling functions in DLLs, and using raw pointers. A memory access violation can result if the code misuses pointers.
- Describes an issue with a specific Python memory access violation.
-
-
- Security issue
- Describes an issue related to security.
-
-
- Failure Bucket ID
- Refers to the module which caused the fault which generated the crash report
-
-
- Error {0}: {1}
- {Locked="{0}", "{1}"} A description to help a user that is dealing with non-specific error situation. {0} is the error name. {1} is the error description.
-
-
- Frameworks detected
- This refers to the set of application frameworks this application uses.
-
-
- Base address
- The contents of a text block referring to the base address of a loaded module.
-
-
- Entrypoint address
- The contents of a text block referring to the entrypoint address of a loaded module.
-
-
- Pinned
- Text to show when the switch is turned on, to pin the tool to the bar.
-
-
- Not pinned
- Text to show when the switch is turned off, to not pin the tool to the bar.
-
-
- Unpin
- A label for the menuitem to unpin a tool on the bar.
-
-
- Unpin
- Should be the same as UnpinMenuItem.Text
-
-
- Unregister
- Same as UnregisterMenuItem.Text
-
-
- About
- Header for the Settings item for product information and privacy statement.
-
-
- Info, Privacy Statement
- Sub-header for the Settings item for product information and privacy statement.
-
-
- Additional tools
- Header for the Settings item for configuring additional tools.
-
-
- Add or edit tool configurations
- Sub-header for the Settings item for configuring additional tools.
-
-
- Advanced settings
- Header for the Settings item for configuring advanced features.
-
-
- Configure advanced features
- Sub-header for the Settings item for configuring advanced features.
-
-
- Preferences
- Header for the Settings item for user preferences.
-
-
- Themes
- Sub-header for the Settings item for user preferences.
-
-
- Settings
- The title of the main Settings page.
-
-
- Theme
- Title for the theme settings sub-page item.
-
-
- Dark
- Refers to a color theme or scheme.
-
-
- Windows default
- Refers to a color theme or scheme.
-
-
- Light
- Refers to a color theme or scheme.
-
-
- Dev Diagnostics
- {Locked} This is the name of the product.
-
-
- © Microsoft. All rights reserved.
- This is the copyright notice for the product.
-
-
- Related links
- Header for a set of hyperlinks to information about the product.
-
-
- Documentation
- Label for the link to the documentation for the product.
-
-
- https://go.microsoft.com/fwlink/?linkid=2275140
- Link to the documentation for the product.
-
-
- Privacy Statement
- Label for the link to the standard privacy policy statement.
-
-
- https://go.microsoft.com/fwlink/?linkid=2234882
- Link to the standard privacy policy statement.
-
-
- Source code
- Label for the link to the source code for the product.
-
-
- https://go.microsoft.com/fwlink/?linkid=2234396
- Link to the source code for the product.
-
-
- Register an external tool with Dev Diagnostics
- Header for the settings item to add a tool to the product.
-
-
- Edit or unregister existing tools
- Header for the setting item to edit or unregister tools from the product.
-
-
- The starting priority for threads created within this process
- Tooltip for the Base Priority field.
-
-
- The CPU architecture of the target process
- Tooltip for the CPU Architecture field.
-
-
- The windowing or application frameworks used in this app
- Tooltip for the Framework Types field.
-
-
- The process ID of the target process
- Tooltip for the PID field.
-
-
- True if the target process is running under an Administrator account
- Tooltip for the Running as Admin field.
-
-
- True if the target process is running as a System process, based on its Session ID
- Tooltip for the Running as System field.
-
-
- The executable used to start the process
- Tooltip for the Main Module field.
-
-
- True if this process is packaged with MSIX
- Tooltip for the MSIX Packaged field.
-
-
- Threads with different priorities in the process run relative to the priority class of the process
- Tooltip for the Priority Class field.
-
-
- Close
- Text used on the Close button on a message dialog.
-
-
- External tool {0} registered
- Message shown to the user when an external tool is registered.
-
-
- Executable
- The executable path of an external tool.
-
-
- Invalid tool path or name
- Text for the message to show to the user when the supplied path or name is not valid.
-
-
- Select a process to investigate
- Describes using a button in Dev Diagnostics' UX to investigate another process running on the system
-
-
- Dev Diagnostics
- {Locked} The product name
-
-
- {0} process running on {1} machine
- {Locked="{0}", "{1}"} Message text when the process is the specified CPU architecture running on the specified CPU machine. {0} is the process architecture, {1} is the machine architecture.
-
-
- Unknown
- Message text when the CPU architecture of the process is unknown.
-
-
- Unknown process type running on {0}
- {Locked="{0}"}. Message text when the process is unknown CPU architecture running on the specified CPU machine. {0} is the machine architecture.
-
-
- X64 process running on X64 machine
- Message text when the process is x64 CPU architecture running on an X64 CPU machine.
-
-
- Go to Advanced app settings
- Content Dialog button text which on click opens the Advanced App settings page in Windows Settings app.
-
-
- Go to Windows Settings > Apps > Advanced app settings > App execution alias > Dev Diagnostics > Enable the toggle and try to launch Dev Insights as admin again.
- Content Dialog content suggesting users steps to enable app execution alias from Windows Settings app
-
-
- Enable App Execution Alias for Dev Diagnostics and try again
- Content Dialog title to enable app execution alias for Dev Diagnostics
-
-
- Detach from the currently targeted process
- Used to describe what the DetachAppButton does
-
-
- Detach
- Menu Item that allows the user to detach from the current process
-
-
- Dump file
- Header text for the link to a WER dump
-
-
- Activation
- Header text for a group of radio buttons indicating the activation type
-
-
- Refresh
- Text for a button to refresh the list of apps
-
-
- Icon
- Column heading for the icon column in a datagrid
-
-
- Name
- Column heading for the name column in a datagrid
-
-
- Provide the command-line or protocol arguments here. Use {pid}, {hwnd}, or {crashDumpPath} if you want Dev Diagnostics to substitute the target app's process ID or window handle. For example:
- {Locked="{pid}", "{hwnd}", "{crashDumpPath}"} Description text for a section where the user can type in the arguments to be used for the app
-
-
- Arguments
- Header text for a section describing the arguments to be used for the app
-
-
- Launch
- Text for a radio button for the launch activation option
-
-
- Protocol
- Text for a radio button for the protocol option
-
-
- Launch example: /something /process={pid} /another={hwnd}
- Example launch activation argument string
-
-
- Protocol example: myprotocol:///args?one=ABC&two={pid}&three={hwnd}
- Example protocol argument string
-
-
- The type of activation for this tool
- Describes the section where the user can specify the type of tool activation to use.
-
-
- Get a list of installed apps
- Describes a button that will get a list of installed apps.
-
-
- Pin this tool to the toolbar, as well as adding it to the menu
- Describes a toggle switch for pinning a tool to the toolbar.
-
-
- Launch this tool by its path or package identity
- Describes a radio button that specifies how to launch the selected tool.
-
-
- Launch this tool by its registered protocol
- Describes a radio button that specifies how to launch the selected tool.
-
-
- Browse the filesystem to find a tool
- Describes a button for browsing the filesystem.
-
-
- The name you want to use for this tool in the menu and toolbar
- Describes a textbox where the user can enter a name for the tool.
-
-
- Collapse the large content panel
- The tooltip for a button which collapses the large content panel.
-
-
- Name of the attached app
- Refers to the app's name in the bar
-
-
- Clipboard Monitor
- A label for the Clipboard Monitor tool
-
-
- Image Options
- A label for the Image Options tool
-
-
- See insights that Dev Diagnostics has identified
- Tooltip that tells users what the Insights button will do
-
-
- Insights
- A text label for the Insights button
-
-
- Processes
- A text label for the Processes button
-
-
- Manage Tools
- Label for a button to allow users to manage external tools
-
-
- All Files
- Filter string to specify that the file dialog should include all files
-
-
- Batch Files
- Filter string to specify that the file dialog should include batch files
-
-
- Command Files
- Filter string to specify that the file dialog should include command files
-
-
- Executables
- Filter string to specify that the file dialog should include executable files
-
-
- Management Console Files
- Filter string to specify that the file dialog should include Management Console files
-
-
- PowerShell Scripts
- Filter string to specify that the file dialog should include PowerShell files
-
-
- Local WER crash dump collection for app
- Label for Windows Error reporting toggle switch
-
-
- Enable capture of Windows Error Reporting dumps for offline analysis
- Tooltip to enable local cab collection for Windows Error Reports
-
-
- More
- Label for a link that navigates the user to a location to learn more about WER local dumps
-
-
- Change
- The contents of a button to allow the user to trigger elevation to change WER settings
-
-
- Dev Diagnostics needs to run as Admin in order to modify WER crash dump collection for an app.
- Tooltip for a button that relaunches Dev Diagnostics as admin to change WER settings
-
-
- Get Information
- The contents of a button to allow the user to trigger elevation to get more information
-
-
- Dev Diagnostics needs to run as Admin in order to get more data for an app.
- Tooltip for a button that relaunches Dev Diagnostics as admin to get more data
-
-
- Dump Info
- Selector Pivot that shows information about a Dump File
-
-
- Filter Data to Target App
- Label on a toggle button that controls whether presented data is filtered to the selected app
-
-
- Controls whether data presented is for the entire system or filtered to the selected app
- Tooltip for the FilterDataToTargetApp toggle
-
-
- Activation arguments
- Label for the arguments passed in when activating the target app.
-
-
- Any arguments provided to the app when it was activated
- Tooltip for the arguments passed in when activating the target app.
-
-
- Full name
- Textblock showing the full name of the MSIX package for this app.
-
-
- Package full name
- Tooltip for the full name of the MSIX package for this app.
-
-
- Version
- Textblock showing the version of the MSIX package for this app.
-
-
- Package version
- Tooltip for the version of the MSIX package for this app.
-
-
- Display name
- Textblock showing the display name of the MSIX package for this app.
-
-
- Display name for this package
- Tooltip for the display name of the MSIX package for this app.
-
-
- Installed date
- Textblock showing the installed date of the MSIX package for this app.
-
-
- Date this package was installed
- Tooltip for the installed date of the MSIX package for this app.
-
-
- Installed path
- Textblock showing the installed path of the MSIX package for this app.
-
-
- Filesystem path where this package is installed
- Tooltip for the installed path of the MSIX package for this app.
-
-
- Publisher
- Textblock showing the publisher name of the MSIX package for this app.
-
-
- Name of the package publisher
- Tooltip for the full publisher of the MSIX package for this app.
-
-
- Development mode
- Textblock showing whether the MSIX package for this app was installed in development mode.
-
-
- Was this package sideloaded in development mode
- Tooltip for whether the MSIX package for this app was installed in development mode.
-
-
- Signature kind
- Textblock showing the signature kind of the MSIX package for this app.
-
-
- The kind of signature used to sign this package, if any
- Tooltip for the signature kind of the MSIX package for this app.
-
-
- Status
- Textblock showing the status of the MSIX package for this app.
-
-
- Deployment status of this package
- Tooltip for the status of the MSIX package for this app.
-
-
- Dependencies
- Textblock showing the list of dependencies for the MSIX package for this app.
-
-
- Additional packages this app depends on
- Tooltip for the list of dependencies for the MSIX package for this app.
-
-
- (unknown)
- Text used in messages to indicate that the value of this item is unknown.
-
-
- No issues
- A message indicating that there are no issues with the given item.
-
-
- Tool Type
- Button text allowing the user to select the type of tool
-
-
- Set the type of the tool being added.
- Tooltip for the button text allowing the user to select the type of tool
-
-
- WER crash dump analyzer
- Describes type of tool used to analyze WER dumps
-
-
- Tool that will be used to analyze WER crash dumps generated on the system
- Tooltip that describes what a WER Dump analyzer does
-
-
- Dev Diagnostics Clipboard Monitor
- Window title for the clipboard monitor tool
-
-
- Dev Insights Image Options
- Window title for the image options tool
-
-
- Analysis unavailable.
- Message shown when there isn't crash analysis available.
-
-
- Dump File Size: {0} bytes
-Dump File creation time: {1}
- {Locked="{0}", "{1}"} Created string that contains basic information about a crash dump
-
-
- Use this tool for WER crash dump bucketing
- Context menu button used to select a tool that is using to bucket WER reports
-
-
- Use this tool for WER crash dump bucketing
- Context menu button used to select a tool that is using to bucket WER reports
-
-
- Regular Expression for WER crash dump bucket
- Label for a textbox that will contain the regular expression a tool uses to determine the bucketing string of a cab.
-
-
- Application Verifier
- Label for a checkbox that enables Application Verifier for the target app.
-
-
- Process list
- Name of the button that brings up the process list page
-
-
- Insights
- Name of the button that brings up the Insights page
-
-
- Expand or Collapse
- Name of the button expands or collapses the UI.
-
-
- Page Navigation
- Name of the nav list.
-
-
- Detach from the currently targeted process
- Description of the detach app button for narrator to read.
-
-
- Run as administrator
- Description of the button to run as administrator.
-
-
- Resize navigation pane
- Description of the control to change the size of the navigation pane
-
-
- Refresh the process list
- Narrator description for the button that refreshes the process list
-
-
- Process list filter
- Narrator description for the combobox that filters the process list
-
-
- Modules
- Narrator description for the Modules List ListView
-
-
- Resize modules pane
- Description of the control to change the size of the navigation pane
-
-
- Run as administrator
- Description of the button to run Dev Diagnostics as administrator
-
-
- Run as administrator
- Description of the control button to run Dev Diagnostics as administrator
-
-
- Clear the list
- Description of the button to clear the log output of the WinLogs page
-
-
- Filter the list
- Description of the button to filter the log output list
-
-
- A list of all running processes. You can select an item from the list to target. You can also type a name in the search box to find that process. The drop-down contains a list of all items that are filtered out by default - you can select any of these to include them in the main list. Another way to select your target process is to bring its window to the foreground and then use the hotkey Windows+F12.
- {Locked="Windows+F12"} Description of the Process list page.
-
-
- Recent crash reports available on this machine. By default, this is filtered to your target app (if any). You can select any dump file in the list to open it in a dump analyzer tool of your choice. If you want to change your choice of dump analyzer tool, go to Windows Settings > Apps > Default apps > Set default for ".dmp" file type.
- {Locked=".dmp"} Description of the Crash reports page.
-
-
- As Dev Diagnostics gathers context data for your target app, it can analyze the data, and in some cases it can provide insights into the nature of the problem. If Dev Insights does identify insights, they will be listed here. (Note that this is a work in progress, and initially there are very few cases where Dev Insights can provide definitive analysis.)
- Description of the Insights page.
-
-
- A list of a wide range of resource usage and sensor items for both your target app (if any), and for the system as a whole.
- Description of the Resource usage page.
-
-
- All the modules (DLLs, etc) that have been loaded by your target process.
- Description of the Loaded modules page.
-
-
- As you exercise the features of your target app, this will generate log outputs in various forms. By default, this page tracks Event Tracing for Windows (ETW) logs, the system Event log, and Windows Error Reporting (WER) logs. You can also enable Debug Output tracking, althought this can produce a large amount of output, depending on the app. Dev Diagnostics analyzes log output and in some cases can generate insights.
- Description of the Windows logs page.
-
-
- Information about the current target app.
- Description of the App details page.
-
-
- (No insights found)
- Placeholder text on the Insights page when the insights list is empty.
-
-
- Process exited due to missing files
- Title of an insight informing the user of a reason why a process exited
-
-
- Process {0} (pid: {1,6}) exited with error code {2}. To help diagnose this issue, enable loader snaps and try to launch the process again.
- {Locked="{0}, "{1,6}", "{2}"} Formatted string informing the user the process name {0}, the Process ID {1}, the exit code {2} of a process.
-
-
- Process {0} (pid: {1,6}) exited due to missing files
- {Locked="{0}, "{1,6}"} Formatted string informing the user the process name {0} and the Process ID {1}
-
-
- Enable
- Label on button that enables loader snaps
-
-
- Launch an elevated executable to enable loader snaps for this executable.
- Tooltip that describes what the enable button will do
-
-
- Enable
- Text for a button to allow a user to enable local dump collection
-
-
- Disable
- Text for a button to allow a user to disable local dump collection
-
-
- Disable the capture of Windows Error Reporting dumps for offline analysis
- Tooltip to disable local cab collection for Windows Error Reports
-
-
\ No newline at end of file
diff --git a/tools/DevDiagnostics/DevHome.DevDiagnostics/Styles/CommandBarStyle.xaml b/tools/DevDiagnostics/DevHome.DevDiagnostics/Styles/CommandBarStyle.xaml
deleted file mode 100644
index 739bbfd9d8..0000000000
--- a/tools/DevDiagnostics/DevHome.DevDiagnostics/Styles/CommandBarStyle.xaml
+++ /dev/null
@@ -1,838 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/tools/DevDiagnostics/DevHome.DevDiagnostics/Telemetry/FeatureState.cs b/tools/DevDiagnostics/DevHome.DevDiagnostics/Telemetry/FeatureState.cs
deleted file mode 100644
index 3dfee458ac..0000000000
--- a/tools/DevDiagnostics/DevHome.DevDiagnostics/Telemetry/FeatureState.cs
+++ /dev/null
@@ -1,66 +0,0 @@
-// Copyright (c) Microsoft Corporation.
-// Licensed under the MIT License.
-
-using System;
-using System.Collections.Generic;
-using System.Linq;
-
-namespace DevHome.DevDiagnostics.Telemetry;
-
-// NOTE: The below flags can never be deleted. We should only rename features that were removed from the product.
-// The enum can only take additions over time.
-[Flags]
-internal enum Feature
-{
- None = 0x0,
- AppDetails = 0x1,
- ResourceUsage = 0x2,
- LoadedModule = 0x4,
- WERReports = 0x8,
- WinLogs = 0x10,
- ProcessList = 0x20,
- Insights = 0x40,
- InsightsAtStartup = 0x80,
- MonitorCPU = 0x100,
-}
-
-internal enum FeatureShareType
-{
- Exclusive,
- Shared,
-}
-
-internal sealed class FeatureState
-{
- internal static readonly Dictionary Features = new()
- {
- { Feature.AppDetails, FeatureShareType.Exclusive },
- { Feature.ResourceUsage, FeatureShareType.Exclusive },
- { Feature.LoadedModule, FeatureShareType.Exclusive },
- { Feature.WERReports, FeatureShareType.Exclusive },
- { Feature.WinLogs, FeatureShareType.Exclusive },
- { Feature.ProcessList, FeatureShareType.Exclusive },
- { Feature.Insights, FeatureShareType.Exclusive },
- { Feature.InsightsAtStartup, FeatureShareType.Shared },
- { Feature.MonitorCPU, FeatureShareType.Shared },
- };
-
- internal static bool IsExclusive(Feature feature)
- {
- if (FeatureState.Features[feature] == FeatureShareType.Exclusive)
- {
- return true;
- }
-
- return false;
- }
-}
-
-public static class EnumExtensions
-{
- public static IEnumerable GetFlags(this T en)
- where T : struct, Enum
- {
- return Enum.GetValues().Where(member => en.HasFlag(member)).ToArray();
- }
-}
diff --git a/tools/DevDiagnostics/DevHome.DevDiagnostics/Telemetry/FocusStartEventData.cs b/tools/DevDiagnostics/DevHome.DevDiagnostics/Telemetry/FocusStartEventData.cs
deleted file mode 100644
index 8ba40ee274..0000000000
--- a/tools/DevDiagnostics/DevHome.DevDiagnostics/Telemetry/FocusStartEventData.cs
+++ /dev/null
@@ -1,16 +0,0 @@
-// Copyright (c) Microsoft Corporation.
-// Licensed under the MIT License.
-
-using System;
-using System.Diagnostics.Tracing;
-
-namespace DevHome.DevDiagnostics.TelemetryEvents;
-
-[EventData]
-public class FocusStartEventData : TimedStartEventBase
-{
- internal FocusStartEventData(string featureName, DateTime featureStartTime)
- : base(featureName, featureStartTime)
- {
- }
-}
diff --git a/tools/DevDiagnostics/DevHome.DevDiagnostics/Telemetry/FocusStopEventData.cs b/tools/DevDiagnostics/DevHome.DevDiagnostics/Telemetry/FocusStopEventData.cs
deleted file mode 100644
index ff52103cca..0000000000
--- a/tools/DevDiagnostics/DevHome.DevDiagnostics/Telemetry/FocusStopEventData.cs
+++ /dev/null
@@ -1,16 +0,0 @@
-// Copyright (c) Microsoft Corporation.
-// Licensed under the MIT License.
-
-using System;
-using System.Diagnostics.Tracing;
-
-namespace DevHome.DevDiagnostics.TelemetryEvents;
-
-[EventData]
-public class FocusStopEventData : TimedStopEventBase
-{
- internal FocusStopEventData(string featureName, DateTime featureStartTime)
- : base(featureName, featureStartTime)
- {
- }
-}
diff --git a/tools/DevDiagnostics/DevHome.DevDiagnostics/Telemetry/LogStateChangedEventData.cs b/tools/DevDiagnostics/DevHome.DevDiagnostics/Telemetry/LogStateChangedEventData.cs
deleted file mode 100644
index ff367df179..0000000000
--- a/tools/DevDiagnostics/DevHome.DevDiagnostics/Telemetry/LogStateChangedEventData.cs
+++ /dev/null
@@ -1,30 +0,0 @@
-// Copyright (c) Microsoft Corporation.
-// Licensed under the MIT License.
-
-using System;
-using System.Diagnostics.Tracing;
-using DevHome.Telemetry;
-using Microsoft.Diagnostics.Telemetry;
-using Microsoft.Diagnostics.Telemetry.Internal;
-
-namespace DevHome.DevDiagnostics.TelemetryEvents;
-
-[EventData]
-public class LogStateChangedEventData : EventBase
-{
- internal LogStateChangedEventData(string stateName, string stateValue)
- {
- StateName = stateName;
- StateValue = stateValue;
- }
-
- public override PartA_PrivTags PartA_PrivTags => PrivTags.ProductAndServiceUsage;
-
- public string StateName { get; private set; }
-
- public string StateValue { get; private set; }
-
- public override void ReplaceSensitiveStrings(Func replaceSensitiveStrings)
- {
- }
-}
diff --git a/tools/DevDiagnostics/DevHome.DevDiagnostics/Telemetry/TelemetryReporter.cs b/tools/DevDiagnostics/DevHome.DevDiagnostics/Telemetry/TelemetryReporter.cs
deleted file mode 100644
index e4a1382666..0000000000
--- a/tools/DevDiagnostics/DevHome.DevDiagnostics/Telemetry/TelemetryReporter.cs
+++ /dev/null
@@ -1,171 +0,0 @@
-// Copyright (c) Microsoft Corporation.
-// Licensed under the MIT License.
-
-using System;
-using System.Threading;
-using DevHome.Common.Extensions;
-using DevHome.DevDiagnostics.TelemetryEvents;
-using DevHome.Telemetry;
-using Microsoft.UI.Xaml;
-using Serilog;
-
-namespace DevHome.DevDiagnostics.Telemetry;
-
-internal sealed class TelemetryReporter : IDisposable
-{
- private readonly FeatureState currentFeatureState = new();
- private WindowEventGenerator? eventGenerator;
- private static readonly Mutex FeatureMutex = new();
- private static readonly ILogger Log = Serilog.Log.ForContext("SourceContext", nameof(TelemetryReporter));
-
- private static Feature currentFeatureSet;
-
- internal static Feature CurrentFeatureSet => currentFeatureSet;
-
- public TelemetryReporter()
- {
- }
-
- internal static void SetWindow(Window win)
- {
- ArgumentNullException.ThrowIfNull(win, nameof(win));
-
- // Make sure to apply all this to the already existing service object.
- var rep = Application.Current.GetService();
- rep.eventGenerator = new WindowEventGenerator(win);
- rep.eventGenerator.InteractiveUsageVisibilityEvent += rep.InteractiveUsageVisibilityEvent;
- rep.eventGenerator.InteractiveUsageFocusEvent += rep.InteractiveUsageFocusEvent;
- }
-
- public void SwitchTo(Feature requestedFeature)
- {
- if (FeatureMutex.WaitOne())
- {
- if (FeatureState.IsExclusive(requestedFeature))
- {
- var foundFirst = false;
-
- // Use a copy of the flags, since we'll be modifying them inside the loop.
- var currentFeatureSetIterator = currentFeatureSet.GetFlags();
- foreach (var flag in currentFeatureSetIterator)
- {
- // Skip empty flag.
- if (flag == Feature.None)
- {
- continue;
- }
-
- if (foundFirst)
- {
- continue;
- }
-
- // If the requested feature is exclusive and the current iteration feature is exclusive,
- // remove it as we're about to add an exclusive.
- if (FeatureState.IsExclusive(flag))
- {
- // First fire any events to stop the previous features telemetry.
- // Debug.Assert(eventGenerator != null, "eventGenerator is null");
- if (eventGenerator != null)
- {
- var eventArgs = new WindowEventGenerator.InteractiveUsageEventArgs(WindowEventGenerator.InteractiveUsageEventType.Stop);
- if (eventGenerator.CurrentlyVisible)
- {
- InteractiveUsageVisibilityEvent(this, eventArgs);
- }
-
- if (eventGenerator.CurrentlyFocused)
- {
- InteractiveUsageFocusEvent(this, eventArgs);
- }
- }
-
- // Remove existing exclusive features.
- currentFeatureSet &= ~flag;
-
- Log.Debug("Removed an exclusive feature {0}.", flag);
- Log.Debug("currentFeatureSet = {0}", currentFeatureSet.ToString());
-
- // Leave a mark that we've encountered our first exclusive feature. There should only ever be one.
- foundFirst = true;
- }
- }
- }
-
- // Add the feature to the set.
- currentFeatureSet |= requestedFeature;
- Log.Debug("Added the exclusive feature {0}.", requestedFeature);
- Log.Debug("currentFeatureSet = {0}", currentFeatureSet.ToString());
- }
-
- // TODO: Codepath probably should throw exception... (failed to acquire mutex...)
- }
-
- public Feature CurrentExclusive
- {
- get
- {
- foreach (var flag in currentFeatureSet.GetFlags())
- {
- // Skip empty flag.
- if (flag == Feature.None)
- {
- continue;
- }
-
- // Return the first exclusive.
- if (FeatureState.IsExclusive(flag))
- {
- return currentFeatureSet & flag;
- }
- }
-
- return Feature.None;
- }
- }
-
- private void InteractiveUsageVisibilityEvent(object? sender, WindowEventGenerator.InteractiveUsageEventArgs e)
- {
- var app = App.Current as DevHome.DevDiagnostics.App;
- if (app != null)
- {
- var featureName = CurrentExclusive.ToString();
-
- if (e.UsageType == WindowEventGenerator.InteractiveUsageEventType.Start)
- {
- App.Log("DevHome_DevDiagnostics_VisibilityStart", LogLevel.Measure, new VisibilityStartEventData(featureName, DateTime.Now));
- Log.Debug("Visibility Start!");
- }
- else
- {
- App.Log("DevHome_DevDiagnostics_VisibilityStop", LogLevel.Measure, new VisibilityStopEventData(featureName, DateTime.Now));
- Log.Debug("Visibility Stop");
- }
- }
- }
-
- private void InteractiveUsageFocusEvent(object? sender, WindowEventGenerator.InteractiveUsageEventArgs e)
- {
- var app = App.Current as DevHome.DevDiagnostics.App;
- if (app != null)
- {
- var featureName = CurrentExclusive.ToString();
-
- if (e.UsageType == WindowEventGenerator.InteractiveUsageEventType.Start)
- {
- App.Log("DevHome_DevDiagnostics_FocusStart", LogLevel.Measure, new VisibilityStartEventData(featureName, DateTime.Now));
- Log.Debug("Focus Start!");
- }
- else
- {
- App.Log("DevHome_DevDiagnostics_FocusStop", LogLevel.Measure, new VisibilityStopEventData(featureName, DateTime.Now));
- Log.Debug("Focus Stop");
- }
- }
- }
-
- public void Dispose()
- {
- eventGenerator?.Dispose();
- }
-}
diff --git a/tools/DevDiagnostics/DevHome.DevDiagnostics/Telemetry/TimedStartEventBase.cs b/tools/DevDiagnostics/DevHome.DevDiagnostics/Telemetry/TimedStartEventBase.cs
deleted file mode 100644
index cbc6576b03..0000000000
--- a/tools/DevDiagnostics/DevHome.DevDiagnostics/Telemetry/TimedStartEventBase.cs
+++ /dev/null
@@ -1,30 +0,0 @@
-// Copyright (c) Microsoft Corporation.
-// Licensed under the MIT License.
-
-using System;
-using System.Diagnostics.Tracing;
-using DevHome.Telemetry;
-using Microsoft.Diagnostics.Telemetry;
-using Microsoft.Diagnostics.Telemetry.Internal;
-
-namespace DevHome.DevDiagnostics.TelemetryEvents;
-
-[EventData]
-public class TimedStartEventBase : EventBase
-{
- protected TimedStartEventBase(string featureName, DateTime featureStartTime)
- {
- Name = featureName;
- StartTime = featureStartTime;
- }
-
- protected string Name { get; private set; }
-
- protected DateTime StartTime { get; private set; }
-
- public override PartA_PrivTags PartA_PrivTags => PrivTags.ProductAndServiceUsage;
-
- public override void ReplaceSensitiveStrings(Func replaceSensitiveStrings)
- {
- }
-}
diff --git a/tools/DevDiagnostics/DevHome.DevDiagnostics/Telemetry/TimedStopEventBase.cs b/tools/DevDiagnostics/DevHome.DevDiagnostics/Telemetry/TimedStopEventBase.cs
deleted file mode 100644
index 3300365c97..0000000000
--- a/tools/DevDiagnostics/DevHome.DevDiagnostics/Telemetry/TimedStopEventBase.cs
+++ /dev/null
@@ -1,30 +0,0 @@
-// Copyright (c) Microsoft Corporation.
-// Licensed under the MIT License.
-
-using System;
-using System.Diagnostics.Tracing;
-using DevHome.Telemetry;
-using Microsoft.Diagnostics.Telemetry;
-using Microsoft.Diagnostics.Telemetry.Internal;
-
-namespace DevHome.DevDiagnostics.TelemetryEvents;
-
-[EventData]
-public class TimedStopEventBase : EventBase
-{
- internal TimedStopEventBase(string featureName, DateTime featureStopTime)
- {
- Name = featureName;
- StopTime = featureStopTime;
- }
-
- public string Name { get; private set; }
-
- public DateTime StopTime { get; private set; }
-
- public override PartA_PrivTags PartA_PrivTags => PrivTags.ProductAndServiceUsage;
-
- public override void ReplaceSensitiveStrings(Func replaceSensitiveStrings)
- {
- }
-}
diff --git a/tools/DevDiagnostics/DevHome.DevDiagnostics/Telemetry/UsageEventData.cs b/tools/DevDiagnostics/DevHome.DevDiagnostics/Telemetry/UsageEventData.cs
deleted file mode 100644
index 8a39aedd70..0000000000
--- a/tools/DevDiagnostics/DevHome.DevDiagnostics/Telemetry/UsageEventData.cs
+++ /dev/null
@@ -1,21 +0,0 @@
-// Copyright (c) Microsoft Corporation.
-// Licensed under the MIT License.
-
-using System;
-using System.Diagnostics.Tracing;
-using DevHome.Telemetry;
-using Microsoft.Diagnostics.Telemetry;
-using Microsoft.Diagnostics.Telemetry.Internal;
-
-namespace DevHome.DevDiagnostics.TelemetryEvents;
-
-// Used to produce basic single-line telemetry events based on a simple string.
-[EventData]
-public class UsageEventData : EventBase
-{
- public override PartA_PrivTags PartA_PrivTags => PrivTags.ProductAndServiceUsage;
-
- public override void ReplaceSensitiveStrings(Func replaceSensitiveStrings)
- {
- }
-}
diff --git a/tools/DevDiagnostics/DevHome.DevDiagnostics/Telemetry/VisibilityStartEventData.cs b/tools/DevDiagnostics/DevHome.DevDiagnostics/Telemetry/VisibilityStartEventData.cs
deleted file mode 100644
index 08a71c6c6f..0000000000
--- a/tools/DevDiagnostics/DevHome.DevDiagnostics/Telemetry/VisibilityStartEventData.cs
+++ /dev/null
@@ -1,16 +0,0 @@
-// Copyright (c) Microsoft Corporation.
-// Licensed under the MIT License.
-
-using System;
-using System.Diagnostics.Tracing;
-
-namespace DevHome.DevDiagnostics.TelemetryEvents;
-
-[EventData]
-public class VisibilityStartEventData : TimedStartEventBase
-{
- internal VisibilityStartEventData(string featureName, DateTime featureStartTime)
- : base(featureName, featureStartTime)
- {
- }
-}
diff --git a/tools/DevDiagnostics/DevHome.DevDiagnostics/Telemetry/VisibilityStopEventData.cs b/tools/DevDiagnostics/DevHome.DevDiagnostics/Telemetry/VisibilityStopEventData.cs
deleted file mode 100644
index aedb9c60b8..0000000000
--- a/tools/DevDiagnostics/DevHome.DevDiagnostics/Telemetry/VisibilityStopEventData.cs
+++ /dev/null
@@ -1,16 +0,0 @@
-// Copyright (c) Microsoft Corporation.
-// Licensed under the MIT License.
-
-using System;
-using System.Diagnostics.Tracing;
-
-namespace DevHome.DevDiagnostics.TelemetryEvents;
-
-[EventData]
-public class VisibilityStopEventData : TimedStopEventBase
-{
- internal VisibilityStopEventData(string featureName, DateTime featureStartTime)
- : base(featureName, featureStartTime)
- {
- }
-}
diff --git a/tools/DevDiagnostics/DevHome.DevDiagnostics/Telemetry/WindowEventGenerator.cs b/tools/DevDiagnostics/DevHome.DevDiagnostics/Telemetry/WindowEventGenerator.cs
deleted file mode 100644
index 181909bc05..0000000000
--- a/tools/DevDiagnostics/DevHome.DevDiagnostics/Telemetry/WindowEventGenerator.cs
+++ /dev/null
@@ -1,165 +0,0 @@
-// Copyright (c) Microsoft Corporation.
-// Licensed under the MIT License.
-
-using System;
-using System.Threading;
-using DevHome.Common.Extensions;
-using DevHome.DevDiagnostics.Helpers;
-using Microsoft.UI.Xaml;
-using Windows.Win32;
-using Windows.Win32.Foundation;
-
-namespace DevHome.Telemetry;
-
-internal sealed class WindowEventGenerator : WindowHooker, IDisposable
-{
- private readonly Window window;
- private readonly Mutex visibilityMutex = new();
- private readonly Mutex focusMutex = new();
- private bool currentlyVisible;
- private bool currentlyFocused;
-
- internal bool CurrentlyVisible => currentlyVisible;
-
- internal bool CurrentlyFocused => currentlyFocused;
-
- internal enum InteractiveUsageEventType
- {
- Start,
- Stop,
- }
-
- internal sealed class InteractiveUsageEventArgs : EventArgs
- {
- internal InteractiveUsageEventArgs(InteractiveUsageEventType usageType)
- {
- UsageType = usageType;
- }
-
- public InteractiveUsageEventType UsageType { get; private set; }
- }
-
- public event System.EventHandler? InteractiveUsageVisibilityEvent;
-
- public event System.EventHandler? InteractiveUsageFocusEvent;
-
- public WindowEventGenerator(Window window)
- {
- this.window = window;
- Start(new HWND(window.GetWindowHandle()));
- }
-
- private void FireInteractiveUsageVisibilityEvent(bool newValue)
- {
- InteractiveUsageEventArgs interactiveArgs;
- var oldValue = false;
- var triggerEvent = false;
- {
- if (visibilityMutex.WaitOne())
- {
- oldValue = currentlyVisible;
-
- if (newValue != oldValue)
- {
- triggerEvent = true;
- currentlyVisible = newValue;
- }
- }
- }
-
- if (triggerEvent)
- {
- if (newValue)
- {
- interactiveArgs = new InteractiveUsageEventArgs(InteractiveUsageEventType.Start);
- }
- else
- {
- interactiveArgs = new InteractiveUsageEventArgs(InteractiveUsageEventType.Stop);
- }
-
- var raiseEvent = InteractiveUsageVisibilityEvent;
- if (raiseEvent != null)
- {
- raiseEvent(this, interactiveArgs);
- }
- }
- }
-
- private void FireInteractiveUsageFocusEvent(bool newValue)
- {
- InteractiveUsageEventArgs interactiveArgs;
- var oldValue = false;
- var triggerEvent = false;
- {
- if (focusMutex.WaitOne())
- {
- oldValue = currentlyFocused;
-
- if (newValue != oldValue)
- {
- triggerEvent = true;
- currentlyFocused = newValue;
- }
- }
- }
-
- if (triggerEvent)
- {
- if (newValue)
- {
- interactiveArgs = new InteractiveUsageEventArgs(InteractiveUsageEventType.Start);
- }
- else
- {
- interactiveArgs = new InteractiveUsageEventArgs(InteractiveUsageEventType.Stop);
- }
-
- var raiseEvent = InteractiveUsageFocusEvent;
- if (raiseEvent != null)
- {
- raiseEvent(this, interactiveArgs);
- }
- }
- }
-
- protected override LRESULT CustomWndProc(HWND hWnd, uint msg, WPARAM wParam, LPARAM lParam)
- {
- switch (msg)
- {
- case PInvoke.WM_ACTIVATE:
- {
- if (wParam == 0)
- {
- FireInteractiveUsageVisibilityEvent(false);
- }
- else
- {
- FireInteractiveUsageVisibilityEvent(true);
- }
-
- break;
- }
-
- case PInvoke.WM_SETFOCUS:
- {
- FireInteractiveUsageFocusEvent(true);
- break;
- }
-
- case PInvoke.WM_KILLFOCUS:
- {
- FireInteractiveUsageFocusEvent(false);
- break;
- }
- }
-
- return base.CustomWndProc(hWnd, msg, wParam, lParam);
- }
-
- public void Dispose()
- {
- visibilityMutex.Dispose();
- focusMutex.Dispose();
- }
-}
diff --git a/tools/DevDiagnostics/DevHome.DevDiagnostics/ViewModels/AboutViewModel.cs b/tools/DevDiagnostics/DevHome.DevDiagnostics/ViewModels/AboutViewModel.cs
deleted file mode 100644
index 3ca4954bfe..0000000000
--- a/tools/DevDiagnostics/DevHome.DevDiagnostics/ViewModels/AboutViewModel.cs
+++ /dev/null
@@ -1,41 +0,0 @@
-// Copyright (c) Microsoft Corporation.
-// Licensed under the MIT License.
-
-using System.Collections.ObjectModel;
-using CommunityToolkit.Mvvm.ComponentModel;
-using DevHome.Common.Extensions;
-using DevHome.Common.Models;
-using DevHome.DevDiagnostics.Helpers;
-using DevHome.DevDiagnostics.Services;
-using Microsoft.UI.Xaml;
-using Serilog;
-
-namespace DevHome.DevDiagnostics.ViewModels;
-
-public partial class AboutViewModel : ObservableObject
-{
- private static readonly ILogger _log = Log.ForContext("SourceContext", nameof(AboutViewModel));
-
- public ObservableCollection Breadcrumbs { get; }
-
- [ObservableProperty]
- private string _versionDescription;
-
- public AboutViewModel()
- {
- _versionDescription = GetVersionDescription();
-
- Breadcrumbs = new ObservableCollection
- {
- new(CommonHelper.GetLocalizedString("SettingsPageHeader"), typeof(SettingsPageViewModel).FullName!),
- new(CommonHelper.GetLocalizedString("SettingsAboutHeader"), typeof(AboutViewModel).FullName!),
- };
- }
-
- private static string GetVersionDescription()
- {
- var appInfoService = Application.Current.GetService();
- var version = appInfoService.GetAppVersion();
- return $"{version.Major}.{version.Minor}.{version.Build}.{version.Revision}";
- }
-}
diff --git a/tools/DevDiagnostics/DevHome.DevDiagnostics/ViewModels/AdditionalToolsViewModel.cs b/tools/DevDiagnostics/DevHome.DevDiagnostics/ViewModels/AdditionalToolsViewModel.cs
deleted file mode 100644
index 00486d6c09..0000000000
--- a/tools/DevDiagnostics/DevHome.DevDiagnostics/ViewModels/AdditionalToolsViewModel.cs
+++ /dev/null
@@ -1,26 +0,0 @@
-// Copyright (c) Microsoft Corporation.
-// Licensed under the MIT License.
-
-using System.Collections.ObjectModel;
-using CommunityToolkit.Mvvm.ComponentModel;
-using DevHome.Common.Models;
-using DevHome.DevDiagnostics.Helpers;
-using Serilog;
-
-namespace DevHome.DevDiagnostics.ViewModels;
-
-public partial class AdditionalToolsViewModel : ObservableObject
-{
- private static readonly ILogger _log = Log.ForContext("SourceContext", nameof(AdditionalToolsViewModel));
-
- public ObservableCollection Breadcrumbs { get; }
-
- public AdditionalToolsViewModel()
- {
- Breadcrumbs = new ObservableCollection
- {
- new(CommonHelper.GetLocalizedString("SettingsPageHeader"), typeof(SettingsPageViewModel).FullName!),
- new(CommonHelper.GetLocalizedString("SettingsAdditionalToolsHeader"), typeof(AdditionalToolsViewModel).FullName!),
- };
- }
-}
diff --git a/tools/DevDiagnostics/DevHome.DevDiagnostics/ViewModels/AdvancedSettingsViewModel.cs b/tools/DevDiagnostics/DevHome.DevDiagnostics/ViewModels/AdvancedSettingsViewModel.cs
deleted file mode 100644
index 476c26aea2..0000000000
--- a/tools/DevDiagnostics/DevHome.DevDiagnostics/ViewModels/AdvancedSettingsViewModel.cs
+++ /dev/null
@@ -1,26 +0,0 @@
-// Copyright (c) Microsoft Corporation.
-// Licensed under the MIT License.
-
-using System.Collections.ObjectModel;
-using CommunityToolkit.Mvvm.ComponentModel;
-using DevHome.Common.Models;
-using DevHome.DevDiagnostics.Helpers;
-using Serilog;
-
-namespace DevHome.DevDiagnostics.ViewModels;
-
-public partial class AdvancedSettingsViewModel : ObservableObject
-{
- private static readonly ILogger _log = Log.ForContext("SourceContext", nameof(AdvancedSettingsViewModel));
-
- public ObservableCollection Breadcrumbs { get; }
-
- public AdvancedSettingsViewModel()
- {
- Breadcrumbs = new ObservableCollection
- {
- new(CommonHelper.GetLocalizedString("SettingsPageHeader"), typeof(SettingsPageViewModel).FullName!),
- new(CommonHelper.GetLocalizedString("SettingsAdvancedSettingsHeader"), typeof(AdvancedSettingsViewModel).FullName!),
- };
- }
-}
diff --git a/tools/DevDiagnostics/DevHome.DevDiagnostics/ViewModels/AppDetailsPageViewModel.cs b/tools/DevDiagnostics/DevHome.DevDiagnostics/ViewModels/AppDetailsPageViewModel.cs
deleted file mode 100644
index 627b674c11..0000000000
--- a/tools/DevDiagnostics/DevHome.DevDiagnostics/ViewModels/AppDetailsPageViewModel.cs
+++ /dev/null
@@ -1,276 +0,0 @@
-// Copyright (c) Microsoft Corporation.
-// Licensed under the MIT License.
-
-using System;
-using System.Collections.Generic;
-using System.ComponentModel;
-using System.Diagnostics;
-using System.Globalization;
-using System.Linq;
-using System.Text;
-using CommunityToolkit.Mvvm.ComponentModel;
-using CommunityToolkit.Mvvm.Input;
-using DevHome.Common.Helpers;
-using DevHome.DevDiagnostics.Helpers;
-using DevHome.DevDiagnostics.Models;
-using Microsoft.UI.Xaml;
-using Serilog;
-using Windows.ApplicationModel;
-using Windows.System.Diagnostics;
-
-namespace DevHome.DevDiagnostics.ViewModels;
-
-public partial class AppDetailsPageViewModel : ObservableObject
-{
- private static readonly ILogger _log = Log.ForContext("SourceContext", nameof(AppDetailsPageViewModel));
-
- private readonly string _noIssuesText = CommonHelper.GetLocalizedString("NoIssuesText");
-
- [ObservableProperty]
- private AppRuntimeInfo _appInfo;
-
- [ObservableProperty]
- private Visibility _runAsAdminVisibility = Visibility.Collapsed;
-
- [ObservableProperty]
- private Visibility _processRunningParamsVisibility = Visibility.Collapsed;
-
- [ObservableProperty]
- private Visibility _processPackageVisibility = Visibility.Collapsed;
-
- [ObservableProperty]
- private Visibility _appSettingsVisibility = Visibility.Collapsed;
-
- private Process? _targetProcess;
-
- public AppDetailsPageViewModel()
- {
- TargetAppData.Instance.PropertyChanged += TargetApp_PropertyChanged;
- AppInfo = new();
-
- var process = TargetAppData.Instance.TargetProcess;
- if (process is not null)
- {
- AppSettingsVisibility = Visibility.Visible;
- UpdateTargetProcess(process);
- }
- else
- {
- AppSettingsVisibility = Visibility.Collapsed;
- }
- }
-
- public void UpdateTargetProcess(Process process)
- {
- if (_targetProcess != process)
- {
- _targetProcess = process;
- RunAsAdminVisibility = Visibility.Collapsed;
- AppInfo = new();
-
- try
- {
- AppInfo.ProcessId = _targetProcess.Id;
-
- if (process.HasExited)
- {
- AppInfo.Visibility = Visibility.Collapsed;
- ProcessRunningParamsVisibility = Visibility.Collapsed;
- }
- else
- {
- AppInfo.Visibility = Visibility.Visible;
- ProcessRunningParamsVisibility = Visibility.Visible;
- AppInfo.IsRunningAsSystem = TargetAppData.Instance.IsRunningAsSystem;
- AppInfo.IsRunningAsAdmin = TargetAppData.Instance.IsRunningAsAdmin;
- AppInfo.BasePriority = _targetProcess.BasePriority;
- AppInfo.PriorityClass = (int)_targetProcess.PriorityClass;
-
- if (_targetProcess.MainModule != null)
- {
- AppInfo.MainModuleFileName = _targetProcess.MainModule.FileName;
- var cpuArchitecture = WindowHelper.GetAppArchitecture(
- _targetProcess.SafeHandle, _targetProcess.MainModule.FileName);
- AppInfo.CpuArchitecture = cpuArchitecture;
- }
-
- AppInfo.GetFrameworksAndCommandLine(_targetProcess);
- var pdi = ProcessDiagnosticInfo.TryGetForProcessId((uint)(_targetProcess?.Id ?? 0));
- if (pdi is not null)
- {
- GetPackageInfo(pdi);
- }
- }
- }
- catch (Win32Exception ex)
- {
- // This can throw if the process is running elevated and we are not.
- _log.Error(ex, "Unable to construct an AppInfo for target process.");
- if (ex.NativeErrorCode == (int)Windows.Win32.Foundation.WIN32_ERROR.ERROR_ACCESS_DENIED)
- {
- // Hide properties that cannot be retrieved when the target app is elevated and PI is not.
- AppInfo.Visibility = Visibility.Collapsed;
-
- // Only show the button when not running as admin. This is possible when the target app is a system app.
- if (!RuntimeHelper.IsCurrentProcessRunningAsAdmin())
- {
- RunAsAdminVisibility = Visibility.Visible;
- }
- }
- }
- catch (Exception e)
- {
- _log.Error(e, "Failed to update target process.");
- }
- }
- }
-
- private void TargetApp_PropertyChanged(object? sender, PropertyChangedEventArgs e)
- {
- if (e.PropertyName == nameof(TargetAppData.TargetProcess))
- {
- if (TargetAppData.Instance.TargetProcess is not null)
- {
- AppSettingsVisibility = Visibility.Visible;
- UpdateTargetProcess(TargetAppData.Instance.TargetProcess);
- }
- else
- {
- AppSettingsVisibility = Visibility.Collapsed;
- }
- }
- }
-
- [RelayCommand]
- private void RunAsAdmin()
- {
- if (_targetProcess is not null)
- {
- CommonHelper.RunAsAdmin(_targetProcess.Id, nameof(AppDetailsPageViewModel));
- }
- }
-
- [RelayCommand]
- public void DetachFromProcess()
- {
- TargetAppData.Instance.ClearAppData();
- }
-
- private void GetPackageInfo(ProcessDiagnosticInfo pdi)
- {
- if (!pdi.IsPackaged)
- {
- ProcessPackageVisibility = Visibility.Collapsed;
- return;
- }
-
- AppInfo.IsPackaged = true;
- ProcessPackageVisibility = Visibility.Visible;
-
- var package = pdi.GetAppDiagnosticInfos().FirstOrDefault()?.AppInfo.Package;
- if (package is not null)
- {
- if (package.Id is not null)
- {
- AppInfo.PackageInfo.FullName = package.Id.FullName;
- var version = package.Id.Version;
- AppInfo.PackageInfo.Version = $"{version.Major}.{version.Minor}.{version.Build}.{version.Revision}";
- }
-
- AppInfo.PackageInfo.DisplayName = package.DisplayName;
- AppInfo.PackageInfo.InstalledDate = package.InstalledDate.ToString(CultureInfo.CurrentCulture);
- AppInfo.PackageInfo.InstalledPath = package.InstalledPath;
- AppInfo.PackageInfo.Publisher = package.PublisherDisplayName;
- AppInfo.PackageInfo.IsDevelopmentMode = package.IsDevelopmentMode;
- AppInfo.PackageInfo.SignatureKind = $"{package.SignatureKind}";
- AppInfo.PackageInfo.Status = GetPackageStatus(package);
-
- List dependencies = [];
- foreach (var dependency in package.Dependencies)
- {
- dependencies.Add(dependency.Id.FullName);
- }
-
- AppInfo.PackageInfo.Dependencies = string.Join(", ", dependencies);
- }
- }
-
- private string GetPackageStatus(Package package)
- {
- // Convert the individual bool Status properties to a list of matching strings.
- List trueProperties = [];
- var status = package.Status;
-
- if (status.DataOffline)
- {
- trueProperties.Add(nameof(status.DataOffline));
- }
-
- if (status.DependencyIssue)
- {
- trueProperties.Add(nameof(status.DependencyIssue));
- }
-
- if (status.DeploymentInProgress)
- {
- trueProperties.Add(nameof(status.DeploymentInProgress));
- }
-
- if (status.Disabled)
- {
- trueProperties.Add(nameof(status.Disabled));
- }
-
- if (status.IsPartiallyStaged)
- {
- trueProperties.Add(nameof(status.IsPartiallyStaged));
- }
-
- if (status.LicenseIssue)
- {
- trueProperties.Add(nameof(status.LicenseIssue));
- }
-
- if (status.Modified)
- {
- trueProperties.Add(nameof(status.Modified));
- }
-
- if (status.NeedsRemediation)
- {
- trueProperties.Add(nameof(status.NeedsRemediation));
- }
-
- if (status.NotAvailable)
- {
- trueProperties.Add(nameof(status.NotAvailable));
- }
-
- if (status.PackageOffline)
- {
- trueProperties.Add(nameof(status.PackageOffline));
- }
-
- if (status.Servicing)
- {
- trueProperties.Add(nameof(status.Servicing));
- }
-
- if (status.Tampered)
- {
- trueProperties.Add(nameof(status.Tampered));
- }
-
- string combinedStatus;
- if (trueProperties.Count > 0)
- {
- combinedStatus = string.Join(", ", trueProperties);
- }
- else
- {
- combinedStatus = _noIssuesText;
- }
-
- return combinedStatus;
- }
-}
diff --git a/tools/DevDiagnostics/DevHome.DevDiagnostics/ViewModels/BarWindowViewModel.cs b/tools/DevDiagnostics/DevHome.DevDiagnostics/ViewModels/BarWindowViewModel.cs
deleted file mode 100644
index a95cfef307..0000000000
--- a/tools/DevDiagnostics/DevHome.DevDiagnostics/ViewModels/BarWindowViewModel.cs
+++ /dev/null
@@ -1,271 +0,0 @@
-// Copyright (c) Microsoft Corporation.
-// Licensed under the MIT License.
-
-using System.Collections.ObjectModel;
-using System.Collections.Specialized;
-using System.ComponentModel;
-using System.Diagnostics;
-using CommunityToolkit.Mvvm.ComponentModel;
-using CommunityToolkit.Mvvm.Input;
-using DevHome.Common.Extensions;
-using DevHome.DevDiagnostics.Helpers;
-using DevHome.DevDiagnostics.Models;
-using DevHome.DevDiagnostics.Services;
-using Microsoft.UI.Xaml;
-using Microsoft.UI.Xaml.Controls;
-using Microsoft.UI.Xaml.Media.Imaging;
-using Serilog;
-using Windows.Graphics;
-using Windows.System;
-using Windows.Win32.Foundation;
-
-namespace DevHome.DevDiagnostics.ViewModels;
-
-public partial class BarWindowViewModel : ObservableObject
-{
- private static readonly ILogger _log = Log.ForContext("SourceContext", nameof(BarWindowViewModel));
-
- private readonly string _errorTitleText = CommonHelper.GetLocalizedString("ToolLaunchErrorTitle");
- private readonly string _expandToolTip = CommonHelper.GetLocalizedString("SwitchToLargeLayoutToolTip");
- private readonly string _collapseToolTip = CommonHelper.GetLocalizedString("SwitchToSmallLayoutToolTip");
-
- private readonly Microsoft.UI.Dispatching.DispatcherQueue _dispatcher;
- private readonly ExternalToolsHelper _externalToolsHelper;
-
- private readonly ObservableCollection