2 * Emulator initialisation code
7 #include "wine/winbase16.h"
14 #include "debugtools.h"
16 extern void PROCESS_InitWine( int argc
, char *argv
[] ) WINE_NORETURN
;
18 /***********************************************************************
19 * Main loop of initial task
21 void wine_initial_task(void)
27 if (!LoadLibraryA( "user32.dll" ))
29 MESSAGE( "Cannot load user32.dll\n" );
30 ExitProcess( GetLastError() );
34 GetStartupInfoA( &info
);
35 if (!(info
.dwFlags
& STARTF_USESHOWWINDOW
)) info
.wShowWindow
= SW_SHOWNORMAL
;
37 if ((instance
= WinExec16( GetCommandLineA(), info
.wShowWindow
)) < 32)
39 if (instance
== 11) /* try DOS format */
41 MZ_LoadImage( GetCommandLineA() );
42 /* if we get back here it failed */
43 instance
= GetLastError();
46 MESSAGE( "%s: can't exec '%s': ", argv0
, GetCommandLineA() );
49 case 2: MESSAGE("file not found\n" ); break;
50 case 11: MESSAGE("invalid exe file\n" ); break;
51 default: MESSAGE("error=%d\n", instance
); break;
53 ExitProcess(instance
);
56 /* Start message loop for desktop window */
58 while ( GetNumTasks16() > 1 && Callout
.GetMessageA( &msg
, 0, 0, 0 ) )
60 Callout
.TranslateMessage( &msg
);
61 Callout
.DispatchMessageA( &msg
);
68 /**********************************************************************
71 int main( int argc
, char *argv
[] )
73 PROCESS_InitWine( argc
, argv
);
74 return 1; /* not reached */