diff --git a/tools/winebuild/spec32.c b/tools/winebuild/spec32.c index 09bb636c987..9dd436b8901 100644 --- a/tools/winebuild/spec32.c +++ b/tools/winebuild/spec32.c @@ -509,19 +509,31 @@ void BuildSpec32File( FILE *outfile ) case SPEC_MODE_GUIEXE: if (!init_func) init_func = "WinMain"; fprintf( outfile, - "\n#include \n" + "\ntypedef struct {\n" + " unsigned int cb;\n" + " char *lpReserved, *lpDesktop, *lpTitle;\n" + " unsigned int dwX, dwY, dwXSize, dwYSize;\n" + " unsigned int dwXCountChars, dwYCountChars, dwFillAttribute, dwFlags;\n" + " unsigned short wShowWindow, cbReserved2;\n" + " char *lpReserved2;\n" + " void *hStdInput, *hStdOutput, *hStdError;\n" + "} STARTUPINFOA;\n" "int _ARGC;\n" "char **_ARGV;\n" - "extern int __stdcall %s(HINSTANCE,HINSTANCE,LPSTR,INT);\n" + "extern int __stdcall %s(void *,void *,char *,int);\n" + "extern char * __stdcall GetCommandLineA(void);\n" + "extern void * __stdcall GetModuleHandleA(char *);\n" + "extern void __stdcall GetStartupInfoA(STARTUPINFOA *);\n" + "extern void __stdcall ExitProcess(unsigned int);\n" "static void __wine_exe_main(void)\n" "{\n" " extern int __wine_get_main_args( char ***argv );\n" " STARTUPINFOA info;\n" - " LPSTR cmdline = GetCommandLineA();\n" + " char *cmdline = GetCommandLineA();\n" " while (*cmdline && *cmdline != ' ') cmdline++;\n" " if (*cmdline) cmdline++;\n" " GetStartupInfoA( &info );\n" - " if (!(info.dwFlags & STARTF_USESHOWWINDOW)) info.wShowWindow = 1;\n" + " if (!(info.dwFlags & 1)) info.wShowWindow = 1;\n" " _ARGC = __wine_get_main_args( &_ARGV );\n" " ExitProcess( %s( GetModuleHandleA(0), 0, cmdline, info.wShowWindow ) );\n" "}\n\n", init_func, init_func ); @@ -531,19 +543,32 @@ void BuildSpec32File( FILE *outfile ) case SPEC_MODE_GUIEXE_UNICODE: if (!init_func) init_func = "WinMain"; fprintf( outfile, - "\n#include \n" + "\ntypedef unsigned short WCHAR;\n" + "typedef struct {\n" + " unsigned int cb;\n" + " char *lpReserved, *lpDesktop, *lpTitle;\n" + " unsigned int dwX, dwY, dwXSize, dwYSize;\n" + " unsigned int dwXCountChars, dwYCountChars, dwFillAttribute, dwFlags;\n" + " unsigned short wShowWindow, cbReserved2;\n" + " char *lpReserved2;\n" + " void *hStdInput, *hStdOutput, *hStdError;\n" + "} STARTUPINFOA;\n" "int _ARGC;\n" "WCHAR **_ARGV;\n" - "extern int __stdcall %s(HINSTANCE,HINSTANCE,LPSTR,INT);\n" + "extern int __stdcall %s(void *,void *,char *,int);\n" + "extern char * __stdcall GetCommandLineA(void);\n" + "extern void * __stdcall GetModuleHandleA(char *);\n" + "extern void __stdcall GetStartupInfoA(STARTUPINFOA *);\n" + "extern void __stdcall ExitProcess(unsigned int);\n" "static void __wine_exe_main(void)\n" "{\n" " extern int __wine_get_wmain_args( WCHAR ***argv );\n" " STARTUPINFOA info;\n" - " LPSTR cmdline = GetCommandLineA();\n" + " char *cmdline = GetCommandLineA();\n" " while (*cmdline && *cmdline != ' ') cmdline++;\n" " if (*cmdline) cmdline++;\n" " GetStartupInfoA( &info );\n" - " if (!(info.dwFlags & STARTF_USESHOWWINDOW)) info.wShowWindow = 1;\n" + " if (!(info.dwFlags & 1)) info.wShowWindow = 1;\n" " _ARGC = __wine_get_wmain_args( &_ARGV );\n" " ExitProcess( %s( GetModuleHandleA(0), 0, cmdline, info.wShowWindow ) );\n" "}\n\n", init_func, init_func );