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
August 2011
----- 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
498 discussions
Start a n
N
ew thread
[jimtabor] 53391: [User32] - Fix copy paste error in DIALOG_IsAccelerator, fixes a crash. - Up Dialog.c to 1.3.26, sync port and minimized differences.
by jimtabor@svn.reactos.org
Author: jimtabor Date: Tue Aug 23 03:27:14 2011 New Revision: 53391 URL:
http://svn.reactos.org/svn/reactos?rev=53391&view=rev
Log: [User32] - Fix copy paste error in DIALOG_IsAccelerator, fixes a crash. - Up Dialog.c to 1.3.26, sync port and minimized differences. Modified: trunk/reactos/dll/win32/user32/windows/dialog.c Modified: trunk/reactos/dll/win32/user32/windows/dialog.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/user32/windows/d…
============================================================================== --- trunk/reactos/dll/win32/user32/windows/dialog.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/user32/windows/dialog.c [iso-8859-1] Tue Aug 23 03:27:14 2011 @@ -74,7 +74,7 @@ UINT id; LPCWSTR className; LPCWSTR windowName; - BOOL windowNameFree; + BOOL windowNameFree; // ReactOS LPCVOID data; } DLG_CONTROL_INFO; @@ -318,6 +318,7 @@ if (!(dlgInfo = GETDLGINFO(hwnd))) return FALSE; + TRACE(" BEGIN\n" ); while (items--) { template = (LPCSTR)DIALOG_GetControl32( (const WORD *)template, &info, @@ -401,44 +402,10 @@ dlgInfo->idResult = GetWindowLongPtrA( hwndCtrl, GWLP_ID ); } } + TRACE(" END\n" ); return TRUE; } - /*********************************************************************** - * DIALOG_FindMsgDestination - * - * The messages that IsDialogMessage sends may not go to the dialog - * calling IsDialogMessage if that dialog is a child, and it has the - * DS_CONTROL style set. - * We propagate up until we hit one that does not have DS_CONTROL, or - * whose parent is not a dialog. - * - * This is undocumented behaviour. - */ -static HWND DIALOG_FindMsgDestination( HWND hwndDlg ) -{ - while (GetWindowLongA(hwndDlg, GWL_STYLE) & DS_CONTROL) - { - PWND pWnd; - HWND hParent = GetParent(hwndDlg); - if (!hParent) break; -// ReactOS - if (!IsWindow(hParent)) break; - - pWnd = ValidateHwnd(hParent); - // FIXME: Use pWnd->fnid == FNID_DESKTOP - if (!pWnd || hParent == GetDesktopWindow()) break; - - if (!(pWnd->state & WNDS_DIALOGWINDOW)) - { - break; - } - - hwndDlg = hParent; - } - - return hwndDlg; -} /*********************************************************************** * DIALOG_IsAccelerator @@ -455,7 +422,7 @@ DWORD style = GetWindowLongPtrW( hwndControl, GWL_STYLE ); if ((style & (WS_VISIBLE | WS_DISABLED)) == WS_VISIBLE) { - dlgCode = SendMessageA( hwndControl, WM_GETDLGCODE, 0, 0 ); + dlgCode = SendMessageW( hwndControl, WM_GETDLGCODE, 0, 0 ); if ( (dlgCode & (DLGC_BUTTON | DLGC_STATIC)) && GetWindowTextW( hwndControl, buffer, sizeof(buffer)/sizeof(WCHAR) )) { @@ -464,7 +431,7 @@ do { - p = wcschr( p + 2, '&' ); + p = strchrW( p + 2, '&' ); } while (p != NULL && p[1] == '&'); @@ -515,6 +482,42 @@ } /*********************************************************************** + * DIALOG_FindMsgDestination + * + * The messages that IsDialogMessage sends may not go to the dialog + * calling IsDialogMessage if that dialog is a child, and it has the + * DS_CONTROL style set. + * We propagate up until we hit one that does not have DS_CONTROL, or + * whose parent is not a dialog. + * + * This is undocumented behaviour. + */ +static HWND DIALOG_FindMsgDestination( HWND hwndDlg ) +{ + while (GetWindowLongA(hwndDlg, GWL_STYLE) & DS_CONTROL) + { + PWND pWnd; + HWND hParent = GetParent(hwndDlg); + if (!hParent) break; +// ReactOS + if (!IsWindow(hParent)) break; + + pWnd = ValidateHwnd(hParent); + // FIXME: Use pWnd->fnid == FNID_DESKTOP + if (!pWnd || hParent == GetDesktopWindow()) break; + + if (!(pWnd->state & WNDS_DIALOGWINDOW)) + { + break; + } + + hwndDlg = hParent; + } + + return hwndDlg; +} + + /*********************************************************************** * DIALOG_DoDialogBox */ INT DIALOG_DoDialogBox( HWND hwnd, HWND owner ) @@ -545,15 +548,22 @@ /* No message present -> send ENTERIDLE and wait */ SendMessageW( ownerMsg, WM_ENTERIDLE, MSGF_DIALOGBOX, (LPARAM)hwnd ); } - if (!GetMessageW( &msg, 0, 0, 0 )) break; + GetMessageW( &msg, 0, 0, 0 ); } + if (msg.message == WM_QUIT) + { + PostQuitMessage( msg.wParam ); + if (!IsWindow( hwnd )) return 0; + break; + } if (!IsWindow( hwnd )) return 0; if (!(dlgInfo->flags & DF_END) && !IsDialogMessageW( hwnd, &msg)) { TranslateMessage( &msg ); DispatchMessageW( &msg ); } + if (!IsWindow( hwnd )) return 0; if (dlgInfo->flags & DF_END) break; if (bFirstEmpty && msg.message == WM_TIMER) @@ -603,6 +613,11 @@ result->y = GET_WORD(p); p++; result->cx = GET_WORD(p); p++; result->cy = GET_WORD(p); p++; + TRACE("DIALOG%s %d, %d, %d, %d, %d\n", + result->dialogEx ? "EX" : "", result->x, result->y, + result->cx, result->cy, result->helpId ); + TRACE(" STYLE 0x%08x\n", result->style ); + TRACE(" EXSTYLE 0x%08x\n", result->exStyle ); /* Get the menu name */ @@ -615,9 +630,11 @@ case 0xffff: result->menuName = (LPCWSTR)(UINT_PTR)GET_WORD( p + 1 ); p += 2; + TRACE(" MENU %04x\n", LOWORD(result->menuName) ); break; default: result->menuName = (LPCWSTR)p; + TRACE(" MENU %s\n", debugstr_w(result->menuName) ); p += strlenW( result->menuName ) + 1; break; } @@ -633,9 +650,11 @@ case 0xffff: result->className = (LPCWSTR)(UINT_PTR)GET_WORD( p + 1 ); p += 2; + TRACE(" CLASS %04x\n", LOWORD(result->className) ); break; default: result->className = (LPCWSTR)p; + TRACE(" CLASS %s\n", debugstr_w( result->className )); p += strlenW( result->className ) + 1; break; } @@ -644,6 +663,7 @@ result->caption = (LPCWSTR)p; p += strlenW( result->caption ) + 1; + TRACE(" CAPTION %s\n", debugstr_w( result->caption ) ); /* Get the font name */ @@ -678,6 +698,10 @@ } result->faceName = (LPCWSTR)p; p += strlenW( result->faceName ) + 1; + + TRACE(" FONT %d, %s, %d, %s\n", + result->pointSize, debugstr_w( result->faceName ), + result->weight, result->italic ? "TRUE" : "FALSE" ); } } @@ -969,13 +993,13 @@ if (dlgProc) { HWND focus = GetNextDlgTabItem( hwnd, 0, FALSE ); - if (SendMessageW( hwnd, WM_INITDIALOG, (WPARAM)focus, param ) && + if (SendMessageW( hwnd, WM_INITDIALOG, (WPARAM)focus, param ) && IsWindow( hwnd ) && ((~template.style & DS_CONTROL) || (template.style & WS_VISIBLE))) { /* By returning TRUE, app has requested a default focus assignment. * WM_INITDIALOG may have changed the tab order, so find the first * tabstop control again. */ - dlgInfo->hwndFocus = GetNextDlgTabItem( hwnd, 0, FALSE); + dlgInfo->hwndFocus = GetNextDlgTabItem( hwnd, 0, FALSE ); if( dlgInfo->hwndFocus ) SetFocus( dlgInfo->hwndFocus ); } @@ -1289,6 +1313,7 @@ return retWnd ? retWnd : hwndCtrl; } + /********************************************************************** * DIALOG_DlgDirListW * @@ -1305,8 +1330,7 @@ ((attrib & DDL_POSTMSGS) ? PostMessageW( hwnd, msg, wparam, lparam ) \ : SendMessageW( hwnd, msg, wparam, lparam )) -// TRACE("%p '%s' %d %d %04x\n", -// hDlg, spec ? spec : "NULL", idLBox, idStatic, attrib ); + TRACE("%p %s %d %d %04x\n", hDlg, debugstr_w(spec), idLBox, idStatic, attrib ); /* If the path exists and is a directory, chdir to it */ if (!spec || !spec[0] || SetCurrentDirectoryW( spec )) spec = any; @@ -1377,6 +1401,7 @@ return TRUE; #undef SENDMSG } + /********************************************************************** * DIALOG_DlgDirListA @@ -2039,7 +2064,7 @@ BOOL *lpTranslated, BOOL bSigned) { - char str[30]; + char str[30]; char * endptr; long result = 0; @@ -2314,6 +2339,39 @@ /* I wonder why it doesn't send a DM_SETDEFID */ } } + +/*********************************************************************** + * DIALOG_IdToHwnd + * + * A recursive version of GetDlgItem + * + * RETURNS + * The HWND for a Child ID. + */ +static HWND DIALOG_IdToHwnd( HWND hwndDlg, INT id ) +{ + int i; + HWND *list = WIN_ListChildren( hwndDlg ); + HWND ret = 0; + + if (!list) return 0; + + for (i = 0; list[i]; i++) + { + if (GetWindowLongPtrW( list[i], GWLP_ID ) == id) + { + ret = list[i]; + break; + } + + /* Recurse into every child */ + if ((ret = DIALOG_IdToHwnd( list[i], id ))) break; + } + + HeapFree( GetProcessHeap(), 0, list ); + return ret; +} + /* * @implemented @@ -2419,7 +2477,7 @@ } else if (DC_HASDEFID == HIWORD(dw = SendMessageW (hDlg, DM_GETDEFID, 0, 0))) { - HWND hwndDef = GetDlgItem(hDlg, LOWORD(dw)); + HWND hwndDef = DIALOG_IdToHwnd(hDlg, LOWORD(dw)); if (hwndDef ? IsWindowEnabled(hwndDef) : LOWORD(dw)==IDOK) SendMessageW( hDlg, WM_COMMAND, MAKEWPARAM( LOWORD(dw), BN_CLICKED ), (LPARAM)hwndDef); }
13 years, 4 months
1
0
0
0
[cgutman] 53390: [INF] - Install the processors class - Add missing INFs to syssetup.inf
by cgutman@svn.reactos.org
Author: cgutman Date: Tue Aug 23 02:28:45 2011 New Revision: 53390 URL:
http://svn.reactos.org/svn/reactos?rev=53390&view=rev
Log: [INF] - Install the processors class - Add missing INFs to syssetup.inf Modified: trunk/reactos/media/inf/cpu.inf trunk/reactos/media/inf/syssetup.inf trunk/reactos/media/inf/syssetup.inf.tpl Modified: trunk/reactos/media/inf/cpu.inf URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/media/inf/cpu.inf?rev=5339…
============================================================================== Binary files - no diff available. Modified: trunk/reactos/media/inf/syssetup.inf URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/media/inf/syssetup.inf?rev…
============================================================================== --- trunk/reactos/media/inf/syssetup.inf [iso-8859-1] (original) +++ trunk/reactos/media/inf/syssetup.inf [iso-8859-1] Tue Aug 23 02:28:45 2011 @@ -5,9 +5,11 @@ [DeviceInfsToInstall] battery.inf cdrom.inf +cpu.inf disk.inf display.inf fdc.inf +hal.inf hdc.inf keyboard.inf machine.inf Modified: trunk/reactos/media/inf/syssetup.inf.tpl URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/media/inf/syssetup.inf.tpl…
============================================================================== Binary files - no diff available.
13 years, 4 months
1
0
0
0
[tkreuzer] 53389: [LIBSAMPLERATE] - Fix amd64 build
by tkreuzer@svn.reactos.org
Author: tkreuzer Date: Mon Aug 22 22:22:11 2011 New Revision: 53389 URL:
http://svn.reactos.org/svn/reactos?rev=53389&view=rev
Log: [LIBSAMPLERATE] - Fix amd64 build Modified: trunk/reactos/lib/3rdparty/libsamplerate/config.h Modified: trunk/reactos/lib/3rdparty/libsamplerate/config.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/3rdparty/libsamplerate…
============================================================================== --- trunk/reactos/lib/3rdparty/libsamplerate/config.h [iso-8859-1] (original) +++ trunk/reactos/lib/3rdparty/libsamplerate/config.h [iso-8859-1] Mon Aug 22 22:22:11 2011 @@ -207,12 +207,11 @@ #define inline __inline /* ReactOS hacks */ -void DbgBreak(void); -unsigned long __cdecl DbgPrint(const char *Format, ...); -#define exit(n) DbgBreak() +void __stdcall DbgBreakPoint(void); +unsigned long __cdecl DbgPrint(const char *Format, ...); +#define exit(n) DbgBreakPoint() #define printf DbgPrint -#ifdef _M_AMD64 -#define _mm_load_sd(x) __hack_hack(x) // Prevent an internal compiler error -#pragma warning(disable:4244) -#endif +# ifdef _MSC_VER +# pragma warning(disable:4244) +# endif /* _MSC_VER */
13 years, 4 months
1
0
0
0
[tkreuzer] 53388: [CRT] Fix definition of __m128d and __m128.
by tkreuzer@svn.reactos.org
Author: tkreuzer Date: Mon Aug 22 21:59:13 2011 New Revision: 53388 URL:
http://svn.reactos.org/svn/reactos?rev=53388&view=rev
Log: [CRT] Fix definition of __m128d and __m128. Modified: trunk/reactos/include/crt/_mingw.h trunk/reactos/include/crt/emmintrin.h trunk/reactos/include/crt/xmmintrin.h Modified: trunk/reactos/include/crt/_mingw.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/crt/_mingw.h?rev=5…
============================================================================== --- trunk/reactos/include/crt/_mingw.h [iso-8859-1] (original) +++ trunk/reactos/include/crt/_mingw.h [iso-8859-1] Mon Aug 22 21:59:13 2011 @@ -207,8 +207,10 @@ #ifdef _MSC_VER #define ATTRIB_NORETURN +#define _DECLSPEC_INTRIN_TYPE __declspec(intrin_type) #else #define ATTRIB_NORETURN DECLSPEC_NORETURN +#define _DECLSPEC_INTRIN_TYPE #endif #include "_mingw_mac.h" Modified: trunk/reactos/include/crt/emmintrin.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/crt/emmintrin.h?re…
============================================================================== --- trunk/reactos/include/crt/emmintrin.h [iso-8859-1] (original) +++ trunk/reactos/include/crt/emmintrin.h [iso-8859-1] Mon Aug 22 21:59:13 2011 @@ -11,7 +11,7 @@ #include <crtdefs.h> #include <xmmintrin.h> -typedef struct _CRT_ALIGN(16) __m128d +typedef struct _DECLSPEC_INTRIN_TYPE _CRT_ALIGN(16) __m128d { double m128d_f64[2]; } __m128d; Modified: trunk/reactos/include/crt/xmmintrin.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/crt/xmmintrin.h?re…
============================================================================== --- trunk/reactos/include/crt/xmmintrin.h [iso-8859-1] (original) +++ trunk/reactos/include/crt/xmmintrin.h [iso-8859-1] Mon Aug 22 21:59:13 2011 @@ -11,7 +11,7 @@ #include <crtdefs.h> #include <mmintrin.h> -typedef union _CRT_ALIGN(16) __m128 +typedef union _DECLSPEC_INTRIN_TYPE _CRT_ALIGN(16) __m128 { float m128_f32[4]; unsigned __int64 m128_u64[2];
13 years, 4 months
1
0
0
0
[jimtabor] 53387: [WineTest:User32] - Up the rest to 1.3.26.
by jimtabor@svn.reactos.org
Author: jimtabor Date: Mon Aug 22 21:33:49 2011 New Revision: 53387 URL:
http://svn.reactos.org/svn/reactos?rev=53387&view=rev
Log: [WineTest:User32] - Up the rest to 1.3.26. Modified: trunk/rostests/winetests/user32/broadcast.c trunk/rostests/winetests/user32/class.c trunk/rostests/winetests/user32/clipboard.c trunk/rostests/winetests/user32/combo.c trunk/rostests/winetests/user32/cursoricon.c trunk/rostests/winetests/user32/dce.c trunk/rostests/winetests/user32/dde.c trunk/rostests/winetests/user32/dialog.c trunk/rostests/winetests/user32/edit.c trunk/rostests/winetests/user32/generated.c trunk/rostests/winetests/user32/input.c trunk/rostests/winetests/user32/listbox.c trunk/rostests/winetests/user32/menu.c trunk/rostests/winetests/user32/monitor.c trunk/rostests/winetests/user32/resource.c trunk/rostests/winetests/user32/scroll.c trunk/rostests/winetests/user32/static.c trunk/rostests/winetests/user32/sysparams.c trunk/rostests/winetests/user32/text.c trunk/rostests/winetests/user32/wsprintf.c [This mail would be too long, it was shortened to contain the URLs only.] Modified: trunk/rostests/winetests/user32/broadcast.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/user32/broadcas…
Modified: trunk/rostests/winetests/user32/class.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/user32/class.c?…
Modified: trunk/rostests/winetests/user32/clipboard.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/user32/clipboar…
Modified: trunk/rostests/winetests/user32/combo.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/user32/combo.c?…
Modified: trunk/rostests/winetests/user32/cursoricon.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/user32/cursoric…
Modified: trunk/rostests/winetests/user32/dce.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/user32/dce.c?re…
Modified: trunk/rostests/winetests/user32/dde.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/user32/dde.c?re…
Modified: trunk/rostests/winetests/user32/dialog.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/user32/dialog.c…
Modified: trunk/rostests/winetests/user32/edit.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/user32/edit.c?r…
Modified: trunk/rostests/winetests/user32/generated.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/user32/generate…
Modified: trunk/rostests/winetests/user32/input.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/user32/input.c?…
Modified: trunk/rostests/winetests/user32/listbox.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/user32/listbox.…
Modified: trunk/rostests/winetests/user32/menu.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/user32/menu.c?r…
Modified: trunk/rostests/winetests/user32/monitor.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/user32/monitor.…
Modified: trunk/rostests/winetests/user32/resource.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/user32/resource…
Modified: trunk/rostests/winetests/user32/scroll.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/user32/scroll.c…
Modified: trunk/rostests/winetests/user32/static.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/user32/static.c…
Modified: trunk/rostests/winetests/user32/sysparams.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/user32/sysparam…
Modified: trunk/rostests/winetests/user32/text.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/user32/text.c?r…
Modified: trunk/rostests/winetests/user32/wsprintf.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/user32/wsprintf…
13 years, 4 months
1
0
0
0
[jimtabor] 53386: [WineTest:User32] - Up msg to 1.3.26.
by jimtabor@svn.reactos.org
Author: jimtabor Date: Mon Aug 22 21:07:39 2011 New Revision: 53386 URL:
http://svn.reactos.org/svn/reactos?rev=53386&view=rev
Log: [WineTest:User32] - Up msg to 1.3.26. Modified: trunk/rostests/winetests/user32/msg.c Modified: trunk/rostests/winetests/user32/msg.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/user32/msg.c?re…
============================================================================== --- trunk/rostests/winetests/user32/msg.c [iso-8859-1] (original) +++ trunk/rostests/winetests/user32/msg.c [iso-8859-1] Mon Aug 22 21:07:39 2011 @@ -20,8 +20,8 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ -#define _WIN32_WINNT 0x0600 /* For WM_CHANGEUISTATE,QS_RAWINPUT,WM_DWMxxxx */ -#define WINVER 0x0600 /* for WM_GETTITLEBARINFOEX */ +//#define _WIN32_WINNT 0x0600 /* For WM_CHANGEUISTATE,QS_RAWINPUT,WM_DWMxxxx */ +//#define WINVER 0x0600 /* for WM_GETTITLEBARINFOEX */ #include <assert.h> #include <stdarg.h> @@ -79,6 +79,7 @@ static BOOL test_DestroyWindow_flag; static HWINEVENTHOOK hEvent_hook; +static HHOOK hKBD_hook; static HHOOK hCBT_hook; static DWORD cbt_hook_thread_id; @@ -105,7 +106,8 @@ beginpaint=0x40, optional=0x80, hook=0x100, - winevent_hook=0x200 + winevent_hook=0x200, + kbd_hook=0x400 } msg_flags_t; struct message { @@ -293,7 +295,7 @@ { WM_NCACTIVATE, sent|wparam|defwinproc, 0 }, /* in the 2nd MDI child */ { WM_MDIACTIVATE, sent|defwinproc }, /* in the 2nd MDI child */ { HCBT_MINMAX, hook|lparam, 0, SW_MAXIMIZE }, - /* Preparing for maximize and maximaze the 1st MDI child */ + /* Preparing for maximize and maximize the 1st MDI child */ { WM_GETMINMAXINFO, sent|defwinproc }, /* in the 1st MDI child */ { WM_WINDOWPOSCHANGING, sent|wparam|defwinproc, SWP_FRAMECHANGED|SWP_STATECHANGED }, /* in the 1st MDI child */ { WM_NCCALCSIZE, sent|wparam|defwinproc, 1 }, /* in the 1st MDI child */ @@ -1717,6 +1719,8 @@ static HWINEVENTHOOK (WINAPI *pSetWinEventHook)(DWORD, DWORD, HMODULE, WINEVENTPROC, DWORD, DWORD, DWORD); static BOOL (WINAPI *pTrackMouseEvent)(TRACKMOUSEEVENT*); static BOOL (WINAPI *pUnhookWinEvent)(HWINEVENTHOOK); +static BOOL (WINAPI *pGetMonitorInfoA)(HMONITOR,LPMONITORINFO); +static HMONITOR (WINAPI *pMonitorFromPoint)(POINT,DWORD); /* kernel32 functions */ static BOOL (WINAPI *pGetCPInfoExA)(UINT, DWORD, LPCPINFOEXA); @@ -1738,6 +1742,8 @@ GET_PROC(user32, SetWinEventHook) GET_PROC(user32, TrackMouseEvent) GET_PROC(user32, UnhookWinEvent) + GET_PROC(user32, GetMonitorInfoA) + GET_PROC(user32, MonitorFromPoint) GET_PROC(kernel32, GetCPInfoExA) @@ -1938,6 +1944,11 @@ else if (expected->flags & winevent_hook) { trace_(file, line)( " %u: expected: winevent %04x - actual: %s\n", + count, expected->message, actual->output ); + } + else if (expected->flags & kbd_hook) + { + trace_(file, line)( " %u: expected: kbd %04x - actual: %s\n", count, expected->message, actual->output ); } else @@ -2014,7 +2025,8 @@ while (expected->message && actual->message) { - if (expected->message == actual->message) + if (expected->message == actual->message && + !((expected->flags ^ actual->flags) & (hook|winevent_hook|kbd_hook))) { if (expected->flags & wparam) { @@ -2108,13 +2120,19 @@ context, count, expected->message); if ((expected->flags & winevent_hook) != (actual->flags & winevent_hook)) dump++; + ok_( file, line) ((expected->flags & kbd_hook) == (actual->flags & kbd_hook), + "%s: %u: the msg 0x%04x should have been sent by a keyboard hook\n", + context, count, expected->message); + if ((expected->flags & kbd_hook) != (actual->flags & kbd_hook)) dump++; + expected++; actual++; } /* silently drop hook messages if there is no support for them */ else if ((expected->flags & optional) || ((expected->flags & hook) && !hCBT_hook) || - ((expected->flags & winevent_hook) && !hEvent_hook)) + ((expected->flags & winevent_hook) && !hEvent_hook) || + ((expected->flags & kbd_hook) && !hKBD_hook)) expected++; else if (todo) { @@ -3363,7 +3381,7 @@ RECT rc; HMENU hMenu = CreateMenu(); - assert(mdi_RegisterWindowClasses()); + if (!mdi_RegisterWindowClasses()) assert(0); flush_sequence(); @@ -6157,6 +6175,16 @@ flush_events(); ok_sequence( WmEmptySeq, "WmEmptySeq", FALSE ); + trace("testing UpdateWindow(NULL)\n"); + SetLastError(0xdeadbeef); + ok(!UpdateWindow(NULL), "UpdateWindow(NULL) should fail\n"); + ok(GetLastError() == ERROR_INVALID_WINDOW_HANDLE || + broken( GetLastError() == 0xdeadbeef ) /* win9x */, + "wrong error code %d\n", GetLastError()); + check_update_rgn( hwnd, 0 ); + flush_events(); + ok_sequence( WmEmptySeq, "WmEmptySeq", FALSE ); + /* now with frame */ SetRectRgn( hrgn, -5, -5, 20, 20 ); @@ -6701,7 +6729,7 @@ CloseHandle(wnd_event.start_event); SetLastError(0xdeadbeef); - ok(!DestroyWindow(wnd_event.hwnd), "DestroyWindow succeded\n"); + ok(!DestroyWindow(wnd_event.hwnd), "DestroyWindow succeeded\n"); ok(GetLastError() == ERROR_ACCESS_DENIED || GetLastError() == 0xdeadbeef, "wrong error code %d\n", GetLastError()); @@ -6723,7 +6751,7 @@ SetLastError(0xdeadbeef); len = DispatchMessageA(&msg); ok((!len && GetLastError() == ERROR_MESSAGE_SYNC_ONLY) || broken(len), /* nt4 */ - "DispatchMessageA(WM_GETTEXT) succeded on another thread window: ret %d, error %d\n", len, GetLastError()); + "DispatchMessageA(WM_GETTEXT) succeeded on another thread window: ret %d, error %d\n", len, GetLastError()); /* the following test causes an exception in user.exe under win9x */ msg.hwnd = wnd_event.hwnd; @@ -7686,6 +7714,49 @@ return DefWindowProcA(hWnd,msg,wParam,lParam); } +static LRESULT WINAPI HotkeyMsgCheckProcA(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) +{ + static LONG defwndproc_counter = 0; + LRESULT ret; + struct recvd_message msg; + DWORD queue_status; + + if (ignore_message( message )) return 0; + + if ((message >= WM_KEYFIRST && message <= WM_KEYLAST) || + message == WM_HOTKEY || message >= WM_APP) + { + msg.hwnd = hwnd; + msg.message = message; + msg.flags = sent|wparam|lparam; + if (defwndproc_counter) msg.flags |= defwinproc; + msg.wParam = wParam; + msg.lParam = lParam; + msg.descr = "HotkeyMsgCheckProcA"; + add_message(&msg); + } + + defwndproc_counter++; + ret = DefWindowProcA(hwnd, message, wParam, lParam); + defwndproc_counter--; + + if (message == WM_APP) + { + queue_status = GetQueueStatus(QS_HOTKEY); + ok((queue_status & (QS_HOTKEY << 16)) == QS_HOTKEY << 16, "expected QS_HOTKEY << 16 set, got %x\n", queue_status); + queue_status = GetQueueStatus(QS_POSTMESSAGE); + ok((queue_status & (QS_POSTMESSAGE << 16)) == QS_POSTMESSAGE << 16, "expected QS_POSTMESSAGE << 16 set, got %x\n", queue_status); + PostMessageA(hwnd, WM_APP+1, 0, 0); + } + else if (message == WM_APP+1) + { + queue_status = GetQueueStatus(QS_HOTKEY); + ok((queue_status & (QS_HOTKEY << 16)) == 0, "expected QS_HOTKEY << 16 cleared, got %x\n", queue_status); + } + + return ret; +} + static BOOL RegisterWindowClasses(void) { WNDCLASSA cls; @@ -7701,6 +7772,10 @@ cls.hbrBackground = GetStockObject(WHITE_BRUSH); cls.lpszMenuName = NULL; cls.lpszClassName = "TestWindowClass"; + if(!RegisterClassA(&cls)) return FALSE; + + cls.lpfnWndProc = HotkeyMsgCheckProcA; + cls.lpszClassName = "HotkeyWindowClass"; if(!RegisterClassA(&cls)) return FALSE; cls.lpfnWndProc = ShowWindowProcA; @@ -10012,6 +10087,50 @@ flush_events(); } +static INT_PTR CALLBACK wm_quit_dlg_proc(HWND hwnd, UINT message, WPARAM wp, LPARAM lp) +{ + struct recvd_message msg; + + if (ignore_message( message )) return 0; + + msg.hwnd = hwnd; + msg.message = message; + msg.flags = sent|wparam|lparam; + msg.wParam = wp; + msg.lParam = lp; + msg.descr = "dialog"; + add_message(&msg); + + switch (message) + { + case WM_INITDIALOG: + PostMessage(hwnd, WM_QUIT, 0x1234, 0x5678); + PostMessage(hwnd, WM_USER, 0xdead, 0xbeef); + return 0; + + case WM_GETDLGCODE: + return 0; + + case WM_USER: + EndDialog(hwnd, 0); + break; + } + + return 1; +} + +static const struct message WmQuitDialogSeq[] = { + { HCBT_CREATEWND, hook }, + { WM_SETFONT, sent }, + { WM_INITDIALOG, sent }, + { WM_CHANGEUISTATE, sent|optional }, + { HCBT_DESTROYWND, hook }, + { 0x0090, sent|optional }, /* Vista */ + { WM_DESTROY, sent }, + { WM_NCDESTROY, sent }, + { 0 } +}; + static void test_quit_message(void) { MSG msg; @@ -10062,6 +10181,18 @@ ret = GetMessage(&msg, NULL, 0, 0); ok(ret > 0, "GetMessage failed with error %d\n", GetLastError()); ok(msg.message == WM_USER, "Received message 0x%04x instead of WM_USER\n", msg.message); + + flush_events(); + flush_sequence(); + ret = DialogBoxParam(GetModuleHandle(0), "TEST_EMPTY_DIALOG", 0, wm_quit_dlg_proc, 0); + ok(ret == 1, "expected 1, got %d\n", ret); + ok_sequence(WmQuitDialogSeq, "WmQuitDialogSeq", FALSE); + memset(&msg, 0xab, sizeof(msg)); + ret = PeekMessage(&msg, NULL, 0, 0, PM_REMOVE); + ok(ret, "PeekMessage failed\n"); + ok(msg.message == WM_QUIT, "Received message 0x%04x instead of WM_QUIT\n", msg.message); + ok(msg.wParam == 0x1234, "wParam was 0x%lx instead of 0x1234\n", msg.wParam); + ok(msg.lParam == 0, "lParam was 0x%lx instead of 0\n", msg.lParam); } static const struct message WmMouseHoverSeq[] = { @@ -10631,71 +10762,132 @@ LPARAM ret; /* ShowWindow return value */ DWORD style; /* window style after the command */ const struct message *msg; /* message sequence the command produces */ + INT wp_cmd, wp_flags; /* window placement after the command */ + POINT wp_min, wp_max; /* window placement after the command */ BOOL todo_msg; /* message sequence doesn't match what Wine does */ } sw[] = { -/* 1 */ { SW_SHOWNORMAL, FALSE, WS_VISIBLE, WmShowNormal, FALSE }, -/* 2 */ { SW_SHOWNORMAL, TRUE, WS_VISIBLE, WmEmptySeq, FALSE }, -/* 3 */ { SW_HIDE, TRUE, 0, WmHide_1, FALSE }, -/* 4 */ { SW_HIDE, FALSE, 0, WmEmptySeq, FALSE }, -/* 5 */ { SW_SHOWMINIMIZED, FALSE, WS_VISIBLE|WS_MINIMIZE, WmShowMinimized_1, FALSE }, -/* 6 */ { SW_SHOWMINIMIZED, TRUE, WS_VISIBLE|WS_MINIMIZE, WmMinMax_1, FALSE }, -/* 7 */ { SW_HIDE, TRUE, WS_MINIMIZE, WmHide_1, FALSE }, -/* 8 */ { SW_HIDE, FALSE, WS_MINIMIZE, WmEmptySeq, FALSE }, -/* 9 */ { SW_SHOWMAXIMIZED, FALSE, WS_VISIBLE|WS_MAXIMIZE, WmShowMaximized_1, FALSE }, -/* 10 */ { SW_SHOWMAXIMIZED, TRUE, WS_VISIBLE|WS_MAXIMIZE, WmMinMax_2, FALSE }, -/* 11 */ { SW_HIDE, TRUE, WS_MAXIMIZE, WmHide_1, FALSE }, -/* 12 */ { SW_HIDE, FALSE, WS_MAXIMIZE, WmEmptySeq, FALSE }, -/* 13 */ { SW_SHOWNOACTIVATE, FALSE, WS_VISIBLE, WmShowNoActivate_1, FALSE }, -/* 14 */ { SW_SHOWNOACTIVATE, TRUE, WS_VISIBLE, WmEmptySeq, FALSE }, -/* 15 */ { SW_HIDE, TRUE, 0, WmHide_2, FALSE }, -/* 16 */ { SW_HIDE, FALSE, 0, WmEmptySeq, FALSE }, -/* 17 */ { SW_SHOW, FALSE, WS_VISIBLE, WmShow, FALSE }, -/* 18 */ { SW_SHOW, TRUE, WS_VISIBLE, WmEmptySeq, FALSE }, -/* 19 */ { SW_MINIMIZE, TRUE, WS_VISIBLE|WS_MINIMIZE, WmMinimize_1, FALSE }, -/* 20 */ { SW_MINIMIZE, TRUE, WS_VISIBLE|WS_MINIMIZE, WmMinMax_3, FALSE }, -/* 21 */ { SW_HIDE, TRUE, WS_MINIMIZE, WmHide_2, FALSE }, -/* 22 */ { SW_SHOWMINNOACTIVE, FALSE, WS_VISIBLE|WS_MINIMIZE, WmShowMinNoActivate, TRUE }, -/* 23 */ { SW_SHOWMINNOACTIVE, TRUE, WS_VISIBLE|WS_MINIMIZE, WmMinMax_4, FALSE }, -/* 24 */ { SW_HIDE, TRUE, WS_MINIMIZE, WmHide_2, FALSE }, -/* 25 */ { SW_HIDE, FALSE, WS_MINIMIZE, WmEmptySeq, FALSE }, -/* 26 */ { SW_SHOWNA, FALSE, WS_VISIBLE|WS_MINIMIZE, WmShowNA_1, FALSE }, -/* 27 */ { SW_SHOWNA, TRUE, WS_VISIBLE|WS_MINIMIZE, WmShowNA_2, FALSE }, -/* 28 */ { SW_HIDE, TRUE, WS_MINIMIZE, WmHide_2, FALSE }, -/* 29 */ { SW_HIDE, FALSE, WS_MINIMIZE, WmEmptySeq, FALSE }, -/* 30 */ { SW_RESTORE, FALSE, WS_VISIBLE, WmRestore_1, FALSE }, -/* 31 */ { SW_RESTORE, TRUE, WS_VISIBLE, WmEmptySeq, FALSE }, -/* 32 */ { SW_HIDE, TRUE, 0, WmHide_3, FALSE }, -/* 33 */ { SW_HIDE, FALSE, 0, WmEmptySeq, FALSE }, -/* 34 */ { SW_NORMALNA, FALSE, 0, WmEmptySeq, FALSE }, /* what does this mean?! */ -/* 35 */ { SW_NORMALNA, FALSE, 0, WmEmptySeq, FALSE }, -/* 36 */ { SW_HIDE, FALSE, 0, WmEmptySeq, FALSE }, -/* 37 */ { SW_RESTORE, FALSE, WS_VISIBLE, WmRestore_2, FALSE }, -/* 38 */ { SW_RESTORE, TRUE, WS_VISIBLE, WmEmptySeq, FALSE }, -/* 39 */ { SW_SHOWNOACTIVATE, TRUE, WS_VISIBLE, WmEmptySeq, FALSE }, -/* 40 */ { SW_MINIMIZE, TRUE, WS_VISIBLE|WS_MINIMIZE, WmMinimize_2, FALSE }, -/* 41 */ { SW_MINIMIZE, TRUE, WS_VISIBLE|WS_MINIMIZE, WmMinMax_3, FALSE }, -/* 42 */ { SW_SHOWMAXIMIZED, TRUE, WS_VISIBLE|WS_MAXIMIZE, WmShowMaximized_2, FALSE }, -/* 43 */ { SW_SHOWMAXIMIZED, TRUE, WS_VISIBLE|WS_MAXIMIZE, WmMinMax_2, FALSE }, -/* 44 */ { SW_MINIMIZE, TRUE, WS_VISIBLE|WS_MINIMIZE, WmMinimize_1, FALSE }, -/* 45 */ { SW_MINIMIZE, TRUE, WS_VISIBLE|WS_MINIMIZE, WmMinMax_3, FALSE }, -/* 46 */ { SW_RESTORE, TRUE, WS_VISIBLE|WS_MAXIMIZE, WmRestore_3, FALSE }, -/* 47 */ { SW_RESTORE, TRUE, WS_VISIBLE, WmRestore_4, FALSE }, -/* 48 */ { SW_SHOWMAXIMIZED, TRUE, WS_VISIBLE|WS_MAXIMIZE, WmShowMaximized_3, FALSE }, -/* 49 */ { SW_SHOW, TRUE, WS_VISIBLE|WS_MAXIMIZE, WmEmptySeq, FALSE }, -/* 50 */ { SW_SHOWNORMAL, TRUE, WS_VISIBLE, WmRestore_5, FALSE }, -/* 51 */ { SW_SHOWNORMAL, TRUE, WS_VISIBLE, WmRestore_5, FALSE }, -/* 52 */ { SW_HIDE, TRUE, 0, WmHide_1, FALSE }, -/* 53 */ { SW_HIDE, FALSE, 0, WmEmptySeq, FALSE }, -/* 54 */ { SW_MINIMIZE, FALSE, WS_VISIBLE|WS_MINIMIZE, WmMinimize_3, FALSE }, -/* 55 */ { SW_HIDE, TRUE, WS_MINIMIZE, WmHide_2, FALSE }, -/* 56 */ { SW_SHOWNOACTIVATE, FALSE, WS_VISIBLE, WmShowNoActivate_2, FALSE }, -/* 57 */ { SW_SHOW, TRUE, WS_VISIBLE, WmEmptySeq, FALSE } +/* 1 */ { SW_SHOWNORMAL, FALSE, WS_VISIBLE, WmShowNormal, + SW_SHOWNORMAL, 0, {-1,-1}, {-1,-1}, FALSE }, +/* 2 */ { SW_SHOWNORMAL, TRUE, WS_VISIBLE, WmEmptySeq, + SW_SHOWNORMAL, 0, {-1,-1}, {-1,-1}, FALSE }, +/* 3 */ { SW_HIDE, TRUE, 0, WmHide_1, + SW_SHOWNORMAL, 0, {-1,-1}, {-1,-1}, FALSE }, +/* 4 */ { SW_HIDE, FALSE, 0, WmEmptySeq, + SW_SHOWNORMAL, 0, {-1,-1}, {-1,-1}, FALSE }, +/* 5 */ { SW_SHOWMINIMIZED, FALSE, WS_VISIBLE|WS_MINIMIZE, WmShowMinimized_1, + SW_SHOWMINIMIZED, 0, {-32000,-32000}, {-1,-1}, FALSE }, +/* 6 */ { SW_SHOWMINIMIZED, TRUE, WS_VISIBLE|WS_MINIMIZE, WmMinMax_1, + SW_SHOWMINIMIZED, 0, {-32000,-32000}, {-1,-1}, FALSE }, +/* 7 */ { SW_HIDE, TRUE, WS_MINIMIZE, WmHide_1, + SW_SHOWMINIMIZED, 0, {-32000,-32000}, {-1,-1}, FALSE }, +/* 8 */ { SW_HIDE, FALSE, WS_MINIMIZE, WmEmptySeq, + SW_SHOWMINIMIZED, 0, {-32000,-32000}, {-1,-1}, FALSE }, +/* 9 */ { SW_SHOWMAXIMIZED, FALSE, WS_VISIBLE|WS_MAXIMIZE, WmShowMaximized_1, + SW_SHOWMAXIMIZED, WPF_RESTORETOMAXIMIZED, {-32000,-32000}, {-1,-1}, FALSE }, +/* 10 */ { SW_SHOWMAXIMIZED, TRUE, WS_VISIBLE|WS_MAXIMIZE, WmMinMax_2, + SW_SHOWMAXIMIZED, WPF_RESTORETOMAXIMIZED, {-32000,-32000}, {-1,-1}, FALSE }, +/* 11 */ { SW_HIDE, TRUE, WS_MAXIMIZE, WmHide_1, + SW_SHOWMAXIMIZED, WPF_RESTORETOMAXIMIZED, {-32000,-32000}, {-1,-1}, FALSE }, +/* 12 */ { SW_HIDE, FALSE, WS_MAXIMIZE, WmEmptySeq, + SW_SHOWMAXIMIZED, WPF_RESTORETOMAXIMIZED, {-32000,-32000}, {-1,-1}, FALSE }, +/* 13 */ { SW_SHOWNOACTIVATE, FALSE, WS_VISIBLE, WmShowNoActivate_1, + SW_SHOWNORMAL, 0, {-32000,-32000}, {-1,-1}, FALSE }, +/* 14 */ { SW_SHOWNOACTIVATE, TRUE, WS_VISIBLE, WmEmptySeq, + SW_SHOWNORMAL, 0, {-32000,-32000}, {-1,-1}, FALSE }, +/* 15 */ { SW_HIDE, TRUE, 0, WmHide_2, + SW_SHOWNORMAL, 0, {-32000,-32000}, {-1,-1}, FALSE }, +/* 16 */ { SW_HIDE, FALSE, 0, WmEmptySeq, + SW_SHOWNORMAL, 0, {-32000,-32000}, {-1,-1}, FALSE }, +/* 17 */ { SW_SHOW, FALSE, WS_VISIBLE, WmShow, + SW_SHOWNORMAL, 0, {-32000,-32000}, {-1,-1}, FALSE }, +/* 18 */ { SW_SHOW, TRUE, WS_VISIBLE, WmEmptySeq, + SW_SHOWNORMAL, 0, {-32000,-32000}, {-1,-1}, FALSE }, +/* 19 */ { SW_MINIMIZE, TRUE, WS_VISIBLE|WS_MINIMIZE, WmMinimize_1, + SW_SHOWMINIMIZED, 0, {-32000,-32000}, {-1,-1}, FALSE }, +/* 20 */ { SW_MINIMIZE, TRUE, WS_VISIBLE|WS_MINIMIZE, WmMinMax_3, + SW_SHOWMINIMIZED, 0, {-32000,-32000}, {-1,-1}, FALSE }, +/* 21 */ { SW_HIDE, TRUE, WS_MINIMIZE, WmHide_2, + SW_SHOWMINIMIZED, 0, {-32000,-32000}, {-1,-1}, FALSE }, +/* 22 */ { SW_SHOWMINNOACTIVE, FALSE, WS_VISIBLE|WS_MINIMIZE, WmShowMinNoActivate, + SW_SHOWMINIMIZED, 0, {-32000,-32000}, {-1,-1}, TRUE }, +/* 23 */ { SW_SHOWMINNOACTIVE, TRUE, WS_VISIBLE|WS_MINIMIZE, WmMinMax_4, + SW_SHOWMINIMIZED, 0, {-32000,-32000}, {-1,-1}, FALSE }, +/* 24 */ { SW_HIDE, TRUE, WS_MINIMIZE, WmHide_2, + SW_SHOWMINIMIZED, 0, {-32000,-32000}, {-1,-1}, FALSE }, +/* 25 */ { SW_HIDE, FALSE, WS_MINIMIZE, WmEmptySeq, + SW_SHOWMINIMIZED, 0, {-32000,-32000}, {-1,-1}, FALSE }, +/* 26 */ { SW_SHOWNA, FALSE, WS_VISIBLE|WS_MINIMIZE, WmShowNA_1, + SW_SHOWMINIMIZED, 0, {-32000,-32000}, {-1,-1}, FALSE }, +/* 27 */ { SW_SHOWNA, TRUE, WS_VISIBLE|WS_MINIMIZE, WmShowNA_2, + SW_SHOWMINIMIZED, 0, {-32000,-32000}, {-1,-1}, FALSE }, +/* 28 */ { SW_HIDE, TRUE, WS_MINIMIZE, WmHide_2, + SW_SHOWMINIMIZED, 0, {-32000,-32000}, {-1,-1}, FALSE }, +/* 29 */ { SW_HIDE, FALSE, WS_MINIMIZE, WmEmptySeq, + SW_SHOWMINIMIZED, 0, {-32000,-32000}, {-1,-1}, FALSE }, +/* 30 */ { SW_RESTORE, FALSE, WS_VISIBLE, WmRestore_1, + SW_SHOWNORMAL, 0, {-32000,-32000}, {-1,-1}, FALSE }, +/* 31 */ { SW_RESTORE, TRUE, WS_VISIBLE, WmEmptySeq, + SW_SHOWNORMAL, 0, {-32000,-32000}, {-1,-1}, FALSE }, +/* 32 */ { SW_HIDE, TRUE, 0, WmHide_3, + SW_SHOWNORMAL, 0, {-32000,-32000}, {-1,-1}, FALSE }, +/* 33 */ { SW_HIDE, FALSE, 0, WmEmptySeq, + SW_SHOWNORMAL, 0, {-32000,-32000}, {-1,-1}, FALSE }, +/* 34 */ { SW_NORMALNA, FALSE, 0, WmEmptySeq, /* what does this mean?! */ + SW_SHOWNORMAL, 0, {-32000,-32000}, {-1,-1}, FALSE }, +/* 35 */ { SW_NORMALNA, FALSE, 0, WmEmptySeq, + SW_SHOWNORMAL, 0, {-32000,-32000}, {-1,-1}, FALSE }, +/* 36 */ { SW_HIDE, FALSE, 0, WmEmptySeq, + SW_SHOWNORMAL, 0, {-32000,-32000}, {-1,-1}, FALSE }, +/* 37 */ { SW_RESTORE, FALSE, WS_VISIBLE, WmRestore_2, + SW_SHOWNORMAL, 0, {-32000,-32000}, {-1,-1}, FALSE }, +/* 38 */ { SW_RESTORE, TRUE, WS_VISIBLE, WmEmptySeq, + SW_SHOWNORMAL, 0, {-32000,-32000}, {-1,-1}, FALSE }, +/* 39 */ { SW_SHOWNOACTIVATE, TRUE, WS_VISIBLE, WmEmptySeq, + SW_SHOWNORMAL, 0, {-32000,-32000}, {-1,-1}, FALSE }, +/* 40 */ { SW_MINIMIZE, TRUE, WS_VISIBLE|WS_MINIMIZE, WmMinimize_2, + SW_SHOWMINIMIZED, 0, {-32000,-32000}, {-1,-1}, FALSE }, +/* 41 */ { SW_MINIMIZE, TRUE, WS_VISIBLE|WS_MINIMIZE, WmMinMax_3, + SW_SHOWMINIMIZED, 0, {-32000,-32000}, {-1,-1}, FALSE }, +/* 42 */ { SW_SHOWMAXIMIZED, TRUE, WS_VISIBLE|WS_MAXIMIZE, WmShowMaximized_2, + SW_SHOWMAXIMIZED, WPF_RESTORETOMAXIMIZED, {-32000,-32000}, {-1,-1}, FALSE }, +/* 43 */ { SW_SHOWMAXIMIZED, TRUE, WS_VISIBLE|WS_MAXIMIZE, WmMinMax_2, + SW_SHOWMAXIMIZED, WPF_RESTORETOMAXIMIZED, {-32000,-32000}, {-1,-1}, FALSE }, +/* 44 */ { SW_MINIMIZE, TRUE, WS_VISIBLE|WS_MINIMIZE, WmMinimize_1, + SW_SHOWMINIMIZED, WPF_RESTORETOMAXIMIZED, {-32000,-32000}, {-1,-1}, FALSE }, +/* 45 */ { SW_MINIMIZE, TRUE, WS_VISIBLE|WS_MINIMIZE, WmMinMax_3, + SW_SHOWMINIMIZED, WPF_RESTORETOMAXIMIZED, {-32000,-32000}, {-1,-1}, FALSE }, +/* 46 */ { SW_RESTORE, TRUE, WS_VISIBLE|WS_MAXIMIZE, WmRestore_3, + SW_SHOWMAXIMIZED, WPF_RESTORETOMAXIMIZED, {-32000,-32000}, {-1,-1}, FALSE }, +/* 47 */ { SW_RESTORE, TRUE, WS_VISIBLE, WmRestore_4, + SW_SHOWNORMAL, WPF_RESTORETOMAXIMIZED, {-32000,-32000}, {-1,-1}, FALSE }, +/* 48 */ { SW_SHOWMAXIMIZED, TRUE, WS_VISIBLE|WS_MAXIMIZE, WmShowMaximized_3, + SW_SHOWMAXIMIZED, WPF_RESTORETOMAXIMIZED, {-32000,-32000}, {-1,-1}, FALSE }, +/* 49 */ { SW_SHOW, TRUE, WS_VISIBLE|WS_MAXIMIZE, WmEmptySeq, + SW_SHOWMAXIMIZED, WPF_RESTORETOMAXIMIZED, {-32000,-32000}, {-1,-1}, FALSE }, +/* 50 */ { SW_SHOWNORMAL, TRUE, WS_VISIBLE, WmRestore_5, + SW_SHOWNORMAL, WPF_RESTORETOMAXIMIZED, {-32000,-32000}, {-1,-1}, FALSE }, +/* 51 */ { SW_SHOWNORMAL, TRUE, WS_VISIBLE, WmRestore_5, + SW_SHOWNORMAL, WPF_RESTORETOMAXIMIZED, {-32000,-32000}, {-1,-1}, FALSE }, +/* 52 */ { SW_HIDE, TRUE, 0, WmHide_1, + SW_SHOWNORMAL, WPF_RESTORETOMAXIMIZED, {-32000,-32000}, {-1,-1}, FALSE }, +/* 53 */ { SW_HIDE, FALSE, 0, WmEmptySeq, + SW_SHOWNORMAL, WPF_RESTORETOMAXIMIZED, {-32000,-32000}, {-1,-1}, FALSE }, +/* 54 */ { SW_MINIMIZE, FALSE, WS_VISIBLE|WS_MINIMIZE, WmMinimize_3, + SW_SHOWMINIMIZED, 0, {-32000,-32000}, {-1,-1}, FALSE }, +/* 55 */ { SW_HIDE, TRUE, WS_MINIMIZE, WmHide_2, + SW_SHOWMINIMIZED, 0, {-32000,-32000}, {-1,-1}, FALSE }, +/* 56 */ { SW_SHOWNOACTIVATE, FALSE, WS_VISIBLE, WmShowNoActivate_2, + SW_SHOWNORMAL, 0, {-32000,-32000}, {-1,-1}, FALSE }, +/* 57 */ { SW_SHOW, TRUE, WS_VISIBLE, WmEmptySeq, + SW_SHOWNORMAL, 0, {-32000,-32000}, {-1,-1}, FALSE } }; HWND hwnd; DWORD style; LPARAM ret; INT i; + WINDOWPLACEMENT wp; + RECT win_rc, work_rc = {0, 0, 0, 0}; #define WS_BASE (WS_CAPTION|WS_SYSMENU|WS_MINIMIZEBOX|WS_MAXIMIZEBOX|WS_POPUP|WS_CLIPSIBLINGS) hwnd = CreateWindowEx(0, "ShowWindowClass", NULL, WS_BASE, @@ -10708,6 +10900,52 @@ flush_events(); flush_sequence(); + + if (pGetMonitorInfoA && pMonitorFromPoint) + { + HMONITOR hmon; + MONITORINFO mi; + POINT pt = {0, 0}; + + SetLastError(0xdeadbeef); + hmon = pMonitorFromPoint(pt, MONITOR_DEFAULTTOPRIMARY); + ok(hmon != 0, "MonitorFromPoint error %u\n", GetLastError()); + + mi.cbSize = sizeof(mi); + SetLastError(0xdeadbeef); + ret = pGetMonitorInfoA(hmon, &mi); + ok(ret, "GetMonitorInfo error %u\n", GetLastError()); + trace("monitor (%d,%d-%d,%d), work (%d,%d-%d,%d)\n", + mi.rcMonitor.left, mi.rcMonitor.top, mi.rcMonitor.right, mi.rcMonitor.bottom, + mi.rcWork.left, mi.rcWork.top, mi.rcWork.right, mi.rcWork.bottom); + work_rc = mi.rcWork; + } + + GetWindowRect(hwnd, &win_rc); + OffsetRect(&win_rc, -work_rc.left, -work_rc.top); + + wp.length = sizeof(wp); + SetLastError(0xdeadbeaf); + ret = GetWindowPlacement(hwnd, &wp); + ok(ret, "GetWindowPlacement error %u\n", GetLastError()); + ok(wp.flags == 0, "expected 0, got %#x\n", wp.flags); + ok(wp.showCmd == SW_SHOWNORMAL, "expected SW_SHOWNORMAL, got %d\n", wp.showCmd); + ok(wp.ptMinPosition.x == -1 && wp.ptMinPosition.y == -1, + "expected -1,-1 got %d,%d\n", wp.ptMinPosition.x, wp.ptMinPosition.y); + ok(wp.ptMaxPosition.x == -1 && wp.ptMaxPosition.y == -1, + "expected -1,-1 got %d,%d\n", wp.ptMaxPosition.x, wp.ptMaxPosition.y); + if (work_rc.left || work_rc.top) todo_wine /* FIXME: remove once Wine is fixed */ + ok(EqualRect(&win_rc, &wp.rcNormalPosition), + "expected %d,%d-%d,%d got %d,%d-%d,%d\n", + win_rc.left, win_rc.top, win_rc.right, win_rc.bottom, + wp.rcNormalPosition.left, wp.rcNormalPosition.top, + wp.rcNormalPosition.right, wp.rcNormalPosition.bottom); + else + ok(EqualRect(&win_rc, &wp.rcNormalPosition), + "expected %d,%d-%d,%d got %d,%d-%d,%d\n", + win_rc.left, win_rc.top, win_rc.right, win_rc.bottom, + wp.rcNormalPosition.left, wp.rcNormalPosition.top, + wp.rcNormalPosition.right, wp.rcNormalPosition.bottom); for (i = 0; i < sizeof(sw)/sizeof(sw[0]); i++) { @@ -10732,6 +10970,47 @@ sprintf(comment, "%d: ShowWindow(%s)", i+1, sw_cmd_name[idx]); ok_sequence(sw[i].msg, comment, sw[i].todo_msg); + + wp.length = sizeof(wp); + SetLastError(0xdeadbeaf); + ret = GetWindowPlacement(hwnd, &wp); + ok(ret, "GetWindowPlacement error %u\n", GetLastError()); + ok(wp.flags == sw[i].wp_flags, "expected %#x, got %#x\n", sw[i].wp_flags, wp.flags); + ok(wp.showCmd == sw[i].wp_cmd, "expected %d, got %d\n", sw[i].wp_cmd, wp.showCmd); + + /* NT moves the minimized window to -32000,-32000, win9x to 3000,3000 */ + if ((wp.ptMinPosition.x + work_rc.left == -32000 && wp.ptMinPosition.y + work_rc.top == -32000) || + (wp.ptMinPosition.x + work_rc.left == 3000 && wp.ptMinPosition.y + work_rc.top == 3000)) + { + ok((wp.ptMinPosition.x + work_rc.left == sw[i].wp_min.x && wp.ptMinPosition.y + work_rc.top == sw[i].wp_min.y) || + (wp.ptMinPosition.x + work_rc.left == 3000 && wp.ptMinPosition.y + work_rc.top == 3000), + "expected %d,%d got %d,%d\n", sw[i].wp_min.x, sw[i].wp_min.y, wp.ptMinPosition.x, wp.ptMinPosition.y); + } + else + { + if (wp.ptMinPosition.x != sw[i].wp_min.x || wp.ptMinPosition.y != sw[i].wp_min.y) + todo_wine + ok(wp.ptMinPosition.x == sw[i].wp_min.x && wp.ptMinPosition.y == sw[i].wp_min.y, + "expected %d,%d got %d,%d\n", sw[i].wp_min.x, sw[i].wp_min.y, wp.ptMinPosition.x, wp.ptMinPosition.y); + else + ok(wp.ptMinPosition.x == sw[i].wp_min.x && wp.ptMinPosition.y == sw[i].wp_min.y, + "expected %d,%d got %d,%d\n", sw[i].wp_min.x, sw[i].wp_min.y, wp.ptMinPosition.x, wp.ptMinPosition.y); + } + + if (wp.ptMaxPosition.x != sw[i].wp_max.x || wp.ptMaxPosition.y != sw[i].wp_max.y) + todo_wine + ok(wp.ptMaxPosition.x == sw[i].wp_max.x && wp.ptMaxPosition.y == sw[i].wp_max.y, + "expected %d,%d got %d,%d\n", sw[i].wp_max.x, sw[i].wp_max.y, wp.ptMaxPosition.x, wp.ptMaxPosition.y); + else + ok(wp.ptMaxPosition.x == sw[i].wp_max.x && wp.ptMaxPosition.y == sw[i].wp_max.y, + "expected %d,%d got %d,%d\n", sw[i].wp_max.x, sw[i].wp_max.y, wp.ptMaxPosition.x, wp.ptMaxPosition.y); + +if (0) /* FIXME: Wine behaves completely different here */ + ok(EqualRect(&win_rc, &wp.rcNormalPosition), + "expected %d,%d-%d,%d got %d,%d-%d,%d\n", + win_rc.left, win_rc.top, win_rc.right, win_rc.bottom, + wp.rcNormalPosition.left, wp.rcNormalPosition.top, + wp.rcNormalPosition.right, wp.rcNormalPosition.bottom); flush_events(); flush_sequence(); @@ -11419,6 +11698,7 @@ ok( !PeekMessageA( &msg, hwnd, 0, 0, PM_REMOVE ), "got message %x\n", msg.message ); DestroyWindow(hwnd); + DestroyWindow(hwnd2); } #define ID_LISTBOX 0x000f @@ -11746,6 +12026,33 @@ { 0 } }; +static const struct message wm_single_menu_item[] = +{ + { HCBT_KEYSKIPPED, hook|wparam|lparam|optional, VK_MENU, 0x20000001 }, + { WM_SYSKEYDOWN, sent|wparam|lparam, VK_MENU, 0x20000001 }, + { HCBT_KEYSKIPPED, hook|wparam|lparam|optional, 'Q', 0x20000001 }, + { WM_SYSKEYDOWN, sent|wparam|lparam, 'Q', 0x20000001 }, + { WM_SYSCHAR, sent|wparam|lparam, 'q', 0x20000001 }, + { HCBT_SYSCOMMAND, hook|wparam|lparam, SC_KEYMENU, 'q' }, + { WM_ENTERMENULOOP, sent|wparam|lparam, 0, 0 }, + { WM_INITMENU, sent|lparam, 0, 0 }, + { WM_MENUSELECT, sent|wparam|optional, MAKEWPARAM(300,MF_HILITE) }, + { WM_MENUSELECT, sent|wparam|lparam, MAKEWPARAM(0,0xffff), 0 }, + { WM_EXITMENULOOP, sent|wparam|lparam, 0, 0 }, + { WM_MENUCOMMAND, sent }, + { HCBT_KEYSKIPPED, hook|wparam|lparam|optional, 'Q', 0xe0000001 }, + { WM_SYSKEYUP, sent|wparam|lparam, 'Q', 0xe0000001 }, + { HCBT_KEYSKIPPED, hook|wparam|lparam|optional, VK_MENU, 0xc0000001 }, + { WM_KEYUP, sent|wparam|lparam, VK_MENU, 0xc0000001 }, + + { HCBT_KEYSKIPPED, hook|wparam|lparam|optional, VK_ESCAPE, 1 }, + { WM_KEYDOWN, sent|wparam|lparam, VK_ESCAPE, 1 }, + { WM_CHAR, sent|wparam|lparam, VK_ESCAPE, 0x00000001 }, + { HCBT_KEYSKIPPED, hook|wparam|lparam|optional, VK_ESCAPE, 0xc0000001 }, + { WM_KEYUP, sent|wparam|lparam, VK_ESCAPE, 0xc0000001 }, + { 0 } +}; + static LRESULT WINAPI parent_menu_proc(HWND hwnd, UINT message, WPARAM wp, LPARAM lp) { if (message == WM_ENTERIDLE || @@ -11903,6 +12210,21 @@ DispatchMessage(&msg); } ok_sequence(wm_popup_menu_2, "submenu of a popup menu command", FALSE); + + trace("testing single menu item command\n"); + flush_sequence(); + keybd_event(VK_MENU, 0, 0, 0); + keybd_event('Q', 0, 0, 0); + keybd_event('Q', 0, KEYEVENTF_KEYUP, 0); + keybd_event(VK_MENU, 0, KEYEVENTF_KEYUP, 0); + keybd_event(VK_ESCAPE, 0, 0, 0); + keybd_event(VK_ESCAPE, 0, KEYEVENTF_KEYUP, 0); + while (PeekMessage(&msg, 0, 0, 0, PM_REMOVE)) + { + TranslateMessage(&msg); + DispatchMessage(&msg); + } + ok_sequence(wm_single_menu_item, "single menu item command", FALSE); set_menu_style(hmenu, 0); style = get_menu_style(hmenu); @@ -12501,11 +12823,611 @@ CloseHandle( thread ); } +static const struct message WmSetParentSeq_1[] = { + { WM_SHOWWINDOW, sent|wparam, 0 }, + { EVENT_OBJECT_PARENTCHANGE, winevent_hook|wparam|lparam, 0, 0 }, + { WM_WINDOWPOSCHANGING, sent|wparam, SWP_NOSIZE }, + { WM_CHILDACTIVATE, sent }, + { WM_WINDOWPOSCHANGED, sent|wparam, SWP_NOSIZE|SWP_NOREDRAW|SWP_NOCLIENTSIZE }, + { WM_MOVE, sent|defwinproc|wparam, 0 }, + { EVENT_OBJECT_LOCATIONCHANGE, winevent_hook|wparam|lparam, 0, 0 }, + { WM_SHOWWINDOW, sent|wparam, 1 }, + { 0 } +}; + +static const struct message WmSetParentSeq_2[] = { + { WM_SHOWWINDOW, sent|wparam, 0 }, + { WM_WINDOWPOSCHANGING, sent|wparam, SWP_HIDEWINDOW|SWP_NOSIZE|SWP_NOMOVE }, + { EVENT_OBJECT_HIDE, winevent_hook|wparam|lparam, 0, 0 }, + { WM_WINDOWPOSCHANGED, sent|wparam, SWP_HIDEWINDOW|SWP_NOSIZE|SWP_NOMOVE|SWP_NOCLIENTSIZE|SWP_NOCLIENTMOVE }, + { HCBT_SETFOCUS, hook|optional }, + { WM_NCACTIVATE, sent|wparam|optional, 0 }, + { WM_ACTIVATE, sent|wparam|optional, 0 }, + { WM_ACTIVATEAPP, sent|wparam|optional, 0 }, + { WM_KILLFOCUS, sent|wparam, 0 }, + { EVENT_OBJECT_PARENTCHANGE, winevent_hook|wparam|lparam, 0, 0 }, + { WM_WINDOWPOSCHANGING, sent|wparam, SWP_NOSIZE }, + { HCBT_ACTIVATE, hook|optional }, + { EVENT_SYSTEM_FOREGROUND, winevent_hook|wparam|lparam, 0, 0 }, + { WM_WINDOWPOSCHANGING, sent|wparam|optional, SWP_NOSIZE|SWP_NOMOVE }, + { WM_NCACTIVATE, sent|wparam|optional, 1 }, + { WM_ACTIVATE, sent|wparam|optional, 1 }, + { HCBT_SETFOCUS, hook|optional }, + { EVENT_OBJECT_FOCUS, winevent_hook|wparam|lparam, OBJID_CLIENT, 0 }, + { WM_SETFOCUS, sent|optional|defwinproc }, + { WM_WINDOWPOSCHANGED, sent|wparam, SWP_NOREDRAW|SWP_NOSIZE|SWP_NOCLIENTSIZE }, + { WM_MOVE, sent|defwinproc|wparam, 0 }, + { EVENT_OBJECT_LOCATIONCHANGE, winevent_hook|wparam|lparam, 0, 0 }, + { WM_SHOWWINDOW, sent|wparam, 1 }, + { WM_WINDOWPOSCHANGING, sent|wparam, SWP_SHOWWINDOW|SWP_NOSIZE|SWP_NOMOVE }, + { EVENT_OBJECT_SHOW, winevent_hook|wparam|lparam, 0, 0 }, + { WM_WINDOWPOSCHANGED, sent|wparam, SWP_SHOWWINDOW|SWP_NOSIZE|SWP_NOMOVE|SWP_NOCLIENTSIZE|SWP_NOCLIENTMOVE }, + { 0 } +}; + + +static void test_SetParent(void) +{ + HWND parent1, parent2, child, popup; + RECT rc, rc_old; + + parent1 = CreateWindowEx(0, "TestParentClass", NULL, WS_OVERLAPPEDWINDOW, + 100, 100, 200, 200, 0, 0, 0, NULL); + ok(parent1 != 0, "Failed to create parent1 window\n"); + + parent2 = CreateWindowEx(0, "TestParentClass", NULL, WS_OVERLAPPEDWINDOW, + 400, 100, 200, 200, 0, 0, 0, NULL); + ok(parent2 != 0, "Failed to create parent2 window\n"); + + /* WS_CHILD window */ + child = CreateWindowEx(0, "TestWindowClass", NULL, WS_CHILD | WS_VISIBLE, + 10, 10, 150, 150, parent1, 0, 0, NULL); + ok(child != 0, "Failed to create child window\n"); + + GetWindowRect(parent1, &rc); + trace("parent1 (%d,%d)-(%d,%d)\n", rc.left, rc.top, rc.right, rc.bottom); + GetWindowRect(child, &rc_old); + MapWindowPoints(0, parent1, (POINT *)&rc_old, 2); + trace("child (%d,%d)-(%d,%d)\n", rc_old.left, rc_old.top, rc_old.right, rc_old.bottom); + + flush_sequence(); + + SetParent(child, parent2); + flush_events(); + ok_sequence(WmSetParentSeq_1, "SetParent() visible WS_CHILD", TRUE); + + ok(GetWindowLongA(child, GWL_STYLE) & WS_VISIBLE, "WS_VISIBLE should be set\n"); + ok(!IsWindowVisible(child), "IsWindowVisible() should return FALSE\n"); + + GetWindowRect(parent2, &rc); + trace("parent2 (%d,%d)-(%d,%d)\n", rc.left, rc.top, rc.right, rc.bottom); + GetWindowRect(child, &rc); + MapWindowPoints(0, parent2, (POINT *)&rc, 2); + trace("child (%d,%d)-(%d,%d)\n", rc.left, rc.top, rc.right, rc.bottom); + + ok(EqualRect(&rc_old, &rc), "rects do not match (%d,%d-%d,%d) / (%d,%d-%d,%d)\n", + rc_old.left, rc_old.top, rc_old.right, rc_old.bottom, + rc.left, rc.top, rc.right, rc.bottom ); + + /* WS_POPUP window */ + popup = CreateWindowEx(0, "TestWindowClass", NULL, WS_POPUP | WS_VISIBLE, + 20, 20, 100, 100, 0, 0, 0, NULL); + ok(popup != 0, "Failed to create popup window\n"); + + GetWindowRect(popup, &rc_old); + trace("popup (%d,%d)-(%d,%d)\n", rc_old.left, rc_old.top, rc_old.right, rc_old.bottom); + + flush_sequence(); + + SetParent(popup, child); + flush_events(); + ok_sequence(WmSetParentSeq_2, "SetParent() visible WS_POPUP", TRUE); + + ok(GetWindowLongA(popup, GWL_STYLE) & WS_VISIBLE, "WS_VISIBLE should be set\n"); + ok(!IsWindowVisible(popup), "IsWindowVisible() should return FALSE\n"); + + GetWindowRect(child, &rc); + trace("parent2 (%d,%d)-(%d,%d)\n", rc.left, rc.top, rc.right, rc.bottom); + GetWindowRect(popup, &rc); + MapWindowPoints(0, child, (POINT *)&rc, 2); + trace("popup (%d,%d)-(%d,%d)\n", rc.left, rc.top, rc.right, rc.bottom); + + ok(EqualRect(&rc_old, &rc), "rects do not match (%d,%d-%d,%d) / (%d,%d-%d,%d)\n", + rc_old.left, rc_old.top, rc_old.right, rc_old.bottom, + rc.left, rc.top, rc.right, rc.bottom ); + + DestroyWindow(popup); + DestroyWindow(child); + DestroyWindow(parent1); + DestroyWindow(parent2); + + flush_sequence(); +} + +static const struct message WmKeyReleaseOnly[] = { + { HCBT_KEYSKIPPED, hook|wparam|lparam|optional, 0x41, 0x80000001 }, + { WM_KEYUP, sent|wparam|lparam, 0x41, 0x80000001 }, + { 0 } +}; +static const struct message WmKeyPressNormal[] = { + { HCBT_KEYSKIPPED, hook|wparam|lparam|optional, 0x41, 0x1 }, + { WM_KEYDOWN, sent|wparam|lparam, 0x41, 0x1 }, + { 0 } +}; +static const struct message WmKeyPressRepeat[] = { + { HCBT_KEYSKIPPED, hook|wparam|lparam|optional, 0x41, 0x40000001 }, + { WM_KEYDOWN, sent|wparam|lparam, 0x41, 0x40000001 }, + { 0 } +}; +static const struct message WmKeyReleaseNormal[] = { + { HCBT_KEYSKIPPED, hook|wparam|lparam|optional, 0x41, 0xc0000001 }, + { WM_KEYUP, sent|wparam|lparam, 0x41, 0xc0000001 }, + { 0 } +}; + +static void test_keyflags(void) +{ + HWND test_window; + SHORT key_state; + BYTE keyboard_state[256]; + MSG msg; + + test_window = CreateWindowEx(0, "TestWindowClass", NULL, WS_OVERLAPPEDWINDOW | WS_VISIBLE, + 100, 100, 200, 200, 0, 0, 0, NULL); + + flush_sequence(); + + /* keyup without a keydown */ + keybd_event(0x41, 0, KEYEVENTF_KEYUP, 0); + while (PeekMessage(&msg, NULL, WM_KEYFIRST, WM_KEYLAST, PM_REMOVE)) + DispatchMessage(&msg); + ok_sequence(WmKeyReleaseOnly, "key release only", TRUE); + + key_state = GetAsyncKeyState(0x41); + ok((key_state & 0x8000) == 0, "unexpected key state %x\n", key_state); + + key_state = GetKeyState(0x41); + ok((key_state & 0x8000) == 0, "unexpected key state %x\n", key_state); + + /* keydown */ + keybd_event(0x41, 0, 0, 0); + while (PeekMessage(&msg, NULL, WM_KEYFIRST, WM_KEYLAST, PM_REMOVE)) + DispatchMessage(&msg); + ok_sequence(WmKeyPressNormal, "key press only", FALSE); + + key_state = GetAsyncKeyState(0x41); + ok((key_state & 0x8000) == 0x8000, "unexpected key state %x\n", key_state); + + key_state = GetKeyState(0x41); + ok((key_state & 0x8000) == 0x8000, "unexpected key state %x\n", key_state); + + /* keydown repeat */ + keybd_event(0x41, 0, 0, 0); + while (PeekMessage(&msg, NULL, WM_KEYFIRST, WM_KEYLAST, PM_REMOVE)) + DispatchMessage(&msg); + ok_sequence(WmKeyPressRepeat, "key press repeat", FALSE); + + key_state = GetAsyncKeyState(0x41); + ok((key_state & 0x8000) == 0x8000, "unexpected key state %x\n", key_state); + + key_state = GetKeyState(0x41); + ok((key_state & 0x8000) == 0x8000, "unexpected key state %x\n", key_state); + + /* keyup */ + keybd_event(0x41, 0, KEYEVENTF_KEYUP, 0); + while (PeekMessage(&msg, NULL, WM_KEYFIRST, WM_KEYLAST, PM_REMOVE)) + DispatchMessage(&msg); + ok_sequence(WmKeyReleaseNormal, "key release repeat", FALSE); + + key_state = GetAsyncKeyState(0x41); + ok((key_state & 0x8000) == 0, "unexpected key state %x\n", key_state); + + key_state = GetKeyState(0x41); + ok((key_state & 0x8000) == 0, "unexpected key state %x\n", key_state); + + /* set the key state in this thread */ + GetKeyboardState(keyboard_state); + keyboard_state[0x41] = 0x80; + SetKeyboardState(keyboard_state); + + key_state = GetAsyncKeyState(0x41); + ok((key_state & 0x8000) == 0, "unexpected key state %x\n", key_state); + + /* keydown */ + keybd_event(0x41, 0, 0, 0); + while (PeekMessage(&msg, NULL, WM_KEYFIRST, WM_KEYLAST, PM_REMOVE)) + DispatchMessage(&msg); + ok_sequence(WmKeyPressRepeat, "key press after setkeyboardstate", TRUE); + + key_state = GetAsyncKeyState(0x41); + ok((key_state & 0x8000) == 0x8000, "unexpected key state %x\n", key_state); + + key_state = GetKeyState(0x41); + ok((key_state & 0x8000) == 0x8000, "unexpected key state %x\n", key_state); + + /* clear the key state in this thread */ + GetKeyboardState(keyboard_state); + keyboard_state[0x41] = 0; + SetKeyboardState(keyboard_state); + + key_state = GetAsyncKeyState(0x41); + ok((key_state & 0x8000) == 0x8000, "unexpected key state %x\n", key_state); + + /* keyup */ + keybd_event(0x41, 0, KEYEVENTF_KEYUP, 0); + while (PeekMessage(&msg, NULL, WM_KEYFIRST, WM_KEYLAST, PM_REMOVE)) + DispatchMessage(&msg); + ok_sequence(WmKeyReleaseOnly, "key release after setkeyboardstate", TRUE); + + key_state = GetAsyncKeyState(0x41); + ok((key_state & 0x8000) == 0, "unexpected key state %x\n", key_state); + + key_state = GetKeyState(0x41); + ok((key_state & 0x8000) == 0, "unexpected key state %x\n", key_state); + + DestroyWindow(test_window); + flush_sequence(); +} + +static const struct message WmHotkeyPressLWIN[] = { + { WM_KEYDOWN, kbd_hook|wparam|lparam, VK_LWIN, LLKHF_INJECTED }, + { HCBT_KEYSKIPPED, hook|wparam|lparam|optional, VK_LWIN, 1 }, + { WM_KEYDOWN, sent|wparam|lparam, VK_LWIN, 1 }, + { 0 } +}; +static const struct message WmHotkeyPress[] = { + { WM_KEYDOWN, kbd_hook|lparam, 0, LLKHF_INJECTED }, + { WM_HOTKEY, sent|wparam, 5 }, + { 0 } +}; +static const struct message WmHotkeyRelease[] = { + { WM_KEYUP, kbd_hook|lparam, 0, LLKHF_INJECTED|LLKHF_UP }, + { HCBT_KEYSKIPPED, hook|lparam|optional, 0, 0x80000001 }, + { WM_KEYUP, sent|lparam, 0, 0x80000001 }, + { 0 } +}; +static const struct message WmHotkeyReleaseLWIN[] = { + { WM_KEYUP, kbd_hook|wparam|lparam, VK_LWIN, LLKHF_INJECTED|LLKHF_UP }, + { HCBT_KEYSKIPPED, hook|wparam|lparam|optional, VK_LWIN, 0xc0000001 }, + { WM_KEYUP, sent|wparam|lparam, VK_LWIN, 0xc0000001 }, + { 0 } +}; +static const struct message WmHotkeyCombined[] = { + { WM_KEYDOWN, kbd_hook|wparam|lparam, VK_LWIN, LLKHF_INJECTED }, + { WM_KEYDOWN, kbd_hook|lparam, 0, LLKHF_INJECTED }, + { WM_KEYUP, kbd_hook|lparam, 0, LLKHF_INJECTED|LLKHF_UP }, + { WM_KEYUP, kbd_hook|wparam|lparam, VK_LWIN, LLKHF_INJECTED|LLKHF_UP }, + { WM_APP, sent, 0, 0 }, + { WM_HOTKEY, sent|wparam, 5 }, + { WM_APP+1, sent, 0, 0 }, + { HCBT_KEYSKIPPED, hook|wparam|lparam|optional, VK_LWIN, 1 }, + { WM_KEYDOWN, sent|wparam|lparam, VK_LWIN, 1 }, + { HCBT_KEYSKIPPED, hook|optional, 0, 0x80000001 }, + { WM_KEYUP, sent, 0, 0x80000001 }, /* lparam not checked so the sequence isn't a todo */ + { HCBT_KEYSKIPPED, hook|wparam|lparam|optional, VK_LWIN, 0xc0000001 }, + { WM_KEYUP, sent|wparam|lparam, VK_LWIN, 0xc0000001 }, + { 0 } +}; +static const struct message WmHotkeyPrevious[] = { + { WM_KEYDOWN, kbd_hook|wparam|lparam, VK_LWIN, LLKHF_INJECTED }, + { WM_KEYDOWN, kbd_hook|lparam, 0, LLKHF_INJECTED }, + { WM_KEYUP, kbd_hook|lparam, 0, LLKHF_INJECTED|LLKHF_UP }, + { WM_KEYUP, kbd_hook|wparam|lparam, VK_LWIN, LLKHF_INJECTED|LLKHF_UP }, + { HCBT_KEYSKIPPED, hook|wparam|lparam|optional, VK_LWIN, 1 }, + { WM_KEYDOWN, sent|wparam|lparam, VK_LWIN, 1 }, + { HCBT_KEYSKIPPED, hook|lparam|optional, 0, 1 }, + { WM_KEYDOWN, sent|lparam, 0, 1 }, + { HCBT_KEYSKIPPED, hook|optional|lparam, 0, 0xc0000001 }, + { WM_KEYUP, sent|lparam, 0, 0xc0000001 }, + { HCBT_KEYSKIPPED, hook|wparam|lparam|optional, VK_LWIN, 0xc0000001 }, + { WM_KEYUP, sent|wparam|lparam, VK_LWIN, 0xc0000001 }, + { 0 } +}; +static const struct message WmHotkeyNew[] = { + { WM_KEYDOWN, kbd_hook|lparam, 0, LLKHF_INJECTED }, + { WM_KEYUP, kbd_hook|lparam, 0, LLKHF_INJECTED|LLKHF_UP }, + { WM_HOTKEY, sent|wparam, 5 }, + { HCBT_KEYSKIPPED, hook|optional, 0, 0x80000001 }, + { WM_KEYUP, sent, 0, 0x80000001 }, /* lparam not checked so the sequence isn't a todo */ + { 0 } +}; + +static int hotkey_letter; + +static LRESULT CALLBACK KeyboardHookProc(int nCode, WPARAM wParam, LPARAM lParam) +{ + struct recvd_message msg; + + if (nCode == HC_ACTION) + { + KBDLLHOOKSTRUCT *kdbhookstruct = (KBDLLHOOKSTRUCT*)lParam; + + msg.hwnd = 0; + msg.message = wParam; + msg.flags = kbd_hook|wparam|lparam; + msg.wParam = kdbhookstruct->vkCode; + msg.lParam = kdbhookstruct->flags; + msg.descr = "KeyboardHookProc"; + add_message(&msg); + + if (wParam == WM_KEYUP || wParam == WM_KEYDOWN) + { + ok(kdbhookstruct->vkCode == VK_LWIN || kdbhookstruct->vkCode == hotkey_letter, + "unexpected keycode %x\n", kdbhookstruct->vkCode); + } + } + + return CallNextHookEx(hKBD_hook, nCode, wParam, lParam); +} + +static void test_hotkey(void) +{ + HWND test_window, taskbar_window; + BOOL ret; + MSG msg; + DWORD queue_status; + SHORT key_state; + + SetLastError(0xdeadbeef); + ret = UnregisterHotKey(NULL, 0); + ok(ret == FALSE, "expected FALSE, got %i\n", ret); + ok(GetLastError() == ERROR_HOTKEY_NOT_REGISTERED || broken(GetLastError() == 0xdeadbeef), + "unexpected error %d\n", GetLastError()); + + if (ret == TRUE) + { + skip("hotkeys not supported\n"); + return; + } + + test_window = CreateWindowEx(0, "HotkeyWindowClass", NULL, WS_OVERLAPPEDWINDOW | WS_VISIBLE, + 100, 100, 200, 200, 0, 0, 0, NULL); + + flush_sequence(); + + SetLastError(0xdeadbeef); + ret = UnregisterHotKey(test_window, 0); + ok(ret == FALSE, "expected FALSE, got %i\n", ret); + ok(GetLastError() == ERROR_HOTKEY_NOT_REGISTERED || broken(GetLastError() == 0xdeadbeef), + "unexpected error %d\n", GetLastError()); + + /* Search for a Windows Key + letter combination that hasn't been registered */ + for (hotkey_letter = 0x41; hotkey_letter <= 0x51; hotkey_letter ++) + { + SetLastError(0xdeadbeef); + ret = RegisterHotKey(test_window, 5, MOD_WIN, hotkey_letter); + + if (ret == TRUE) + { + break; + } + else + { + ok(GetLastError() == ERROR_HOTKEY_ALREADY_REGISTERED || broken(GetLastError() == 0xdeadbeef), + "unexpected error %d\n", GetLastError()); + } + } + + if (hotkey_letter == 0x52) + { + ok(0, "Couldn't find any free Windows Key + letter combination\n"); + goto end; + } + + hKBD_hook = SetWindowsHookEx(WH_KEYBOARD_LL, KeyboardHookProc, GetModuleHandle(NULL), 0); + if (!hKBD_hook) win_skip("WH_KEYBOARD_LL is not supported\n"); + + /* Same key combination, different id */ + SetLastError(0xdeadbeef); + ret = RegisterHotKey(test_window, 4, MOD_WIN, hotkey_letter); + ok(ret == FALSE, "expected FALSE, got %i\n", ret); + ok(GetLastError() == ERROR_HOTKEY_ALREADY_REGISTERED || broken(GetLastError() == 0xdeadbeef), + "unexpected error %d\n", GetLastError()); + + /* Same key combination, different window */ + SetLastError(0xdeadbeef); + ret = RegisterHotKey(NULL, 5, MOD_WIN, hotkey_letter); + ok(ret == FALSE, "expected FALSE, got %i\n", ret); + ok(GetLastError() == ERROR_HOTKEY_ALREADY_REGISTERED || broken(GetLastError() == 0xdeadbeef), + "unexpected error %d\n", GetLastError()); + + /* Register the same hotkey twice */ + SetLastError(0xdeadbeef); + ret = RegisterHotKey(test_window, 5, MOD_WIN, hotkey_letter); + ok(ret == FALSE, "expected FALSE, got %i\n", ret); + ok(GetLastError() == ERROR_HOTKEY_ALREADY_REGISTERED || broken(GetLastError() == 0xdeadbeef), + "unexpected error %d\n", GetLastError()); + + /* Window on another thread */ + taskbar_window = FindWindowA("Shell_TrayWnd", NULL); + if (!taskbar_window) + { + skip("no taskbar?\n"); + } + else + { + SetLastError(0xdeadbeef); + ret = RegisterHotKey(taskbar_window, 5, 0, hotkey_letter); + ok(ret == FALSE, "expected FALSE, got %i\n", ret); + ok(GetLastError() == ERROR_WINDOW_OF_OTHER_THREAD || broken(GetLastError() == 0xdeadbeef), + "unexpected error %d\n", GetLastError()); + } + + /* Inject the appropriate key sequence */ + keybd_event(VK_LWIN, 0, 0, 0); + while (PeekMessage(&msg, NULL, 0, 0, PM_REMOVE)) + DispatchMessage(&msg); + ok_sequence(WmHotkeyPressLWIN, "window hotkey press LWIN", FALSE); + + keybd_event(hotkey_letter, 0, 0, 0); + queue_status = GetQueueStatus(QS_HOTKEY); + ok((queue_status & (QS_HOTKEY << 16)) == QS_HOTKEY << 16, "expected QS_HOTKEY << 16 set, got %x\n", queue_status); + while (PeekMessage(&msg, NULL, 0, 0, PM_REMOVE)) + { + if (msg.message == WM_HOTKEY) + { + ok(msg.hwnd == test_window, "unexpected hwnd %p\n", msg.hwnd); + ok(msg.lParam == MAKELPARAM(MOD_WIN, hotkey_letter), "unexpected WM_HOTKEY lparam %lx\n", msg.lParam); + } + DispatchMessage(&msg); + } + ok_sequence(WmHotkeyPress, "window hotkey press", FALSE); + + queue_status = GetQueueStatus(QS_HOTKEY); + ok((queue_status & (QS_HOTKEY << 16)) == 0, "expected QS_HOTKEY << 16 cleared, got %x\n", queue_status); + + key_state = GetAsyncKeyState(hotkey_letter); + ok((key_state & 0x8000) == 0x8000, "unexpected key state %x\n", key_state); + + keybd_event(hotkey_letter, 0, KEYEVENTF_KEYUP, 0); + while (PeekMessage(&msg, NULL, 0, 0, PM_REMOVE)) + DispatchMessage(&msg); + ok_sequence(WmHotkeyRelease, "window hotkey release", TRUE); + + keybd_event(VK_LWIN, 0, KEYEVENTF_KEYUP, 0); + while (PeekMessage(&msg, NULL, 0, 0, PM_REMOVE)) + DispatchMessage(&msg); + ok_sequence(WmHotkeyReleaseLWIN, "window hotkey release LWIN", FALSE); + + /* normal posted WM_HOTKEY messages set QS_HOTKEY */ + PostMessage(test_window, WM_HOTKEY, 0, 0); + queue_status = GetQueueStatus(QS_HOTKEY); + ok((queue_status & (QS_HOTKEY << 16)) == QS_HOTKEY << 16, "expected QS_HOTKEY << 16 set, got %x\n", queue_status); + queue_status = GetQueueStatus(QS_POSTMESSAGE); + ok((queue_status & (QS_POSTMESSAGE << 16)) == QS_POSTMESSAGE << 16, "expected QS_POSTMESSAGE << 16 set, got %x\n", queue_status); + while (PeekMessage(&msg, NULL, 0, 0, PM_REMOVE)) + DispatchMessage(&msg); + flush_sequence(); + + /* Send and process all messages at once */ + PostMessage(test_window, WM_APP, 0, 0); + keybd_event(VK_LWIN, 0, 0, 0); + keybd_event(hotkey_letter, 0, 0, 0); + keybd_event(hotkey_letter, 0, KEYEVENTF_KEYUP, 0); + keybd_event(VK_LWIN, 0, KEYEVENTF_KEYUP, 0); + + while (PeekMessage(&msg, NULL, 0, 0, PM_REMOVE)) + { + if (msg.message == WM_HOTKEY) + { + ok(msg.hwnd == test_window, "unexpected hwnd %p\n", msg.hwnd); + ok(msg.lParam == MAKELPARAM(MOD_WIN, hotkey_letter), "unexpected WM_HOTKEY lparam %lx\n", msg.lParam); + } + DispatchMessage(&msg); + } + ok_sequence(WmHotkeyCombined, "window hotkey combined", FALSE); + + /* Register same hwnd/id with different key combination */ + ret = RegisterHotKey(test_window, 5, 0, hotkey_letter); + ok(ret == TRUE, "expected TRUE, got %i, err=%d\n", ret, GetLastError()); + + /* Previous key combination does not work */ + keybd_event(VK_LWIN, 0, 0, 0); + keybd_event(hotkey_letter, 0, 0, 0); + keybd_event(hotkey_letter, 0, KEYEVENTF_KEYUP, 0); + keybd_event(VK_LWIN, 0, KEYEVENTF_KEYUP, 0); + + while (PeekMessage(&msg, NULL, 0, 0, PM_REMOVE)) + DispatchMessage(&msg); + ok_sequence(WmHotkeyPrevious, "window hotkey previous", FALSE); + + /* New key combination works */ + keybd_event(hotkey_letter, 0, 0, 0); + keybd_event(hotkey_letter, 0, KEYEVENTF_KEYUP, 0); + + while (PeekMessage(&msg, NULL, 0, 0, PM_REMOVE)) + { + if (msg.message == WM_HOTKEY) + { + ok(msg.hwnd == test_window, "unexpected hwnd %p\n", msg.hwnd); + ok(msg.lParam == MAKELPARAM(0, hotkey_letter), "unexpected WM_HOTKEY lparam %lx\n", msg.lParam); + } + DispatchMessage(&msg); + } + ok_sequence(WmHotkeyNew, "window hotkey new", FALSE); + + /* Unregister hotkey properly */ + ret = UnregisterHotKey(test_window, 5); + ok(ret == TRUE, "expected TRUE, got %i, err=%d\n", ret, GetLastError()); + + /* Unregister hotkey again */ + SetLastError(0xdeadbeef); + ret = UnregisterHotKey(test_window, 5); + ok(ret == FALSE, "expected FALSE, got %i\n", ret); + ok(GetLastError() == ERROR_HOTKEY_NOT_REGISTERED || broken(GetLastError() == 0xdeadbeef), + "unexpected error %d\n", GetLastError()); + + /* Register thread hotkey */ + ret = RegisterHotKey(NULL, 5, MOD_WIN, hotkey_letter); + ok(ret == TRUE, "expected TRUE, got %i, err=%d\n", ret, GetLastError()); + + /* Inject the appropriate key sequence */ + keybd_event(VK_LWIN, 0, 0, 0); + while (PeekMessage(&msg, NULL, 0, 0, PM_REMOVE)) + { + ok(msg.hwnd != NULL, "unexpected thread message %x\n", msg.message); + DispatchMessage(&msg); + } + ok_sequence(WmHotkeyPressLWIN, "thread hotkey press LWIN", FALSE); + + keybd_event(hotkey_letter, 0, 0, 0); + while (PeekMessage(&msg, NULL, 0, 0, PM_REMOVE)) + { + if (msg.message == WM_HOTKEY) + { + struct recvd_message message; + ok(msg.hwnd == NULL, "unexpected hwnd %p\n", msg.hwnd); + ok(msg.lParam == MAKELPARAM(MOD_WIN, hotkey_letter), "unexpected WM_HOTKEY lparam %lx\n", msg.lParam); + message.message = msg.message; + message.flags = sent|wparam|lparam; + message.wParam = msg.wParam; + message.lParam = msg.lParam; + message.descr = "test_hotkey thread message"; + add_message(&message); + } + else + ok(msg.hwnd != NULL, "unexpected thread message %x\n", msg.message); + DispatchMessage(&msg); + } + ok_sequence(WmHotkeyPress, "thread hotkey press", FALSE); + + keybd_event(hotkey_letter, 0, KEYEVENTF_KEYUP, 0); + while (PeekMessage(&msg, NULL, 0, 0, PM_REMOVE)) + { + ok(msg.hwnd != NULL, "unexpected thread message %x\n", msg.message); + DispatchMessage(&msg); + } + ok_sequence(WmHotkeyRelease, "thread hotkey release", TRUE); + + keybd_event(VK_LWIN, 0, KEYEVENTF_KEYUP, 0); + while (PeekMessage(&msg, NULL, 0, 0, PM_REMOVE)) + { + ok(msg.hwnd != NULL, "unexpected thread message %x\n", msg.message); + DispatchMessage(&msg); + } + ok_sequence(WmHotkeyReleaseLWIN, "thread hotkey release LWIN", FALSE); + + /* Unregister thread hotkey */ + ret = UnregisterHotKey(NULL, 5); + ok(ret == TRUE, "expected TRUE, got %i, err=%d\n", ret, GetLastError()); + + if (hKBD_hook) UnhookWindowsHookEx(hKBD_hook); + hKBD_hook = NULL; + +end: + UnregisterHotKey(NULL, 5); + UnregisterHotKey(test_window, 5); + DestroyWindow(test_window); + flush_sequence(); +} + START_TEST(msg) { char **test_argv; BOOL ret; BOOL (WINAPI *pIsWinEventHookInstalled)(DWORD)= 0;/*GetProcAddress(user32, "IsWinEventHookInstalled");*/ + HMODULE hModuleImm32; + BOOL (WINAPI *pImmDisableIME)(DWORD); int argc = winetest_get_mainargs( &test_argv ); if (argc >= 3) @@ -12518,6 +13440,15 @@ } init_procs(); + + hModuleImm32 = LoadLibrary("imm32.dll"); + if (hModuleImm32) { + pImmDisableIME = (void *)GetProcAddress(hModuleImm32, "ImmDisableIME"); + if (pImmDisableIME) + pImmDisableIME(0); + } + pImmDisableIME = NULL; + FreeLibrary(hModuleImm32); if (!RegisterWindowClasses()) assert(0); @@ -12553,6 +13484,7 @@ hEvent_hook = 0; #endif + test_SetParent(); test_PostMessage(); test_ShowWindow(); test_PeekMessage(); @@ -12597,6 +13529,8 @@ test_paintingloop(); test_defwinproc(); test_clipboard_viewers(); + test_keyflags(); + test_hotkey(); /* keep it the last test, under Windows it tends to break the tests * which rely on active/foreground windows being correct. */
13 years, 4 months
1
0
0
0
[jimtabor] 53385: [Win32k] - Implement FlashWindowEx without the state verification test via global atom and window properties list. Pass all but two in win:test_FlashWindowEx. - Add missing atom's...
by jimtabor@svn.reactos.org
Author: jimtabor Date: Mon Aug 22 19:58:32 2011 New Revision: 53385 URL:
http://svn.reactos.org/svn/reactos?rev=53385&view=rev
Log: [Win32k] - Implement FlashWindowEx without the state verification test via global atom and window properties list. Pass all but two in win:test_FlashWindowEx. - Add missing atom's and global thread information pointer, based on patch from bug 5655. Modified: trunk/reactos/subsystems/win32/win32k/include/ntuser.h trunk/reactos/subsystems/win32/win32k/ntuser/ntstubs.c trunk/reactos/subsystems/win32/win32k/ntuser/ntuser.c Modified: trunk/reactos/subsystems/win32/win32k/include/ntuser.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/in…
============================================================================== --- trunk/reactos/subsystems/win32/win32k/include/ntuser.h [iso-8859-1] (original) +++ trunk/reactos/subsystems/win32/win32k/include/ntuser.h [iso-8859-1] Mon Aug 22 19:58:32 2011 @@ -10,6 +10,7 @@ #define UserLeaveCo UserLeave extern PSERVERINFO gpsi; +extern PTHREADINFO gptiCurrent; INIT_FUNCTION NTSTATUS NTAPI InitUserImpl(VOID); VOID FASTCALL CleanupUserImpl(VOID); Modified: trunk/reactos/subsystems/win32/win32k/ntuser/ntstubs.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/nt…
============================================================================== --- trunk/reactos/subsystems/win32/win32k/ntuser/ntstubs.c [iso-8859-1] (original) +++ trunk/reactos/subsystems/win32/win32k/ntuser/ntstubs.c [iso-8859-1] Mon Aug 22 19:58:32 2011 @@ -1157,14 +1157,45 @@ } /* - * @unimplemented + * @implemented */ BOOL APIENTRY NtUserFlashWindowEx(IN PFLASHWINFO pfwi) { - STUB - - return 1; + PWND pWnd; + FLASHWINFO finfo = {0}; + BOOL Ret = TRUE; + + UserEnterExclusive(); + + _SEH2_TRY + { + ProbeForRead(pfwi, sizeof(FLASHWINFO), sizeof(ULONG)); + RtlCopyMemory(&finfo, pfwi, sizeof(FLASHWINFO)); + } + _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER) + { + SetLastNtError(_SEH2_GetExceptionCode()); + Ret = FALSE; + } + _SEH2_END + + if (!Ret) goto Exit; + + if (!(pWnd = (PWND)UserGetObject(gHandleTable, finfo.hwnd, otWindow)) || + finfo.cbSize != sizeof(FLASHWINFO) || + finfo.dwFlags & ~(FLASHW_ALL|FLASHW_TIMER|FLASHW_TIMERNOFG) ) + { + EngSetLastError(ERROR_INVALID_PARAMETER); + Ret = FALSE; + goto Exit; + } + + //Ret = IntFlashWindowEx(pWnd, &finfo); + +Exit: + UserLeave(); + return Ret; } /* Modified: trunk/reactos/subsystems/win32/win32k/ntuser/ntuser.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/nt…
============================================================================== --- trunk/reactos/subsystems/win32/win32k/ntuser/ntuser.c [iso-8859-1] (original) +++ trunk/reactos/subsystems/win32/win32k/ntuser/ntuser.c [iso-8859-1] Mon Aug 22 19:58:32 2011 @@ -17,9 +17,12 @@ /* GLOBALS *******************************************************************/ +PTHREADINFO gptiCurrent = NULL; ERESOURCE UserLock; ATOM AtomMessage; // Window Message atom. ATOM AtomWndObj; // Window Object atom. +ATOM AtomLayer; // Window Layer atom. +ATOM AtomFlashWndState; // Window Flash State atom. BOOL gbInitialized; HINSTANCE hModClient = NULL; BOOL ClientPfnInit = FALSE; @@ -46,6 +49,8 @@ gpsi->atomContextHelpIdProp = IntAddGlobalAtom(L"SysCH", TRUE); AtomWndObj = IntAddGlobalAtom(L"SysWNDO", TRUE); + AtomLayer = IntAddGlobalAtom(L"SysLayer", TRUE); + AtomFlashWndState = IntAddGlobalAtom(L"FlashWState", TRUE); return STATUS_SUCCESS; } @@ -222,6 +227,7 @@ ASSERT_NOGDILOCKS(); KeEnterCriticalRegion(); ExAcquireResourceExclusiveLite(&UserLock, TRUE); + gptiCurrent = PsGetCurrentThreadWin32Thread(); } VOID FASTCALL UserLeave(VOID)
13 years, 4 months
1
0
0
0
[jimtabor] 53384: [WineTest:User32:User32] - Up win to 1.3.26, keeping original patch plus skipping test_SetForegroundWindow, it hangs on WaitForSingleObject line 2771, needs regression testing.
by jimtabor@svn.reactos.org
Author: jimtabor Date: Mon Aug 22 19:16:39 2011 New Revision: 53384 URL:
http://svn.reactos.org/svn/reactos?rev=53384&view=rev
Log: [WineTest:User32:User32] - Up win to 1.3.26, keeping original patch plus skipping test_SetForegroundWindow, it hangs on WaitForSingleObject line 2771, needs regression testing. Modified: trunk/rostests/winetests/user32/win.c Modified: trunk/rostests/winetests/user32/win.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/user32/win.c?re…
============================================================================== --- trunk/rostests/winetests/user32/win.c [iso-8859-1] (original) +++ trunk/rostests/winetests/user32/win.c [iso-8859-1] Mon Aug 22 19:16:39 2011 @@ -21,7 +21,7 @@ */ /* To get ICON_SMALL2 with the MSVC headers */ -#define _WIN32_WINNT 0x0501 +//#define _WIN32_WINNT 0x0501 #include <assert.h> #include <stdlib.h> @@ -49,10 +49,17 @@ static UINT (WINAPI *pGetWindowModuleFileNameA)(HWND,LPSTR,UINT); static BOOL (WINAPI *pGetLayeredWindowAttributes)(HWND,COLORREF*,BYTE*,DWORD*); static BOOL (WINAPI *pSetLayeredWindowAttributes)(HWND,COLORREF,BYTE,DWORD); +static BOOL (WINAPI *pUpdateLayeredWindow)(HWND,HDC,POINT*,SIZE*,HDC,POINT*,COLORREF,BLENDFUNCTION*,DWORD); static BOOL (WINAPI *pGetMonitorInfoA)(HMONITOR,LPMONITORINFO); static HMONITOR (WINAPI *pMonitorFromPoint)(POINT,DWORD); static int (WINAPI *pGetWindowRgnBox)(HWND,LPRECT); static BOOL (WINAPI *pGetGUIThreadInfo)(DWORD, GUITHREADINFO*); +static BOOL (WINAPI *pGetProcessDefaultLayout)( DWORD *layout ); +static BOOL (WINAPI *pSetProcessDefaultLayout)( DWORD layout ); +static BOOL (WINAPI *pFlashWindowEx)( PFLASHWINFO pfwi ); +static DWORD (WINAPI *pSetLayout)(HDC hdc, DWORD layout); +static DWORD (WINAPI *pGetLayout)(HDC hdc); +static BOOL (WINAPI *pMirrorRgn)(HWND hwnd, HRGN hrgn); static BOOL test_lbuttondown_flag; static HWND hwndMessage; @@ -119,6 +126,34 @@ res = pGetAncestor( hwnd, GA_ROOTOWNER ); ok( res == ga_root_owner, "Wrong result for GA_ROOTOWNER %p expected %p\n", res, ga_root_owner ); } +} + +#define check_wnd_state(a,b,c,d) check_wnd_state_(__FILE__,__LINE__,a,b,c,d) +static void check_wnd_state_(const char *file, int line, + HWND active, HWND foreground, HWND focus, HWND capture) +{ + ok_(file, line)(active == GetActiveWindow(), "GetActiveWindow() = %p\n", GetActiveWindow()); + /* only check foreground if it belongs to the current thread */ + /* foreground can be moved to a different app pretty much at any time */ + if (foreground && GetForegroundWindow() && + GetWindowThreadProcessId(GetForegroundWindow(), NULL) == GetCurrentThreadId()) + ok_(file, line)(foreground == GetForegroundWindow(), "GetForegroundWindow() = %p\n", GetForegroundWindow()); + ok_(file, line)(focus == GetFocus(), "GetFocus() = %p\n", GetFocus()); + ok_(file, line)(capture == GetCapture(), "GetCapture() = %p\n", GetCapture()); +} + +/* same as above but without capture test */ +#define check_active_state(a,b,c) check_active_state_(__FILE__,__LINE__,a,b,c) +static void check_active_state_(const char *file, int line, + HWND active, HWND foreground, HWND focus) +{ + ok_(file, line)(active == GetActiveWindow(), "GetActiveWindow() = %p\n", GetActiveWindow()); + /* only check foreground if it belongs to the current thread */ + /* foreground can be moved to a different app pretty much at any time */ + if (foreground && GetForegroundWindow() && + GetWindowThreadProcessId(GetForegroundWindow(), NULL) == GetCurrentThreadId()) + ok_(file, line)(foreground == GetForegroundWindow(), "GetForegroundWindow() = %p\n", GetForegroundWindow()); + ok_(file, line)(focus == GetFocus(), "GetFocus() = %p\n", GetFocus()); } static BOOL ignore_message( UINT message ) @@ -380,6 +415,15 @@ check_parents( test, desktop, 0, desktop, 0, test, desktop ); /* window is now child of desktop so GWLP_HWNDPARENT changes owner from now on */ + if (!is_win9x) + { + ret = (HWND)SetWindowLongPtrA( test, GWLP_HWNDPARENT, (LONG_PTR)test ); + ok( ret == 0, "GWL_HWNDPARENT return value %p expected 0\n", ret ); + check_parents( test, desktop, 0, desktop, 0, test, desktop ); + } + else + win_skip("Test creates circular window tree under Win9x/WinMe\n" ); + ret = (HWND)SetWindowLongPtrA( test, GWLP_HWNDPARENT, (LONG_PTR)child ); ok( ret == 0, "GWL_HWNDPARENT return value %p expected 0\n", ret ); check_parents( test, desktop, child, desktop, child, test, desktop ); @@ -595,6 +639,22 @@ HWND hwnd[3]; BOOL ret; MSG msg; + + if (pGetGUIThreadInfo) + { + GUITHREADINFO info; + info.cbSize = sizeof(info); + ret = pGetGUIThreadInfo( GetCurrentThreadId(), &info ); + ok( ret || broken(!ret), /* win9x */ + "GetGUIThreadInfo failed without message queue\n" ); + SetLastError( 0xdeadbeef ); + info.cbSize = sizeof(info) + 1; + ret = pGetGUIThreadInfo( GetCurrentThreadId(), &info ); + ok( !ret, "GetGUIThreadInfo succeeded with wrong size\n" ); + ok( GetLastError() == ERROR_INVALID_PARAMETER || + broken(GetLastError() == 0xdeadbeef), /* win9x */ + "wrong error %u\n", GetLastError() ); + } PeekMessage( &msg, 0, 0, 0, PM_NOREMOVE ); /* make sure we have a message queue */ @@ -665,8 +725,12 @@ /* Win9x does not fixup cx/xy for WM_WINDOWPOSCHANGING */ if (!(winpos->flags & SWP_NOSIZE) && !is_win9x) { - ok(winpos->cx >= 0 && winpos->cx <= 32767, "bad winpos->cx %d\n", winpos->cx); - ok(winpos->cy >= 0 && winpos->cy <= 32767, "bad winpos->cy %d\n", winpos->cy); + ok((winpos->cx >= 0 && winpos->cx <= 32767) || + winpos->cx == 32768, /* win7 doesn't truncate */ + "bad winpos->cx %d\n", winpos->cx); + ok((winpos->cy >= 0 && winpos->cy <= 32767) || + winpos->cy == 40000, /* win7 doesn't truncate */ + "bad winpos->cy %d\n", winpos->cy); } break; } @@ -680,8 +744,12 @@ ok(winpos->x >= -32768 && winpos->x <= 32767, "bad winpos->x %d\n", winpos->x); ok(winpos->y >= -32768 && winpos->y <= 32767, "bad winpos->y %d\n", winpos->y); - ok(winpos->cx >= 0 && winpos->cx <= 32767, "bad winpos->cx %d\n", winpos->cx); - ok(winpos->cy >= 0 && winpos->cy <= 32767, "bad winpos->cy %d\n", winpos->cy); + ok((winpos->cx >= 0 && winpos->cx <= 32767) || + winpos->cx == 32768, /* win7 doesn't truncate */ + "bad winpos->cx %d\n", winpos->cx); + ok((winpos->cy >= 0 && winpos->cy <= 32767) || + winpos->cy == 40000, /* win7 doesn't truncate */ + "bad winpos->cy %d\n", winpos->cy); GetWindowRect(hwnd, &rc1); SetRect(&rc2, winpos->x, winpos->y, winpos->x + winpos->cx, winpos->y + winpos->cy); @@ -939,8 +1007,6 @@ RECT rc; LONG style; CBT_CREATEWNDA *createwnd = (CBT_CREATEWNDA *)lParam; - trace("HCBT_CREATEWND: hwnd %p, parent %p, style %08x\n", - hwnd, createwnd->lpcs->hwndParent, createwnd->lpcs->style); ok(createwnd->hwndInsertAfter == HWND_TOP, "hwndInsertAfter should be always HWND_TOP\n"); if (pGetWindowInfo) @@ -1009,7 +1075,6 @@ case HCBT_MOVESIZE: case HCBT_MINMAX: case HCBT_ACTIVATE: - case HCBT_SETFOCUS: if (pGetWindowInfo && IsWindow(hwnd)) { WINDOWINFO info; @@ -1023,9 +1088,9 @@ verify_window_info(code_name, hwnd, &info); } break; - /* on HCBT_DESTROYWND window state is undefined */ + /* window state is undefined */ + case HCBT_SETFOCUS: case HCBT_DESTROYWND: - trace( "HCBT_DESTROYWND: hwnd %p\n", hwnd ); break; default: break; @@ -1905,10 +1970,14 @@ return DefWindowProc( hwnd, msg, wparam, lparam ); } -static void test_SetWindowPos(HWND hwnd) +static void test_SetWindowPos(HWND hwnd, HWND hwnd2) { RECT orig_win_rc, rect; LONG_PTR old_proc; + HWND hwnd_grandchild, hwnd_child, hwnd_child2; + HWND hwnd_desktop; + RECT rc1, rc2; + BOOL ret; SetRect(&rect, 111, 222, 333, 444); ok(!GetWindowRect(0, &rect), "GetWindowRect succeeded\n"); @@ -1923,7 +1992,8 @@ GetWindowRect(hwnd, &orig_win_rc); old_proc = SetWindowLongPtr( hwnd, GWLP_WNDPROC, (ULONG_PTR)nccalcsize_proc ); - SetWindowPos(hwnd, 0, 100, 100, 0, 0, SWP_NOZORDER|SWP_FRAMECHANGED); + ret = SetWindowPos(hwnd, 0, 100, 100, 0, 0, SWP_NOZORDER|SWP_FRAMECHANGED); + ok(ret, "Got %d\n", ret); GetWindowRect( hwnd, &rect ); ok( rect.left == 100 && rect.top == 100 && rect.right == 100 && rect.bottom == 100, "invalid window rect %d,%d-%d,%d\n", rect.left, rect.top, rect.right, rect.bottom ); @@ -1932,7 +2002,8 @@ ok( rect.left == 90 && rect.top == 90 && rect.right == 110 && rect.bottom == 110, "invalid client rect %d,%d-%d,%d\n", rect.left, rect.top, rect.right, rect.bottom ); - SetWindowPos(hwnd, 0, 200, 200, 0, 0, SWP_NOZORDER|SWP_FRAMECHANGED); + ret = SetWindowPos(hwnd, 0, 200, 200, 0, 0, SWP_NOZORDER|SWP_FRAMECHANGED); + ok(ret, "Got %d\n", ret); GetWindowRect( hwnd, &rect ); ok( rect.left == 200 && rect.top == 200 && rect.right == 200 && rect.bottom == 200, "invalid window rect %d,%d-%d,%d\n", rect.left, rect.top, rect.right, rect.bottom ); @@ -1941,30 +2012,151 @@ ok( rect.left == 210 && rect.top == 210 && rect.right == 190 && rect.bottom == 190, "invalid client rect %d,%d-%d,%d\n", rect.left, rect.top, rect.right, rect.bottom ); - SetWindowPos(hwnd, 0, orig_win_rc.left, orig_win_rc.top, - orig_win_rc.right, orig_win_rc.bottom, 0); + ret = SetWindowPos(hwnd, 0, orig_win_rc.left, orig_win_rc.top, + orig_win_rc.right, orig_win_rc.bottom, 0); + ok(ret, "Got %d\n", ret); SetWindowLongPtr( hwnd, GWLP_WNDPROC, old_proc ); /* Win9x truncates coordinates to 16-bit irrespectively */ if (!is_win9x) { - SetWindowPos(hwnd, 0, -32769, -40000, -32769, -90000, SWP_NOMOVE); - SetWindowPos(hwnd, 0, 32768, 40000, 32768, 40000, SWP_NOMOVE); - - SetWindowPos(hwnd, 0, -32769, -40000, -32769, -90000, SWP_NOSIZE); - SetWindowPos(hwnd, 0, 32768, 40000, 32768, 40000, SWP_NOSIZE); - } - - SetWindowPos(hwnd, 0, orig_win_rc.left, orig_win_rc.top, - orig_win_rc.right, orig_win_rc.bottom, 0); + ret = SetWindowPos(hwnd, 0, -32769, -40000, -32769, -90000, SWP_NOMOVE); + ok(ret, "Got %d\n", ret); + ret = SetWindowPos(hwnd, 0, 32768, 40000, 32768, 40000, SWP_NOMOVE); + ok(ret, "Got %d\n", ret); + + ret = SetWindowPos(hwnd, 0, -32769, -40000, -32769, -90000, SWP_NOSIZE); + ok(ret, "Got %d\n", ret); + ret = SetWindowPos(hwnd, 0, 32768, 40000, 32768, 40000, SWP_NOSIZE); + ok(ret, "Got %d\n", ret); + } + + ret = SetWindowPos(hwnd, 0, orig_win_rc.left, orig_win_rc.top, + orig_win_rc.right, orig_win_rc.bottom, 0); + ok(ret, "Got %d\n", ret); ok(!(GetWindowLong(hwnd, GWL_EXSTYLE) & WS_EX_TOPMOST), "WS_EX_TOPMOST should not be set\n"); - SetWindowPos(hwnd, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOSIZE|SWP_NOMOVE); + ret = SetWindowPos(hwnd, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOSIZE|SWP_NOMOVE); + ok(ret, "Got %d\n", ret); ok(GetWindowLong(hwnd, GWL_EXSTYLE) & WS_EX_TOPMOST, "WS_EX_TOPMOST should be set\n"); - SetWindowPos(hwnd, HWND_TOP, 0, 0, 0, 0, SWP_NOSIZE|SWP_NOMOVE); + ret = SetWindowPos(hwnd, HWND_TOP, 0, 0, 0, 0, SWP_NOSIZE|SWP_NOMOVE); + ok(ret, "Got %d\n", ret); ok(GetWindowLong(hwnd, GWL_EXSTYLE) & WS_EX_TOPMOST, "WS_EX_TOPMOST should be set\n"); - SetWindowPos(hwnd, HWND_NOTOPMOST, 0, 0, 0, 0, SWP_NOSIZE|SWP_NOMOVE); + ret = SetWindowPos(hwnd, HWND_NOTOPMOST, 0, 0, 0, 0, SWP_NOSIZE|SWP_NOMOVE); + ok(ret, "Got %d\n", ret); ok(!(GetWindowLong(hwnd, GWL_EXSTYLE) & WS_EX_TOPMOST), "WS_EX_TOPMOST should not be set\n"); + + hwnd_desktop = GetDesktopWindow(); + ok(!!hwnd_desktop, "Failed to get hwnd_desktop window (%d).\n", GetLastError()); + hwnd_child = create_tool_window(WS_VISIBLE|WS_CHILD, hwnd); + ok(!!hwnd_child, "Failed to create child window (%d)\n", GetLastError()); + hwnd_grandchild = create_tool_window(WS_VISIBLE|WS_CHILD, hwnd_child); + ok(!!hwnd_child, "Failed to create child window (%d)\n", GetLastError()); + hwnd_child2 = create_tool_window(WS_VISIBLE|WS_CHILD, hwnd); + ok(!!hwnd_child2, "Failed to create second child window (%d)\n", GetLastError()); + + ret = SetWindowPos(hwnd, hwnd2, 0, 0, 0, 0, SWP_NOMOVE|SWP_NOSIZE); + ok(ret, "Got %d\n", ret); + check_active_state(hwnd, hwnd, hwnd); + + ret = SetWindowPos(hwnd2, hwnd, 0, 0, 0, 0, SWP_NOMOVE|SWP_NOSIZE); + ok(ret, "Got %d\n", ret); + check_active_state(hwnd2, hwnd2, hwnd2); + + /* Returns TRUE also for windows that are not siblings */ + ret = SetWindowPos(hwnd_child, hwnd2, 0, 0, 0, 0, SWP_NOMOVE|SWP_NOSIZE); + ok(ret, "Got %d\n", ret); + check_active_state(hwnd2, hwnd2, hwnd2); + + ret = SetWindowPos(hwnd2, hwnd_child, 0, 0, 0, 0, SWP_NOMOVE|SWP_NOSIZE); + ok(ret, "Got %d\n", ret); + check_active_state(hwnd2, hwnd2, hwnd2); + + /* Does not seem to do anything even without passing flags, still returns TRUE */ + GetWindowRect(hwnd_child, &rc1); + ret = SetWindowPos(hwnd_child, hwnd2 , 1, 2, 3, 4, 0); + ok(ret, "Got %d\n", ret); + GetWindowRect(hwnd_child, &rc2); + ok(rc1.left == rc2.left && rc1.top == rc2.top && + rc1.right == rc2.right && rc1.bottom == rc2.bottom, + "(%d, %d, %d, %d) != (%d, %d, %d, %d)\n", + rc1.left, rc1.top, rc1.right, rc1.bottom, rc2.left, rc2.top, rc2.right, rc2.bottom); + check_active_state(hwnd2, hwnd2, hwnd2); + + /* Same thing the other way around. */ + GetWindowRect(hwnd2, &rc1); + ret = SetWindowPos(hwnd2, hwnd_child, 1, 2, 3, 4, 0); + ok(ret, "Got %d\n", ret); + GetWindowRect(hwnd2, &rc2); + ok(rc1.left == rc2.left && rc1.top == rc2.top && + rc1.right == rc2.right && rc1.bottom == rc2.bottom, + "(%d, %d, %d, %d) != (%d, %d, %d, %d)\n", + rc1.left, rc1.top, rc1.right, rc1.bottom, rc2.left, rc2.top, rc2.right, rc2.bottom); + check_active_state(hwnd2, hwnd2, hwnd2); + + /* .. and with these windows. */ + GetWindowRect(hwnd_grandchild, &rc1); + ret = SetWindowPos(hwnd_grandchild, hwnd_child2, 1, 2, 3, 4, 0); + ok(ret, "Got %d\n", ret); + GetWindowRect(hwnd_grandchild, &rc2); + ok(rc1.left == rc2.left && rc1.top == rc2.top && + rc1.right == rc2.right && rc1.bottom == rc2.bottom, + "(%d, %d, %d, %d) != (%d, %d, %d, %d)\n", + rc1.left, rc1.top, rc1.right, rc1.bottom, rc2.left, rc2.top, rc2.right, rc2.bottom); + check_active_state(hwnd2, hwnd2, hwnd2); + + /* Add SWP_NOZORDER and it will be properly resized. */ + GetWindowRect(hwnd_grandchild, &rc1); + ret = SetWindowPos(hwnd_grandchild, hwnd_child2, 1, 2, 3, 4, SWP_NOZORDER); + ok(ret, "Got %d\n", ret); + GetWindowRect(hwnd_grandchild, &rc2); + ok((rc1.left+1) == rc2.left && (rc1.top+2) == rc2.top && + (rc1.left+4) == rc2.right && (rc1.top+6) == rc2.bottom, + "(%d, %d, %d, %d) != (%d, %d, %d, %d)\n", + rc1.left+1, rc1.top+2, rc1.left+4, rc1.top+6, rc2.left, rc2.top, rc2.right, rc2.bottom); + check_active_state(hwnd2, hwnd2, hwnd2); + + /* Given a sibling window, the window is properly resized. */ + GetWindowRect(hwnd_child, &rc1); + ret = SetWindowPos(hwnd_child, hwnd_child2, 1, 2, 3, 4, 0); + ok(ret, "Got %d\n", ret); + GetWindowRect(hwnd_child, &rc2); + ok((rc1.left+1) == rc2.left && (rc1.top+2) == rc2.top && + (rc1.left+4) == rc2.right && (rc1.top+6) == rc2.bottom, + "(%d, %d, %d, %d) != (%d, %d, %d, %d)\n", + rc1.left+1, rc1.top+2, rc1.left+4, rc1.top+6, rc2.left, rc2.top, rc2.right, rc2.bottom); + check_active_state(hwnd2, hwnd2, hwnd2); + + /* Involving the desktop window changes things. */ + ret = SetWindowPos(hwnd_child, hwnd_desktop, 0, 0, 0, 0, SWP_NOMOVE|SWP_NOSIZE); + ok(!ret, "Got %d\n", ret); + check_active_state(hwnd2, hwnd2, hwnd2); + + GetWindowRect(hwnd_child, &rc1); + ret = SetWindowPos(hwnd_child, hwnd_desktop, 0, 0, 0, 0, 0); + ok(!ret, "Got %d\n", ret); + GetWindowRect(hwnd_child, &rc2); + ok(rc1.top == rc2.top && rc1.left == rc2.left && + rc1.bottom == rc2.bottom && rc1.right == rc2.right, + "(%d, %d, %d, %d) != (%d, %d, %d, %d)\n", + rc1.top, rc1.left, rc1.bottom, rc1.right, rc2.top, rc2.left, rc2.bottom, rc2.right); + check_active_state(hwnd2, hwnd2, hwnd2); + + ret = SetWindowPos(hwnd_desktop, hwnd_child, 0, 0, 0, 0, SWP_NOMOVE|SWP_NOSIZE); + ok(!ret, "Got %d\n", ret); + check_active_state(hwnd2, hwnd2, hwnd2); + + ret = SetWindowPos(hwnd_desktop, hwnd, 0, 0, 0, 0, SWP_NOMOVE|SWP_NOSIZE); + ok(!ret, "Got %d\n", ret); + check_active_state(hwnd2, hwnd2, hwnd2); + + ret = SetWindowPos(hwnd, hwnd_desktop, 0, 0, 0, 0, SWP_NOMOVE|SWP_NOSIZE); + ok(!ret, "Got %d\n", ret); + check_active_state(hwnd2, hwnd2, hwnd2); + + DestroyWindow(hwnd_grandchild); + DestroyWindow(hwnd_child); + DestroyWindow(hwnd_child2); } static void test_SetMenu(HWND parent) @@ -2403,20 +2595,6 @@ DestroyWindow( child ); } -#define check_wnd_state(a,b,c,d) check_wnd_state_(__FILE__,__LINE__,a,b,c,d) -static void check_wnd_state_(const char *file, int line, - HWND active, HWND foreground, HWND focus, HWND capture) -{ - ok_(file, line)(active == GetActiveWindow(), "GetActiveWindow() = %p\n", GetActiveWindow()); - /* only check foreground if it belongs to the current thread */ - /* foreground can be moved to a different app pretty much at any time */ - if (foreground && GetForegroundWindow() && - GetWindowThreadProcessId(GetForegroundWindow(), NULL) == GetCurrentThreadId()) - ok_(file, line)(foreground == GetForegroundWindow(), "GetForegroundWindow() = %p\n", GetForegroundWindow()); - ok_(file, line)(focus == GetFocus(), "GetFocus() = %p\n", GetFocus()); - ok_(file, line)(capture == GetCapture(), "GetCapture() = %p\n", GetCapture()); -} - static void test_SetActiveWindow(HWND hwnd) { HWND hwnd2; @@ -2550,7 +2728,8 @@ hwnd2 = GetForegroundWindow(); ok(hwnd2 == hwnd, "Wrong foreground window %p\n", hwnd2); - ok(SetForegroundWindow( GetDesktopWindow() ), "SetForegroundWindow(desktop) error: %d\n", GetLastError()); + ret = SetForegroundWindow( GetDesktopWindow() ); + ok(ret, "SetForegroundWindow(desktop) error: %d\n", GetLastError()); hwnd2 = GetForegroundWindow(); ok(hwnd2 != hwnd, "Wrong foreground window %p\n", hwnd2); @@ -2669,10 +2848,7 @@ static void test_capture_1(void) { - HWND button, capture, oldFocus, oldActive; - - oldFocus = GetFocus(); - oldActive = GetActiveWindow(); + HWND button, capture; capture = GetCapture(); ok(capture == 0, "GetCapture() = %p\n", capture); @@ -2690,7 +2866,9 @@ check_wnd_state(button, 0, button, button); DestroyWindow(button); - check_wnd_state(oldActive, 0, oldFocus, 0); + /* old active window test depends on previously executed window + * activation tests, and fails under NT4. + check_wnd_state(oldActive, 0, oldFocus, 0);*/ } static void test_capture_2(void) @@ -2847,6 +3025,7 @@ HWND hwnd; WNDCLASSA wclass; HINSTANCE hInstance = GetModuleHandleA( NULL ); + ATOM aclass; if (!pGetGUIThreadInfo) { @@ -2863,10 +3042,11 @@ wclass.lpszMenuName = 0; wclass.cbClsExtra = 0; wclass.cbWndExtra = 0; - assert (RegisterClassA( &wclass )); - assert (hwnd = CreateWindowA( wclass.lpszClassName, "MenuTest", - WS_OVERLAPPEDWINDOW, CW_USEDEFAULT, 0, - 400, 200, NULL, NULL, hInstance, NULL) ); + aclass = RegisterClassA( &wclass ); + ok( aclass, "RegisterClassA failed with error %d\n", GetLastError()); + hwnd = CreateWindowA( wclass.lpszClassName, "MenuTest", + WS_OVERLAPPEDWINDOW, CW_USEDEFAULT, 0, + 400, 200, NULL, NULL, hInstance, NULL); ok(hwnd != NULL, "CreateWindowEx failed with error %d\n", GetLastError()); if (!hwnd) return; hmenu = CreatePopupMenu(); @@ -3293,10 +3473,10 @@ static void test_SetParent(void) { - BOOL ret; HWND desktop = GetDesktopWindow(); HMENU hMenu; - HWND parent, child1, child2, child3, child4, sibling; + HWND ret, parent, child1, child2, child3, child4, sibling, popup; + BOOL bret; parent = CreateWindowExA(0, "static", NULL, WS_OVERLAPPEDWINDOW, 100, 100, 200, 200, 0, 0, 0, NULL); @@ -3341,8 +3521,6 @@ if (!is_win9x) /* Win9x doesn't survive this test */ { - HWND ret; - ok(!SetParent(parent, child1), "SetParent should fail\n"); ok(!SetParent(child2, child3), "SetParent should fail\n"); ok(SetParent(child1, parent) != 0, "SetParent should not fail\n"); @@ -3388,8 +3566,7 @@ ok(SetParent(sibling, parent) != 0, "SetParent should not fail\n"); ok(GetMenu(sibling) == hMenu, "SetParent should not remove menu\n"); - ret = DestroyWindow(parent); - ok( ret, "DestroyWindow() error %d\n", GetLastError()); + ok(DestroyWindow(parent), "DestroyWindow() failed\n"); ok(!IsWindow(parent), "parent still exists\n"); ok(!IsWindow(sibling), "sibling still exists\n"); @@ -3397,6 +3574,51 @@ ok(!IsWindow(child2), "child2 still exists\n"); ok(!IsWindow(child3), "child3 still exists\n"); ok(!IsWindow(child4), "child4 still exists\n"); + + parent = CreateWindowExA(0, "static", NULL, WS_OVERLAPPEDWINDOW, + 100, 100, 200, 200, 0, 0, 0, NULL); + assert(parent != 0); + child1 = CreateWindowExA(0, "static", NULL, WS_CHILD, + 0, 0, 50, 50, parent, 0, 0, NULL); + assert(child1 != 0); + popup = CreateWindowExA(0, "static", NULL, WS_POPUP, + 0, 0, 50, 50, 0, 0, 0, NULL); + assert(popup != 0); + + trace("parent %p, child %p, popup %p\n", parent, child1, popup); + + check_parents(parent, desktop, 0, 0, 0, parent, parent); + check_parents(child1, parent, parent, parent, 0, parent, parent); + check_parents(popup, desktop, 0, 0, 0, popup, popup); + + SetActiveWindow(parent); + SetFocus(parent); + check_active_state(parent, 0, parent); + + ret = SetParent(popup, child1); + ok(ret == desktop, "expected %p, got %p\n", desktop, ret); + check_parents(popup, child1, child1, 0, 0, parent, popup); +todo_wine + check_active_state(popup, 0, popup); + + SetActiveWindow(parent); + SetFocus(parent); + check_active_state(parent, 0, parent); + + bret = SetForegroundWindow(popup); +todo_wine { + ok(bret || broken(!bret), "SetForegroundWindow() failed\n"); + if (!bret) + check_active_state(popup, 0, popup); + else + check_active_state(popup, popup, popup); + } + + ok(DestroyWindow(parent), "DestroyWindow() failed\n"); + + ok(!IsWindow(parent), "parent still exists\n"); + ok(!IsWindow(child1), "child1 still exists\n"); + ok(!IsWindow(popup), "popup still exists\n"); } static LRESULT WINAPI StyleCheckProc(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam) @@ -3481,6 +3703,25 @@ ok((dwActualStyle == dwStyleOut) && (dwActualExStyle == dwExStyleOut), "Style (0x%08x) should really be 0x%08x and/or Ex style (0x%08x) should really be 0x%08x\n", dwActualStyle, dwStyleOut, dwActualExStyle, dwExStyleOut); + + /* try setting the styles explicitly */ + SetWindowLong( hwnd, GWL_EXSTYLE, dwExStyleIn ); + SetWindowLong( hwnd, GWL_STYLE, dwStyleIn ); + dwActualStyle = GetWindowLong(hwnd, GWL_STYLE); + dwActualExStyle = GetWindowLong(hwnd, GWL_EXSTYLE); + /* WS_CLIPSIBLINGS can't be reset on top-level windows */ + if (dwStyleIn & WS_CHILD) dwStyleOut = dwStyleIn; + else dwStyleOut = dwStyleIn | WS_CLIPSIBLINGS; + /* WS_EX_WINDOWEDGE can't always be changed */ + if ((dwExStyleIn & WS_EX_DLGMODALFRAME) || (dwStyleIn & WS_THICKFRAME)) + dwExStyleOut = dwExStyleIn | WS_EX_WINDOWEDGE; + else if (dwStyleIn & (WS_CHILD | WS_POPUP)) + dwExStyleOut = dwExStyleIn & ~WS_EX_WINDOWEDGE; + else + dwExStyleOut = dwExStyleIn; + ok((dwActualStyle == dwStyleOut) && (dwActualExStyle == dwExStyleOut), + "%08x/%08x: Style (0x%08x) should really be 0x%08x and/or Ex style (0x%08x) should really be 0x%08x\n", + dwStyleIn, dwExStyleIn, dwActualStyle, dwStyleOut, dwActualExStyle, dwExStyleOut); DestroyWindow(hwnd); if (hwndParent) DestroyWindow(hwndParent); @@ -3823,6 +4064,10 @@ HWND hwnd; INT rc; + ok(!IsWindow(0), "IsWindow(0)\n"); + ok(!IsWindow(HWND_BROADCAST), "IsWindow(HWND_BROADCAST)\n"); + ok(!IsWindow(HWND_TOPMOST), "IsWindow(HWND_TOPMOST)\n"); + /* Just a param check */ if (pGetMonitorInfoA) { @@ -4442,6 +4687,8 @@ "wrong y size %d/%d\n", cs->cy, expected_cy ); ok( (rect.right - rect.left == expected_rect.right - expected_rect.left && rect.bottom - rect.top == expected_rect.bottom - expected_rect.top) || + (rect.right - rect.left == min( 65535, expected_rect.right - expected_rect.left ) && + rect.bottom - rect.top == min( 65535, expected_rect.bottom - expected_rect.top )) || broken( rect.right - rect.left == broken_rect.right - broken_rect.left && rect.bottom - rect.top == broken_rect.bottom - broken_rect.top) || broken( rect.right - rect.left == (short)broken_rect.right - (short)broken_rect.left && @@ -4472,10 +4719,12 @@ HMENU hmenu; RECT rc, rc_minmax; MINMAXINFO minmax; + BOOL res; #define expect_menu(window, menu) \ SetLastError(0xdeadbeef); \ - ok(GetMenu(window) == (HMENU)menu, "GetMenu error %d\n", GetLastError()) + res = (GetMenu(window) == (HMENU)menu); \ + ok(res, "GetMenu error %d\n", GetLastError()) #define expect_style(window, style)\ ok((ULONG)GetWindowLong(window, GWL_STYLE) == (style), "expected style %x != %x\n", (LONG)(style), GetWindowLong(window, GWL_STYLE)) @@ -4494,7 +4743,8 @@ assert(parent != 0); SetLastError(0xdeadbeef); - ok(IsMenu(hmenu), "IsMenu error %d\n", GetLastError()); + res = IsMenu(hmenu); + ok(res, "IsMenu error %d\n", GetLastError()); /* WS_CHILD */ SetLastError(0xdeadbeef); @@ -4743,8 +4993,10 @@ hwnd = CreateWindowExA(0, "Sizes_WndClass", NULL, WS_CHILD, 300000, 300000, 200000, 200000, parent, 0, 0, NULL); ok( hwnd != 0, "creation failed err %u\n", GetLastError()); GetClientRect( hwnd, &rc ); - ok( rc.right == 200000 || broken(rc.right == (short)200000), "invalid rect right %u\n", rc.right ); - ok( rc.bottom == 200000 || broken(rc.bottom == (short)200000), "invalid rect bottom %u\n", rc.bottom ); + ok( rc.right == 200000 || rc.right == 65535 || broken(rc.right == (short)200000), + "invalid rect right %u\n", rc.right ); + ok( rc.bottom == 200000 || rc.bottom == 65535 || broken(rc.bottom == (short)200000), + "invalid rect bottom %u\n", rc.bottom ); DestroyWindow(hwnd); expected_cx = expected_cy = -10; @@ -4780,7 +5032,8 @@ ok( hwnd != 0, "creation failed err %u\n", GetLastError()); GetClientRect( hwnd, &rc ); ok( rc.right == 100, "invalid rect right %u\n", rc.right ); - ok( rc.bottom == 0x7fffffff - 10 || broken(rc.bottom == 0), "invalid rect bottom %u\n", rc.bottom ); + ok( rc.bottom == 0x7fffffff - 10 || rc.bottom ==65535 || broken(rc.bottom == 0), + "invalid rect bottom %u\n", rc.bottom ); DestroyWindow(hwnd); expected_cx = 0x7fffffff; @@ -4790,8 +5043,10 @@ hwnd = CreateWindowExA(0, "Sizes_WndClass", NULL, WS_CHILD, 20, 10, 0x7fffffff, 0x7fffffff, parent, 0, 0, NULL); ok( hwnd != 0, "creation failed err %u\n", GetLastError()); GetClientRect( hwnd, &rc ); - ok( rc.right == 0x7fffffff - 20 || broken(rc.right == 0), "invalid rect right %u\n", rc.right ); - ok( rc.bottom == 0x7fffffff - 10 || broken(rc.bottom == 0), "invalid rect bottom %u\n", rc.bottom ); + ok( rc.right == 0x7fffffff - 20 || rc.right == 65535 || broken(rc.right == 0), + "invalid rect right %u\n", rc.right ); + ok( rc.bottom == 0x7fffffff - 10 || rc.right == 65535 || broken(rc.bottom == 0), + "invalid rect bottom %u\n", rc.bottom ); DestroyWindow(hwnd); /* top level window */ @@ -4804,6 +5059,74 @@ ok( rc.bottom <= expected_cy, "invalid rect bottom %u\n", rc.bottom ); DestroyWindow(hwnd); + if (pGetLayout && pSetLayout) + { + HDC hdc = GetDC( parent ); + pSetLayout( hdc, LAYOUT_RTL ); + if (pGetLayout( hdc )) + { + ReleaseDC( parent, hdc ); + DestroyWindow( parent ); + SetLastError( 0xdeadbeef ); + parent = CreateWindowEx(WS_EX_APPWINDOW | WS_EX_LAYOUTRTL, "static", NULL, WS_POPUP, + 0, 0, 100, 100, 0, 0, 0, NULL); + ok( parent != 0, "creation failed err %u\n", GetLastError()); + expect_ex_style( parent, WS_EX_APPWINDOW | WS_EX_LAYOUTRTL ); + hwnd = CreateWindowExA(0, "static", NULL, WS_CHILD, 0, 0, 20, 20, parent, 0, 0, NULL); + ok( hwnd != 0, "creation failed err %u\n", GetLastError()); + expect_ex_style( hwnd, WS_EX_LAYOUTRTL ); + DestroyWindow( hwnd ); + hwnd = CreateWindowExA(0, "static", NULL, WS_POPUP, 0, 0, 20, 20, parent, 0, 0, NULL); + ok( hwnd != 0, "creation failed err %u\n", GetLastError()); + expect_ex_style( hwnd, 0 ); + DestroyWindow( hwnd ); + SetWindowLongW( parent, GWL_EXSTYLE, WS_EX_APPWINDOW | WS_EX_LAYOUTRTL | WS_EX_NOINHERITLAYOUT ); + hwnd = CreateWindowExA(0, "static", NULL, WS_CHILD, 0, 0, 20, 20, parent, 0, 0, NULL); + ok( hwnd != 0, "creation failed err %u\n", GetLastError()); + expect_ex_style( hwnd, 0 ); + DestroyWindow( hwnd ); + + if (pGetProcessDefaultLayout && pSetProcessDefaultLayout) + { + DWORD layout; + + SetLastError( 0xdeadbeef ); + ok( !pGetProcessDefaultLayout( NULL ), "GetProcessDefaultLayout succeeded\n" ); + ok( GetLastError() == ERROR_NOACCESS, "wrong error %u\n", GetLastError() ); + SetLastError( 0xdeadbeef ); + ok( pGetProcessDefaultLayout( &layout ), + "GetProcessDefaultLayout failed err %u\n", GetLastError ()); + ok( layout == 0, "GetProcessDefaultLayout wrong layout %x\n", layout ); + SetLastError( 0xdeadbeef ); + ok( pSetProcessDefaultLayout( 7 ), + "SetProcessDefaultLayout failed err %u\n", GetLastError ()); + ok( pGetProcessDefaultLayout( &layout ), + "GetProcessDefaultLayout failed err %u\n", GetLastError ()); + ok( layout == 7, "GetProcessDefaultLayout wrong layout %x\n", layout ); + SetLastError( 0xdeadbeef ); + ok( pSetProcessDefaultLayout( LAYOUT_RTL ), + "SetProcessDefaultLayout failed err %u\n", GetLastError ()); + ok( pGetProcessDefaultLayout( &layout ), + "GetProcessDefaultLayout failed err %u\n", GetLastError ()); + ok( layout == LAYOUT_RTL, "GetProcessDefaultLayout wrong layout %x\n", layout ); + hwnd = CreateWindowEx(WS_EX_APPWINDOW, "static", NULL, WS_POPUP, + 0, 0, 100, 100, 0, 0, 0, NULL); + ok( hwnd != 0, "creation failed err %u\n", GetLastError()); + expect_ex_style( hwnd, WS_EX_APPWINDOW | WS_EX_LAYOUTRTL ); + DestroyWindow( hwnd ); + hwnd = CreateWindowEx(WS_EX_APPWINDOW, "static", NULL, WS_POPUP, + 0, 0, 100, 100, parent, 0, 0, NULL); + ok( hwnd != 0, "creation failed err %u\n", GetLastError()); + expect_ex_style( hwnd, WS_EX_APPWINDOW ); + DestroyWindow( hwnd ); + pSetProcessDefaultLayout( 0 ); + } + else win_skip( "SetProcessDefaultLayout not supported\n" ); + } + else win_skip( "SetLayout not supported\n" ); + } + else win_skip( "SetLayout not available\n" ); + DestroyWindow(parent); UnregisterClass("MinMax_WndClass", GetModuleHandle(0)); @@ -4834,13 +5157,13 @@ retval = SetWindowLongPtr(NULL, GWLP_WNDPROC, 0); ok(!retval, "SetWindowLongPtr on invalid window handle should have returned 0 instead of 0x%lx\n", retval); ok(check_error(GetLastError(), ERROR_INVALID_WINDOW_HANDLE), - "SetWindowLongPtr should have set error to ERROR_INVALID_WINDOW_HANDLE instad of %d\n", GetLastError()); + "SetWindowLongPtr should have set error to ERROR_INVALID_WINDOW_HANDLE instead of %d\n", GetLastError()); SetLastError(0xdeadbeef); retval = SetWindowLongPtr(hwndMain, 0xdeadbeef, 0); ok(!retval, "SetWindowLongPtr on invalid index should have returned 0 instead of 0x%lx\n", retval); ok(check_error(GetLastError(), ERROR_INVALID_INDEX), - "SetWindowLongPtr should have set error to ERROR_INVALID_INDEX instad of %d\n", GetLastError()); + "SetWindowLongPtr should have set error to ERROR_INVALID_INDEX instead of %d\n", GetLastError()); SetLastError(0xdeadbeef); retval = SetWindowLongPtr(hwndMain, GWLP_WNDPROC, 0); @@ -4872,7 +5195,7 @@ { HWND hwnd; DWORD style; - RECT rcMain, rc; + RECT rcMain, rc, rcMinimized; LPARAM ret; SetRect(&rcMain, 120, 120, 210, 210); @@ -4914,8 +5237,16 @@ ok(style & WS_VISIBLE, "window should be visible\n"); ok(style & WS_MINIMIZE, "window should be minimized\n"); ok(!(style & WS_MAXIMIZE), "window should not be maximized\n"); + GetWindowRect(hwnd, &rcMinimized); + ok(!EqualRect(&rcMain, &rcMinimized), "rects shouldn't match\n"); + /* shouldn't be able to resize minimized windows */ + ret = SetWindowPos(hwnd, 0, 0, 0, + (rcMinimized.right - rcMinimized.left) * 2, + (rcMinimized.bottom - rcMinimized.top) * 2, + SWP_NOMOVE | SWP_NOACTIVATE | SWP_NOZORDER); + ok(ret, "not expected ret: %lu\n", ret); GetWindowRect(hwnd, &rc); - ok(!EqualRect(&rcMain, &rc), "rects shouldn't match\n"); + ok(EqualRect(&rc, &rcMinimized), "rects should match\n"); ShowWindow(hwnd, SW_RESTORE); ok(ret, "not expected ret: %lu\n", ret); @@ -5448,21 +5779,38 @@ COLORREF key = 0; BYTE alpha = 0; DWORD flags = 0; + POINT pt = { 0, 0 }; + SIZE sz = { 200, 200 }; + HDC hdc; + HBITMAP hbm; BOOL ret; - if (!pGetLayeredWindowAttributes || !pSetLayeredWindowAttributes) + if (!pGetLayeredWindowAttributes || !pSetLayeredWindowAttributes || !pUpdateLayeredWindow) { win_skip( "layered windows not supported\n" ); return; } + + hdc = CreateCompatibleDC( 0 ); + hbm = CreateCompatibleBitmap( hdc, 200, 200 ); + SelectObject( hdc, hbm ); + hwnd = CreateWindowExA(0, "MainWindowClass", "message window", WS_CAPTION, 100, 100, 200, 200, 0, 0, 0, NULL); assert( hwnd ); + SetLastError( 0xdeadbeef ); + ret = pUpdateLayeredWindow( hwnd, 0, NULL, &sz, hdc, &pt, 0, NULL, ULW_OPAQUE ); + ok( !ret, "UpdateLayeredWindow should fail on non-layered window\n" ); + ok( GetLastError() == ERROR_INVALID_PARAMETER, "expected ERROR_INVALID_PARAMETER, got %u\n", GetLastError() ); ret = pGetLayeredWindowAttributes( hwnd, &key, &alpha, &flags ); ok( !ret, "GetLayeredWindowAttributes should fail on non-layered window\n" ); ret = pSetLayeredWindowAttributes( hwnd, 0, 0, LWA_ALPHA ); ok( !ret, "SetLayeredWindowAttributes should fail on non-layered window\n" ); SetWindowLong( hwnd, GWL_EXSTYLE, GetWindowLong(hwnd, GWL_EXSTYLE) | WS_EX_LAYERED ); + ret = pGetLayeredWindowAttributes( hwnd, &key, &alpha, &flags ); + ok( !ret, "GetLayeredWindowAttributes should fail on layered but not initialized window\n" ); + ret = pUpdateLayeredWindow( hwnd, 0, NULL, &sz, hdc, &pt, 0, NULL, ULW_OPAQUE ); + ok( ret, "UpdateLayeredWindow should succeed on layered window\n" ); ret = pGetLayeredWindowAttributes( hwnd, &key, &alpha, &flags ); ok( !ret, "GetLayeredWindowAttributes should fail on layered but not initialized window\n" ); ret = pSetLayeredWindowAttributes( hwnd, 0x123456, 44, LWA_ALPHA ); @@ -5472,14 +5820,23 @@ ok( key == 0x123456 || key == 0, "wrong color key %x\n", key ); ok( alpha == 44, "wrong alpha %u\n", alpha ); ok( flags == LWA_ALPHA, "wrong flags %x\n", flags ); + SetLastError( 0xdeadbeef ); + ret = pUpdateLayeredWindow( hwnd, 0, NULL, &sz, hdc, &pt, 0, NULL, ULW_OPAQUE ); + ok( !ret, "UpdateLayeredWindow should fail on layered but initialized window\n" ); + ok( GetLastError() == ERROR_INVALID_PARAMETER, "expected ERROR_INVALID_PARAMETER, got %u\n", GetLastError() ); /* clearing WS_EX_LAYERED resets attributes */ SetWindowLong( hwnd, GWL_EXSTYLE, GetWindowLong(hwnd, GWL_EXSTYLE) & ~WS_EX_LAYERED ); + SetLastError( 0xdeadbeef ); + ret = pUpdateLayeredWindow( hwnd, 0, NULL, &sz, hdc, &pt, 0, NULL, ULW_OPAQUE ); + ok( !ret, "UpdateLayeredWindow should fail on non-layered window\n" ); ret = pGetLayeredWindowAttributes( hwnd, &key, &alpha, &flags ); ok( !ret, "GetLayeredWindowAttributes should fail on no longer layered window\n" ); SetWindowLong( hwnd, GWL_EXSTYLE, GetWindowLong(hwnd, GWL_EXSTYLE) | WS_EX_LAYERED ); ret = pGetLayeredWindowAttributes( hwnd, &key, &alpha, &flags ); ok( !ret, "GetLayeredWindowAttributes should fail on layered but not initialized window\n" ); + ret = pUpdateLayeredWindow( hwnd, 0, NULL, &sz, hdc, &pt, 0, NULL, ULW_OPAQUE ); + ok( ret, "UpdateLayeredWindow should succeed on layered window\n" ); ret = pSetLayeredWindowAttributes( hwnd, 0x654321, 22, LWA_COLORKEY | LWA_ALPHA ); ok( ret, "SetLayeredWindowAttributes should succeed on layered window\n" ); ret = pGetLayeredWindowAttributes( hwnd, &key, &alpha, &flags ); @@ -5487,6 +5844,10 @@ ok( key == 0x654321, "wrong color key %x\n", key ); ok( alpha == 22, "wrong alpha %u\n", alpha ); ok( flags == (LWA_COLORKEY | LWA_ALPHA), "wrong flags %x\n", flags ); + SetLastError( 0xdeadbeef ); + ret = pUpdateLayeredWindow( hwnd, 0, NULL, &sz, hdc, &pt, 0, NULL, ULW_OPAQUE ); + ok( !ret, "UpdateLayeredWindow should fail on layered but initialized window\n" ); + ok( GetLastError() == ERROR_INVALID_PARAMETER, "expected ERROR_INVALID_PARAMETER, got %u\n", GetLastError() ); ret = pSetLayeredWindowAttributes( hwnd, 0x888888, 33, LWA_COLORKEY ); ok( ret, "SetLayeredWindowAttributes should succeed on layered window\n" ); @@ -5520,6 +5881,8 @@ ok( flags == 0, "wrong flags %x\n", flags ); DestroyWindow( hwnd ); + DeleteDC( hdc ); + DeleteObject( hbm ); } static MONITORINFO mi; @@ -5881,7 +6244,8 @@ cls.lpszMenuName = NULL; cls.lpszClassName = className; SetLastError(0xdeadbeef); - ok(RegisterClassA(&cls),"RegisterClassA failed, error: %u\n", GetLastError()); + success = RegisterClassA(&cls); + ok(success,"RegisterClassA failed, error: %u\n", GetLastError()); for(i = 0; i < NUMBER_OF_THICK_CHILD_TESTS; i++) { @@ -5973,7 +6337,7 @@ { HWND hwnd; RECT r; - int ret; + int ret, width; HRGN hrgn; if (!pGetWindowRgnBox) @@ -6006,23 +6370,249 @@ ok( r.left == 2 && r.top == 3 && r.right == 10 && r.bottom == 15, "Expected (2,3,10,15), got (%d,%d,%d,%d)\n", r.left, r.top, r.right, r.bottom); - DeleteObject(hrgn); + if (pMirrorRgn) + { + hrgn = CreateRectRgn(2, 3, 10, 15); + ret = pMirrorRgn( hwnd, hrgn ); + ok( ret == TRUE, "MirrorRgn failed %u\n", ret ); + r.left = r.top = r.right = r.bottom = 0; + GetWindowRect( hwnd, &r ); + width = r.right - r.left; + r.left = r.top = r.right = r.bottom = 0; + ret = GetRgnBox( hrgn, &r ); + ok( ret == SIMPLEREGION, "GetRgnBox failed %u\n", ret ); + ok( r.left == width - 10 && r.top == 3 && r.right == width - 2 && r.bottom == 15, + "Wrong rectangle (%d,%d,%d,%d) for width %d\n", r.left, r.top, r.right, r.bottom, width ); + } + else win_skip( "MirrorRgn not supported\n" ); } DestroyWindow(hwnd); } +static void test_rtl_layout(void) +{ + HWND parent, child; + RECT r; + POINT pt; + + if (!pSetProcessDefaultLayout) + { + win_skip( "SetProcessDefaultLayout not supported\n" ); + return; + } + + parent = CreateWindowExA(WS_EX_LAYOUTRTL, "static", NULL, WS_POPUP, 100, 100, 300, 300, NULL, 0, 0, NULL); + child = CreateWindowExA(0, "static", NULL, WS_CHILD, 10, 10, 20, 20, parent, 0, 0, NULL); + + GetWindowRect( parent, &r ); + ok( r.left == 100 && r.right == 400, "wrong rect %d,%d - %d,%d\n", r.left, r.top, r.right, r.bottom ); + GetClientRect( parent, &r ); + ok( r.left == 0 && r.right == 300, "wrong rect %d,%d - %d,%d\n", r.left, r.top, r.right, r.bottom ); + GetClientRect( child, &r ); + ok( r.left == 0 && r.right == 20, "wrong rect %d,%d - %d,%d\n", r.left, r.top, r.right, r.bottom ); + MapWindowPoints( child, parent, (POINT *)&r, 2 ); + ok( r.left == 10 && r.right == 30, "wrong rect %d,%d - %d,%d\n", r.left, r.top, r.right, r.bottom ); + GetWindowRect( child, &r ); + ok( r.left == 370 && r.right == 390, "wrong rect %d,%d - %d,%d\n", r.left, r.top, r.right, r.bottom ); + MapWindowPoints( NULL, parent, (POINT *)&r, 2 ); + ok( r.left == 10 && r.right == 30, "wrong rect %d,%d - %d,%d\n", r.left, r.top, r.right, r.bottom ); + GetWindowRect( child, &r ); + MapWindowPoints( NULL, parent, (POINT *)&r, 1 ); + MapWindowPoints( NULL, parent, (POINT *)&r + 1, 1 ); + ok( r.left == 30 && r.right == 10, "wrong rect %d,%d - %d,%d\n", r.left, r.top, r.right, r.bottom ); + pt.x = pt.y = 12; + MapWindowPoints( child, parent, &pt, 1 ); + ok( pt.x == 22 && pt.y == 22, "wrong point %d,%d\n", pt.x, pt.y ); + SetWindowPos( parent, 0, 0, 0, 250, 250, SWP_NOMOVE | SWP_NOZORDER | SWP_NOACTIVATE ); + GetWindowRect( parent, &r ); + ok( r.left == 100 && r.right == 350, "wrong rect %d,%d - %d,%d\n", r.left, r.top, r.right, r.bottom ); + GetWindowRect( child, &r ); + ok( r.left == 320 && r.right == 340, "wrong rect %d,%d - %d,%d\n", r.left, r.top, r.right, r.bottom ); + SetWindowLongW( parent, GWL_EXSTYLE, 0 ); + GetWindowRect( child, &r ); + ok( r.left == 320 && r.right == 340, "wrong rect %d,%d - %d,%d\n", r.left, r.top, r.right, r.bottom ); + MapWindowPoints( NULL, parent, (POINT *)&r, 2 ); + ok( r.left == 220 && r.right == 240, "wrong rect %d,%d - %d,%d\n", r.left, r.top, r.right, r.bottom ); + SetWindowLongW( parent, GWL_EXSTYLE, WS_EX_LAYOUTRTL ); + GetWindowRect( child, &r ); + ok( r.left == 320 && r.right == 340, "wrong rect %d,%d - %d,%d\n", r.left, r.top, r.right, r.bottom ); + MapWindowPoints( NULL, parent, (POINT *)&r, 2 ); + ok( r.left == 10 && r.right == 30, "wrong rect %d,%d - %d,%d\n", r.left, r.top, r.right, r.bottom ); + SetWindowPos( child, 0, 0, 0, 30, 30, SWP_NOMOVE | SWP_NOZORDER | SWP_NOACTIVATE ); + GetWindowRect( child, &r ); + ok( r.left == 310 && r.right == 340, "wrong rect %d,%d - %d,%d\n", r.left, r.top, r.right, r.bottom ); + MapWindowPoints( NULL, parent, (POINT *)&r, 2 ); + ok( r.left == 10 && r.right == 40, "wrong rect %d,%d - %d,%d\n", r.left, r.top, r.right, r.bottom ); + DestroyWindow( child ); + DestroyWindow( parent ); +} + +static void test_FlashWindowEx(void) +{ + HWND hwnd; + FLASHWINFO finfo; + BOOL ret; + + if (!pFlashWindowEx) + { + win_skip( "FlashWindowEx not supported\n" ); + return; + } + + hwnd = CreateWindowExA( 0, "MainWindowClass", "FlashWindow", WS_POPUP, + 0, 0, 0, 0, 0, 0, 0, NULL ); + ok( hwnd != 0, "CreateWindowExA error %d\n", GetLastError() ); + + finfo.cbSize = sizeof(FLASHWINFO); + finfo.dwFlags = FLASHW_TIMER; + finfo.uCount = 3; + finfo.dwTimeout = 200; + finfo.hwnd = NULL; + SetLastError(0xdeadbeef); + ret = pFlashWindowEx(&finfo); + todo_wine ok(!ret && GetLastError() == ERROR_INVALID_PARAMETER, + "FlashWindowEx returned with %d\n", GetLastError()); + + finfo.hwnd = hwnd; + SetLastError(0xdeadbeef); + ret = pFlashWindowEx(NULL); + todo_wine ok(!ret && GetLastError() == ERROR_NOACCESS, + "FlashWindowEx returned with %d\n", GetLastError()); + + SetLastError(0xdeadbeef); + ret = pFlashWindowEx(&finfo); + todo_wine ok(!ret, "FlashWindowEx succeeded\n"); + + finfo.cbSize = sizeof(FLASHWINFO) - 1; + SetLastError(0xdeadbeef); + ret = pFlashWindowEx(&finfo); + todo_wine ok(!ret && GetLastError()==ERROR_INVALID_PARAMETER, + "FlashWindowEx succeeded\n"); + + finfo.cbSize = sizeof(FLASHWINFO) + 1; + SetLastError(0xdeadbeef); + ret = pFlashWindowEx(&finfo); + todo_wine ok(!ret && GetLastError()==ERROR_INVALID_PARAMETER, + "FlashWindowEx succeeded\n"); + finfo.cbSize = sizeof(FLASHWINFO); + + DestroyWindow( hwnd ); + + SetLastError(0xdeadbeef); + ret = pFlashWindowEx(&finfo); + todo_wine ok(!ret && GetLastError() == ERROR_INVALID_PARAMETER, + "FlashWindowEx returned with %d\n", GetLastError()); + + ok(finfo.cbSize == sizeof(FLASHWINFO), "FlashWindowEx modified cdSize to %x\n", finfo.cbSize); + ok(finfo.hwnd == hwnd, "FlashWindowEx modified hwnd to %p\n", finfo.hwnd); + ok(finfo.dwFlags == FLASHW_TIMER, "FlashWindowEx modified dwFlags to %x\n", finfo.dwFlags); + ok(finfo.uCount == 3, "FlashWindowEx modified uCount to %x\n", finfo.uCount); + ok(finfo.dwTimeout == 200, "FlashWindowEx modified dwTimeout to %x\n", finfo.dwTimeout); + + hwnd = CreateWindowExA( 0, "MainWindowClass", "FlashWindow", WS_VISIBLE | WS_POPUPWINDOW, + 0, 0, 0, 0, 0, 0, 0, NULL ); + ok( hwnd != 0, "CreateWindowExA error %d\n", GetLastError() ); + finfo.hwnd = hwnd; + + SetLastError(0xdeadbeef); + ret = pFlashWindowEx(NULL); + todo_wine ok(!ret && GetLastError() == ERROR_NOACCESS, + "FlashWindowEx returned with %d\n", GetLastError()); + + SetLastError(0xdeadbeef); + ret = pFlashWindowEx(&finfo); + todo_wine ok(!ret, "FlashWindowEx succeeded\n"); + + ok(finfo.cbSize == sizeof(FLASHWINFO), "FlashWindowEx modified cdSize to %x\n", finfo.cbSize); + ok(finfo.hwnd == hwnd, "FlashWindowEx modified hwnd to %p\n", finfo.hwnd); + ok(finfo.dwFlags == FLASHW_TIMER, "FlashWindowEx modified dwFlags to %x\n", finfo.dwFlags); + ok(finfo.uCount == 3, "FlashWindowEx modified uCount to %x\n", finfo.uCount); + ok(finfo.dwTimeout == 200, "FlashWindowEx modified dwTimeout to %x\n", finfo.dwTimeout); + + finfo.dwFlags = FLASHW_STOP; + SetLastError(0xdeadbeef); + ret = pFlashWindowEx(&finfo); + ok(ret, "FlashWindowEx failed with %d\n", GetLastError()); + + DestroyWindow( hwnd ); +} + +static void test_FindWindowEx(void) +{ + HWND hwnd, found; + CHAR title[1]; + + hwnd = CreateWindowExA( 0, "MainWindowClass", "caption", WS_POPUP, 0,0,0,0, 0, 0, 0, NULL ); + ok( hwnd != 0, "CreateWindowExA error %d\n", GetLastError() ); + + title[0] = 0; + + found = FindWindowExA( 0, 0, "MainWindowClass", title ); + ok( found == NULL, "expected a NULL hwnd\n" ); + found = FindWindowExA( 0, 0, "MainWindowClass", NULL ); + ok( found == hwnd, "found is %p, expected a valid hwnd\n", found ); + + DestroyWindow( hwnd ); + + hwnd = CreateWindowExA( 0, "MainWindowClass", NULL, WS_POPUP, 0,0,0,0, 0, 0, 0, NULL ); + ok( hwnd != 0, "CreateWindowExA error %d\n", GetLastError() ); + + found = FindWindowExA( 0, 0, "MainWindowClass", title ); + ok( found == hwnd, "found is %p, expected a valid hwnd\n", found ); + found = FindWindowExA( 0, 0, "MainWindowClass", NULL ); + ok( found == hwnd, "found is %p, expected a valid hwnd\n", found ); + + DestroyWindow( hwnd ); + + /* test behaviour with a window title that is an empty character */ + found = FindWindowExA( 0, 0, "Shell_TrayWnd", title ); + ok( found != NULL, "found is NULL, expected a valid hwnd\n" ); + found = FindWindowExA( 0, 0, "Shell_TrayWnd", NULL ); + ok( found != NULL, "found is NULL, expected a valid hwnd\n" ); +} + +static void test_GetLastActivePopup(void) +{ + HWND hwndOwner, hwndPopup1, hwndPopup2; + + hwndOwner = CreateWindowExA(0, "MainWindowClass", NULL, + WS_VISIBLE | WS_POPUPWINDOW, + 100, 100, 200, 200, + NULL, 0, GetModuleHandle(0), NULL); + hwndPopup1 = CreateWindowExA(0, "MainWindowClass", NULL, + WS_VISIBLE | WS_POPUPWINDOW, + 100, 100, 200, 200, + hwndOwner, 0, GetModuleHandle(0), NULL); + hwndPopup2 = CreateWindowExA(0, "MainWindowClass", NULL, + WS_VISIBLE | WS_POPUPWINDOW, + 100, 100, 200, 200, + hwndPopup1, 0, GetModuleHandle(0), NULL); + ok( GetLastActivePopup(hwndOwner) == hwndPopup2, "wrong last active popup\n" ); + DestroyWindow( hwndPopup2 ); + DestroyWindow( hwndPopup1 ); + DestroyWindow( hwndOwner ); +} + START_TEST(win) { HMODULE user32 = GetModuleHandleA( "user32.dll" ); + HMODULE gdi32 = GetModuleHandleA("gdi32.dll"); pGetAncestor = (void *)GetProcAddress( user32, "GetAncestor" ); pGetWindowInfo = (void *)GetProcAddress( user32, "GetWindowInfo" ); pGetWindowModuleFileNameA = (void *)GetProcAddress( user32, "GetWindowModuleFileNameA" ); pGetLayeredWindowAttributes = (void *)GetProcAddress( user32, "GetLayeredWindowAttributes" ); pSetLayeredWindowAttributes = (void *)GetProcAddress( user32, "SetLayeredWindowAttributes" ); + pUpdateLayeredWindow = (void *)GetProcAddress( user32, "UpdateLayeredWindow" ); pGetMonitorInfoA = (void *)GetProcAddress( user32, "GetMonitorInfoA" ); pMonitorFromPoint = (void *)GetProcAddress( user32, "MonitorFromPoint" ); pGetWindowRgnBox = (void *)GetProcAddress( user32, "GetWindowRgnBox" ); pGetGUIThreadInfo = (void *)GetProcAddress( user32, "GetGUIThreadInfo" ); + pGetProcessDefaultLayout = (void *)GetProcAddress( user32, "GetProcessDefaultLayout" ); + pSetProcessDefaultLayout = (void *)GetProcAddress( user32, "SetProcessDefaultLayout" ); + pFlashWindowEx = (void *)GetProcAddress( user32, "FlashWindowEx" ); + pGetLayout = (void *)GetProcAddress( gdi32, "GetLayout" ); + pSetLayout = (void *)GetProcAddress( gdi32, "SetLayout" ); + pMirrorRgn = (void *)GetProcAddress( gdi32, "MirrorRgn" ); if (!RegisterWindowClasses()) assert(0); @@ -6032,6 +6622,10 @@ hhook = SetWindowsHookExA(WH_CBT, cbt_hook_proc, 0, GetCurrentThreadId()); if (!hhook) win_skip( "Cannot set CBT hook, skipping some tests\n" ); + + /* make sure that these tests are executed first */ + test_FindWindowEx(); + test_SetParent(); hwndMain = CreateWindowExA(/*WS_EX_TOOLWINDOW*/ 0, "MainWindowClass", "Main window", WS_CAPTION | WS_SYSMENU | WS_MINIMIZEBOX | @@ -6059,15 +6653,16 @@ test_capture_2(); test_capture_3(hwndMain, hwndMain2); test_capture_4(); + test_rtl_layout(); + test_FlashWindowEx(); test_CreateWindow(); test_parent_owner(); - test_SetParent(); test_enum_thread_windows(); test_mdi(); test_icons(); - test_SetWindowPos(hwndMain); + test_SetWindowPos(hwndMain, hwndMain2); test_SetMenu(hwndMain); test_SetFocus(hwndMain); test_SetActiveWindow(hwndMain); @@ -6076,6 +6671,7 @@ test_children_zorder(hwndMain); test_popup_zorder(hwndMain2, hwndMain, WS_POPUP); test_popup_zorder(hwndMain2, hwndMain, 0); + test_GetLastActivePopup(); test_keyboard_input(hwndMain); test_mouse_input(hwndMain); test_validatergn(hwndMain); @@ -6098,11 +6694,14 @@ test_Expose(); test_layered_window(); - test_SetForegroundWindow(hwndMain); + if(!winetest_interactive) + skip("skipping test_SetForegroundWindow, Hangs on WaitForSingleObject line 2771\n"); + else + test_SetForegroundWindow(hwndMain); if(!winetest_interactive) - skip("bug 5957: skipping test_shell_window, it crashes ros/win7 explorer\n"); + skip("bug 5957: skipping test_shell_window, it crashes ros/win7 explorer\n"); else - test_shell_window(); + test_shell_window(); test_handles( hwndMain ); test_winregion();
13 years, 4 months
1
0
0
0
[ekohl] 53383: - Update list with the latest changes by jgardou. - Remove an obviously wrong citation.
by ekohl@svn.reactos.org
Author: ekohl Date: Mon Aug 22 18:45:10 2011 New Revision: 53383 URL:
http://svn.reactos.org/svn/reactos?rev=53383&view=rev
Log: - Update list with the latest changes by jgardou. - Remove an obviously wrong citation. Modified: trunk/reactos/media/doc/README.WINE Modified: trunk/reactos/media/doc/README.WINE URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/media/doc/README.WINE?rev=…
============================================================================== --- trunk/reactos/media/doc/README.WINE [iso-8859-1] (original) +++ trunk/reactos/media/doc/README.WINE [iso-8859-1] Mon Aug 22 18:45:10 2011 @@ -22,11 +22,11 @@ The following build tools are shared with Wine. reactos/tools/unicode # Synced to Wine-1_2rc6 -reactos/tools/widl # Synced to Wine-1_3_4 +reactos/tools/widl # Synced to Wine-1.3.26 reactos/tools/winebuild # Synced to Wine-1_1_13 reactos/tools/wmc # Synced to Wine-20081105 (~Wine-1.1.7) -reactos/tools/wpp # Synced to Wine-20081105 (~Wine-1.1.7) -reactos/tools/wrc # Synced to Wine-1_1_28 +reactos/tools/wpp # Synced to Wine-1.3.26 +reactos/tools/wrc # Synced to Wine-1.3.26 The following libraries are shared with Wine. @@ -140,7 +140,7 @@ reactos/dll/win32/resutils # Autosync reactos/dll/win32/riched20 # Autosync reactos/dll/win32/riched32 # Autosync -reactos/dll/win32/rpcrt4 # Synced to Wine-0_9_55 +reactos/dll/win32/rpcrt4 # Synced to Wine-1.3.26 reactos/dll/win32/rsabase # Autosync reactos/dll/win32/rsaenh # Autosync reactos/dll/win32/sccbase # Autosync @@ -212,7 +212,7 @@ reactos/lib/sdk/uuid # Synced to Wine-1.1.42 advapi32 - - reactos/dll/win32/advapi32/crypt/*.c # ekohl says we're not sharing this + reactos/dll/win32/advapi32/crypt/*.c # Unknown reactos/dll/win32/advapi32/sec/cred.c # Out of Sync reactos/dll/win32/advapi32/sec/sid.c # Out of Sync @@ -263,7 +263,7 @@ reactos/dll/win32/user32/windows/menu.c # Forked reactos/dll/win32/user32/windows/messagebox.c # Forked reactos/dll/win32/user32/windows/rect.c # Forked (uitools.c) - reactos/dll/win32/user32/windows/spy.c # Synced to Wine-1_1_40 + reactos/dll/win32/user32/windows/spy.c # Synced to Wine-1_1_40 reactos/dll/win32/user32/windows/text.c # Forked (lstr.c) reactos/dll/win32/user32/windows/winpos.c # Forked
13 years, 4 months
1
0
0
0
[cgutman] 53382: [PNPMGR] - Fix enumeration of existing root devices after a reboot
by cgutman@svn.reactos.org
Author: cgutman Date: Mon Aug 22 18:40:40 2011 New Revision: 53382 URL:
http://svn.reactos.org/svn/reactos?rev=53382&view=rev
Log: [PNPMGR] - Fix enumeration of existing root devices after a reboot Modified: trunk/reactos/ntoskrnl/io/pnpmgr/pnproot.c Modified: trunk/reactos/ntoskrnl/io/pnpmgr/pnproot.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/io/pnpmgr/pnproot…
============================================================================== --- trunk/reactos/ntoskrnl/io/pnpmgr/pnproot.c [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/io/pnpmgr/pnproot.c [iso-8859-1] Mon Aug 22 18:40:40 2011 @@ -381,7 +381,7 @@ UNICODE_STRING KeyName = RTL_CONSTANT_STRING(L"\\Registry\\Machine\\" REGSTR_PATH_SYSTEMENUM L"\\" REGSTR_KEY_ROOTENUM); UNICODE_STRING SubKeyName; WCHAR DevicePath[MAX_PATH + 1]; - RTL_QUERY_REGISTRY_TABLE QueryTable[5]; + RTL_QUERY_REGISTRY_TABLE QueryTable[4]; PPNPROOT_DEVICE Device = NULL; HANDLE KeyHandle = INVALID_HANDLE_VALUE; HANDLE SubKeyHandle = INVALID_HANDLE_VALUE; @@ -507,14 +507,14 @@ /* Fill device ID and instance ID */ if (!RtlCreateUnicodeString(&Device->DeviceID, DevicePath)) { - DPRINT("RtlCreateUnicodeString() failed\n"); + DPRINT1("RtlCreateUnicodeString() failed\n"); Status = STATUS_NO_MEMORY; goto cleanup; } if (!RtlCreateUnicodeString(&Device->InstanceID, SubKeyInfo->Name)) { - DPRINT("RtlCreateUnicodeString() failed\n"); + DPRINT1("RtlCreateUnicodeString() failed\n"); Status = STATUS_NO_MEMORY; goto cleanup; } @@ -523,38 +523,45 @@ Status = IopOpenRegistryKeyEx(&DeviceKeyHandle, SubKeyHandle, &Device->InstanceID, KEY_READ); if (!NT_SUCCESS(Status)) { - DPRINT("IopOpenRegistryKeyEx() failed with status 0x%08lx\n", Status); + DPRINT1("IopOpenRegistryKeyEx() failed with status 0x%08lx\n", Status); break; } - /* Fill other informations */ + /* Fill information from the device instance key */ + RtlZeroMemory(QueryTable, sizeof(QueryTable)); + QueryTable[0].QueryRoutine = QueryStringCallback; + QueryTable[0].Name = L"DeviceDesc"; + QueryTable[0].EntryContext = &Device->DeviceDescription; + + RtlQueryRegistryValues(RTL_REGISTRY_HANDLE, + (PCWSTR)DeviceKeyHandle, + QueryTable, + NULL, + NULL); + + /* Fill information from the LogConf subkey */ Buffer1.Data = (PVOID *)&Device->ResourceRequirementsList; Buffer1.Length = NULL; Buffer2.Data = (PVOID *)&Device->ResourceList; Buffer2.Length = &Device->ResourceListSize; RtlZeroMemory(QueryTable, sizeof(QueryTable)); - QueryTable[0].QueryRoutine = QueryStringCallback; - QueryTable[0].Name = L"DeviceDesc"; - QueryTable[0].EntryContext = &Device->DeviceDescription; - QueryTable[1].Flags = RTL_QUERY_REGISTRY_SUBKEY; - QueryTable[1].Name = L"LogConf"; + QueryTable[0].Flags = RTL_QUERY_REGISTRY_SUBKEY; + QueryTable[0].Name = L"LogConf"; + QueryTable[1].QueryRoutine = QueryBinaryValueCallback; + QueryTable[1].Name = L"BasicConfigVector"; + QueryTable[1].EntryContext = &Buffer1; QueryTable[2].QueryRoutine = QueryBinaryValueCallback; - QueryTable[2].Name = L"BasicConfigVector"; - QueryTable[2].EntryContext = &Buffer1; - QueryTable[3].QueryRoutine = QueryBinaryValueCallback; - QueryTable[3].Name = L"BootConfig"; - QueryTable[3].EntryContext = &Buffer2; - - Status = RtlQueryRegistryValues( - RTL_REGISTRY_HANDLE, - (PCWSTR)DeviceKeyHandle, - QueryTable, - NULL, - NULL); - if (!NT_SUCCESS(Status)) + QueryTable[2].Name = L"BootConfig"; + QueryTable[2].EntryContext = &Buffer2; + + if (!NT_SUCCESS(RtlQueryRegistryValues(RTL_REGISTRY_HANDLE, + (PCWSTR)DeviceKeyHandle, + QueryTable, + NULL, + NULL))) { - DPRINT("RtlQueryRegistryValues() failed with status 0x%08lx\n", Status); - break; + /* Non-fatal error */ + DPRINT1("Failed to read the LogConf key for %S\\%S\n", DevicePath, SubKeyInfo->Name); } ZwClose(DeviceKeyHandle);
13 years, 4 months
1
0
0
0
← Newer
1
...
10
11
12
13
14
15
16
...
50
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
Results per page:
10
25
50
100
200