- avoid winternl.h depending on winbase.h

- define RTL versions of TIME_ZONE_INFORMATION and SYSTEMTIME
This commit is contained in:
Mike McCormack 2005-06-20 18:37:17 +00:00 committed by Alexandre Julliard
parent 1cfdb0fd9d
commit 78911f34d9
3 changed files with 42 additions and 9 deletions

View file

@ -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;
}

View file

@ -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 (time_t utc, int bias, int dst)
/*** 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(LPTIME_ZONE_INFORMATION tzinfo)
* 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 RtlQueryTimeZoneInformation(LPTIME_ZONE_INFORMATION tzinfo)
* 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;

View file

@ -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 RtlQueryEnvironmentVariable_U(PWSTR,PUNICODE_STRING,PUNICODE_ST
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 RtlSetGroupSecurityDescriptor(PSECURITY_DESCRIPTOR,PSID,BOOLEAN
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);