mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-04 18:26:39 +02:00
bootstrapper: handle the unhandled
This commit is contained in:
committed by
Andrey Nekrasov
parent
305a04ce69
commit
c2d6f740a1
@@ -403,8 +403,13 @@ void notifications::show_toast_with_activations(std::wstring message,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
notifier.Show(notification);
|
||||
try
|
||||
{
|
||||
notifier.Show(notification);
|
||||
}
|
||||
catch (...)
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
void notifications::update_progress_bar_toast(std::wstring_view tag, progress_bar_params params)
|
||||
|
||||
@@ -27,15 +27,21 @@ inline std::vector<wil::unique_process_handle> getProcessHandlesByName(const std
|
||||
handleAccess |= PROCESS_QUERY_LIMITED_INFORMATION | PROCESS_VM_READ;
|
||||
for (const DWORD processId : processIds)
|
||||
{
|
||||
wil::unique_process_handle hProcess{ OpenProcess(handleAccess, FALSE, processId) };
|
||||
wchar_t name[MAX_PATH + 1];
|
||||
if (!hProcess || !GetProcessImageFileNameW(hProcess.get(), name, MAX_PATH))
|
||||
try
|
||||
{
|
||||
continue;
|
||||
wil::unique_process_handle hProcess{ OpenProcess(handleAccess, FALSE, processId) };
|
||||
wchar_t name[MAX_PATH + 1];
|
||||
if (!hProcess || !GetProcessImageFileNameW(hProcess.get(), name, MAX_PATH))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
if (processName == PathFindFileNameW(name))
|
||||
{
|
||||
result.push_back(std::move(hProcess));
|
||||
}
|
||||
}
|
||||
if (processName == PathFindFileNameW(name))
|
||||
catch (...)
|
||||
{
|
||||
result.push_back(std::move(hProcess));
|
||||
}
|
||||
}
|
||||
return result;
|
||||
|
||||
Reference in New Issue
Block a user