Andrey Turkin : kernel32: Add ExitProcess wrapper to please Shrinker.
Alexandre Julliard
julliard at winehq.org
Wed Oct 8 08:33:12 CDT 2008
Module: wine
Branch: master
Commit: 7ba54ab45cf2d6f87f238f9985e778847fd3077a
URL: http://source.winehq.org/git/wine.git/?a=commit;h=7ba54ab45cf2d6f87f238f9985e778847fd3077a
Author: Andrey Turkin <andrey.turkin at gmail.com>
Date: Tue Oct 7 20:16:19 2008 +0400
kernel32: Add ExitProcess wrapper to please Shrinker.
---
dlls/kernel32/process.c | 22 +++++++++++++++++++++-
1 files changed, 21 insertions(+), 1 deletions(-)
diff --git a/dlls/kernel32/process.c b/dlls/kernel32/process.c
index 759612b..1d68462 100644
--- a/dlls/kernel32/process.c
+++ b/dlls/kernel32/process.c
@@ -2137,7 +2137,6 @@ BOOL WINAPI TerminateProcess( HANDLE handle, DWORD exit_code )
return !status;
}
-
/***********************************************************************
* ExitProcess (KERNEL32.@)
*
@@ -2149,6 +2148,26 @@ BOOL WINAPI TerminateProcess( HANDLE handle, DWORD exit_code )
* RETURNS
* Nothing.
*/
+#ifdef __i386__
+__ASM_GLOBAL_FUNC( ExitProcess, /* Shrinker depend on this particular ExitProcess implementation */
+ "pushl %ebp\n\t"
+ ".byte 0x8B, 0xEC\n\t" /* movl %esp, %ebp */
+ ".byte 0x6A, 0x00\n\t" /* pushl $0 */
+ ".byte 0x68, 0x00, 0x00, 0x00, 0x00\n\t" /* pushl $0 - 4 bytes immediate */
+ "pushl 8(%ebp)\n\t"
+ "call " __ASM_NAME("process_ExitProcess") "\n\t"
+ "leave\n\t"
+ "ret $4" )
+
+void WINAPI process_ExitProcess( DWORD status )
+{
+ LdrShutdownProcess();
+ NtTerminateProcess(GetCurrentProcess(), status);
+ exit(status);
+}
+
+#else
+
void WINAPI ExitProcess( DWORD status )
{
LdrShutdownProcess();
@@ -2156,6 +2175,7 @@ void WINAPI ExitProcess( DWORD status )
exit(status);
}
+#endif
/***********************************************************************
* GetExitCodeProcess [KERNEL32.@]
More information about the wine-cvs
mailing list