Commit 8a64b83e authored by Ulrich Weigand's avatar Ulrich Weigand Committed by Alexandre Julliard

Bugfix: don't call ExitProcess() before SYSLEVEL_Init().

parent ea65e29b
......@@ -8,7 +8,7 @@
#include "windef.h"
extern void MAIN_Usage(char*);
extern BOOL MAIN_MainInit(void);
extern BOOL MAIN_MainInit( int *argc, char *argv[] );
extern BOOL MAIN_WineInit( int *argc, char *argv[] );
extern HINSTANCE MAIN_WinelibInit( int *argc, char *argv[] );
extern int MAIN_GetLanguageID(char*lang, char*country, char*charset, char*dialect);
......
......@@ -57,14 +57,20 @@ DEFAULT_DEBUG_CHANNEL(server)
/***********************************************************************
* Main initialisation routine
*/
BOOL MAIN_MainInit(void)
BOOL MAIN_MainInit( int *argc, char *argv[] )
{
/* Create the initial process */
if (!PROCESS_Init()) return 0;
/* Set server debug level */
CLIENT_SetDebug( TRACE_ON(server) );
/* Initialize syslevel handling */
SYSLEVEL_Init();
/* Parse command line arguments */
MAIN_WineInit( argc, argv );
/* Load the configuration file */
if (!PROFILE_LoadWineIni()) return FALSE;
......@@ -98,6 +104,10 @@ BOOL MAIN_MainInit(void)
/* Read DOS config.sys */
if (!DOSCONF_ReadConfig()) return FALSE;
/* Initialize KERNEL */
if (!LoadLibrary16( "KRNL386.EXE" )) return FALSE;
if (!LoadLibraryA( "KERNEL32" )) return FALSE;
return TRUE;
}
......@@ -288,18 +298,8 @@ HINSTANCE MAIN_WinelibInit( int *argc, char *argv[] )
OFSTRUCT ofs;
HMODULE16 hModule;
/* Create the initial process */
if (!PROCESS_Init()) return 0;
/* Parse command line arguments */
MAIN_WineInit( argc, argv );
/* Main initialization */
if (!MAIN_MainInit()) return 0;
/* Initialize KERNEL */
if (!LoadLibrary16( "KRNL386.EXE" )) return 0;
if (!LoadLibraryA( "KERNEL32" )) return 0;
if (!MAIN_MainInit( argc, argv )) return 0;
/* Create and switch to initial task */
if (!(wm = ELF_CreateDummyModule( argv[0], argv[0] )))
......
......@@ -115,25 +115,13 @@ int main( int argc, char *argv[] )
*/
DEBUG_argv0 = argv[0];
/* Create the initial process */
if (!PROCESS_Init()) return FALSE;
/* Parse command-line */
if (!MAIN_WineInit( &argc, argv )) return 1;
MAIN_argc = argc; MAIN_argv = argv;
/* Set up debugger hook */
EXC_SetDebugEventHook( wine_debugger );
if (Options.debug)
TASK_AddTaskEntryBreakpoint = DEBUG_AddTaskEntryBreakpoint;
TASK_AddTaskEntryBreakpoint = DEBUG_AddTaskEntryBreakpoint;
/* Initialize everything */
if (!MAIN_MainInit()) return 1;
/* Load kernel modules */
if (!LoadLibrary16( "KRNL386.EXE" )) return 1;
if (!LoadLibraryA( "KERNEL32" )) return 1;
if (!MAIN_MainInit( &argc, argv )) return 1;
MAIN_argc = argc; MAIN_argv = argv;
/* Create initial task */
if ( !(pModule = NE_GetPtr( GetModuleHandle16( "KERNEL" ) )) ) return 1;
......
......@@ -23,6 +23,7 @@
#include "pe_image.h"
#include "task.h"
#include "server.h"
#include "options.h"
#include "callback.h"
#include "debugtools.h"
......@@ -482,7 +483,7 @@ void PROCESS_Start(void)
}
/* If requested, add entry point breakpoint */
if ( TASK_AddTaskEntryBreakpoint )
if ( Options.debug && TASK_AddTaskEntryBreakpoint )
TASK_AddTaskEntryBreakpoint( pdb->task );
/* Now call the entry point */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment