2 * Emulator initialisation code
7 #include "wine/winbase16.h"
11 #include "builtin32.h"
15 #include "debugtools.h"
17 /***********************************************************************
18 * Main loop of initial task
20 static void initial_task(void)
26 GetStartupInfoA( &info );
27 if (!(info.dwFlags & STARTF_USESHOWWINDOW)) info.wShowWindow = SW_SHOWNORMAL;
29 if ((instance = WinExec16( GetCommandLineA(), info.wShowWindow )) < 32)
31 MESSAGE( "%s: can't exec '%s': ", argv0, GetCommandLineA() );
34 case 2: MESSAGE("file not found\n" ); break;
35 case 11: MESSAGE("invalid exe file\n" ); break;
36 default: MESSAGE("error=%d\n", instance ); break;
38 ExitProcess(instance);
41 /* Start message loop for desktop window */
43 while ( GetNumTasks16() > 1 && Callout.GetMessageA( &msg, 0, 0, 0 ) )
45 Callout.TranslateMessage( &msg );
46 Callout.DispatchMessageA( &msg );
53 /**********************************************************************
56 int main( int argc, char *argv[] )
58 BUILTIN32_DESCRIPTOR descriptor;
60 memset( &descriptor, 0, sizeof(descriptor) );
61 descriptor.filename = argv[0];
62 descriptor.dllentrypoint = initial_task;
63 BUILTIN32_RegisterDLL( &descriptor );
65 PROCESS_InitWine( argc, argv );
66 return 1; /* not reached */