msvcrt: Try to call CorExitProcess instead of ExitProcess on exit.

This commit is contained in:
Vincent Povirk 2011-02-21 15:49:59 -06:00 committed by Alexandre Julliard
parent ae0797150e
commit 71bfd33463
1 changed files with 15 additions and 0 deletions

View File

@ -265,8 +265,23 @@ MSVCRT__onexit_t CDECL MSVCRT__onexit(MSVCRT__onexit_t func)
*/
void CDECL MSVCRT_exit(int exitcode)
{
HMODULE hmscoree;
static const WCHAR mscoreeW[] = {'m','s','c','o','r','e','e',0};
void WINAPI (*pCorExitProcess)(int);
TRACE("(%d)\n",exitcode);
MSVCRT__cexit();
hmscoree = GetModuleHandleW(mscoreeW);
if (hmscoree)
{
pCorExitProcess = (void*)GetProcAddress(hmscoree, "CorExitProcess");
if (pCorExitProcess)
pCorExitProcess(exitcode);
}
ExitProcess(exitcode);
}