mirror of
https://github.com/notepad-plus-plus/notepad-plus-plus.git
synced 2025-07-25 14:54:39 +02:00
Fix DisplayInfo maxAdapters searching limitation
ref: https://github.com/notepad-plus-plus/notepad-plus-plus/issues/16588#issuecomment-2906537768 Close #16633
This commit is contained in:
parent
dfba125356
commit
d767fd846c
@ -52,9 +52,10 @@ void AppendDisplayAdaptersInfo(wstring& strOut, const unsigned int maxAdaptersIn
|
|||||||
nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr);
|
nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr);
|
||||||
if ((lStatus == ERROR_SUCCESS) && (dwSubkeysCount > 0))
|
if ((lStatus == ERROR_SUCCESS) && (dwSubkeysCount > 0))
|
||||||
{
|
{
|
||||||
|
DWORD dwAdapterSubkeysFound = 0;
|
||||||
for (DWORD i = 0; i < dwSubkeysCount; ++i)
|
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: "
|
strOut += L"\n - warning, search has been limited to maximum number of adapter records: "
|
||||||
+ std::to_wstring(maxAdaptersIn);
|
+ 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)
|
if (::RegQueryValueExW(hkAdapterSubKey, L"DriverDesc", nullptr, &dwType, (LPBYTE)wszKeyVal, &dwSize)
|
||||||
== ERROR_SUCCESS)
|
== ERROR_SUCCESS)
|
||||||
{
|
{
|
||||||
|
dwAdapterSubkeysFound++;
|
||||||
strOut += strAdapterNo + L": Description - ";
|
strOut += strAdapterNo + L": Description - ";
|
||||||
strOut += wszKeyVal;
|
strOut += wszKeyVal;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user