[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!

svn path=/trunk/; revision=71904
This commit is contained in:
James Tabor 2016-07-12 18:23:04 +00:00
parent 1c7b4d4699
commit d9af32368a
4 changed files with 13 additions and 12 deletions

View file

@ -1283,11 +1283,7 @@ IntGetAtomFromStringOrAtom(
} }
else else
{ {
if (Status == STATUS_OBJECT_NAME_NOT_FOUND) if (Status != STATUS_OBJECT_NAME_NOT_FOUND)
{
EngSetLastError(ERROR_CLASS_DOES_NOT_EXIST);
}
else
{ {
SetLastNtError(Status); SetLastNtError(Status);
} }
@ -1362,7 +1358,6 @@ IntGetClassAtom(
Link); Link);
if (Class == NULL) if (Class == NULL)
{ {
EngSetLastError(ERROR_CLASS_DOES_NOT_EXIST);
return (RTL_ATOM)0; return (RTL_ATOM)0;
}else{TRACE("Step 4: 0x%p\n",Class );} }else{TRACE("Step 4: 0x%p\n",Class );}
@ -1415,7 +1410,6 @@ IntGetAndReferenceClass(PUNICODE_STRING ClassName, HINSTANCE hInstance, BOOL bDe
ERR("Class \"%wZ\" not found\n", ClassName); ERR("Class \"%wZ\" not found\n", ClassName);
} }
EngSetLastError(ERROR_CANNOT_FIND_WND_CLASS);
return NULL; return NULL;
} }
@ -1539,6 +1533,7 @@ UserUnregisterClass(IN PUNICODE_STRING ClassName,
&Link); &Link);
if (ClassAtom == (RTL_ATOM)0) if (ClassAtom == (RTL_ATOM)0)
{ {
EngSetLastError(ERROR_CLASS_DOES_NOT_EXIST);
TRACE("UserUnregisterClass: No Class found.\n"); TRACE("UserUnregisterClass: No Class found.\n");
return FALSE; return FALSE;
} }

View file

@ -1921,6 +1921,7 @@ co_UserCreateWindowEx(CREATESTRUCTW* Cs,
Class = IntGetAndReferenceClass(ClassName, Cs->hInstance, FALSE); Class = IntGetAndReferenceClass(ClassName, Cs->hInstance, FALSE);
if(!Class) if(!Class)
{ {
EngSetLastError(ERROR_CANNOT_FIND_WND_CLASS);
ERR("Failed to find class %wZ\n", ClassName); ERR("Failed to find class %wZ\n", ClassName);
goto cleanup; goto cleanup;
} }
@ -2856,6 +2857,7 @@ NtUserFindWindowEx(HWND hwndParent,
if (!IntGetAtomFromStringOrAtom(&ClassName, if (!IntGetAtomFromStringOrAtom(&ClassName,
&ClassAtom)) &ClassAtom))
{ {
EngSetLastError(ERROR_CANNOT_FIND_WND_CLASS);
_SEH2_LEAVE; _SEH2_LEAVE;
} }
} }

View file

@ -16,7 +16,7 @@ extern ATOM AtomFlashWndState;
#define HAS_THINFRAME(Style, ExStyle) \ #define HAS_THINFRAME(Style, ExStyle) \
(((Style) & WS_BORDER) || (!((Style) & (WS_CHILD | WS_POPUP)))) (((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) \ #define IntIsDesktopWindow(WndObj) \
(WndObj->spwndParent == NULL) (WndObj->spwndParent == NULL)

View file

@ -308,7 +308,7 @@ static const WORD *DIALOG_GetControl32( const WORD *p, DLG_CONTROL_INFO *info,
if (GET_WORD(p)) if (GET_WORD(p))
{ {
info->data = p + 1; info->data = p;
p += GET_WORD(p) / sizeof(WORD); p += GET_WORD(p) / sizeof(WORD);
} }
else info->data = NULL; else info->data = NULL;
@ -931,7 +931,10 @@ static HWND DIALOG_CreateIndirect( HINSTANCE hInst, LPCVOID dlgTemplate,
{ {
pos.x += MulDiv(template.x, xBaseUnit, 4); pos.x += MulDiv(template.x, xBaseUnit, 4);
pos.y += MulDiv(template.y, yBaseUnit, 8); 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) ) if ( !(template.style & WS_CHILD) )
{ {
@ -1067,6 +1070,7 @@ static HWND DIALOG_CreateIndirect( HINSTANCE hInst, LPCVOID dlgTemplate,
if (template.style & WS_VISIBLE && !(GetWindowLongPtrW( hwnd, GWL_STYLE ) & WS_VISIBLE)) if (template.style & WS_VISIBLE && !(GetWindowLongPtrW( hwnd, GWL_STYLE ) & WS_VISIBLE))
{ {
ShowWindow( hwnd, SW_SHOWNORMAL ); /* SW_SHOW doesn't always work */ ShowWindow( hwnd, SW_SHOWNORMAL ); /* SW_SHOW doesn't always work */
UpdateWindow( hwnd );
IntNotifyWinEvent(EVENT_SYSTEM_DIALOGSTART, hwnd, OBJID_WINDOW, CHILDID_SELF, 0); IntNotifyWinEvent(EVENT_SYSTEM_DIALOGSTART, hwnd, OBJID_WINDOW, CHILDID_SELF, 0);
} }
return hwnd; return hwnd;
@ -1674,7 +1678,7 @@ DefDlgProcA(
BOOL result = FALSE; BOOL result = FALSE;
/* Perform DIALOGINFO initialization if not done */ /* 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 ); SetWindowLongPtrW( hDlg, DWLP_MSGRESULT, 0 );
@ -1734,7 +1738,7 @@ DefDlgProcW(
BOOL result = FALSE; BOOL result = FALSE;
/* Perform DIALOGINFO initialization if not done */ /* 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 ); SetWindowLongPtrW( hDlg, DWLP_MSGRESULT, 0 );