Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-cw
Commits
4ffc11ad
Commit
4ffc11ad
authored
Aug 09, 2005
by
Dmitry Timoshkov
Committed by
Alexandre Julliard
Aug 09, 2005
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make CreateWindow with invalid menu handle test pass on Wine.
parent
1766483e
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
16 additions
and
7 deletions
+16
-7
menu.c
dlls/user/menu.c
+1
-0
win.c
dlls/user/tests/win.c
+6
-6
win.c
dlls/user/win.c
+9
-1
No files found.
dlls/user/menu.c
View file @
4ffc11ad
...
...
@@ -3790,6 +3790,7 @@ BOOL MENU_SetMenu( HWND hWnd, HMENU hMenu )
if
(
hMenu
&&
!
IsMenu
(
hMenu
))
{
WARN
(
"hMenu %p is not a menu handle
\n
"
,
hMenu
);
SetLastError
(
ERROR_INVALID_MENU_HANDLE
);
return
FALSE
;
}
if
(
!
WIN_ALLOWED_MENU
(
GetWindowLongW
(
hWnd
,
GWL_STYLE
)))
...
...
dlls/user/tests/win.c
View file @
4ffc11ad
...
...
@@ -2813,16 +2813,16 @@ static void test_params(void)
rc
=
GetWindowText
(
hwndMain2
,
NULL
,
1024
);
ok
(
rc
==
0
,
"GetWindowText: rc=%d err=%ld
\n
"
,
rc
,
GetLastError
());
SetLastError
(
0xdeadbeef
);
hwnd
=
CreateWindow
(
"LISTBOX"
,
"TestList"
,
(
LBS_STANDARD
&
~
LBS_SORT
),
0
,
0
,
100
,
100
,
NULL
,
(
HMENU
)
1
,
NULL
,
0
);
todo_wine
{
ok
(
hwnd
==
NULL
,
"CreateWindow(parent=NULL, ctlid!=0) should have failed
\n
"
);
}
/* NT sets LastError to ERROR_INVALID_MENU_HANDLE
* but Win9x leaves it unchanged. So no test.
*/
ok
(
!
hwnd
,
"CreateWindow with invalid menu handle should fail
\n
"
);
ok
(
GetLastError
()
==
ERROR_INVALID_MENU_HANDLE
||
/* NT */
GetLastError
()
==
0xdeadbeef
,
/* Win9x */
"wrong last error value %ld
\n
"
,
GetLastError
());
}
static
void
test_AWRwindow
(
LPCSTR
class
,
LONG
style
,
LONG
exStyle
,
BOOL
menu
)
...
...
dlls/user/win.c
View file @
4ffc11ad
...
...
@@ -1025,7 +1025,15 @@ static HWND WIN_CreateWindowEx( CREATESTRUCTA *cs, ATOM classAtom,
if
(((
wndPtr
->
dwStyle
&
(
WS_CAPTION
|
WS_CHILD
))
==
WS_CAPTION
)
||
(
wndPtr
->
dwExStyle
&
WS_EX_APPWINDOW
))
{
if
(
cs
->
hMenu
)
MENU_SetMenu
(
hwnd
,
cs
->
hMenu
);
if
(
cs
->
hMenu
)
{
if
(
!
MENU_SetMenu
(
hwnd
,
cs
->
hMenu
))
{
WIN_ReleasePtr
(
wndPtr
);
free_window_handle
(
hwnd
);
return
0
;
}
}
else
{
LPCSTR
menuName
=
(
LPCSTR
)
GetClassLongPtrA
(
hwnd
,
GCLP_MENUNAME
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment