Skip to content

Instantly share code, notes, and snippets.

@camillol
Created February 7, 2012 05:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save camillol/d1e90d483e3940b5cf3d to your computer and use it in GitHub Desktop.
Save camillol/d1e90d483e3940b5cf3d to your computer and use it in GitHub Desktop.
test
diff --git a/dlls/kernel32/time.c b/dlls/kernel32/time.c
index deb0c33..dea2856 100644
--- a/dlls/kernel32/time.c
+++ b/dlls/kernel32/time.c
@@ -652,12 +652,28 @@ int WINAPI GetCalendarInfoW(LCID Locale, CALID Calendar, CALTYPE CalType,
WARN("lpValue not NULL (%p) when it should!\n", lpValue);
}
+ static const WCHAR dummy[] = {'1',0};
/* FIXME: No verification is made yet wrt Locale
* for the CALTYPES not requiring GetLocaleInfoA */
switch (CalType & ~(CAL_NOUSEROVERRIDE|CAL_RETURN_NUMBER|CAL_USE_CP_ACP)) {
case CAL_ICALINTVALUE:
FIXME("Unimplemented caltype %d\n", CalType & 0xffff);
- return 0;
+ /* according to the bottom of http://msdn.microsoft.com/en-us/library/ms904721.aspx
+ we should be able to return "1" for Gregorian here and empty strings for
+ CAL_IYEAROFFSETRANGE and CAL_SERASTRING. */
+ if (CalType & CAL_RETURN_NUMBER) {
+ *lpValue = 1;
+ return sizeof(DWORD) / sizeof(WCHAR);
+ } else {
+ if (!lpCalData) return 1;
+ if (cchData >= 1){
+ strcpyW( lpCalData, dummy );
+ return 1;
+ }
+ SetLastError( ERROR_INSUFFICIENT_BUFFER );
+ return 0;
+ }
+ break;
case CAL_SCALNAME:
FIXME("Unimplemented caltype %d\n", CalType & 0xffff);
return 0;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment