Skip to content

Commit

Permalink
log errors when failed to get process handle
Browse files Browse the repository at this point in the history
  • Loading branch information
eriforce committed Aug 28, 2024
1 parent e683455 commit fdf2d4d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/Magpie.App/ScalingService.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -332,6 +332,7 @@ void ScalingService::_ScaleForegroundWindow() {
static bool GetWindowIntegrityLevel(HWND hWnd, DWORD& integrityLevel) noexcept {
wil::unique_process_handle hProc = Win32Utils::GetWndProcessHandle(hWnd);
if (!hProc) {
Logger::Get().Error("GetWndProcessHandle 失败");
return false;
}

Expand Down
3 changes: 2 additions & 1 deletion src/Shared/Win32Utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,9 @@ wil::unique_process_handle Win32Utils::GetWndProcessHandle(HWND hWnd) noexcept {
}

std::wstring Win32Utils::GetPathOfWnd(HWND hWnd) noexcept {
wil::unique_process_handle hProc = Win32Utils::GetWndProcessHandle(hWnd);
wil::unique_process_handle hProc = GetWndProcessHandle(hWnd);
if (!hProc) {
Logger::Get().Error("GetWndProcessHandle 失败");
return {};
}

Expand Down

0 comments on commit fdf2d4d

Please sign in to comment.