Unify processes list in BugReportTool source (#14269)

This commit is contained in:
Stefan Markovic 2021-11-05 16:44:39 +01:00 committed by GitHub
parent 3a6dd45741
commit 159629372d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 28 additions and 28 deletions

View file

@ -39,6 +39,7 @@
</ClCompile> </ClCompile>
<ClCompile Include="EventViewer.cpp" /> <ClCompile Include="EventViewer.cpp" />
<ClCompile Include="InstallationFolder.cpp" /> <ClCompile Include="InstallationFolder.cpp" />
<ClCompile Include="ProcessesList.cpp" />
<ClCompile Include="ReportMonitorInfo.cpp" /> <ClCompile Include="ReportMonitorInfo.cpp" />
<ClCompile Include="Main.cpp" /> <ClCompile Include="Main.cpp" />
<ClCompile Include="RegistryUtils.cpp" /> <ClCompile Include="RegistryUtils.cpp" />

View file

@ -14,6 +14,7 @@
<ClCompile Include="EventViewer.cpp" /> <ClCompile Include="EventViewer.cpp" />
<ClCompile Include="XmlDocumentEx.cpp" /> <ClCompile Include="XmlDocumentEx.cpp" />
<ClCompile Include="InstallationFolder.cpp" /> <ClCompile Include="InstallationFolder.cpp" />
<ClCompile Include="ProcessesList.cpp" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Filter Include="ZipTools"> <Filter Include="ZipTools">

View file

@ -10,22 +10,10 @@
#include "XmlDocumentEx.h" #include "XmlDocumentEx.h"
extern std::vector<std::wstring> processes;
namespace namespace
{ {
std::vector<std::wstring> processes =
{
L"PowerToys.exe",
L"PowerToys.Settings.exe",
L"ColorPickerUI.exe",
L"PowerToys.Awake.exe",
L"FancyZonesEditor.exe",
L"PowerToys.FancyZones.exe",
L"PowerToys.KeyboardManagerEngine.exe",
L"PowerToys.KeyboardManagerEditor.exe",
L"PowerLauncher.exe",
L"PowerToys.ShortcutGuide.exe"
};
// Batch size for number of events queried at once // Batch size for number of events queried at once
constexpr int BATCH_SIZE = 50; constexpr int BATCH_SIZE = 50;

View file

@ -0,0 +1,20 @@
#include <string>
#include <vector>
std::vector<std::wstring> processes =
{
L"PowerToys.exe",
L"PowerToys.Settings.exe",
L"ColorPickerUI.exe",
L"PowerToys.Awake.exe",
L"FancyZonesEditor.exe",
L"PowerToys.FancyZones.exe",
L"PowerToys.KeyboardManagerEngine.exe",
L"PowerToys.KeyboardManagerEditor.exe",
L"PowerLauncher.exe",
L"PowerToys.ShortcutGuide.exe",
L"PowerRename.exe",
L"ImageResizer.exe",
L"PowerToys.Update.exe",
L"PowerToys.ActionRunner.exe"
};

View file

@ -4,6 +4,8 @@
using namespace std; using namespace std;
extern std::vector<std::wstring> processes;
namespace namespace
{ {
vector<pair<HKEY, wstring>> registryKeys = { vector<pair<HKEY, wstring>> registryKeys = {
@ -163,20 +165,8 @@ namespace
void ReportCompatibilityTab(HKEY key, wofstream& report) void ReportCompatibilityTab(HKEY key, wofstream& report)
{ {
vector<std::wstring> apps
{
L"PowerToys.exe",
L"ColorPickerUI.exe",
L"FancyZonesEditor.exe",
L"PowerToys.FancyZones.exe",
L"PowerToys.KeyboardManagerEngine.exe",
L"PowerToys.KeyboardManagerEditor.exe",
L"PowerLauncher.exe",
L"PowerToys.ShortcutGuide.exe"
};
map<wstring, wstring> flags; map<wstring, wstring> flags;
for (auto app : apps) for (auto app : processes)
{ {
flags[app] = L""; flags[app] = L"";
} }
@ -190,7 +180,7 @@ void ReportCompatibilityTab(HKEY key, wofstream& report)
auto values = QueryValues(outKey); auto values = QueryValues(outKey);
for (auto value : values) for (auto value : values)
{ {
for (auto app : apps) for (auto app : processes)
{ {
if (value.first.find(app) != wstring::npos) if (value.first.find(app) != wstring::npos)
{ {