Call ExitProcess() after WinMain() returns.

This commit is contained in:
Ulrich Weigand 1999-07-10 11:43:49 +00:00 committed by Alexandre Julliard
parent 7b81ed4a3c
commit 74dec7a0f0
1 changed files with 6 additions and 2 deletions

View File

@ -1,6 +1,7 @@
/* Sample winestub.c file for compiling programs with libwine.so. */ /* Sample winestub.c file for compiling programs with libwine.so. */
#include <string.h> #include <string.h>
#include "winbase.h"
#include "winuser.h" #include "winuser.h"
#include "xmalloc.h" #include "xmalloc.h"
@ -22,7 +23,7 @@ int main( int argc, char *argv [] )
{ {
HINSTANCE hInstance; HINSTANCE hInstance;
LPSTR lpszCmdParam; LPSTR lpszCmdParam;
int i, len = 0; int i, len = 0, retv;
_ARGC = argc; _ARGC = argc;
_ARGV = (char **)argv; _ARGV = (char **)argv;
@ -36,8 +37,11 @@ int main( int argc, char *argv [] )
else lpszCmdParam[0] = '\0'; else lpszCmdParam[0] = '\0';
for (i = 2; i < argc; i++) strcat(strcat(lpszCmdParam, " "), argv[i]); for (i = 2; i < argc; i++) strcat(strcat(lpszCmdParam, " "), argv[i]);
return WinMain (hInstance, /* hInstance */ retv = WinMain (hInstance, /* hInstance */
0, /* hPrevInstance */ 0, /* hPrevInstance */
lpszCmdParam, /* lpszCmdParam */ lpszCmdParam, /* lpszCmdParam */
SW_NORMAL); /* nCmdShow */ SW_NORMAL); /* nCmdShow */
ExitProcess( retv );
return retv;
} }