ExecuteAssembly is initializing exitCode to 0 on entrance to the function. If it then fails prior to exitCode being set when invoking the entry point, the exitCode remains 0 even though there was a failure, and corerun ends up returning a successful exit code.
if (!SUCCEEDED(st))
{
fprintf(stderr, "ExecuteAssembly failed - status: 0x%08x\n", st);
+ exitCode = -1;
}
}
else
LPCSTR entryPointMethodName,
DWORD* exitCode)
{
- *exitCode = 0;
+ if (exitCode == NULL)
+ {
+ return HRESULT_FROM_WIN32(ERROR_INVALID_PARAMETER);
+ }
+ *exitCode = -1;
DWORD error = PAL_InitializeCoreCLR(exePath, coreClrPath, true);
HRESULT hr = HRESULT_FROM_WIN32(error);