From d767fd846ce3d0c218977cd007be23b4b5aa7e22 Mon Sep 17 00:00:00 2001 From: xomx Date: Wed, 4 Jun 2025 18:05:58 +0200 Subject: [PATCH] Fix DisplayInfo maxAdapters searching limitation ref: https://github.com/notepad-plus-plus/notepad-plus-plus/issues/16588#issuecomment-2906537768 Close #16633 --- PowerEditor/src/WinControls/AboutDlg/AboutDlg.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/PowerEditor/src/WinControls/AboutDlg/AboutDlg.cpp b/PowerEditor/src/WinControls/AboutDlg/AboutDlg.cpp index a7dad2215..d8340b64f 100644 --- a/PowerEditor/src/WinControls/AboutDlg/AboutDlg.cpp +++ b/PowerEditor/src/WinControls/AboutDlg/AboutDlg.cpp @@ -52,9 +52,10 @@ void AppendDisplayAdaptersInfo(wstring& strOut, const unsigned int maxAdaptersIn nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr); if ((lStatus == ERROR_SUCCESS) && (dwSubkeysCount > 0)) { + DWORD dwAdapterSubkeysFound = 0; for (DWORD i = 0; i < dwSubkeysCount; ++i) { - if (i >= maxAdaptersIn) + if (dwAdapterSubkeysFound >= maxAdaptersIn) { strOut += L"\n - warning, search has been limited to maximum number of adapter records: " + std::to_wstring(maxAdaptersIn); @@ -77,6 +78,7 @@ void AppendDisplayAdaptersInfo(wstring& strOut, const unsigned int maxAdaptersIn if (::RegQueryValueExW(hkAdapterSubKey, L"DriverDesc", nullptr, &dwType, (LPBYTE)wszKeyVal, &dwSize) == ERROR_SUCCESS) { + dwAdapterSubkeysFound++; strOut += strAdapterNo + L": Description - "; strOut += wszKeyVal; }