Skip to content

Commit

Permalink
Unify processes list in BugReportTool source (#14269)
Browse files Browse the repository at this point in the history
  • Loading branch information
stefansjfw committed Nov 5, 2021
1 parent 3a6dd45 commit 1596293
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 28 deletions.
1 change: 1 addition & 0 deletions tools/BugReportTool/BugReportTool/BugReportTool.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
</ClCompile>
<ClCompile Include="EventViewer.cpp" />
<ClCompile Include="InstallationFolder.cpp" />
<ClCompile Include="ProcessesList.cpp" />
<ClCompile Include="ReportMonitorInfo.cpp" />
<ClCompile Include="Main.cpp" />
<ClCompile Include="RegistryUtils.cpp" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
<ClCompile Include="EventViewer.cpp" />
<ClCompile Include="XmlDocumentEx.cpp" />
<ClCompile Include="InstallationFolder.cpp" />
<ClCompile Include="ProcessesList.cpp" />
</ItemGroup>
<ItemGroup>
<Filter Include="ZipTools">
Expand Down
16 changes: 2 additions & 14 deletions tools/BugReportTool/BugReportTool/EventViewer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,22 +10,10 @@

#include "XmlDocumentEx.h"

extern std::vector<std::wstring> processes;

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
constexpr int BATCH_SIZE = 50;

Expand Down
20 changes: 20 additions & 0 deletions tools/BugReportTool/BugReportTool/ProcessesList.cpp
Original file line number Diff line number Diff line change
@@ -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"
};
18 changes: 4 additions & 14 deletions tools/BugReportTool/BugReportTool/RegistryUtils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

using namespace std;

extern std::vector<std::wstring> processes;

namespace
{
vector<pair<HKEY, wstring>> registryKeys = {
Expand Down Expand Up @@ -163,20 +165,8 @@ namespace

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;
for (auto app : apps)
for (auto app : processes)
{
flags[app] = L"";
}
Expand All @@ -190,7 +180,7 @@ void ReportCompatibilityTab(HKEY key, wofstream& report)
auto values = QueryValues(outKey);
for (auto value : values)
{
for (auto app : apps)
for (auto app : processes)
{
if (value.first.find(app) != wstring::npos)
{
Expand Down

0 comments on commit 1596293

Please sign in to comment.