On Windows, we need to shutdown the EE when receiving a CTRL_CLOSE_EVENT to we run ProcessExit handlers and other code that relies on ProcessExit working (like AssemblyLoadContext.Unloading). One way we receive this event is when there's a running process in a docker container that has the stop command run against it.
}
else
#endif // DEBUGGING_SUPPORTED
- {
+ {
+ if (dwCtrlType == CTRL_CLOSE_EVENT)
+ {
+ // Initiate shutdown so the ProcessExit handlers run
+ ForceEEShutdown(SCA_ReturnWhenShutdownComplete);
+ }
+
g_fInControlC = true; // only for weakening assertions in checked build.
return FALSE; // keep looking for a real handler.
}
RETURN g_EEConfigMemory;
}
-
/**************************************************************/
HRESULT EEConfig::Init()
{
// statically link to EEConfig.
CLRConfig::RegisterGetConfigValueCallback(&GetConfigValueCallback);
-
return S_OK;
}