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
fbf7046a
Commit
fbf7046a
authored
Jul 30, 2015
by
Piotr Caban
Committed by
Alexandre Julliard
Jul 30, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ole32: Don't pump all messages in CoWaitForMultipleHandles in threads without apartment window.
parent
fc761cb9
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
44 additions
and
2 deletions
+44
-2
compobj.c
dlls/ole32/compobj.c
+1
-1
compobj.c
dlls/ole32/tests/compobj.c
+43
-1
No files found.
dlls/ole32/compobj.c
View file @
fbf7046a
...
...
@@ -4388,7 +4388,7 @@ HRESULT WINAPI CoRevertToSelf(void)
static
BOOL
COM_PeekMessage
(
struct
apartment
*
apt
,
MSG
*
msg
)
{
/* first try to retrieve messages for incoming COM calls to the apartment window */
return
PeekMessageW
(
msg
,
apt
->
win
,
0
,
0
,
PM_REMOVE
|
PM_NOYIELD
)
||
return
(
apt
->
win
&&
PeekMessageW
(
msg
,
apt
->
win
,
0
,
0
,
PM_REMOVE
|
PM_NOYIELD
)
)
||
/* next retrieve other messages necessary for the app to remain responsive */
PeekMessageW
(
msg
,
NULL
,
WM_DDE_FIRST
,
WM_DDE_LAST
,
PM_REMOVE
|
PM_NOYIELD
)
||
PeekMessageW
(
msg
,
NULL
,
0
,
0
,
PM_QS_PAINT
|
PM_QS_SENDMESSAGE
|
PM_REMOVE
|
PM_NOYIELD
);
...
...
dlls/ole32/tests/compobj.c
View file @
fbf7046a
...
...
@@ -2126,9 +2126,45 @@ static DWORD CALLBACK post_message_thread(LPVOID arg)
return
0
;
}
static
const
char
cls_name
[]
=
"cowait_test_class"
;
static
DWORD
CALLBACK
test_CoWaitForMultipleHandles_thread
(
LPVOID
arg
)
{
HANDLE
*
handles
=
arg
;
BOOL
success
;
DWORD
index
;
HRESULT
hr
;
HWND
hWnd
;
MSG
msg
;
hr
=
pCoInitializeEx
(
NULL
,
COINIT_APARTMENTTHREADED
);
ok
(
hr
==
S_OK
,
"CoInitializeEx failed with error 0x%08x
\n
"
,
hr
);
hWnd
=
CreateWindowExA
(
0
,
cls_name
,
"Test (thread)"
,
WS_TILEDWINDOW
,
0
,
0
,
640
,
480
,
0
,
0
,
0
,
0
);
ok
(
hWnd
!=
0
,
"CreateWindowExA failed %u
\n
"
,
GetLastError
());
index
=
0xdeadbeef
;
PostMessageA
(
hWnd
,
WM_DDE_FIRST
,
0
,
0
);
hr
=
CoWaitForMultipleHandles
(
0
,
50
,
2
,
handles
,
&
index
);
ok
(
hr
==
RPC_S_CALLPENDING
,
"expected S_OK, got 0x%08x
\n
"
,
hr
);
ok
(
index
==
0
,
"expected index 0, got %u
\n
"
,
index
);
success
=
PeekMessageA
(
&
msg
,
hWnd
,
WM_DDE_FIRST
,
WM_DDE_FIRST
,
PM_REMOVE
);
ok
(
!
success
,
"CoWaitForMultipleHandles didn't pump any messages
\n
"
);
index
=
0xdeadbeef
;
PostMessageA
(
hWnd
,
WM_USER
,
0
,
0
);
hr
=
CoWaitForMultipleHandles
(
0
,
50
,
2
,
handles
,
&
index
);
ok
(
hr
==
RPC_S_CALLPENDING
,
"expected S_OK, got 0x%08x
\n
"
,
hr
);
ok
(
index
==
0
,
"expected index 0, got %u
\n
"
,
index
);
success
=
PeekMessageA
(
&
msg
,
hWnd
,
WM_USER
,
WM_USER
,
PM_REMOVE
);
ok
(
success
,
"CoWaitForMultipleHandles unexpectedly pumped messages
\n
"
);
DestroyWindow
(
hWnd
);
CoUninitialize
();
return
0
;
}
static
void
test_CoWaitForMultipleHandles
(
void
)
{
static
const
char
cls_name
[]
=
"cowait_test_class"
;
HANDLE
handles
[
2
],
thread
;
DWORD
index
,
tid
;
WNDCLASSEXA
wc
;
...
...
@@ -2431,6 +2467,12 @@ static void test_CoWaitForMultipleHandles(void)
CloseHandle
(
thread
);
}
/* test message pumping when CoWaitForMultipleHandles is called from non main apartment thread */
thread
=
CreateThread
(
NULL
,
0
,
test_CoWaitForMultipleHandles_thread
,
handles
,
0
,
&
tid
);
index
=
WaitForSingleObject
(
thread
,
500
);
ok
(
index
==
WAIT_OBJECT_0
,
"WaitForSingleObject failed
\n
"
);
CloseHandle
(
thread
);
CloseHandle
(
handles
[
0
]);
CloseHandle
(
handles
[
1
]);
DestroyWindow
(
hWnd
);
...
...
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