From d98f11705e6e74ee86104b6c02c911f835ae2e45 Mon Sep 17 00:00:00 2001 From: Bernhard Miklautz Date: Mon, 16 Jan 2017 08:58:04 +0100 Subject: [PATCH] shadow server: add more error messages --- server/shadow/shadow.c | 9 +++++++++ server/shadow/shadow_server.c | 9 +++++++++ 2 files changed, 18 insertions(+) diff --git a/server/shadow/shadow.c b/server/shadow/shadow.c index 734f3a5ec..4daf55e47 100644 --- a/server/shadow/shadow.c +++ b/server/shadow/shadow.c @@ -36,6 +36,7 @@ static BOOL g_MessagePump = FALSE; #endif #include +#define TAG SERVER_TAG("shadow") int main(int argc, char** argv) { @@ -52,6 +53,7 @@ int main(int argc, char** argv) if (!server) { status = -1; + WLog_ERR(TAG, "Server new failed"); goto fail_server_new; } @@ -70,14 +72,21 @@ int main(int argc, char** argv) if ((status = shadow_server_parse_command_line(server, argc, argv)) < 0) { shadow_server_command_line_status_print(server, argc, argv, status); + WLog_ERR(TAG, "Problem parsing the command line."); goto fail_parse_command_line; } if ((status = shadow_server_init(server)) < 0) + { + WLog_ERR(TAG, "Server initialization failed."); goto fail_server_init; + } if ((status = shadow_server_start(server)) < 0) + { + WLog_ERR(TAG, "Failed to start server."); goto fail_server_start; + } if (g_MessagePump) { diff --git a/server/shadow/shadow_server.c b/server/shadow/shadow_server.c index 9a66e9c01..094f1bf0a 100644 --- a/server/shadow/shadow_server.c +++ b/server/shadow/shadow_server.c @@ -453,12 +453,18 @@ int shadow_server_start(rdpShadowServer* server) server->screen = shadow_screen_new(server); if (!server->screen) + { + WLog_ERR(TAG, "screen_new failed"); return -1; + } server->capture = shadow_capture_new(server); if (!server->capture) + { + WLog_ERR(TAG, "capture_new failed"); return -1; + } if (!server->ipcSocket) status = server->listener->Open(server->listener, NULL, (UINT16) server->port); @@ -466,7 +472,10 @@ int shadow_server_start(rdpShadowServer* server) status = server->listener->OpenLocal(server->listener, server->ipcSocket); if (!status) + { + WLog_ERR(TAG, "Problem creating listener. (Port already used or insufficient permissions?)"); return -1; + } if (!(server->thread = CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE) shadow_server_thread, (void*) server, 0, NULL)))