mirror of
https://github.com/reactos/reactos.git
synced 2024-10-01 23:14:53 +00:00
[TIMEDATE] Do not display a message box when NTP sync fails (#2305)
This PR merely checks if the string is empty and displaying (only) a debug information to the debugger, at disposal of displaying a message box. I might implement such dynamic resource string to the CPL later in a next PR. CORE-16654
This commit is contained in:
parent
fb30239129
commit
37349d7a0f
|
@ -191,6 +191,13 @@ SetTime(VOID)
|
||||||
|
|
||||||
DPRINT("Time Server is '%S'.\n", szData);
|
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);
|
ulTime = GetServerTime(szData);
|
||||||
|
|
||||||
if (ulTime != 0)
|
if (ulTime != 0)
|
||||||
|
|
|
@ -19,6 +19,6 @@ add_library(timedate MODULE
|
||||||
${CMAKE_CURRENT_BINARY_DIR}/timedate.def)
|
${CMAKE_CURRENT_BINARY_DIR}/timedate.def)
|
||||||
|
|
||||||
set_module_type(timedate cpl UNICODE)
|
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_pch(timedate timedate.h SOURCE)
|
||||||
add_cd_file(TARGET timedate DESTINATION reactos/system32 FOR all)
|
add_cd_file(TARGET timedate DESTINATION reactos/system32 FOR all)
|
||||||
|
|
|
@ -278,7 +278,7 @@ InetTimePageProc(HWND hwndDlg,
|
||||||
dwError = W32TimeSyncNow(L"localhost", 0, 0);
|
dwError = W32TimeSyncNow(L"localhost", 0, 0);
|
||||||
if (dwError != ERROR_SUCCESS)
|
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;
|
break;
|
||||||
|
|
|
@ -16,6 +16,7 @@
|
||||||
#include <wchar.h>
|
#include <wchar.h>
|
||||||
#include <commctrl.h>
|
#include <commctrl.h>
|
||||||
#include <cpl.h>
|
#include <cpl.h>
|
||||||
|
#include <debug.h>
|
||||||
|
|
||||||
#include "resource.h"
|
#include "resource.h"
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue