2 * Win32 kernel functions
4 * Copyright 1995 Martin von Loewis and Cameron Heide
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
27 #include <sys/times.h>
32 #include "wine/unicode.h"
33 #include "wine/debug.h"
35 WINE_DEFAULT_DEBUG_CHANNEL(win32
);
37 /* maximum time adjustment in seconds for SetLocalTime and SetSystemTime */
38 #define SETTIME_MAX_ADJUST 120
41 /* This structure is used to store strings that represent all of the time zones
42 in the world. (This is used to help GetTimeZoneInformation)
46 const char *psTZFromUnix
;
47 WCHAR psTZWindows
[32];
52 static const struct tagTZ_INFO TZ_INFO
[] =
55 {'D','a','t','e','l','i','n','e',' ','S','t','a','n','d','a','r','d',' ','T','i','m','e','\0'},
58 {'S','a','m','o','a',' ','S','t','a','n','d','a','r','d',' ','T','i','m','e','\0'},
61 {'H','a','w','a','i','i','a','n',' ','S','t','a','n','d','a','r','d',' ','T','i','m','e','\0'},
64 {'A','l','a','s','k','a','n',' ','S','t','a','n','d','a','r','d',' ','T','i','m','e','\0'},
67 {'P','a','c','i','f','i','c',' ','S','t','a','n','d','a','r','d',' ','T','i','m','e','\0'},
70 {'U','S',' ','M','o','u','n','t','a','i','n',' ','S','t','a','n','d','a','r','d',' ','T','i','m','e','\0'},
73 {'M','o','u','n','t','a','i','n',' ','S','t','a','n','d','a','r','d',' ','T','i','m','e','\0'},
76 {'C','e','n','t','r','a','l',' ','A','m','e','r','i','c','a',' ','S','t','a','n','d','a','r','d',' ','T','i','m','e','\0'},
79 {'C','e','n','t','r','a','l',' ','S','t','a','n','d','a','r','d',' ','T','i','m','e','\0'},
82 {'S','A',' ','P','a','c','i','f','i','c',' ','S','t','a','n','d','a','r','d',' ','T','i','m','e','\0'},
85 {'E','a','s','t','e','r','n',' ','S','t','a','n','d','a','r','d',' ','T','i','m','e','\0'},
88 {'U','S',' ','E','a','s','t','e','r','n',' ','S','t','a','n','d','a','r','d',' ','T','i','m','e','\0'},
91 {'A','t','l','a','n','t','i','c',' ','S','t','a','n','d','a','r','d',' ','T','i','m','e','\0'},
94 {'S','A',' ','W','e','s','t','e','r','n',' ','S','t','a','n','d','a','r','d',' ','T','i','m','e','\0'},
97 {'P','a','c','i','f','i','c',' ','S','A',' ','S','t','a','n','d','a','r','d',' ','T','i','m','e','\0'},
100 {'N','e','w','f','o','u','n','d','l','a','n','d',' ','S','t','a','n','d','a','r','d',' ','T','i','m','e','\0'},
103 {'E','.',' ','S','o','u','t','h',' ','A','m','e','r','i','c','a',' ','S','t','a','n','d','a','r','d',' ','T','i','m','e','\0'},
106 {'S','A',' ','E','a','s','t','e','r','n',' ','S','t','a','n','d','a','r','d',' ','T','i','m','e','\0'},
109 {'G','r','e','e','n','l','a','n','d',' ','S','t','a','n','d','a','r','d',' ','T','i','m','e','\0'},
112 {'M','i','d','-','A','t','l','a','n','t','i','c',' ','S','t','a','n','d','a','r','d',' ','T','i','m','e','\0'},
115 {'A','z','o','r','e','s',' ','S','t','a','n','d','a','r','d',' ','T','i','m','e','\0'},
118 {'C','a','p','e',' ','V','e','r','d','e',' ','S','t','a','n','d','a','r','d',' ','T','i','m','e','\0'},
121 {'G','r','e','e','n','w','i','c','h',' ','S','t','a','n','d','a','r','d',' ','T','i','m','e','\0'},
124 {'G','M','T',' ','S','t','a','n','d','a','r','d',' ','T','i','m','e','\0'},
127 {'G','M','T',' ','S','t','a','n','d','a','r','d',' ','T','i','m','e','\0'},
130 {'C','e','n','t','r','a','l',' ','E','u','r','o','p','e',' ','S','t','a','n','d','a','r','d',' ','T','i','m','e','\0'},
133 {'W','.',' ','C','e','n','t','r','a','l',' ','A','f','r','i','c','a',' ','S','t','a','n','d','a','r','d',' ','T','i','m','e','\0'},
136 {'E','.',' ','E','u','r','o','p','e',' ','S','t','a','n','d','a','r','d',' ','T','i','m','e','\0'},
139 {'E','g','y','p','t',' ','S','t','a','n','d','a','r','d',' ','T','i','m','e','\0'},
142 {'S','o','u','t','h',' ','A','f','r','i','c','a',' ','S','t','a','n','d','a','r','d',' ','T','i','m','e','\0'},
145 {'I','s','r','a','e','l',' ','S','t','a','n','d','a','r','d',' ','T','i','m','e','\0'},
148 {'A','r','a','b','i','c',' ','S','t','a','n','d','a','r','d',' ','T','i','m','e','\0'},
151 {'A','r','a','b',' ','S','t','a','n','d','a','r','d',' ','T','i','m','e','\0'},
154 {'R','u','s','s','i','a','n',' ','S','t','a','n','d','a','r','d',' ','T','i','m','e','\0'},
157 {'E','.',' ','A','f','r','i','c','a',' ','S','t','a','n','d','a','r','d',' ','T','i','m','e','\0'},
160 {'I','r','a','n',' ','S','t','a','n','d','a','r','d',' ','T','i','m','e','\0'},
163 {'A','r','a','b','i','a','n',' ','S','t','a','n','d','a','r','d',' ','T','i','m','e','\0'},
166 {'C','a','u','c','a','s','u','s',' ','S','t','a','n','d','a','r','d',' ','T','i','m','e','\0'},
169 {'A','f','g','h','a','n','i','s','t','a','n',' ','S','t','a','n','d','a','r','d',' ','T','i','m','e','\0'},
172 {'E','k','a','t','e','r','i','n','b','u','r','g',' ','S','t','a','n','d','a','r','d',' ','T','i','m','e','\0'},
175 {'W','e','s','t',' ','A','s','i','a',' ','S','t','a','n','d','a','r','d',' ','T','i','m','e','\0'},
178 {'I','n','d','i','a',' ','S','t','a','n','d','a','r','d',' ','T','i','m','e','\0'},
181 {'N','e','p','a','l',' ','S','t','a','n','d','a','r','d',' ','T','i','m','e','\0'},
184 {'N','.',' ','C','e','n','t','r','a','l',' ','A','s','i','a',' ','S','t','a','n','d','a','r','d',' ','T','i','m','e','\0'},
187 {'C','e','n','t','r','a','l',' ','A','s','i','a',' ','S','t','a','n','d','a','r','d',' ','T','i','m','e','\0'},
190 {'S','r','i',' ','L','a','n','k','a',' ','S','t','a','n','d','a','r','d',' ','T','i','m','e','\0'},
193 {'M','y','a','n','m','a','r',' ','S','t','a','n','d','a','r','d',' ','T','i','m','e','\0'},
196 {'S','E',' ','A','s','i','a',' ','S','t','a','n','d','a','r','d',' ','T','i','m','e','\0'},
199 {'N','o','r','t','h',' ','A','s','i','a',' ','S','t','a','n','d','a','r','d',' ','T','i','m','e','\0'},
202 {'C','h','i','n','a',' ','S','t','a','n','d','a','r','d',' ','T','i','m','e','\0'},
205 {'N','o','r','t','h',' ','A','s','i','a',' ','E','a','s','t',' ','S','t','a','n','d','a','r','d',' ','T','i','m','e','\0'},
208 {'M','a','l','a','y',' ','P','e','n','i','n','s','u','l','a',' ','S','t','a','n','d','a','r','d',' ','T','i','m','e','\0'},
211 {'W','.',' ','A','u','s','t','r','a','l','i','a',' ','S','t','a','n','d','a','r','d',' ','T','i','m','e','\0'},
214 {'T','o','k','y','o',' ','S','t','a','n','d','a','r','d',' ','T','i','m','e','\0'},
217 {'K','o','r','e','a',' ','S','t','a','n','d','a','r','d',' ','T','i','m','e','\0'},
220 {'Y','a','k','u','t','s','k',' ','S','t','a','n','d','a','r','d',' ','T','i','m','e','\0'},
223 {'C','e','n','.',' ','A','u','s','t','r','a','l','i','a',' ','S','t','a','n','d','a','r','d',' ','T','i','m','e','\0'},
226 {'E','.',' ','A','u','s','t','r','a','l','i','a',' ','S','t','a','n','d','a','r','d',' ','T','i','m','e','\0'},
229 {'W','e','s','t',' ','P','a','c','i','f','i','c',' ','S','t','a','n','d','a','r','d',' ','T','i','m','e','\0'},
232 {'V','l','a','d','i','v','o','s','t','o','k',' ','S','t','a','n','d','a','r','d',' ','T','i','m','e','\0'},
235 {'C','e','n','t','r','a','l',' ','P','a','c','i','f','i','c',' ','S','t','a','n','d','a','r','d',' ','T','i','m','e','\0'},
238 {'N','e','w',' ','Z','e','a','l','a','n','d',' ','S','t','a','n','d','a','r','d',' ','T','i','m','e','\0'},
241 {'F','i','j','i',' ','S','t','a','n','d','a','r','d',' ','T','i','m','e','\0'},
244 {'T','o','n','g','a',' ','S','t','a','n','d','a','r','d',' ','T','i','m','e','\0'},
248 /* TIME_GetTZAsStr: helper function that returns the given timezone as a string.
249 This could be done with a hash table instead of merely iterating through
250 a table, however with the small amount of entries (60 or so) I didn't think
252 static const WCHAR
* TIME_GetTZAsStr (time_t utc
, int bias
, int dst
)
255 struct tm
*ptm
= localtime(&utc
);
258 if (!strftime (psTZName
, 7, "%Z", ptm
))
261 for (i
=0; i
<(sizeof(TZ_INFO
) / sizeof(struct tagTZ_INFO
)); i
++)
263 if ( strcmp(TZ_INFO
[i
].psTZFromUnix
, psTZName
) == 0 &&
264 TZ_INFO
[i
].bias
== bias
&&
265 TZ_INFO
[i
].dst
== dst
267 return TZ_INFO
[i
].psTZWindows
;
274 /* TIME_GetBias: helper function calculates delta local time from UTC */
275 static int TIME_GetBias( time_t utc
, int *pdaylight
)
277 struct tm
*ptm
= localtime(&utc
);
278 *pdaylight
= ptm
->tm_isdst
; /* daylight for local timezone */
280 ptm
->tm_isdst
= *pdaylight
; /* use local daylight, not that of Greenwich */
281 return (int)(utc
-mktime(ptm
));
285 /***********************************************************************
286 * SetLocalTime (KERNEL32.@)
288 * Sets the local time using current time zone and daylight
293 * True if the time was set, false if the time was invalid or the
294 * necessary permissions were not held.
296 BOOL WINAPI
SetLocalTime(
297 const SYSTEMTIME
*systime
) /* [in] The desired local time. */
302 time_t oldsec
=time(NULL
);
305 /* get the number of seconds */
306 t
.tm_sec
= systime
->wSecond
;
307 t
.tm_min
= systime
->wMinute
;
308 t
.tm_hour
= systime
->wHour
;
309 t
.tm_mday
= systime
->wDay
;
310 t
.tm_mon
= systime
->wMonth
- 1;
311 t
.tm_year
= systime
->wYear
- 1900;
315 /* set the new time */
317 tv
.tv_usec
= systime
->wMilliseconds
* 1000;
319 /* error and sanity check*/
320 if( sec
== (time_t)-1 || abs((int)(sec
-oldsec
)) > SETTIME_MAX_ADJUST
){
322 SetLastError(ERROR_INVALID_PARAMETER
);
324 #ifdef HAVE_SETTIMEOFDAY
325 err
=settimeofday(&tv
, NULL
); /* 0 is OK, -1 is error */
328 SetLastError(ERROR_PRIVILEGE_NOT_HELD
);
331 SetLastError(ERROR_CALL_NOT_IMPLEMENTED
);
334 ERR("Cannot set time to %d/%d/%d %d:%d:%d Time adjustment %ld %s\n",
335 systime
->wYear
, systime
->wMonth
, systime
->wDay
, systime
->wHour
,
336 systime
->wMinute
, systime
->wSecond
,
337 sec
-oldsec
, err
== -1 ? "No Permission" :
338 sec
==(time_t)-1 ? "" : "is too large." );
343 /***********************************************************************
344 * GetSystemTimeAdjustment (KERNEL32.@)
346 * Indicates the period between clock interrupt and the amount the clock
347 * is adjusted each interrupt so as to keep it insync with an external source.
351 * Always returns true.
355 * Only the special case of disabled time adjustments is supported.
357 BOOL WINAPI
GetSystemTimeAdjustment(
358 PDWORD lpTimeAdjustment
, /* [out] The clock adjustment per interupt in 100's of nanoseconds. */
359 PDWORD lpTimeIncrement
, /* [out] The time between clock interupts in 100's of nanoseconds. */
360 PBOOL lpTimeAdjustmentDisabled
) /* [out] The clock synchonisation has been disabled. */
362 *lpTimeAdjustment
= 0;
363 *lpTimeIncrement
= 0;
364 *lpTimeAdjustmentDisabled
= TRUE
;
369 /***********************************************************************
370 * SetSystemTime (KERNEL32.@)
372 * Sets the system time (utc).
376 * True if the time was set, false if the time was invalid or the
377 * necessary permissions were not held.
379 BOOL WINAPI
SetSystemTime(
380 const SYSTEMTIME
*systime
) /* [in] The desired system time. */
389 /* call gettimeofday to get the current timezone */
390 gettimeofday(&tv
, &tz
);
392 /* get delta local time from utc */
393 bias
=TIME_GetBias(oldsec
,&dst
);
395 /* get the number of seconds */
396 t
.tm_sec
= systime
->wSecond
;
397 t
.tm_min
= systime
->wMinute
;
398 t
.tm_hour
= systime
->wHour
;
399 t
.tm_mday
= systime
->wDay
;
400 t
.tm_mon
= systime
->wMonth
- 1;
401 t
.tm_year
= systime
->wYear
- 1900;
404 /* correct for timezone and daylight */
407 /* set the new time */
409 tv
.tv_usec
= systime
->wMilliseconds
* 1000;
411 /* error and sanity check*/
412 if( sec
== (time_t)-1 || abs((int)(sec
-oldsec
)) > SETTIME_MAX_ADJUST
){
414 SetLastError(ERROR_INVALID_PARAMETER
);
416 #ifdef HAVE_SETTIMEOFDAY
417 err
=settimeofday(&tv
, NULL
); /* 0 is OK, -1 is error */
420 SetLastError(ERROR_PRIVILEGE_NOT_HELD
);
423 SetLastError(ERROR_CALL_NOT_IMPLEMENTED
);
426 ERR("Cannot set time to %d/%d/%d %d:%d:%d Time adjustment %ld %s\n",
427 systime
->wYear
, systime
->wMonth
, systime
->wDay
, systime
->wHour
,
428 systime
->wMinute
, systime
->wSecond
,
429 sec
-oldsec
, err
== -1 ? "No Permission" :
430 sec
==(time_t)-1 ? "" : "is too large." );
435 /***********************************************************************
436 * GetTimeZoneInformation (KERNEL32.@)
438 * Fills in the a time zone information structure with values based on
439 * the current local time.
443 * The daylight savings time standard or TIME_ZONE_ID_INVALID if the call failed.
445 DWORD WINAPI
GetTimeZoneInformation(
446 LPTIME_ZONE_INFORMATION tzinfo
) /* [out] The time zone structure to be filled in. */
453 memset(tzinfo
, 0, sizeof(TIME_ZONE_INFORMATION
));
456 bias
=TIME_GetBias(gmt
,&daylight
);
458 tzinfo
->Bias
= -bias
/ 60;
459 tzinfo
->StandardBias
= 0;
460 tzinfo
->DaylightBias
= -60;
461 psTZ
= TIME_GetTZAsStr (gmt
, (-bias
/60), daylight
);
462 if (psTZ
) strcpyW( tzinfo
->StandardName
, psTZ
);
463 return TIME_ZONE_ID_STANDARD
;
467 /***********************************************************************
468 * SetTimeZoneInformation (KERNEL32.@)
470 * Set the local time zone with values based on the time zone structure.
474 * True on successful setting of the time zone.
478 * Use the obsolete unix timezone structure and tz_dsttime member.
480 BOOL WINAPI
SetTimeZoneInformation(
481 const LPTIME_ZONE_INFORMATION tzinfo
) /* [in] The new time zone. */
485 tz
.tz_minuteswest
= tzinfo
->Bias
;
487 tz
.tz_dsttime
= DST_NONE
;
491 return !settimeofday(NULL
, &tz
);
495 /***********************************************************************
496 * SystemTimeToTzSpecificLocalTime (KERNEL32.@)
498 * Converts the system time (utc) to the local time in the specified time zone.
502 * Returns true when the local time was calculated.
506 * Does not handle daylight savings time adjustments correctly.
508 BOOL WINAPI
SystemTimeToTzSpecificLocalTime(
509 LPTIME_ZONE_INFORMATION lpTimeZoneInformation
, /* [in] The desired time zone. */
510 LPSYSTEMTIME lpUniversalTime
, /* [in] The utc time to base local time on. */
511 LPSYSTEMTIME lpLocalTime
) /* [out] The local time in the time zone. */
514 SetLastError(ERROR_CALL_NOT_IMPLEMENTED
);
519 /***********************************************************************
520 * GetSystemTimeAsFileTime (KERNEL32.@)
522 * Fills in a file time structure with the current time in UTC format.
524 VOID WINAPI
GetSystemTimeAsFileTime(
525 LPFILETIME time
) /* [out] The file time struct to be filled with the system time. */
527 NtQuerySystemTime( (LARGE_INTEGER
*)time
);
531 /*********************************************************************
532 * TIME_ClockTimeToFileTime (olorin@fandra.org, 20-Sep-1998)
534 * Used by GetProcessTimes to convert clock_t into FILETIME.
536 * Differences to UnixTimeToFileTime:
537 * 1) Divided by CLK_TCK
538 * 2) Time is relative. There is no 'starting date', so there is
539 * no need in offset correction, like in UnixTimeToFileTime
541 static void TIME_ClockTimeToFileTime(clock_t unix_time
, LPFILETIME filetime
)
543 ULONGLONG secs
= RtlEnlargedUnsignedMultiply( unix_time
, 10000000 );
544 secs
= RtlExtendedLargeIntegerDivide( secs
, CLK_TCK
, NULL
);
545 filetime
->dwLowDateTime
= (DWORD
)secs
;
546 filetime
->dwHighDateTime
= (DWORD
)(secs
>> 32);
549 /*********************************************************************
550 * GetProcessTimes (KERNEL32.@)
552 * Returns the user and kernel execution times of a process,
553 * along with the creation and exit times if known.
556 * Would be nice to subtract the cpu time, used by Wine at startup.
557 * Also, there is a need to separate times used by different applications.
561 * Always returns true.
565 * lpCreationTime, lpExitTime are NOT INITIALIZED.
567 BOOL WINAPI
GetProcessTimes(
568 HANDLE hprocess
, /* [in] The process to be queried (obtained from PROCESS_QUERY_INFORMATION). */
569 LPFILETIME lpCreationTime
, /* [out] The creation time of the process. */
570 LPFILETIME lpExitTime
, /* [out] The exit time of the process if exited. */
571 LPFILETIME lpKernelTime
, /* [out] The time spent in kernal routines in 100's of nanoseconds. */
572 LPFILETIME lpUserTime
) /* [out] The time spent in user routines in 100's of nanoseconds. */
577 TIME_ClockTimeToFileTime(tms
.tms_utime
,lpUserTime
);
578 TIME_ClockTimeToFileTime(tms
.tms_stime
,lpKernelTime
);
582 /*********************************************************************
583 * GetCalendarInfoA (KERNEL32.@)
586 int WINAPI
GetCalendarInfoA(LCID Locale
, CALID Calendar
, CALTYPE CalType
,
587 LPSTR lpCalData
, int cchData
, LPDWORD lpValue
)
590 LPWSTR lpCalDataW
= NULL
;
592 FIXME("(%08lx,%08lx,%08lx,%p,%d,%p): quarter-stub\n",
593 Locale
, Calendar
, CalType
, lpCalData
, cchData
, lpValue
);
594 /* FIXME: Should verify if Locale is allowable in ANSI, as per MSDN */
597 if(!(lpCalDataW
= HeapAlloc(GetProcessHeap(), 0, cchData
*sizeof(WCHAR
)))) return 0;
599 ret
= GetCalendarInfoW(Locale
, Calendar
, CalType
, lpCalDataW
, cchData
, lpValue
);
600 if(ret
&& lpCalDataW
&& lpCalData
)
601 WideCharToMultiByte(CP_ACP
, 0, lpCalDataW
, cchData
, lpCalData
, cchData
, NULL
, NULL
);
603 HeapFree(GetProcessHeap(), 0, lpCalDataW
);
608 /*********************************************************************
609 * GetCalendarInfoW (KERNEL32.@)
612 int WINAPI
GetCalendarInfoW(LCID Locale
, CALID Calendar
, CALTYPE CalType
,
613 LPWSTR lpCalData
, int cchData
, LPDWORD lpValue
)
615 FIXME("(%08lx,%08lx,%08lx,%p,%d,%p): quarter-stub\n",
616 Locale
, Calendar
, CalType
, lpCalData
, cchData
, lpValue
);
618 if (CalType
& CAL_NOUSEROVERRIDE
)
619 FIXME("flag CAL_NOUSEROVERRIDE used, not fully implemented\n");
620 if (CalType
& CAL_USE_CP_ACP
)
621 FIXME("flag CAL_USE_CP_ACP used, not fully implemented\n");
623 if (CalType
& CAL_RETURN_NUMBER
) {
624 if (lpCalData
!= NULL
)
625 WARN("lpCalData not NULL (%p) when it should!\n", lpCalData
);
627 WARN("cchData not 0 (%d) when it should!\n", cchData
);
630 WARN("lpValue not NULL (%p) when it should!\n", lpValue
);
633 /* FIXME: No verification is made yet wrt Locale
634 * for the CALTYPES not requiring GetLocaleInfoA */
635 switch (CalType
& ~(CAL_NOUSEROVERRIDE
|CAL_RETURN_NUMBER
|CAL_USE_CP_ACP
)) {
636 case CAL_ICALINTVALUE
:
637 FIXME("Unimplemented caltype %ld\n", CalType
& 0xffff);
640 FIXME("Unimplemented caltype %ld\n", CalType
& 0xffff);
642 case CAL_IYEAROFFSETRANGE
:
643 FIXME("Unimplemented caltype %ld\n", CalType
& 0xffff);
646 FIXME("Unimplemented caltype %ld\n", CalType
& 0xffff);
649 return GetLocaleInfoW(Locale
, LOCALE_SSHORTDATE
, lpCalData
, cchData
);
651 return GetLocaleInfoW(Locale
, LOCALE_SLONGDATE
, lpCalData
, cchData
);
653 return GetLocaleInfoW(Locale
, LOCALE_SDAYNAME1
, lpCalData
, cchData
);
655 return GetLocaleInfoW(Locale
, LOCALE_SDAYNAME2
, lpCalData
, cchData
);
657 return GetLocaleInfoW(Locale
, LOCALE_SDAYNAME3
, lpCalData
, cchData
);
659 return GetLocaleInfoW(Locale
, LOCALE_SDAYNAME4
, lpCalData
, cchData
);
661 return GetLocaleInfoW(Locale
, LOCALE_SDAYNAME5
, lpCalData
, cchData
);
663 return GetLocaleInfoW(Locale
, LOCALE_SDAYNAME6
, lpCalData
, cchData
);
665 return GetLocaleInfoW(Locale
, LOCALE_SDAYNAME7
, lpCalData
, cchData
);
666 case CAL_SABBREVDAYNAME1
:
667 return GetLocaleInfoW(Locale
, LOCALE_SABBREVDAYNAME1
, lpCalData
, cchData
);
668 case CAL_SABBREVDAYNAME2
:
669 return GetLocaleInfoW(Locale
, LOCALE_SABBREVDAYNAME2
, lpCalData
, cchData
);
670 case CAL_SABBREVDAYNAME3
:
671 return GetLocaleInfoW(Locale
, LOCALE_SABBREVDAYNAME3
, lpCalData
, cchData
);
672 case CAL_SABBREVDAYNAME4
:
673 return GetLocaleInfoW(Locale
, LOCALE_SABBREVDAYNAME4
, lpCalData
, cchData
);
674 case CAL_SABBREVDAYNAME5
:
675 return GetLocaleInfoW(Locale
, LOCALE_SABBREVDAYNAME5
, lpCalData
, cchData
);
676 case CAL_SABBREVDAYNAME6
:
677 return GetLocaleInfoW(Locale
, LOCALE_SABBREVDAYNAME6
, lpCalData
, cchData
);
678 case CAL_SABBREVDAYNAME7
:
679 return GetLocaleInfoW(Locale
, LOCALE_SABBREVDAYNAME7
, lpCalData
, cchData
);
680 case CAL_SMONTHNAME1
:
681 return GetLocaleInfoW(Locale
, LOCALE_SMONTHNAME1
, lpCalData
, cchData
);
682 case CAL_SMONTHNAME2
:
683 return GetLocaleInfoW(Locale
, LOCALE_SMONTHNAME2
, lpCalData
, cchData
);
684 case CAL_SMONTHNAME3
:
685 return GetLocaleInfoW(Locale
, LOCALE_SMONTHNAME3
, lpCalData
, cchData
);
686 case CAL_SMONTHNAME4
:
687 return GetLocaleInfoW(Locale
, LOCALE_SMONTHNAME4
, lpCalData
, cchData
);
688 case CAL_SMONTHNAME5
:
689 return GetLocaleInfoW(Locale
, LOCALE_SMONTHNAME5
, lpCalData
, cchData
);
690 case CAL_SMONTHNAME6
:
691 return GetLocaleInfoW(Locale
, LOCALE_SMONTHNAME6
, lpCalData
, cchData
);
692 case CAL_SMONTHNAME7
:
693 return GetLocaleInfoW(Locale
, LOCALE_SMONTHNAME7
, lpCalData
, cchData
);
694 case CAL_SMONTHNAME8
:
695 return GetLocaleInfoW(Locale
, LOCALE_SMONTHNAME8
, lpCalData
, cchData
);
696 case CAL_SMONTHNAME9
:
697 return GetLocaleInfoW(Locale
, LOCALE_SMONTHNAME9
, lpCalData
, cchData
);
698 case CAL_SMONTHNAME10
:
699 return GetLocaleInfoW(Locale
, LOCALE_SMONTHNAME10
, lpCalData
, cchData
);
700 case CAL_SMONTHNAME11
:
701 return GetLocaleInfoW(Locale
, LOCALE_SMONTHNAME11
, lpCalData
, cchData
);
702 case CAL_SMONTHNAME12
:
703 return GetLocaleInfoW(Locale
, LOCALE_SMONTHNAME12
, lpCalData
, cchData
);
704 case CAL_SMONTHNAME13
:
705 return GetLocaleInfoW(Locale
, LOCALE_SMONTHNAME13
, lpCalData
, cchData
);
706 case CAL_SABBREVMONTHNAME1
:
707 return GetLocaleInfoW(Locale
, LOCALE_SABBREVMONTHNAME1
, lpCalData
, cchData
);
708 case CAL_SABBREVMONTHNAME2
:
709 return GetLocaleInfoW(Locale
, LOCALE_SABBREVMONTHNAME2
, lpCalData
, cchData
);
710 case CAL_SABBREVMONTHNAME3
:
711 return GetLocaleInfoW(Locale
, LOCALE_SABBREVMONTHNAME3
, lpCalData
, cchData
);
712 case CAL_SABBREVMONTHNAME4
:
713 return GetLocaleInfoW(Locale
, LOCALE_SABBREVMONTHNAME4
, lpCalData
, cchData
);
714 case CAL_SABBREVMONTHNAME5
:
715 return GetLocaleInfoW(Locale
, LOCALE_SABBREVMONTHNAME5
, lpCalData
, cchData
);
716 case CAL_SABBREVMONTHNAME6
:
717 return GetLocaleInfoW(Locale
, LOCALE_SABBREVMONTHNAME6
, lpCalData
, cchData
);
718 case CAL_SABBREVMONTHNAME7
:
719 return GetLocaleInfoW(Locale
, LOCALE_SABBREVMONTHNAME7
, lpCalData
, cchData
);
720 case CAL_SABBREVMONTHNAME8
:
721 return GetLocaleInfoW(Locale
, LOCALE_SABBREVMONTHNAME8
, lpCalData
, cchData
);
722 case CAL_SABBREVMONTHNAME9
:
723 return GetLocaleInfoW(Locale
, LOCALE_SABBREVMONTHNAME9
, lpCalData
, cchData
);
724 case CAL_SABBREVMONTHNAME10
:
725 return GetLocaleInfoW(Locale
, LOCALE_SABBREVMONTHNAME10
, lpCalData
, cchData
);
726 case CAL_SABBREVMONTHNAME11
:
727 return GetLocaleInfoW(Locale
, LOCALE_SABBREVMONTHNAME11
, lpCalData
, cchData
);
728 case CAL_SABBREVMONTHNAME12
:
729 return GetLocaleInfoW(Locale
, LOCALE_SABBREVMONTHNAME12
, lpCalData
, cchData
);
730 case CAL_SABBREVMONTHNAME13
:
731 return GetLocaleInfoW(Locale
, LOCALE_SABBREVMONTHNAME13
, lpCalData
, cchData
);
733 return GetLocaleInfoW(Locale
, LOCALE_SYEARMONTH
, lpCalData
, cchData
);
734 case CAL_ITWODIGITYEARMAX
:
735 FIXME("Unimplemented caltype %ld\n", CalType
& 0xffff);
737 default: MESSAGE("Unknown caltype %ld\n",CalType
& 0xffff);
743 /*********************************************************************
744 * SetCalendarInfoA (KERNEL32.@)
747 int WINAPI
SetCalendarInfoA(LCID Locale
, CALID Calendar
, CALTYPE CalType
, LPCSTR lpCalData
)
749 FIXME("(%08lx,%08lx,%08lx,%s): stub\n",
750 Locale
, Calendar
, CalType
, debugstr_a(lpCalData
));
754 /*********************************************************************
755 * SetCalendarInfoW (KERNEL32.@)
758 int WINAPI
SetCalendarInfoW(LCID Locale
, CALID Calendar
, CALTYPE CalType
, LPCWSTR lpCalData
)
760 FIXME("(%08lx,%08lx,%08lx,%s): stub\n",
761 Locale
, Calendar
, CalType
, debugstr_w(lpCalData
));