- avoid winternl.h depending on winbase.h
- define RTL versions of TIME_ZONE_INFORMATION and SYSTEMTIME
diff --git a/dlls/kernel/time.c b/dlls/kernel/time.c
index 5e2b3b6..5f3a275 100644
--- a/dlls/kernel/time.c
+++ b/dlls/kernel/time.c
@@ -42,6 +42,7 @@
#include "windef.h"
#include "winbase.h"
#include "winternl.h"
+#include "ntstatus.h"
#include "kernel_private.h"
#include "wine/unicode.h"
#include "wine/debug.h"
@@ -371,7 +372,10 @@
LPTIME_ZONE_INFORMATION tzinfo) /* [out] Destination for time zone information */
{
NTSTATUS status;
- if ((status = RtlQueryTimeZoneInformation(tzinfo))) {
+
+ status = RtlQueryTimeZoneInformation( (RTL_TIME_ZONE_INFORMATION*)tzinfo );
+ if ( status != STATUS_SUCCESS )
+ {
SetLastError( RtlNtStatusToDosError(status) );
return TIME_ZONE_ID_INVALID;
}
@@ -391,7 +395,8 @@
const TIME_ZONE_INFORMATION *tzinfo) /* [in] The new time zone. */
{
NTSTATUS status;
- if ((status = RtlSetTimeZoneInformation(tzinfo)))
+ status = RtlSetTimeZoneInformation( (RTL_TIME_ZONE_INFORMATION*) tzinfo );
+ if ( status != STATUS_SUCCESS )
SetLastError( RtlNtStatusToDosError(status) );
return !status;
}
diff --git a/dlls/ntdll/time.c b/dlls/ntdll/time.c
index d60231e..9cbb9ce 100644
--- a/dlls/ntdll/time.c
+++ b/dlls/ntdll/time.c
@@ -40,7 +40,6 @@
#define NONAMELESSUNION
#define NONAMELESSSTRUCT
#include "windef.h"
-#include "winbase.h"
#include "winternl.h"
#include "wine/unicode.h"
#include "wine/debug.h"
@@ -842,7 +841,7 @@
/*** TIME_GetTimeZoneInfoFromReg: helper for GetTimeZoneInformation ***/
-static int TIME_GetTimeZoneInfoFromReg(LPTIME_ZONE_INFORMATION tzinfo)
+static int TIME_GetTimeZoneInfoFromReg(RTL_TIME_ZONE_INFORMATION *tzinfo)
{
BYTE buf[90];
KEY_VALUE_PARTIAL_INFORMATION * KpInfo =
@@ -909,13 +908,13 @@
* Success: STATUS_SUCCESS.
* Failure: An NTSTATUS error code indicating the problem.
*/
-NTSTATUS WINAPI RtlQueryTimeZoneInformation(LPTIME_ZONE_INFORMATION tzinfo)
+NTSTATUS WINAPI RtlQueryTimeZoneInformation(RTL_TIME_ZONE_INFORMATION *tzinfo)
{
time_t gmt;
int bias, daylight;
const WCHAR *psTZ;
- memset(tzinfo, 0, sizeof(TIME_ZONE_INFORMATION));
+ memset(tzinfo, 0, sizeof(RTL_TIME_ZONE_INFORMATION));
if( !TIME_GetTimeZoneInfoFromReg(tzinfo)) {
@@ -948,7 +947,7 @@
* BUGS
* Uses the obsolete unix timezone structure and tz_dsttime member.
*/
-NTSTATUS WINAPI RtlSetTimeZoneInformation( const TIME_ZONE_INFORMATION *tzinfo )
+NTSTATUS WINAPI RtlSetTimeZoneInformation( const RTL_TIME_ZONE_INFORMATION *tzinfo )
{
#ifdef HAVE_SETTIMEOFDAY
struct timezone tz;
diff --git a/include/winternl.h b/include/winternl.h
index 345b7aa..e64dbf0 100644
--- a/include/winternl.h
+++ b/include/winternl.h
@@ -76,6 +76,35 @@
} FILETIME, *PFILETIME, *LPFILETIME;
#endif /* _FILETIME_ */
+/*
+ * RTL_SYSTEM_TIME and RTL_TIME_ZONE_INFORMATION are the same as
+ * the SYSTEMTIME and TIME_ZONE_INFORMATION structures defined
+ * in winbase.h, however we need to define them seperately so
+ * winternl.h doesn't depend on winbase.h. They are used by
+ * RtlQueryTimeZoneInformation and RtlSetTimeZoneInformation.
+ * The names are guessed; if anybody knows the real names, let me know.
+ */
+typedef struct _RTL_SYSTEM_TIME {
+ WORD wYear;
+ WORD wMonth;
+ WORD wDayOfWeek;
+ WORD wDay;
+ WORD wHour;
+ WORD wMinute;
+ WORD wSecond;
+ WORD wMilliseconds;
+} RTL_SYSTEM_TIME, *PRTL_SYSTEM_TIME;
+
+typedef struct _RTL_TIME_ZONE_INFORMATION {
+ LONG Bias;
+ WCHAR StandardName[32];
+ RTL_SYSTEM_TIME StandardDate;
+ LONG StandardBias;
+ WCHAR DaylightName[32];
+ RTL_SYSTEM_TIME DaylightDate;
+ LONG DaylightBias;
+} RTL_TIME_ZONE_INFORMATION, *PRTL_TIME_ZONE_INFORMATION;
+
typedef struct _CLIENT_ID
{
HANDLE UniqueProcess;
@@ -1953,7 +1982,7 @@
NTSTATUS WINAPI RtlQueryInformationAcl(PACL,LPVOID,DWORD,ACL_INFORMATION_CLASS);
NTSTATUS WINAPI RtlQueryProcessDebugInformation(ULONG,ULONG,PDEBUG_BUFFER);
NTSTATUS WINAPI RtlQueryRegistryValues(ULONG, PCWSTR, PRTL_QUERY_REGISTRY_TABLE, PVOID, PVOID);
-NTSTATUS WINAPI RtlQueryTimeZoneInformation(LPTIME_ZONE_INFORMATION);
+NTSTATUS WINAPI RtlQueryTimeZoneInformation(RTL_TIME_ZONE_INFORMATION*);
void WINAPI RtlRaiseException(PEXCEPTION_RECORD);
void WINAPI RtlRaiseStatus(NTSTATUS);
ULONG WINAPI RtlRandom(PULONG);
@@ -1979,7 +2008,7 @@
void WINAPI RtlSetLastWin32Error(DWORD);
void WINAPI RtlSetLastWin32ErrorAndNtStatusFromNtStatus(NTSTATUS);
NTSTATUS WINAPI RtlSetSaclSecurityDescriptor(PSECURITY_DESCRIPTOR,BOOLEAN,PACL,BOOLEAN);
-NTSTATUS WINAPI RtlSetTimeZoneInformation(const TIME_ZONE_INFORMATION*);
+NTSTATUS WINAPI RtlSetTimeZoneInformation(const RTL_TIME_ZONE_INFORMATION*);
ULONG WINAPI RtlSizeHeap(HANDLE,ULONG,PVOID);
LPDWORD WINAPI RtlSubAuthoritySid(PSID,DWORD);
LPBYTE WINAPI RtlSubAuthorityCountSid(PSID);