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 int WINAPI
wine_initial_task( HINSTANCE inst
, HINSTANCE prev
, LPSTR cmdline
, INT show
)
26 if (!LoadLibraryA( "user32.dll" ))
28 MESSAGE( "Cannot load user32.dll\n" );
29 ExitProcess( GetLastError() );
33 if ((instance
= WinExec16( GetCommandLineA(), show
)) < 32)
35 if (instance
== 11) /* try DOS format */
37 MZ_LoadImage( GetCommandLineA() );
38 /* if we get back here it failed */
39 instance
= GetLastError();
42 MESSAGE( "%s: can't exec '%s': ", argv0
, GetCommandLineA() );
45 case 2: MESSAGE("file not found\n" ); break;
46 case 11: MESSAGE("invalid exe file\n" ); break;
47 default: MESSAGE("error=%d\n", instance
); break;
49 ExitProcess(instance
);
52 /* Start message loop for desktop window */
54 while ( GetNumTasks16() > 1 && Callout
.GetMessageA( &msg
, 0, 0, 0 ) )
56 Callout
.TranslateMessage( &msg
);
57 Callout
.DispatchMessageA( &msg
);
64 /**********************************************************************
67 int main( int argc
, char *argv
[] )
69 PROCESS_InitWine( argc
, argv
);
70 return 1; /* not reached */