Nikolay Sivov : comctl32/datetime: Block WM_SETTEXT message.
Alexandre Julliard
julliard at winehq.org
Fri Oct 9 09:24:11 CDT 2009
Module: wine
Branch: master
Commit: b398d4434d0fe9cf037ecd4c559fc42732a2b8b9
URL: http://source.winehq.org/git/wine.git/?a=commit;h=b398d4434d0fe9cf037ecd4c559fc42732a2b8b9
Author: Nikolay Sivov <bunglehead at gmail.com>
Date: Thu Oct 8 22:05:13 2009 +0400
comctl32/datetime: Block WM_SETTEXT message.
---
dlls/comctl32/datetime.c | 3 +++
dlls/comctl32/tests/datetime.c | 20 ++++++++++++++++++++
2 files changed, 23 insertions(+), 0 deletions(-)
diff --git a/dlls/comctl32/datetime.c b/dlls/comctl32/datetime.c
index 097e442..5cda4c0 100644
--- a/dlls/comctl32/datetime.c
+++ b/dlls/comctl32/datetime.c
@@ -1399,6 +1399,9 @@ DATETIME_WindowProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
case WM_GETFONT:
return (LRESULT) infoPtr->hFont;
+ case WM_SETTEXT:
+ return CB_ERR;
+
default:
if ((uMsg >= WM_USER) && (uMsg < WM_APP) && !COMCTL32_IsReflectedMessage(uMsg))
ERR("unknown msg %04x wp=%08lx lp=%08lx\n",
diff --git a/dlls/comctl32/tests/datetime.c b/dlls/comctl32/tests/datetime.c
index a0f12f0..7cd08a0 100644
--- a/dlls/comctl32/tests/datetime.c
+++ b/dlls/comctl32/tests/datetime.c
@@ -668,6 +668,25 @@ static void test_dtm_set_and_get_system_time(void)
DestroyWindow(hWnd);
}
+static void test_wm_set_get_text(void)
+{
+ static const CHAR a_str[] = "a";
+ char buff[10];
+ HWND hWnd;
+ LRESULT ret;
+
+ hWnd = create_datetime_control(0);
+
+ ret = SendMessage(hWnd, WM_SETTEXT, 0, (LPARAM)a_str);
+ expect(CB_ERR, ret);
+
+ buff[0] = 0;
+ ret = SendMessage(hWnd, WM_GETTEXT, sizeof(buff), (LPARAM)buff);
+ ok(strcmp(buff, a_str) != 0, "Expected text not to change, got %s\n", buff);
+
+ DestroyWindow(hWnd);
+}
+
START_TEST(datetime)
{
HMODULE hComctl32;
@@ -694,4 +713,5 @@ START_TEST(datetime)
test_dtm_set_and_get_range();
test_dtm_set_range_swap_min_max();
test_dtm_set_and_get_system_time();
+ test_wm_set_get_text();
}
More information about the wine-cvs
mailing list