ReactOS.org
Sign In
Sign Up
Sign In
Sign Up
Manage this list
×
Keyboard Shortcuts
Thread View
j
: Next unread message
k
: Previous unread message
j a
: Jump to all threads
j l
: Jump to MailingList overview
2024
December
November
October
September
August
July
June
May
April
March
February
January
2023
December
November
October
September
August
July
June
May
April
March
February
January
2022
December
November
October
September
August
July
June
May
April
March
February
January
2021
December
November
October
September
August
July
June
May
April
March
February
January
2020
December
November
October
September
August
July
June
May
April
March
February
January
2019
December
November
October
September
August
July
June
May
April
March
February
January
2018
December
November
October
September
August
July
June
May
April
March
February
January
2017
December
November
October
September
August
July
June
May
April
March
February
January
2016
December
November
October
September
August
July
June
May
April
March
February
January
2015
December
November
October
September
August
July
June
May
April
March
February
January
2014
December
November
October
September
August
July
June
May
April
March
February
January
2013
December
November
October
September
August
July
June
May
April
March
February
January
2012
December
November
October
September
August
July
June
May
April
March
February
January
2011
December
November
October
September
August
July
June
May
April
March
February
January
2010
December
November
October
September
August
July
June
May
April
March
February
January
2009
December
November
October
September
August
July
June
May
April
March
February
January
2008
December
November
October
September
August
July
June
May
April
March
February
January
2007
December
November
October
September
August
July
June
May
April
March
February
January
2006
December
November
October
September
August
July
June
May
April
March
February
January
2005
December
November
October
September
August
July
June
May
April
March
February
January
2004
December
November
October
September
August
July
June
May
April
March
February
List overview
Download
Ros-diffs
March 2023
----- 2024 -----
December 2024
November 2024
October 2024
September 2024
August 2024
July 2024
June 2024
May 2024
April 2024
March 2024
February 2024
January 2024
----- 2023 -----
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
----- 2022 -----
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
----- 2021 -----
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
----- 2020 -----
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
----- 2019 -----
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
----- 2018 -----
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
----- 2017 -----
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
----- 2016 -----
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
----- 2015 -----
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
----- 2014 -----
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
----- 2013 -----
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
----- 2012 -----
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
----- 2011 -----
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
----- 2010 -----
December 2010
November 2010
October 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
February 2010
January 2010
----- 2009 -----
December 2009
November 2009
October 2009
September 2009
August 2009
July 2009
June 2009
May 2009
April 2009
March 2009
February 2009
January 2009
----- 2008 -----
December 2008
November 2008
October 2008
September 2008
August 2008
July 2008
June 2008
May 2008
April 2008
March 2008
February 2008
January 2008
----- 2007 -----
December 2007
November 2007
October 2007
September 2007
August 2007
July 2007
June 2007
May 2007
April 2007
March 2007
February 2007
January 2007
----- 2006 -----
December 2006
November 2006
October 2006
September 2006
August 2006
July 2006
June 2006
May 2006
April 2006
March 2006
February 2006
January 2006
----- 2005 -----
December 2005
November 2005
October 2005
September 2005
August 2005
July 2005
June 2005
May 2005
April 2005
March 2005
February 2005
January 2005
----- 2004 -----
December 2004
November 2004
October 2004
September 2004
August 2004
July 2004
June 2004
May 2004
April 2004
March 2004
February 2004
ros-diffs@reactos.org
18 participants
139 discussions
Start a n
N
ew thread
[reactos] 01/01: [NOTEPAD] Move '#include <crtdbg.h>' and add _CRTDBG_MAP_ALLOC (#5176)
by Katayama Hirofumi MZ
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=cc4480ffeacc1668c01b4…
commit cc4480ffeacc1668c01b4c57c96e787992933bb5 Author: Katayama Hirofumi MZ <katayama.hirofumi.mz(a)gmail.com> AuthorDate: Mon Mar 20 22:55:12 2023 +0900 Commit: GitHub <noreply(a)github.com> CommitDate: Mon Mar 20 22:55:12 2023 +0900 [NOTEPAD] Move '#include <crtdbg.h>' and add _CRTDBG_MAP_ALLOC (#5176) CORE-18837 --- base/applications/notepad/main.c | 4 ---- base/applications/notepad/notepad.h | 5 +++++ 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/base/applications/notepad/main.c b/base/applications/notepad/main.c index 3f30dd2a3fd..baea8b40ada 100644 --- a/base/applications/notepad/main.c +++ b/base/applications/notepad/main.c @@ -14,10 +14,6 @@ #include <shlobj.h> #include <strsafe.h> -#ifdef _DEBUG -#include <crtdbg.h> -#endif - NOTEPAD_GLOBALS Globals; static ATOM aFINDMSGSTRING; diff --git a/base/applications/notepad/notepad.h b/base/applications/notepad/notepad.h index af329f24dd6..2b9338a3b85 100644 --- a/base/applications/notepad/notepad.h +++ b/base/applications/notepad/notepad.h @@ -23,7 +23,12 @@ #include <shellapi.h> #include <commdlg.h> #include <tchar.h> +#include <stdlib.h> #include <malloc.h> +#ifdef _DEBUG + #define _CRTDBG_MAP_ALLOC + #include <crtdbg.h> +#endif #include "dialog.h" #include "notepad_res.h"
1 year, 9 months
1
0
0
0
[reactos] 01/01: [NTUSER] ime.c: Add ERR(...) to the exception handlers
by Katayama Hirofumi MZ
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=94f22bda27c01af482b46…
commit 94f22bda27c01af482b4614e1547292edc28e896 Author: Katayama Hirofumi MZ <katayama.hirofumi.mz(a)gmail.com> AuthorDate: Mon Mar 20 19:12:25 2023 +0900 Commit: Katayama Hirofumi MZ <katayama.hirofumi.mz(a)gmail.com> CommitDate: Mon Mar 20 19:12:25 2023 +0900 [NTUSER] ime.c: Add ERR(...) to the exception handlers CORE-11700 --- win32ss/user/ntuser/ime.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/win32ss/user/ntuser/ime.c b/win32ss/user/ntuser/ime.c index a86b86adcf5..d483fa2530a 100644 --- a/win32ss/user/ntuser/ime.c +++ b/win32ss/user/ntuser/ime.c @@ -78,6 +78,7 @@ UINT FASTCALL IntGetImeHotKeyLanguageScore(HKL hKL, LANGID HotKeyLangId) } _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER) { + ERR("!!!\n"); lcid = MAKELCID(LANGID_NEUTRAL, SORT_DEFAULT); } _SEH2_END; @@ -2019,7 +2020,7 @@ PWND FASTCALL co_IntCreateDefaultImeWindow(PWND pwndTarget, HINSTANCE hInst) } _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER) { - NOTHING; + ERR("!!!\n"); } _SEH2_END; } @@ -2050,7 +2051,7 @@ BOOL FASTCALL IntImeCanDestroyDefIMEforChild(PWND pImeWnd, PWND pwndTarget) } _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER) { - NOTHING; + ERR("!!!\n"); } _SEH2_END; @@ -2095,7 +2096,7 @@ BOOL FASTCALL IntImeCanDestroyDefIME(PWND pImeWnd, PWND pwndTarget) } _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER) { - NOTHING; + ERR("!!!\n"); } _SEH2_END; @@ -2204,6 +2205,7 @@ BOOL FASTCALL IntCheckImeShowStatus(PWND pwndIme, PTHREADINFO pti) } _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER) { + ERR("!!!\n"); pwndIMC = NULL; } _SEH2_END;
1 year, 9 months
1
0
0
0
[reactos] 01/01: [NTUSER] NtUserSetImeInfoEx: Use _SEH2_YIELD
by Katayama Hirofumi MZ
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=0694b559da00256fd4636…
commit 0694b559da00256fd46364646d6270a059a0e1b2 Author: Katayama Hirofumi MZ <katayama.hirofumi.mz(a)gmail.com> AuthorDate: Mon Mar 20 19:10:04 2023 +0900 Commit: Katayama Hirofumi MZ <katayama.hirofumi.mz(a)gmail.com> CommitDate: Mon Mar 20 19:10:04 2023 +0900 [NTUSER] NtUserSetImeInfoEx: Use _SEH2_YIELD CORE-11700 --- win32ss/user/ntuser/ime.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/win32ss/user/ntuser/ime.c b/win32ss/user/ntuser/ime.c index f4a367f30c9..a86b86adcf5 100644 --- a/win32ss/user/ntuser/ime.c +++ b/win32ss/user/ntuser/ime.c @@ -1157,7 +1157,8 @@ NtUserSetImeInfoEx(PIMEINFOEX pImeInfoEx) } _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER) { - goto Quit; + ERR("!!!\n"); + _SEH2_YIELD(goto Quit); } _SEH2_END;
1 year, 9 months
1
0
0
0
[reactos] 01/01: [NTUSER] NtUserGetImeInfoEx: Use _SEH2_YIELD
by Katayama Hirofumi MZ
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=ed5098b2c926fec9e7203…
commit ed5098b2c926fec9e7203f948124aa945a7aeee9 Author: Katayama Hirofumi MZ <katayama.hirofumi.mz(a)gmail.com> AuthorDate: Mon Mar 20 19:08:38 2023 +0900 Commit: Katayama Hirofumi MZ <katayama.hirofumi.mz(a)gmail.com> CommitDate: Mon Mar 20 19:08:38 2023 +0900 [NTUSER] NtUserGetImeInfoEx: Use _SEH2_YIELD CORE-11700 --- win32ss/user/ntuser/ime.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/win32ss/user/ntuser/ime.c b/win32ss/user/ntuser/ime.c index b5205452121..f4a367f30c9 100644 --- a/win32ss/user/ntuser/ime.c +++ b/win32ss/user/ntuser/ime.c @@ -1042,7 +1042,8 @@ NtUserGetImeInfoEx( } _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER) { - goto Quit; + ERR("!!!\n"); + _SEH2_YIELD(goto Quit); } _SEH2_END; @@ -1057,6 +1058,7 @@ NtUserGetImeInfoEx( } _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER) { + ERR("!!!\n"); ret = FALSE; } _SEH2_END;
1 year, 9 months
1
0
0
0
[reactos] 01/01: [NTUSER] NtUserBuildHimcList: Use _SEH2_YIELD
by Katayama Hirofumi MZ
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=ef20cc081fd777b436b63…
commit ef20cc081fd777b436b639fabe24bf1870c80eaf Author: Katayama Hirofumi MZ <katayama.hirofumi.mz(a)gmail.com> AuthorDate: Mon Mar 20 19:06:44 2023 +0900 Commit: Katayama Hirofumi MZ <katayama.hirofumi.mz(a)gmail.com> CommitDate: Mon Mar 20 19:06:44 2023 +0900 [NTUSER] NtUserBuildHimcList: Use _SEH2_YIELD CORE-11700 --- win32ss/user/ntuser/ime.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/win32ss/user/ntuser/ime.c b/win32ss/user/ntuser/ime.c index 81f1b3621d4..b5205452121 100644 --- a/win32ss/user/ntuser/ime.c +++ b/win32ss/user/ntuser/ime.c @@ -739,7 +739,8 @@ NtUserBuildHimcList(DWORD dwThreadId, DWORD dwCount, HIMC *phList, LPDWORD pdwCo } _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER) { - goto Quit; + ERR("!!!\n"); + _SEH2_YIELD(goto Quit); } _SEH2_END;
1 year, 9 months
1
0
0
0
[reactos] 01/01: [NTUSER] NtUserGetImeHotKey: Use _SEH2_YIELD
by Katayama Hirofumi MZ
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=b30133351738ce75bd3f3…
commit b30133351738ce75bd3f34f62a2b7958f2dc1cef Author: Katayama Hirofumi MZ <katayama.hirofumi.mz(a)gmail.com> AuthorDate: Mon Mar 20 19:04:18 2023 +0900 Commit: Katayama Hirofumi MZ <katayama.hirofumi.mz(a)gmail.com> CommitDate: Mon Mar 20 19:04:18 2023 +0900 [NTUSER] NtUserGetImeHotKey: Use _SEH2_YIELD CORE-11700 --- win32ss/user/ntuser/ime.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/win32ss/user/ntuser/ime.c b/win32ss/user/ntuser/ime.c index 81041dd1332..81f1b3621d4 100644 --- a/win32ss/user/ntuser/ime.c +++ b/win32ss/user/ntuser/ime.c @@ -432,7 +432,8 @@ NtUserGetImeHotKey(DWORD dwHotKeyId, LPUINT lpuModifiers, LPUINT lpuVirtualKey, } _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER) { - goto Quit; + ERR("!!!\n"); + _SEH2_YIELD(goto Quit); } _SEH2_END; @@ -449,6 +450,7 @@ NtUserGetImeHotKey(DWORD dwHotKeyId, LPUINT lpuModifiers, LPUINT lpuVirtualKey, } _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER) { + ERR("!!!\n"); pNode = NULL; } _SEH2_END;
1 year, 9 months
1
0
0
0
[reactos] 01/01: [NTUSER] IntSendMessageToUI: Use _SEH2_YIELD
by Katayama Hirofumi MZ
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=9751d03c3bbff042b9d36…
commit 9751d03c3bbff042b9d36d15e1ce87a1b2dff3c5 Author: Katayama Hirofumi MZ <katayama.hirofumi.mz(a)gmail.com> AuthorDate: Mon Mar 20 18:59:42 2023 +0900 Commit: Katayama Hirofumi MZ <katayama.hirofumi.mz(a)gmail.com> CommitDate: Mon Mar 20 18:59:42 2023 +0900 [NTUSER] IntSendMessageToUI: Use _SEH2_YIELD CORE-11700 --- win32ss/user/ntuser/ime.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/win32ss/user/ntuser/ime.c b/win32ss/user/ntuser/ime.c index 319405ebb06..81041dd1332 100644 --- a/win32ss/user/ntuser/ime.c +++ b/win32ss/user/ntuser/ime.c @@ -2227,7 +2227,6 @@ BOOL FASTCALL IntCheckImeShowStatus(PWND pwndIme, PTHREADINFO pti) } // Send a UI message. -// Win: xxxSendMessageToUI LRESULT FASTCALL IntSendMessageToUI(PTHREADINFO ptiIME, PIMEUI pimeui, UINT uMsg, WPARAM wParam, LPARAM lParam) { @@ -2253,6 +2252,7 @@ IntSendMessageToUI(PTHREADINFO ptiIME, PIMEUI pimeui, UINT uMsg, WPARAM wParam, } _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER) { + ERR("!!!\n"); pwndUI = NULL; } _SEH2_END; @@ -2269,7 +2269,8 @@ IntSendMessageToUI(PTHREADINFO ptiIME, PIMEUI pimeui, UINT uMsg, WPARAM wParam, } _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER) { - goto Quit; + ERR("!!!\n"); + _SEH2_YIELD(goto Quit); } _SEH2_END; @@ -2293,7 +2294,8 @@ IntSendMessageToUI(PTHREADINFO ptiIME, PIMEUI pimeui, UINT uMsg, WPARAM wParam, } _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER) { - goto Quit; + ERR("!!!\n"); + _SEH2_YIELD(goto Quit); } _SEH2_END;
1 year, 9 months
1
0
0
0
[reactos] 01/01: [NTUSER] IntNotifyImeShowStatus: Use _SEH2_YIELD
by Katayama Hirofumi MZ
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=4ab7c93b3511eda8761ce…
commit 4ab7c93b3511eda8761ce715e1db42ecdbfcc688 Author: Katayama Hirofumi MZ <katayama.hirofumi.mz(a)gmail.com> AuthorDate: Mon Mar 20 18:49:23 2023 +0900 Commit: Katayama Hirofumi MZ <katayama.hirofumi.mz(a)gmail.com> CommitDate: Mon Mar 20 18:49:23 2023 +0900 [NTUSER] IntNotifyImeShowStatus: Use _SEH2_YIELD CORE-11700 --- win32ss/user/ntuser/ime.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/win32ss/user/ntuser/ime.c b/win32ss/user/ntuser/ime.c index 97021f0daca..319405ebb06 100644 --- a/win32ss/user/ntuser/ime.c +++ b/win32ss/user/ntuser/ime.c @@ -2327,7 +2327,6 @@ IntSendOpenStatusNotify(PTHREADINFO ptiIME, PIMEUI pimeui, PWND pWnd, BOOL bOpen } // Update the IME status and send a notification. -// Win: xxxNotifyImeShowStatus VOID FASTCALL IntNotifyImeShowStatus(PWND pImeWnd) { PIMEUI pimeui; @@ -2367,9 +2366,12 @@ VOID FASTCALL IntNotifyImeShowStatus(PWND pImeWnd) } _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER) { + ERR("!!!\n"); + if (pti != ptiIME) KeDetachProcess(); - return; + + _SEH2_YIELD(return); } _SEH2_END;
1 year, 9 months
1
0
0
0
[reactos] 01/01: [USER32_APITEST] Follow-up of c39bf0d
by Katayama Hirofumi MZ
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=7c14c0ed7346c81311d81…
commit 7c14c0ed7346c81311d8179562d489439273dca1 Author: Katayama Hirofumi MZ <katayama.hirofumi.mz(a)gmail.com> AuthorDate: Mon Mar 20 16:33:11 2023 +0900 Commit: Katayama Hirofumi MZ <katayama.hirofumi.mz(a)gmail.com> CommitDate: Mon Mar 20 16:33:11 2023 +0900 [USER32_APITEST] Follow-up of c39bf0d Avoid buffer overflow. CORE-15289, CORE-11700 --- modules/rostests/apitests/user32/MessageStateAnalyzer.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/modules/rostests/apitests/user32/MessageStateAnalyzer.c b/modules/rostests/apitests/user32/MessageStateAnalyzer.c index 99041bb4ba1..0343ae8ced2 100644 --- a/modules/rostests/apitests/user32/MessageStateAnalyzer.c +++ b/modules/rostests/apitests/user32/MessageStateAnalyzer.c @@ -182,7 +182,8 @@ EditWindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) MD_msgdump(hwnd, uMsg, wParam, lParam); /* Add message */ - s_Msgs[s_cMsgs++] = msg; + if (s_cMsgs < MAX_MSGS) + s_Msgs[s_cMsgs++] = msg; /* Do inner task */ ret = CallWindowProc(s_fnOldEditWndProc, hwnd, uMsg, wParam, lParam); @@ -207,7 +208,8 @@ ImeWindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) MD_msgdump(hwnd, uMsg, wParam, lParam); /* Add message */ - s_Msgs[s_cMsgs++] = msg; + if (s_cMsgs < MAX_MSGS) + s_Msgs[s_cMsgs++] = msg; /* Do inner task */ ret = CallWindowProc(s_fnOldImeWndProc, hwnd, uMsg, wParam, lParam); @@ -287,7 +289,8 @@ WindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) MD_msgdump(hwnd, uMsg, wParam, lParam); /* Add message */ - s_Msgs[s_cMsgs++] = msg; + if (s_cMsgs < MAX_MSGS) + s_Msgs[s_cMsgs++] = msg; /* Do inner task */ ret = InnerWindowProc(hwnd, uMsg, wParam, lParam);
1 year, 9 months
1
0
0
0
[reactos] 01/01: [USER32_APITEST] Improve MessageStateAnalyzer testcase
by Katayama Hirofumi MZ
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=c39bf0d54bc3d468dd05f…
commit c39bf0d54bc3d468dd05fb18e43e8cf3af5ce2a8 Author: Katayama Hirofumi MZ <katayama.hirofumi.mz(a)gmail.com> AuthorDate: Mon Mar 20 16:17:50 2023 +0900 Commit: Katayama Hirofumi MZ <katayama.hirofumi.mz(a)gmail.com> CommitDate: Mon Mar 20 16:17:50 2023 +0900 [USER32_APITEST] Improve MessageStateAnalyzer testcase CORE-15289, CORE-11700 --- modules/rostests/apitests/user32/CMakeLists.txt | 2 +- .../apitests/user32/MessageStateAnalyzer.c | 696 +++++++-------------- 2 files changed, 233 insertions(+), 465 deletions(-) diff --git a/modules/rostests/apitests/user32/CMakeLists.txt b/modules/rostests/apitests/user32/CMakeLists.txt index 1eaf276a825..a9f4a4cb859 100644 --- a/modules/rostests/apitests/user32/CMakeLists.txt +++ b/modules/rostests/apitests/user32/CMakeLists.txt @@ -64,7 +64,7 @@ add_executable(user32_apitest target_link_libraries(user32_apitest wine ${PSEH_LIB}) set_module_type(user32_apitest win32cui) -add_importlibs(user32_apitest advapi32 gdi32 user32 msvcrt kernel32 ntdll) +add_importlibs(user32_apitest advapi32 imm32 gdi32 user32 msvcrt kernel32 ntdll) add_pch(user32_apitest precomp.h "${PCH_SKIP_SOURCE}") add_rostests_file(TARGET user32_apitest) diff --git a/modules/rostests/apitests/user32/MessageStateAnalyzer.c b/modules/rostests/apitests/user32/MessageStateAnalyzer.c index fd9f8461e3a..99041bb4ba1 100644 --- a/modules/rostests/apitests/user32/MessageStateAnalyzer.c +++ b/modules/rostests/apitests/user32/MessageStateAnalyzer.c @@ -2,14 +2,26 @@ * PROJECT: ReactOS API tests * LICENSE: LGPL-2.1+ (
https://spdx.org/licenses/LGPL-2.1+
) * PURPOSE: debugging and analysis of message states - * COPYRIGHT: Copyright 2019 Katayama Hirofumi MZ <katayama.hirofumi.mz(a)gmail.com> + * COPYRIGHT: Copyright 2019-2023 Katayama Hirofumi MZ <katayama.hirofumi.mz(a)gmail.com> */ #include "precomp.h" #include "undocuser.h" #include "winxx.h" +#include <imm.h> #include <strsafe.h> +#define MAX_MSGS 512 + +static MSG s_Msgs[MAX_MSGS]; +static UINT s_cMsgs = 0; +static CHAR s_prefix[16] = ""; +static HWND s_hMainWnd = NULL; +static HWND s_hwndEdit = NULL; +static HWND s_hImeWnd = NULL; +static WNDPROC s_fnOldEditWndProc = NULL; +static WNDPROC s_fnOldImeWndProc = NULL; + static void MsgDumpPrintf(LPCSTR fmt, ...) { static char s_szText[1024]; @@ -20,234 +32,191 @@ static void MsgDumpPrintf(LPCSTR fmt, ...) va_end(va); } #define MSGDUMP_TPRINTF MsgDumpPrintf -static char s_prefix[16] = ""; #define MSGDUMP_PREFIX s_prefix #include "msgdump.h" /* msgdump.h needs MSGDUMP_TPRINTF and MSGDUMP_PREFIX */ -typedef enum STAGE_TYPE +static void MD_build_prefix(void) { - STAGE_TYPE_SEQUENCE, - STAGE_TYPE_COUNTING -} STAGE_TYPE; + DWORD Flags = InSendMessageEx(NULL); + INT i = 0; -typedef struct STAGE -{ - INT nLine; - UINT uParentMsg; - INT nLevel; - STAGE_TYPE nType; - INT iFirstAction; - INT nCount; - UINT uMessages[10]; - INT iActions[10]; - INT nCounters[10]; -} STAGE; - -/* variables */ -static INT s_iStage; -static INT s_iStep; -static INT s_nLevel; -static BOOL s_bNextStage; -static INT s_nCounters[10]; -static UINT s_msgStack[32]; -static const STAGE *s_pStages; -static INT s_cStages; - -/* macros */ -#define TIMEOUT_TIMER 999 -#define TOTAL_TIMEOUT (5 * 1000) -#define WIDTH 300 -#define HEIGHT 200 -#define PARENT_MSG s_msgStack[s_nLevel - 1] - -static void DoInitialize(const STAGE *pStages, INT cStages) -{ - s_iStage = s_iStep = s_nLevel = 0; - s_bNextStage = FALSE; - ZeroMemory(s_nCounters, sizeof(s_nCounters)); - ZeroMemory(s_msgStack, sizeof(s_msgStack)); - s_pStages = pStages; - s_cStages = cStages; + if (Flags & ISMEX_CALLBACK) + s_prefix[i++] = 'C'; + if (Flags & ISMEX_NOTIFY) + s_prefix[i++] = 'N'; + if (Flags & ISMEX_REPLIED) + s_prefix[i++] = 'R'; + if (Flags & ISMEX_SEND) + s_prefix[i++] = 'S'; + if (i == 0) + s_prefix[i++] = 'P'; + + s_prefix[i++] = ':'; + s_prefix[i++] = ' '; + s_prefix[i] = 0; } -static void DoFinish(void) +#define STAGE_1 1 +#define STAGE_2 2 +#define STAGE_3 3 +#define STAGE_4 4 +#define STAGE_5 5 + +static INT findMessage(INT iMsg, HWND hwnd, UINT uMsg) { - ok_int(s_iStage, s_cStages); - if (s_iStage != s_cStages) + if (iMsg == -1) + iMsg = 0; + for (; iMsg < s_cMsgs; ++iMsg) { - skip("Some stage(s) skipped (Step: %d)\n", s_iStep); + if (s_Msgs[iMsg].message == uMsg && s_Msgs[iMsg].hwnd == hwnd) + return iMsg; } + return -1; } -typedef enum ACTION +typedef struct TEST_ENTRY { - ACTION_ZERO = 0, - ACTION_FIRSTMINMAX, - ACTION_NCCREATE, - ACTION_SHOW, - ACTION_IME_SETCONTEXT_OPEN, - ACTION_IME_NOTIFY_OPEN, - ACTION_DESTROY, - ACTION_IME_SETCONTEXT_CLOSE, - ACTION_IME_NOTIFY_CLOSE, - ACTION_HIDE, - ACTION_DEACTIVATE, - ACTION_ACTIVATE -} ACTION; - -static void DoAction(HWND hwnd, INT iAction, WPARAM wParam, LPARAM lParam) + INT line; + LPCSTR name; + UINT iFound; +} TEST_ENTRY, *PTEST_ENTRY; + +static VOID DoAnalyzeEntries(size_t nCount, PTEST_ENTRY pEntries) { - RECT rc; - switch (iAction) - { - case ACTION_ZERO: - /* does nothing */ - break; - case ACTION_FIRSTMINMAX: - GetWindowRect(hwnd, &rc); - ok_long(rc.right - rc.left, 0); - ok_long(rc.bottom - rc.top, 0); - ok_int(IsWindowVisible(hwnd), FALSE); - break; - case ACTION_NCCREATE: - GetWindowRect(hwnd, &rc); - ok_long(rc.right - rc.left, WIDTH); - ok_long(rc.bottom - rc.top, HEIGHT); - ok_int(IsWindowVisible(hwnd), FALSE); - break; - case ACTION_SHOW: - ShowWindow(hwnd, SW_SHOWNORMAL); - break; - case ACTION_IME_SETCONTEXT_OPEN: - ok(wParam == 1, "Step %d: wParam was %p\n", s_iStep, (void *)wParam); - ok(lParam == 0xC000000F, "Step %d: lParam was %p\n", s_iStep, (void *)lParam); - break; - case ACTION_IME_NOTIFY_OPEN: - ok(wParam == 2, "Step %d: wParam was %p\n", s_iStep, (void *)wParam); - ok(lParam == 0, "Step %d: lParam was %p\n", s_iStep, (void *)lParam); - break; - case ACTION_DESTROY: - DestroyWindow(hwnd); - break; - case ACTION_IME_SETCONTEXT_CLOSE: - ok(wParam == 0, "Step %d: wParam was %p\n", s_iStep, (void *)wParam); - ok(lParam == 0xC000000F, "Step %d: lParam was %p\n", s_iStep, (void *)lParam); - break; - case ACTION_IME_NOTIFY_CLOSE: - ok(wParam == 1, "Step %d: wParam was %p\n", s_iStep, (void *)wParam); - ok(lParam == 0, "Step %d: lParam was %p\n", s_iStep, (void *)lParam); - break; - case ACTION_HIDE: - ShowWindow(hwnd, SW_HIDE); - break; - case ACTION_DEACTIVATE: - SetForegroundWindow(GetDesktopWindow()); - break; - case ACTION_ACTIVATE: - SetForegroundWindow(hwnd); - break; + size_t i; + for (i = 0; i < nCount - 1; ++i) + { + PTEST_ENTRY entry1 = &pEntries[i]; + PTEST_ENTRY entry2 = &pEntries[i + 1]; + ok(entry1->iFound < entry2->iFound, + "Line %d: message wrong order (%d >= %d): %s vs %s\n", + entry1->line, entry1->iFound, entry2->iFound, + entry1->name, entry2->name); } } -static void NextStage(HWND hwnd) +static VOID DoAnalyzeAllMessages(VOID) { - INT i, iAction; - const STAGE *pStage = &s_pStages[s_iStage]; - - if (pStage->nType == STAGE_TYPE_COUNTING) - { - /* check counters */ - for (i = 0; i < pStage->nCount; ++i) - { - if (pStage->nCounters[i] > 0) - { - ok(pStage->nCounters[i] == s_nCounters[i], - "Line %d: s_nCounters[%d] expected %d but %d.\n", - pStage->nLine, i, pStage->nCounters[i], s_nCounters[i]); - } - } + size_t i; + TEST_ENTRY entries1[] = + { + { __LINE__, "WM_NCCREATE", findMessage(0, s_hMainWnd, WM_NCCREATE) }, + { __LINE__, "WM_NCCALCSIZE", findMessage(0, s_hMainWnd, WM_NCCALCSIZE) }, + { __LINE__, "WM_CREATE", findMessage(0, s_hMainWnd, WM_CREATE) }, + { __LINE__, "WM_PARENTNOTIFY", findMessage(0, s_hMainWnd, WM_PARENTNOTIFY) }, + { __LINE__, "WM_WINDOWPOSCHANGING", findMessage(0, s_hMainWnd, WM_WINDOWPOSCHANGING) }, + { __LINE__, "WM_ACTIVATEAPP", findMessage(0, s_hMainWnd, WM_ACTIVATEAPP) }, + { __LINE__, "WM_NCACTIVATE", findMessage(0, s_hMainWnd, WM_NCACTIVATE) }, + { __LINE__, "WM_ACTIVATE", findMessage(0, s_hMainWnd, WM_ACTIVATE) }, + { __LINE__, "WM_IME_SETCONTEXT", findMessage(0, s_hMainWnd, WM_IME_SETCONTEXT) }, + { __LINE__, "WM_IME_NOTIFY", findMessage(0, s_hMainWnd, WM_IME_NOTIFY) }, + { __LINE__, "WM_SETFOCUS", findMessage(0, s_hMainWnd, WM_SETFOCUS) }, + { __LINE__, "WM_KILLFOCUS", findMessage(0, s_hMainWnd, WM_KILLFOCUS) }, + }; + INT iFound1 = entries1[_countof(entries1) - 1].iFound; + TEST_ENTRY entries2[] = + { + { __LINE__, "WM_IME_SETCONTEXT", findMessage(iFound1, s_hMainWnd, WM_IME_SETCONTEXT) }, + { __LINE__, "WM_IME_SETCONTEXT", findMessage(iFound1, s_hwndEdit, WM_IME_SETCONTEXT) }, + { __LINE__, "WM_SETFOCUS", findMessage(iFound1, s_hwndEdit, WM_SETFOCUS) }, + { __LINE__, "WM_SHOWWINDOW", findMessage(iFound1, s_hMainWnd, WM_SHOWWINDOW) }, + { __LINE__, "WM_WINDOWPOSCHANGING", findMessage(iFound1, s_hMainWnd, WM_WINDOWPOSCHANGING) }, + { __LINE__, "WM_NCPAINT", findMessage(iFound1, s_hMainWnd, WM_NCPAINT) }, + { __LINE__, "WM_ERASEBKGND", findMessage(iFound1, s_hMainWnd, WM_ERASEBKGND) }, + { __LINE__, "WM_WINDOWPOSCHANGED", findMessage(iFound1, s_hMainWnd, WM_WINDOWPOSCHANGED) }, + { __LINE__, "WM_SIZE", findMessage(iFound1, s_hMainWnd, WM_SIZE) }, + { __LINE__, "WM_MOVE", findMessage(iFound1, s_hMainWnd, WM_MOVE) }, + }; + INT iFound2 = entries2[_countof(entries2) - 1].iFound; + TEST_ENTRY entries3[] = + { + { __LINE__, "WM_IME_KEYDOWN", findMessage(iFound2, s_hwndEdit, WM_IME_KEYDOWN) }, + { __LINE__, "WM_KEYDOWN", findMessage(iFound2, s_hwndEdit, WM_KEYDOWN) }, + { __LINE__, "WM_IME_KEYUP", findMessage(iFound2, s_hwndEdit, WM_IME_KEYUP) }, + { __LINE__, "WM_CHAR", findMessage(iFound2, s_hwndEdit, WM_CHAR) }, + { __LINE__, "WM_IME_CHAR", findMessage(iFound2, s_hwndEdit, WM_IME_CHAR) }, + }; + INT iFound3 = entries3[_countof(entries3) - 1].iFound; + TEST_ENTRY entries4[] = + { + { __LINE__, "WM_IME_NOTIFY", findMessage(iFound3, s_hwndEdit, WM_IME_NOTIFY) }, + { __LINE__, "WM_IME_NOTIFY", findMessage(iFound3, s_hImeWnd, WM_IME_NOTIFY) }, + { __LINE__, "WM_IME_SETCONTEXT", findMessage(iFound3, s_hwndEdit, WM_IME_SETCONTEXT) }, + { __LINE__, "WM_IME_SETCONTEXT", findMessage(iFound3, s_hImeWnd, WM_IME_SETCONTEXT) }, + }; + INT iFound4 = entries4[_countof(entries4) - 1].iFound; + TEST_ENTRY entries5[] = + { + { __LINE__, "WM_DESTROY", findMessage(iFound4, s_hMainWnd, WM_DESTROY) }, + { __LINE__, "WM_DESTROY", findMessage(iFound4, s_hwndEdit, WM_DESTROY) }, + { __LINE__, "WM_NCDESTROY", findMessage(iFound4, s_hwndEdit, WM_NCDESTROY) }, + { __LINE__, "WM_NCDESTROY", findMessage(iFound4, s_hMainWnd, WM_NCDESTROY) }, + }; + DoAnalyzeEntries(_countof(entries1), entries1); + DoAnalyzeEntries(_countof(entries2), entries2); + DoAnalyzeEntries(_countof(entries3), entries3); + //DoAnalyzeEntries(_countof(entries4), entries4); // No order + DoAnalyzeEntries(_countof(entries5), entries5); + + ok(iFound1 < entries2[0].iFound, "%d vs %d\n", iFound1, entries2[0].iFound); + ok(iFound2 < entries3[0].iFound, "%d vs %d\n", iFound2, entries3[0].iFound); + ok(iFound3 < entries4[0].iFound, "%d vs %d\n", iFound3, entries4[0].iFound); + ok(iFound4 < entries5[0].iFound, "%d vs %d\n", iFound4, entries5[0].iFound); + + for (i = 0; i < _countof(entries4); ++i) + { + ok(entries4[i].iFound != -1, "entries4[%d].iFound was -1\n", i); } +} - /* go to next stage */ - ++s_iStage; - if (s_iStage >= s_cStages) - { - DestroyWindow(hwnd); - return; - } - trace("Stage %d (Line %d)\n", s_iStage, s_pStages[s_iStage].nLine); +static LRESULT CALLBACK +EditWindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) +{ + LRESULT ret; + MSG msg = { hwnd, uMsg, wParam, lParam }; + + /* Build s_prefix */ + MD_build_prefix(); + + /* message dump */ + MD_msgdump(hwnd, uMsg, wParam, lParam); + + /* Add message */ + s_Msgs[s_cMsgs++] = msg; - s_iStep = 0; - ZeroMemory(s_nCounters, sizeof(s_nCounters)); + /* Do inner task */ + ret = CallWindowProc(s_fnOldEditWndProc, hwnd, uMsg, wParam, lParam); - iAction = s_pStages[s_iStage].iFirstAction; - if (iAction) - PostMessage(hwnd, WM_COMMAND, iAction, 0); + /* message return */ + StringCbCopyA(s_prefix, sizeof(s_prefix), "R: "); + MD_msgresult(hwnd, uMsg, wParam, lParam, ret); + + return ret; } -static void DoStage(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) +static LRESULT CALLBACK +ImeWindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) { - INT i, iAction; - const STAGE *pStage; - s_bNextStage = FALSE; + LRESULT ret; + MSG msg = { hwnd, uMsg, wParam, lParam }; - if (s_iStage >= s_cStages) - return; + /* Build s_prefix */ + MD_build_prefix(); - pStage = &s_pStages[s_iStage]; - switch (pStage->nType) - { - case STAGE_TYPE_SEQUENCE: - if (pStage->uMessages[s_iStep] == uMsg) - { - ok_int(1, 1); - ok(s_nLevel == pStage->nLevel, - "Line %d, Step %d: Level expected %d but %d.\n", - pStage->nLine, s_iStep, pStage->nLevel, s_nLevel); - ok(PARENT_MSG == pStage->uParentMsg, - "Line %d, Step %d: PARENT_MSG expected %u but %u.\n", - pStage->nLine, s_iStep, pStage->uParentMsg, PARENT_MSG); - - iAction = pStage->iActions[s_iStep]; - if (iAction) - DoAction(hwnd, iAction, wParam, lParam); - - ++s_iStep; - if (s_iStep >= pStage->nCount) - s_bNextStage = TRUE; - } - break; - case STAGE_TYPE_COUNTING: - for (i = 0; i < pStage->nCount; ++i) - { - if (pStage->uMessages[i] == uMsg) - { - ok_int(1, 1); - ok(s_nLevel == pStage->nLevel, - "Line %d: Level expected %d but %d.\n", - pStage->nLine, pStage->nLevel, s_nLevel); - ok(PARENT_MSG == pStage->uParentMsg, - "Line %d: PARENT_MSG expected %u but %u.\n", - pStage->nLine, pStage->uParentMsg, PARENT_MSG); - - iAction = pStage->iActions[i]; - if (iAction) - DoAction(hwnd, iAction, wParam, lParam); - - ++s_nCounters[i]; - - if (i == pStage->nCount - 1) - s_bNextStage = TRUE; - break; - } - } - break; - } + /* message dump */ + MD_msgdump(hwnd, uMsg, wParam, lParam); - if (s_bNextStage) - { - NextStage(hwnd); - } + /* Add message */ + s_Msgs[s_cMsgs++] = msg; + + /* Do inner task */ + ret = CallWindowProc(s_fnOldImeWndProc, hwnd, uMsg, wParam, lParam); + + /* message return */ + StringCbCopyA(s_prefix, sizeof(s_prefix), "R: "); + MD_msgresult(hwnd, uMsg, wParam, lParam, ret); + + return ret; } static LRESULT CALLBACK @@ -255,299 +224,106 @@ InnerWindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) { switch (uMsg) { - case WM_COMMAND: - DoAction(hwnd, LOWORD(wParam), 0, 0); + case WM_NCCREATE: + s_hMainWnd = hwnd; + trace("s_hMainWnd: %p\n", s_hMainWnd); break; - case WM_TIMER: - KillTimer(hwnd, (UINT)wParam); - if (wParam == TIMEOUT_TIMER) - DestroyWindow(hwnd); + case WM_CREATE: + s_hwndEdit = CreateWindowW(L"EDIT", NULL, WS_CHILD | WS_VISIBLE, + 0, 0, 100, 20, hwnd, NULL, GetModuleHandleW(NULL), NULL); + ok(s_hwndEdit != NULL, "s_hwndEdit was NULL\n"); + trace("s_hwndEdit: %p\n", s_hwndEdit); + s_fnOldEditWndProc = + (WNDPROC)SetWindowLongPtrW(s_hwndEdit, GWLP_WNDPROC, (LONG_PTR)EditWindowProc); + SetFocus(s_hwndEdit); + PostMessageW(hwnd, WM_COMMAND, STAGE_1, 0); + break; + case WM_COMMAND: + switch (LOWORD(wParam)) + { + case STAGE_1: + s_hImeWnd = ImmGetDefaultIMEWnd(hwnd); + ok(s_hImeWnd != NULL, "s_hImeWnd was NULL\n"); + trace("s_hImeWnd: %p\n", s_hImeWnd ); + s_fnOldImeWndProc = (WNDPROC)SetWindowLongPtrW(s_hImeWnd, GWLP_WNDPROC, + (LONG_PTR)ImeWindowProc); + PostMessageW(hwnd, WM_COMMAND, STAGE_2, 0); + break; + case STAGE_2: + PostMessageW(s_hwndEdit, WM_IME_KEYDOWN, 'A', 0); + PostMessageW(hwnd, WM_COMMAND, STAGE_3, 0); + break; + case STAGE_3: + PostMessageW(s_hwndEdit, WM_IME_KEYUP, 'A', 0); + PostMessageW(hwnd, WM_COMMAND, STAGE_4, 0); + break; + case STAGE_4: + PostMessageW(s_hwndEdit, WM_IME_CHAR, 'A', 0); + PostMessageW(hwnd, WM_COMMAND, STAGE_5, 0); + break; + case STAGE_5: + PostMessageW(hwnd, WM_CLOSE, 0, 0); + break; + } break; case WM_DESTROY: PostQuitMessage(0); break; - case WM_NCCREATE: - SetTimer(hwnd, TIMEOUT_TIMER, TOTAL_TIMEOUT, NULL); - /* FALL THROUGH */ - default: - return DefWindowProc(hwnd, uMsg, wParam, lParam); } - return 0; -} - -static void DoBuildPrefix(void) -{ - DWORD Flags = InSendMessageEx(NULL); - INT i = 0; - - if (Flags & ISMEX_CALLBACK) - s_prefix[i++] = 'C'; - if (Flags & ISMEX_NOTIFY) - s_prefix[i++] = 'N'; - if (Flags & ISMEX_REPLIED) - s_prefix[i++] = 'R'; - if (Flags & ISMEX_SEND) - s_prefix[i++] = 'S'; - if (i == 0) - s_prefix[i++] = 'P'; - s_prefix[i++] = ':'; - s_prefix[i++] = ' '; - s_prefix[i] = 0; + return DefWindowProcW(hwnd, uMsg, wParam, lParam); } -static const STAGE s_GeneralStages[] = -{ - /* Stage 0 */ - { - __LINE__, WM_NULL, 1, STAGE_TYPE_SEQUENCE, 0, - 4, - { WM_GETMINMAXINFO, WM_NCCREATE, WM_NCCALCSIZE, WM_CREATE }, - { ACTION_FIRSTMINMAX, ACTION_NCCREATE, 0, 0 }, - }, - /* Stage 1 */ - { - __LINE__, WM_COMMAND, 2, STAGE_TYPE_SEQUENCE, ACTION_SHOW, - 6, - { WM_SHOWWINDOW, WM_WINDOWPOSCHANGING, WM_WINDOWPOSCHANGING, - WM_ACTIVATEAPP, WM_NCACTIVATE, WM_ACTIVATE }, - }, - { - __LINE__, WM_COMMAND, 2, STAGE_TYPE_SEQUENCE, ACTION_DESTROY, - 6, - { WM_WINDOWPOSCHANGING, WM_WINDOWPOSCHANGED, WM_NCACTIVATE, - WM_ACTIVATE, WM_ACTIVATEAPP, WM_KILLFOCUS }, - }, - { - __LINE__, WM_COMMAND, 2, STAGE_TYPE_SEQUENCE, 0, - 2, - { WM_DESTROY, WM_NCDESTROY }, - }, -}; - static LRESULT CALLBACK WindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) { - LRESULT lResult; - - /* Skip asynchronous WM_TIMER messages */ - if (uMsg == WM_TIMER) return InnerWindowProc(hwnd, uMsg, wParam, lParam); + LRESULT ret; + MSG msg = { hwnd, uMsg, wParam, lParam }; - /* build s_prefix */ - DoBuildPrefix(); + /* Build s_prefix */ + MD_build_prefix(); /* message dump */ MD_msgdump(hwnd, uMsg, wParam, lParam); - ++s_nLevel; - s_msgStack[s_nLevel] = uMsg; - { - /* do inner task */ - DoStage(hwnd, uMsg, wParam, lParam); - lResult = InnerWindowProc(hwnd, uMsg, wParam, lParam); - } - --s_nLevel; + /* Add message */ + s_Msgs[s_cMsgs++] = msg; + + /* Do inner task */ + ret = InnerWindowProc(hwnd, uMsg, wParam, lParam); /* message return */ StringCbCopyA(s_prefix, sizeof(s_prefix), "R: "); - MD_msgresult(hwnd, uMsg, wParam, lParam, lResult); - return lResult; -} - -static void General_DoTest(void) -{ - WNDCLASSA wc; - HWND hwnd; - MSG msg; - static const char s_szName[] = "MessageStateAnalyzerGeneral"; - - trace("General_DoTest\n"); - DoInitialize(s_GeneralStages, ARRAYSIZE(s_GeneralStages)); + MD_msgresult(hwnd, uMsg, wParam, lParam, ret); - /* register window class */ - ZeroMemory(&wc, sizeof(wc)); - wc.style = CS_HREDRAW | CS_VREDRAW | CS_DBLCLKS; - wc.lpfnWndProc = WindowProc; - wc.hInstance = GetModuleHandleA(NULL); - wc.hIcon = LoadIcon(NULL, IDI_APPLICATION); - wc.hCursor = LoadCursor(NULL, IDC_ARROW); - wc.hbrBackground = (HBRUSH)(COLOR_3DFACE + 1); - wc.lpszClassName = s_szName; - if (!RegisterClassA(&wc)) - { - skip("RegisterClassW failed.\n"); - return; - } - - /* create a window */ - hwnd = CreateWindowA(s_szName, s_szName, WS_OVERLAPPEDWINDOW, - 0, 0, WIDTH, HEIGHT, NULL, NULL, - GetModuleHandleW(NULL), NULL); - if (!hwnd) - { - skip("CreateWindowW failed.\n"); - return; - } - - /* message loop */ - while (GetMessageA(&msg, NULL, 0, 0)) - { - TranslateMessage(&msg); - DispatchMessageA(&msg); - } - - ok_int(UnregisterClassA(s_szName, GetModuleHandleA(NULL)), TRUE); - - DoFinish(); + return ret; } -static const STAGE s_IMEStages[] = -{ - /* Stage 0 */ - { - __LINE__, WM_NULL, 1, STAGE_TYPE_SEQUENCE, 0, - 4, - { WM_GETMINMAXINFO, WM_NCCREATE, WM_NCCALCSIZE, WM_CREATE }, - { ACTION_FIRSTMINMAX, ACTION_NCCREATE, 0, 0 }, - }, - /* Stage 1 */ - // show - { - __LINE__, WM_COMMAND, 2, STAGE_TYPE_SEQUENCE, ACTION_SHOW, - 6, - { WM_SHOWWINDOW, WM_WINDOWPOSCHANGING, WM_WINDOWPOSCHANGING, - WM_ACTIVATEAPP, WM_NCACTIVATE, WM_ACTIVATE }, - }, - { - __LINE__, WM_ACTIVATE, 3, STAGE_TYPE_SEQUENCE, 0, - 1, - { WM_IME_SETCONTEXT }, - { ACTION_IME_SETCONTEXT_OPEN }, - }, - { - __LINE__, WM_IME_SETCONTEXT, 4, STAGE_TYPE_SEQUENCE, 0, - 1, - { WM_IME_NOTIFY }, - { ACTION_IME_NOTIFY_OPEN }, - }, - // hide - { - __LINE__, WM_COMMAND, 2, STAGE_TYPE_SEQUENCE, ACTION_HIDE, - 8, - { WM_SHOWWINDOW, WM_WINDOWPOSCHANGING, WM_WINDOWPOSCHANGED, - WM_NCACTIVATE, WM_ACTIVATE, WM_ACTIVATEAPP, WM_KILLFOCUS, - WM_IME_SETCONTEXT }, - { 0, 0, 0, 0, 0, 0, 0, ACTION_IME_SETCONTEXT_CLOSE } - }, - { - __LINE__, WM_IME_SETCONTEXT, 3, STAGE_TYPE_SEQUENCE, 0, - 1, - { WM_IME_NOTIFY }, - { ACTION_IME_NOTIFY_CLOSE } - }, - // show again - { - __LINE__, WM_COMMAND, 2, STAGE_TYPE_SEQUENCE, 3, - 6, - { WM_SHOWWINDOW, WM_WINDOWPOSCHANGING, WM_WINDOWPOSCHANGING, - WM_ACTIVATEAPP, WM_NCACTIVATE, WM_ACTIVATE }, - }, - { - __LINE__, WM_ACTIVATE, 3, STAGE_TYPE_SEQUENCE, 0, - 1, - { WM_IME_SETCONTEXT }, - { ACTION_IME_SETCONTEXT_OPEN }, - }, - { - __LINE__, WM_IME_SETCONTEXT, 4, STAGE_TYPE_SEQUENCE, 0, - 1, - { WM_IME_NOTIFY }, - { ACTION_IME_NOTIFY_OPEN }, - }, - // deactivate - { - __LINE__, WM_COMMAND, 2, STAGE_TYPE_SEQUENCE, ACTION_DEACTIVATE, - 4, - { WM_NCACTIVATE, WM_ACTIVATE, WM_ACTIVATEAPP, WM_KILLFOCUS }, - }, - { - __LINE__, WM_COMMAND, 2, STAGE_TYPE_SEQUENCE, 0, - 1, - { WM_IME_SETCONTEXT }, - { ACTION_IME_SETCONTEXT_CLOSE } - }, - { - __LINE__, WM_IME_SETCONTEXT, 3, STAGE_TYPE_SEQUENCE, 0, - 1, - { WM_IME_NOTIFY }, - { ACTION_IME_NOTIFY_CLOSE } - }, - // activate - { - __LINE__, WM_ACTIVATE, 3, STAGE_TYPE_SEQUENCE, ACTION_ACTIVATE, - 1, - { WM_IME_SETCONTEXT }, - { ACTION_IME_SETCONTEXT_OPEN } - }, - { - __LINE__, WM_IME_SETCONTEXT, 4, STAGE_TYPE_SEQUENCE, 0, - 1, - { WM_IME_NOTIFY }, - { ACTION_IME_NOTIFY_OPEN }, - }, - // destroy - { - __LINE__, WM_COMMAND, 2, STAGE_TYPE_SEQUENCE, ACTION_DESTROY, - 2, - { WM_WINDOWPOSCHANGING, WM_WINDOWPOSCHANGED }, - }, - { - __LINE__, WM_COMMAND, 2, STAGE_TYPE_SEQUENCE, 0, - 1, - { WM_IME_SETCONTEXT }, - { ACTION_IME_SETCONTEXT_CLOSE } - }, - { - __LINE__, WM_IME_SETCONTEXT, 3, STAGE_TYPE_SEQUENCE, 0, - 1, - { WM_IME_NOTIFY }, - { ACTION_IME_NOTIFY_CLOSE } - }, - { - __LINE__, WM_COMMAND, 2, STAGE_TYPE_SEQUENCE, 0, - 2, - { WM_DESTROY, WM_NCDESTROY }, - }, -}; - -static void IME_DoTest(void) +START_TEST(MessageStateAnalyzer) { - WNDCLASSA wc; + WNDCLASSW wc; HWND hwnd; MSG msg; - static const char s_szName[] = "MessageStateAnalyzerIME"; - - trace("IME_DoTest\n"); - DoInitialize(s_IMEStages, ARRAYSIZE(s_IMEStages)); + static const WCHAR s_szName[] = L"MessageStateAnalyzer"; /* register window class */ ZeroMemory(&wc, sizeof(wc)); wc.style = CS_HREDRAW | CS_VREDRAW | CS_DBLCLKS; wc.lpfnWndProc = WindowProc; - wc.hInstance = GetModuleHandleA(NULL); + wc.hInstance = GetModuleHandleW(NULL); wc.hIcon = LoadIcon(NULL, IDI_APPLICATION); wc.hCursor = LoadCursor(NULL, IDC_ARROW); wc.hbrBackground = (HBRUSH)(COLOR_3DFACE + 1); wc.lpszClassName = s_szName; - if (!RegisterClassA(&wc)) + if (!RegisterClassW(&wc)) { skip("RegisterClassW failed.\n"); return; } /* create a window */ - hwnd = CreateWindowA(s_szName, s_szName, WS_OVERLAPPEDWINDOW, - 0, 0, WIDTH, HEIGHT, NULL, NULL, + hwnd = CreateWindowW(s_szName, s_szName, WS_OVERLAPPEDWINDOW | WS_VISIBLE, + CW_USEDEFAULT, CW_USEDEFAULT, 300, 200, NULL, NULL, GetModuleHandleW(NULL), NULL); if (!hwnd) { @@ -556,19 +332,11 @@ static void IME_DoTest(void) } /* message loop */ - while (GetMessageA(&msg, NULL, 0, 0)) + while (GetMessageW(&msg, NULL, 0, 0)) { TranslateMessage(&msg); - DispatchMessageA(&msg); + DispatchMessageW(&msg); } - ok_int(UnregisterClassA(s_szName, GetModuleHandleA(NULL)), TRUE); - - DoFinish(); -} - -START_TEST(MessageStateAnalyzer) -{ - General_DoTest(); - IME_DoTest(); + DoAnalyzeAllMessages(); }
1 year, 9 months
1
0
0
0
← Newer
1
2
3
4
5
6
7
...
14
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
Results per page:
10
25
50
100
200