diff --git a/base/services/w32time/w32time.c b/base/services/w32time/w32time.c index abc58a5e151..c2b2bfeeeae 100644 --- a/base/services/w32time/w32time.c +++ b/base/services/w32time/w32time.c @@ -191,6 +191,13 @@ SetTime(VOID) DPRINT("Time Server is '%S'.\n", szData); + /* Is the given string empty? */ + if (cbName == 0 || szData[0] == '\0') + { + DPRINT("The time NTP server couldn't be found, the string is empty!\n"); + return ERROR_INVALID_DATA; + } + ulTime = GetServerTime(szData); if (ulTime != 0) diff --git a/dll/cpl/timedate/CMakeLists.txt b/dll/cpl/timedate/CMakeLists.txt index d1b5275dd07..20f0d62d59c 100644 --- a/dll/cpl/timedate/CMakeLists.txt +++ b/dll/cpl/timedate/CMakeLists.txt @@ -19,6 +19,6 @@ add_library(timedate MODULE ${CMAKE_CURRENT_BINARY_DIR}/timedate.def) set_module_type(timedate cpl UNICODE) -add_importlibs(timedate w32time advapi32 user32 gdi32 comctl32 ws2_32 iphlpapi msvcrt kernel32) +add_importlibs(timedate w32time advapi32 user32 gdi32 comctl32 ws2_32 iphlpapi msvcrt kernel32 ntdll) add_pch(timedate timedate.h SOURCE) add_cd_file(TARGET timedate DESTINATION reactos/system32 FOR all) diff --git a/dll/cpl/timedate/internettime.c b/dll/cpl/timedate/internettime.c index 808930e083e..88e95ae0f6e 100644 --- a/dll/cpl/timedate/internettime.c +++ b/dll/cpl/timedate/internettime.c @@ -278,7 +278,7 @@ InetTimePageProc(HWND hwndDlg, dwError = W32TimeSyncNow(L"localhost", 0, 0); if (dwError != ERROR_SUCCESS) { - DisplayWin32Error(dwError); + DPRINT("Failed to synchronize the time! Invalid NTP server name has been caught or no server name could be found (Error: %lu).\n", dwError); } } break; diff --git a/dll/cpl/timedate/timedate.h b/dll/cpl/timedate/timedate.h index 8cf7dbb74bd..500421758b7 100644 --- a/dll/cpl/timedate/timedate.h +++ b/dll/cpl/timedate/timedate.h @@ -16,6 +16,7 @@ #include #include #include +#include #include "resource.h"