add_subdirectory(telnetd)
add_subdirectory(tftpd)
add_subdirectory(umpnpmgr)
+add_subdirectory(w32time)
add_subdirectory(wkssvc)
add_subdirectory(wlansvc)
add_subdirectory(wmisvc)
--- /dev/null
+
+spec2def(w32time.dll w32time.spec ADD_IMPORTLIB)
+
+add_library(w32time SHARED
+ w32time.c
+ ntpclient.c
+ ${CMAKE_CURRENT_BINARY_DIR}/w32time.def)
+
+set_module_type(w32time win32dll UNICODE)
+
+add_importlibs(w32time ws2_32 advapi32 msvcrt kernel32 ntdll)
+add_cd_file(TARGET w32time DESTINATION reactos/system32 FOR all)
*
*/
-#include "timedate.h"
+#include "w32time.h"
#include <winsock2.h>
* COPYRIGHT: Copyright 2006 Ged Murphy <gedmurphy@gmail.com>
*/
-#include "timedate.h"
+#include "w32time.h"
/* Get the domain name from the registry */
static DWORD
}
-DWORD
-SyncTimeNow(VOID)
+DWORD WINAPI
+W32TimeSyncNow(LPCWSTR cmdline,
+ UINT blocking,
+ UINT flags)
{
DWORD dwError;
ULONG ulTime;
+
dwError = GetTimeFromServer(&ulTime);
if (dwError != ERROR_SUCCESS)
{
--- /dev/null
+#ifndef _W32TIME_H
+#define _W32TIME_H
+
+#include <stdarg.h>
+
+#define _INC_WINDOWS
+#define COM_NO_WINDOWS_H
+#define WIN32_NO_STATUS
+
+#include <windef.h>
+#include <winbase.h>
+#include <winnls.h>
+#include <winreg.h>
+
+#define NTPPORT 123
+
+
+/* ntpclient.c */
+// NTP timestamp
+typedef struct _TIMEPACKET
+{
+ DWORD dwInteger;
+ DWORD dwFractional;
+} TIMEPACKET, *PTIMEPACKET;
+
+// NTP packet
+typedef struct _NTPPACKET
+{
+ BYTE LiVnMode;
+ BYTE Stratum;
+ char Poll;
+ char Precision;
+ long RootDelay;
+ long RootDispersion;
+ char ReferenceID[4];
+ TIMEPACKET ReferenceTimestamp;
+ TIMEPACKET OriginateTimestamp;
+ TIMEPACKET ReceiveTimestamp;
+ TIMEPACKET TransmitTimestamp;
+}NTPPACKET, *PNTPPACKET;
+
+ULONG GetServerTime(LPWSTR lpAddress);
+
+#endif /* _W32TIME_H */
--- /dev/null
+18 stdcall W32TimeSyncNow(wstr long long)
dateandtime.c
internettime.c
monthcal.c
- ntpclient.c
timedate.c
timezone.c
- w32time.c
timedate.h)
file(GLOB timedate_rc_deps resources/*.*)
${CMAKE_CURRENT_BINARY_DIR}/timedate.def)
set_module_type(timedate cpl UNICODE)
-add_importlibs(timedate advapi32 user32 gdi32 comctl32 ws2_32 iphlpapi msvcrt kernel32)
+add_importlibs(timedate w32time advapi32 user32 gdi32 comctl32 ws2_32 iphlpapi msvcrt kernel32)
add_pch(timedate timedate.h SOURCE)
add_cd_file(TARGET timedate DESTINATION reactos/system32 FOR all)
#include "timedate.h"
+DWORD WINAPI W32TimeSyncNow(LPCWSTR cmdline, UINT blocking, UINT flags);
+
static VOID
CreateNTPServerList(HWND hwnd)
{
SetNTPServer(hwndDlg);
- dwError = SyncTimeNow();
+ dwError = W32TimeSyncNow(L"localhost", 0, 0);
if (dwError != ERROR_SUCCESS)
{
DisplayWin32Error(dwError);
#define MAX_VALUE_NAME 16383
#define SERVERLISTSIZE 6
#define BUFSIZE 1024
-#define NTPPORT 123
#define ID_TIMER 1
typedef struct
VOID UnregisterClockControl(VOID);
-/* ntpclient.c */
-// NTP timestamp
-typedef struct _TIMEPACKET
-{
- DWORD dwInteger;
- DWORD dwFractional;
-} TIMEPACKET, *PTIMEPACKET;
-
-// NTP packet
-typedef struct _NTPPACKET
-{
- BYTE LiVnMode;
- BYTE Stratum;
- char Poll;
- char Precision;
- long RootDelay;
- long RootDispersion;
- char ReferenceID[4];
- TIMEPACKET ReferenceTimestamp;
- TIMEPACKET OriginateTimestamp;
- TIMEPACKET ReceiveTimestamp;
- TIMEPACKET TransmitTimestamp;
-}NTPPACKET, *PNTPPACKET;
-
-ULONG GetServerTime(LPWSTR lpAddress);
-
-
-/* w32time.c */
-DWORD SyncTimeNow(VOID);
-
-
/* monthcal.c */
#define MCCM_SETDATE (WM_USER + 1)
#define MCCM_GETDATE (WM_USER + 2)