Don't resume threads created with CREATE_SUSPENDED

This fixes errors in Unity 5.6 when it creates baking processes.
This commit is contained in:
David McFarland
2017-05-01 15:34:53 -03:00
committed by Baldur Karlsson
parent e5ec2c7280
commit f22d38bc63
+10 -2
View File
@@ -276,6 +276,7 @@ private:
*lpProcessInformation = dummy;
}
bool resume = (dwCreationFlags & CREATE_SUSPENDED) == 0;
dwCreationFlags |= CREATE_SUSPENDED;
BOOL ret = realFunc(lpApplicationName, lpCommandLine, lpProcessAttributes, lpThreadAttributes,
@@ -328,7 +329,10 @@ private:
}
}
ResumeThread(lpProcessInformation->hThread);
if(resume)
{
ResumeThread(lpProcessInformation->hThread);
}
// ensure we clean up after ourselves
if(dummy.dwProcessId != 0)
@@ -360,6 +364,7 @@ private:
*lpProcessInformation = dummy;
}
bool resume = (dwCreationFlags & CREATE_SUSPENDED) == 0;
dwCreationFlags |= CREATE_SUSPENDED;
BOOL ret = realFunc(lpApplicationName, lpCommandLine, lpProcessAttributes, lpThreadAttributes,
@@ -414,7 +419,10 @@ private:
}
}
ResumeThread(lpProcessInformation->hThread);
if(resume)
{
ResumeThread(lpProcessInformation->hThread);
}
// ensure we clean up after ourselves
if(dummy.dwProcessId != 0)