Author: jimtabor Date: Tue Jul 12 18:23:04 2016 New Revision: 71904 URL: http://svn.reactos.org/svn/reactos?rev=71904&view=rev Log: [Win32SS] - Cleanup error codes for Classes and Menus. - Update (Sync/Port) User32:Dialog to Wine Staging 1.9.11, see CORE-11368. - Now pass exactly the same tests as windows, except for the two ToDos lines 1596 & 1617. The other test failures are on wine for not being compatible!
Modified: trunk/reactos/win32ss/user/ntuser/class.c trunk/reactos/win32ss/user/ntuser/window.c trunk/reactos/win32ss/user/ntuser/window.h trunk/reactos/win32ss/user/user32/windows/dialog.c Modified: trunk/reactos/win32ss/user/ntuser/class.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/user/ntuser/class.c?rev=71904&r1=71903&r2=71904&view=diff ============================================================================== --- trunk/reactos/win32ss/user/ntuser/class.c [iso-8859-1] (original) +++ trunk/reactos/win32ss/user/ntuser/class.c [iso-8859-1] Tue Jul 12 18:23:04 2016 @@ -1283,11 +1283,7 @@ } else { - if (Status == STATUS_OBJECT_NAME_NOT_FOUND) - { - EngSetLastError(ERROR_CLASS_DOES_NOT_EXIST); - } - else + if (Status != STATUS_OBJECT_NAME_NOT_FOUND) { SetLastNtError(Status); } @@ -1362,7 +1358,6 @@ Link); if (Class == NULL) { - EngSetLastError(ERROR_CLASS_DOES_NOT_EXIST); return (RTL_ATOM)0; }else{TRACE("Step 4: 0x%p\n",Class );} @@ -1415,7 +1410,6 @@ ERR("Class \"%wZ\" not found\n", ClassName); } - EngSetLastError(ERROR_CANNOT_FIND_WND_CLASS); return NULL; } @@ -1539,6 +1533,7 @@ &Link); if (ClassAtom == (RTL_ATOM)0) { + EngSetLastError(ERROR_CLASS_DOES_NOT_EXIST); TRACE("UserUnregisterClass: No Class found.\n"); return FALSE; } Modified: trunk/reactos/win32ss/user/ntuser/window.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/user/ntuser/window.c?rev=71904&r1=71903&r2=71904&view=diff ============================================================================== --- trunk/reactos/win32ss/user/ntuser/window.c [iso-8859-1] (original) +++ trunk/reactos/win32ss/user/ntuser/window.c [iso-8859-1] Tue Jul 12 18:23:04 2016 @@ -1921,6 +1921,7 @@ Class = IntGetAndReferenceClass(ClassName, Cs->hInstance, FALSE); if(!Class) { + EngSetLastError(ERROR_CANNOT_FIND_WND_CLASS); ERR("Failed to find class %wZ\n", ClassName); goto cleanup; } @@ -2856,6 +2857,7 @@ if (!IntGetAtomFromStringOrAtom(&ClassName, &ClassAtom)) { + EngSetLastError(ERROR_CANNOT_FIND_WND_CLASS); _SEH2_LEAVE; } } Modified: trunk/reactos/win32ss/user/ntuser/window.h URL: http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/user/ntuser/window.h?rev=71904&r1=71903&r2=71904&view=diff ============================================================================== --- trunk/reactos/win32ss/user/ntuser/window.h [iso-8859-1] (original) +++ trunk/reactos/win32ss/user/ntuser/window.h [iso-8859-1] Tue Jul 12 18:23:04 2016 @@ -16,7 +16,7 @@ #define HAS_THINFRAME(Style, ExStyle) \ (((Style) & WS_BORDER) || (!((Style) & (WS_CHILD | WS_POPUP)))) -#define HAS_MENU(pWnd,style) ((((style) & (WS_CHILD | WS_POPUP)) != WS_CHILD) && IntIsMenu(UlongToHandle(pWnd->IDMenu))) +#define HAS_MENU(pWnd,style) ((((style) & (WS_CHILD | WS_POPUP)) != WS_CHILD) && (pWnd->IDMenu) && IntIsMenu(UlongToHandle(pWnd->IDMenu))) #define IntIsDesktopWindow(WndObj) \ (WndObj->spwndParent == NULL) Modified: trunk/reactos/win32ss/user/user32/windows/dialog.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/user/user32/windows/dialog.c?rev=71904&r1=71903&r2=71904&view=diff ============================================================================== --- trunk/reactos/win32ss/user/user32/windows/dialog.c [iso-8859-1] (original) +++ trunk/reactos/win32ss/user/user32/windows/dialog.c [iso-8859-1] Tue Jul 12 18:23:04 2016 @@ -308,7 +308,7 @@ if (GET_WORD(p)) { - info->data = p + 1; + info->data = p; p += GET_WORD(p) / sizeof(WORD); } else info->data = NULL; @@ -931,7 +931,10 @@ { pos.x += MulDiv(template.x, xBaseUnit, 4); pos.y += MulDiv(template.y, yBaseUnit, 8); - if (!(template.style & (WS_CHILD|DS_ABSALIGN))) ClientToScreen( owner, &pos ); + // + // REACTOS : Need an owner to be passed!!! + // + if (!(template.style & (WS_CHILD|DS_ABSALIGN)) && owner ) ClientToScreen( owner, &pos ); } if ( !(template.style & WS_CHILD) ) { @@ -1067,6 +1070,7 @@ if (template.style & WS_VISIBLE && !(GetWindowLongPtrW( hwnd, GWL_STYLE ) & WS_VISIBLE)) { ShowWindow( hwnd, SW_SHOWNORMAL ); /* SW_SHOW doesn't always work */ + UpdateWindow( hwnd ); IntNotifyWinEvent(EVENT_SYSTEM_DIALOGSTART, hwnd, OBJID_WINDOW, CHILDID_SELF, 0); } return hwnd; @@ -1674,7 +1678,7 @@ BOOL result = FALSE; /* Perform DIALOGINFO initialization if not done */ - if(!(dlgInfo = DIALOG_get_info( hDlg, TRUE ))) return 0; + if(!(dlgInfo = DIALOG_get_info( hDlg, Msg == WM_NCCREATE ))) return 0; SetWindowLongPtrW( hDlg, DWLP_MSGRESULT, 0 ); @@ -1734,7 +1738,7 @@ BOOL result = FALSE; /* Perform DIALOGINFO initialization if not done */ - if(!(dlgInfo = DIALOG_get_info( hDlg, TRUE ))) return 0; + if(!(dlgInfo = DIALOG_get_info( hDlg, Msg == WM_NCCREATE ))) return 0; SetWindowLongPtrW( hDlg, DWLP_MSGRESULT, 0 );