2 * Emulator initialisation code
7 #include "wine/winbase16.h"
15 #include "debugtools.h"
17 extern void PROCESS_InitWine( int argc
, char *argv
[] ) WINE_NORETURN
;
19 /***********************************************************************
20 * Main loop of initial task
22 int WINAPI
wine_initial_task( HINSTANCE inst
, HINSTANCE prev
, LPSTR cmdline
, INT show
)
27 if (!LoadLibraryA( "user32.dll" ))
29 MESSAGE( "Cannot load user32.dll\n" );
30 ExitProcess( GetLastError() );
34 if ((instance
= WinExec16( GetCommandLineA(), show
)) < 32)
36 if (instance
== 11) /* try DOS format */
38 if (DPMI_LoadDosSystem())
39 Dosvm
.LoadDosExe( GetCommandLineA() );
40 /* if we get back here it failed */
41 instance
= GetLastError();
44 MESSAGE( "%s: can't exec '%s': ", argv0
, GetCommandLineA() );
47 case 2: MESSAGE("file not found\n" ); break;
48 case 11: MESSAGE("invalid exe file\n" ); break;
49 default: MESSAGE("error=%d\n", instance
); break;
51 ExitProcess(instance
);
54 /* Start message loop for desktop window */
56 while ( GetNumTasks16() > 1 && Callout
.GetMessageA( &msg
, 0, 0, 0 ) )
58 Callout
.TranslateMessage( &msg
);
59 Callout
.DispatchMessageA( &msg
);
66 /**********************************************************************
69 int main( int argc
, char *argv
[] )
71 PROCESS_InitWine( argc
, argv
);
72 return 1; /* not reached */