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

Alexandre Julliard julliard at winehq.org
Thu Feb 24 11:43:25 CST 2011


Module: wine
Branch: master
Commit: 71bfd33463e24de24ea4a94e47ce01946ad37a25
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=71bfd33463e24de24ea4a94e47ce01946ad37a25

Author: Vincent Povirk <vincent at codeweavers.com>
Date:   Mon Feb 21 15:49:59 2011 -0600

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

---

 dlls/msvcrt/exit.c |   15 +++++++++++++++
 1 files changed, 15 insertions(+), 0 deletions(-)

diff --git a/dlls/msvcrt/exit.c b/dlls/msvcrt/exit.c
index 6e5a58a..d7f28f1 100644
--- a/dlls/msvcrt/exit.c
+++ b/dlls/msvcrt/exit.c
@@ -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);
 }
 




More information about the wine-cvs mailing list