From 73a6b2fc3172d2dc9364eb60e9ba44d84c7b8796 Mon Sep 17 00:00:00 2001 From: Huw D M Davies Date: Mon, 14 Dec 1998 12:50:03 +0000 Subject: [PATCH] Hack OLE_GetFormat* to return something if datelen = 0. Remove unnecessary WINAPI's. --- ole/ole2nls.c | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/ole/ole2nls.c b/ole/ole2nls.c index afe1dcd07ba..73336d858fb 100644 --- a/ole/ole2nls.c +++ b/ole/ole2nls.c @@ -2362,7 +2362,7 @@ UINT32 WINAPI CompareString32W(DWORD lcid, DWORD fdwStyle, * OLE_GetFormatA [Internal] * * FIXME - * Why is it WINAPI if internal? + * If datelen == 0, it should return the reguired string length. * This function implements stuff for GetDateFormat() and GetTimeFormat(). @@ -2394,7 +2394,7 @@ UINT32 WINAPI CompareString32W(DWORD lcid, DWORD fdwStyle, These functions REQUIRE valid locale, date, and format. */ -INT32 WINAPI OLE_GetFormatA(LCID locale, +static INT32 OLE_GetFormatA(LCID locale, DWORD flags, DWORD tflags, LPSYSTEMTIME xtime, @@ -2418,6 +2418,11 @@ INT32 WINAPI OLE_GetFormatA(LCID locale, xtime->wDay, xtime->wHour, xtime->wMinute, xtime->wSecond, _format, _format, date, datelen); + if(datelen == 0) { + FIXME(ole, "datelen = 0, returning 255\n"); + return 255; + } + /* initalize state variables and output buffer */ inpos = outpos = 0; count = 0; inquote = 0; Overflow = 0; @@ -2601,7 +2606,7 @@ INT32 WINAPI OLE_GetFormatA(LCID locale, /****************************************************************************** * OLE_GetFormatW [INTERNAL] */ -INT32 WINAPI OLE_GetFormatW(LCID locale, DWORD flags, DWORD tflags, +static INT32 OLE_GetFormatW(LCID locale, DWORD flags, DWORD tflags, LPSYSTEMTIME xtime, LPCWSTR format, LPWSTR output, INT32 outlen) @@ -2623,6 +2628,10 @@ INT32 WINAPI OLE_GetFormatW(LCID locale, DWORD flags, DWORD tflags, xtime->wDay, xtime->wHour, xtime->wMinute, xtime->wSecond, debugstr_w(format), format, output, outlen); + if(outlen == 0) { + FIXME(ole, "outlen = 0, returning 255\n"); + return 255; + } /* initialize state variables */ inpos = outpos = 0;