From e75096a0df03443216b059a9c9c639c483261d86 Mon Sep 17 00:00:00 2001 From: Andreas Mohr Date: Mon, 24 Jun 2002 23:00:47 +0000 Subject: [PATCH] Made initialization more verbose in case of errors. --- programs/wineconsole/wineconsole.c | 31 ++++++++++++++++++++++++++---- 1 file changed, 27 insertions(+), 4 deletions(-) diff --git a/programs/wineconsole/wineconsole.c b/programs/wineconsole/wineconsole.c index aec56d9dbec..4ab3a56e6e7 100644 --- a/programs/wineconsole/wineconsole.c +++ b/programs/wineconsole/wineconsole.c @@ -420,7 +420,7 @@ static struct inner_data* WINECON_Init(HINSTANCE hInst, void* pid) /****************************************************************** * WINECON_Spawn * - * Spawn the child processus when invoked with wineconsole foo bar + * Spawn the child process when invoked with wineconsole foo bar */ static BOOL WINECON_Spawn(struct inner_data* data, LPCSTR lpCmdLine) { @@ -495,19 +495,42 @@ int PASCAL WinMain(HINSTANCE hInst, HINSTANCE hPrev, LPSTR lpCmdLine, INT nCmdSh /* case of wineconsole , signal process that created us that we're up and running */ if (WINECON_HasEvent(lpCmdLine, &evt)) { - if (!(data = WINECON_Init(hInst, 0))) return 0; + if (!(data = WINECON_Init(hInst, 0))) + { + WINE_ERR("failed to init1 wineconsole.\n"); + return 0; + } ret = SetEvent((HANDLE)evt); + if (!ret) + { + WINE_ERR("SetEvent failed.\n"); + goto cleanup; + } } else { - if (!(data = WINECON_Init(hInst, (void*)GetCurrentProcessId()))) return 0; + if (!(data = WINECON_Init(hInst, (void*)GetCurrentProcessId()))) + { + WINE_ERR("failed to init2 wineconsole.\n"); + return 0; + } ret = WINECON_Spawn(data, lpCmdLine); + if (!ret) + { + WINE_MESSAGE("wineconsole: spawning client program failed. Invalid/missing command line arguments ?\n"); + goto cleanup; + } } - if (ret && WCUSER_InitBackend(data)) + if (WCUSER_InitBackend(data)) { + WINE_TRACE("calling MainLoop.\n"); ret = data->fnMainLoop(data); } + else + WINE_ERR("WCUSER_InitBackend failed.\n"); + +cleanup: WINECON_Delete(data); return ret;