Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
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-winehq
Commits
1b27890a
Commit
1b27890a
authored
Oct 23, 2009
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
user32: Fix the return value of EnumThreadWindows.
parent
a04c6db8
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
58 additions
and
2 deletions
+58
-2
win.c
dlls/user32/tests/win.c
+55
-0
win.c
dlls/user32/win.c
+3
-2
No files found.
dlls/user32/tests/win.c
View file @
1b27890a
...
...
@@ -569,6 +569,60 @@ static void test_parent_owner(void)
DestroyWindow
(
owner
);
}
static
BOOL
CALLBACK
enum_proc
(
HWND
hwnd
,
LPARAM
lParam
)
{
(
*
(
LPINT
)
lParam
)
++
;
if
(
*
(
LPINT
)
lParam
>
2
)
return
FALSE
;
return
TRUE
;
}
static
DWORD
CALLBACK
enum_thread
(
void
*
arg
)
{
INT
count
;
HWND
hwnd
[
3
];
BOOL
ret
;
MSG
msg
;
PeekMessage
(
&
msg
,
0
,
0
,
0
,
PM_NOREMOVE
);
/* make sure we have a message queue */
count
=
0
;
ret
=
EnumThreadWindows
(
GetCurrentThreadId
(),
enum_proc
,
(
LPARAM
)
&
count
);
ok
(
ret
,
"EnumThreadWindows should have returned TRUE
\n
"
);
ok
(
count
==
0
,
"count should be 0 got %d
\n
"
,
count
);
hwnd
[
0
]
=
CreateWindowExA
(
0
,
"ToolWindowClass"
,
"Tool window 1"
,
WS_POPUP
,
0
,
0
,
100
,
100
,
0
,
0
,
0
,
NULL
);
count
=
0
;
ret
=
EnumThreadWindows
(
GetCurrentThreadId
(),
enum_proc
,
(
LPARAM
)
&
count
);
ok
(
ret
,
"EnumThreadWindows should have returned TRUE
\n
"
);
if
(
count
!=
2
)
/* Vista gives us two windows for the price of one */
{
ok
(
count
==
1
,
"count should be 1 got %d
\n
"
,
count
);
hwnd
[
2
]
=
CreateWindowExA
(
0
,
"ToolWindowClass"
,
"Tool window 2"
,
WS_POPUP
,
0
,
0
,
100
,
100
,
0
,
0
,
0
,
NULL
);
}
else
hwnd
[
2
]
=
0
;
hwnd
[
1
]
=
CreateWindowExA
(
0
,
"ToolWindowClass"
,
"Tool window 3"
,
WS_POPUP
,
0
,
0
,
100
,
100
,
0
,
0
,
0
,
NULL
);
count
=
0
;
ret
=
EnumThreadWindows
(
GetCurrentThreadId
(),
enum_proc
,
(
LPARAM
)
&
count
);
ok
(
!
ret
,
"EnumThreadWindows should have returned FALSE
\n
"
);
ok
(
count
==
3
,
"count should be 1 got %d
\n
"
,
count
);
if
(
hwnd
[
2
])
DestroyWindow
(
hwnd
[
2
]);
DestroyWindow
(
hwnd
[
1
]);
DestroyWindow
(
hwnd
[
0
]);
return
0
;
}
/* test EnumThreadWindows in a separate thread */
static
void
test_enum_thread_windows
(
void
)
{
DWORD
id
;
HANDLE
handle
=
CreateThread
(
NULL
,
0
,
enum_thread
,
0
,
0
,
&
id
);
ok
(
!
WaitForSingleObject
(
handle
,
10000
),
"wait failed
\n
"
);
CloseHandle
(
handle
);
}
static
LRESULT
WINAPI
main_window_procA
(
HWND
hwnd
,
UINT
msg
,
WPARAM
wparam
,
LPARAM
lparam
)
{
...
...
@@ -5762,6 +5816,7 @@ START_TEST(win)
test_CreateWindow
();
test_parent_owner
();
test_SetParent
();
test_enum_thread_windows
();
test_mdi
();
test_icons
();
...
...
dlls/user32/win.c
View file @
1b27890a
...
...
@@ -3151,6 +3151,7 @@ BOOL WINAPI EnumThreadWindows( DWORD id, WNDENUMPROC func, LPARAM lParam )
{
HWND
*
list
;
int
i
;
BOOL
ret
=
TRUE
;
USER_CheckNotLock
();
...
...
@@ -3159,9 +3160,9 @@ BOOL WINAPI EnumThreadWindows( DWORD id, WNDENUMPROC func, LPARAM lParam )
/* Now call the callback function for every window */
for
(
i
=
0
;
list
[
i
];
i
++
)
if
(
!
func
(
list
[
i
],
lParam
))
break
;
if
(
!
(
ret
=
func
(
list
[
i
],
lParam
)
))
break
;
HeapFree
(
GetProcessHeap
(),
0
,
list
);
return
TRUE
;
return
ret
;
}
...
...
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