NTDLL: avoid winternl.h depending on winbase.h
Mike McCormack
mike at codeweavers.com
Mon Jun 20 10:46:48 CDT 2005
Anybody know the Windows DDK names for the definition of
TIME_ZONE_INFORMATION and SYSTEMTIME?
Mike
ChangeLog:
* avoid winternl.h depending on winbase.h
* define RTL versions of TIME_ZONE_INFORMATION and SYSTEMTIME
-------------- next part --------------
Index: dlls/kernel/time.c
===================================================================
RCS file: /home/wine/wine/dlls/kernel/time.c,v
retrieving revision 1.52
diff -u -p -r1.52 time.c
--- dlls/kernel/time.c 20 Jun 2005 10:40:37 -0000 1.52
+++ dlls/kernel/time.c 20 Jun 2005 15:48:39 -0000
@@ -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 @@ DWORD WINAPI GetTimeZoneInformation(
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 @@ BOOL WINAPI SetTimeZoneInformation(
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;
}
Index: dlls/ntdll/time.c
===================================================================
RCS file: /home/wine/wine/dlls/ntdll/time.c,v
retrieving revision 1.72
diff -u -p -r1.72 time.c
--- dlls/ntdll/time.c 17 Jun 2005 13:58:34 -0000 1.72
+++ dlls/ntdll/time.c 20 Jun 2005 15:48:39 -0000
@@ -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 @@ static const WCHAR* TIME_GetTZAsStr (tim
/*** 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 @@ static int TIME_GetTimeZoneInfoFromReg(L
* 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 @@ NTSTATUS WINAPI RtlQueryTimeZoneInformat
* 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;
Index: include/winternl.h
===================================================================
RCS file: /home/wine/wine/include/winternl.h,v
retrieving revision 1.143
diff -u -p -r1.143 winternl.h
--- include/winternl.h 20 Jun 2005 11:44:45 -0000 1.143
+++ include/winternl.h 20 Jun 2005 15:48:40 -0000
@@ -76,6 +76,35 @@ typedef struct _FILETIME
} 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 RtlQueryEnvironmentVari
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 @@ NTSTATUS WINAPI RtlSetGroupSecurityDesc
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);
More information about the wine-patches
mailing list