Make sure dbgshim can attach to processes with more than 1000 modules.
https://github.com/dotnet/coreclr/blob/master/src/dlls/dbgshim/dbgshim.cpp#L583
I should fix this.
HandleHolder hProcess = OpenProcess(PROCESS_ALL_ACCESS, FALSE, debuggeePID); if (NULL == hProcess) return E_FAIL;
// These shouldn't be freed
HMODULE modules[1000];
DWORD cbNeeded;
if(!EnumProcessModules(hProcess, modules, sizeof(modules), &cbNeeded))
{
return HRESULT_FROM_WIN32(GetLastError());
}
This limitation has always been there. It only affects Windows unless the legacy EnumerateCLRs api is used on xplat. The new register runtime startup apis do not have this limitation except on when used on Windows.
I don't how important is to fix this.
Moving this to 1.1 after discussing with @mikem8361. With the new dbgshim APIs, this should only affect Windows, and the code has been like this since the Silverlight days.
Dup of dotnet/coreclr#19538