Skip to content
This repository was archived by the owner on Jan 23, 2023. It is now read-only.

Commit d1e3945

Browse files
authored
Merge pull request #7384 from dotnet-bot/from-tfs-release
Merge changes from Release TFS
2 parents ecbf7ad + acb58b0 commit d1e3945

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/dlls/dbgshim/dbgshim.cpp

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -392,7 +392,7 @@ class RuntimeStartupHelper
392392
int numTries = 0;
393393
HRESULT hr;
394394

395-
while (numTries < 10)
395+
while (numTries < 25)
396396
{
397397
// EnumerateCLRs uses the OS API CreateToolhelp32Snapshot which can return ERROR_BAD_LENGTH or
398398
// ERROR_PARTIAL_COPY. If we get either of those, we try wait 1/10th of a second try again (that
@@ -517,7 +517,9 @@ class RuntimeStartupHelper
517517
bool coreclrExists = false;
518518

519519
HRESULT hr = InvokeStartupCallback(&coreclrExists);
520-
if (SUCCEEDED(hr))
520+
// Because the target process is suspended on create, the toolhelp apis fail with the below errors even
521+
// with the retry logic in InternalEnumerateCLRs.
522+
if (SUCCEEDED(hr) || (hr == HRESULT_FROM_WIN32(ERROR_PARTIAL_COPY)) || (hr == HRESULT_FROM_WIN32(ERROR_BAD_LENGTH)))
521523
{
522524
if (!coreclrExists && !m_canceled)
523525
{
@@ -1786,4 +1788,4 @@ CLRCreateInstance(
17861788
#else
17871789
return E_NOTIMPL;
17881790
#endif
1789-
}
1791+
}

0 commit comments

Comments
 (0)