Signed-off-by: Jactry Zeng jzeng@codeweavers.com --- dlls/comctl32/datetime.c | 17 +++++++++++++++++ dlls/comctl32/tests/datetime.c | 5 +++++ 2 files changed, 22 insertions(+)
diff --git a/dlls/comctl32/datetime.c b/dlls/comctl32/datetime.c index 7b7ac8a86a..ace00c7550 100644 --- a/dlls/comctl32/datetime.c +++ b/dlls/comctl32/datetime.c @@ -1565,6 +1565,20 @@ DATETIME_GetText (const DATETIME_INFO *infoPtr, INT count, LPWSTR dst) return lstrlenW(dst); }
+static int DATETIME_GetTextLength(const DATETIME_INFO *info) +{ + int i, length = 0; + WCHAR buffer[80]; + + TRACE("%p.\n", info); + + for (i = 0; i < info->nrFields; i++) + { + DATETIME_ReturnTxt(info, i, buffer, ARRAY_SIZE(buffer)); + length += lstrlenW(buffer); + } + return length; +}
static LRESULT WINAPI DATETIME_WindowProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) @@ -1681,6 +1695,9 @@ DATETIME_WindowProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) case WM_GETTEXT: return (LRESULT) DATETIME_GetText(infoPtr, wParam, (LPWSTR)lParam);
+ case WM_GETTEXTLENGTH: + return (LRESULT)DATETIME_GetTextLength(infoPtr); + case WM_SETTEXT: return CB_ERR;
diff --git a/dlls/comctl32/tests/datetime.c b/dlls/comctl32/tests/datetime.c index 88abce9ed6..111f0bee89 100644 --- a/dlls/comctl32/tests/datetime.c +++ b/dlls/comctl32/tests/datetime.c @@ -793,7 +793,12 @@ static void test_wm_set_get_text(void) if (ret == 0) skip("GetDateFormat failed, returned %ld, error %d\n", ret, GetLastError()); else + { ok(!strcmp(buff, time), "Expected %s, got %s\n", time, buff); + + ret = SendMessageA(hWnd, WM_GETTEXTLENGTH, 0, 0); + ok(ret == strlen(time), "Got wrong length: %ld, expected %d.\n", ret, strlen(time)); + } }
DestroyWindow(hWnd);
Hi,
While running your changed tests, I think I found new failures. Being a bot and all I'm not very good at pattern recognition, so I might be wrong, but could you please double-check?
Full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=78927
Your paranoid android.
=== w10pro64_ar (32 bit report) ===
comctl32: datetime.c:797: Test failed: Expected 18/09/2020, got 2020/09/18
=== w10pro64_ar (64 bit report) ===
comctl32: datetime.c:797: Test failed: Expected 18/09/2020, got 2020/09/18