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
bbf68910
Commit
bbf68910
authored
Nov 05, 2014
by
Sebastian Lackner
Committed by
Alexandre Julliard
Nov 21, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ole32: Verify arguments for CoWaitForMultipleHandles, always initialize index to zero.
parent
f7f2167f
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
13 deletions
+11
-13
compobj.c
dlls/ole32/compobj.c
+11
-0
compobj.c
dlls/ole32/tests/compobj.c
+0
-13
No files found.
dlls/ole32/compobj.c
View file @
bbf68910
...
...
@@ -4431,6 +4431,17 @@ HRESULT WINAPI CoWaitForMultipleHandles(DWORD dwFlags, DWORD dwTimeout,
TRACE
(
"(0x%08x, 0x%08x, %d, %p, %p)
\n
"
,
dwFlags
,
dwTimeout
,
cHandles
,
pHandles
,
lpdwindex
);
if
(
!
lpdwindex
)
return
E_INVALIDARG
;
*
lpdwindex
=
0
;
if
(
!
pHandles
)
return
E_INVALIDARG
;
if
(
!
cHandles
)
return
RPC_E_NO_SYNC
;
while
(
TRUE
)
{
DWORD
now
=
GetTickCount
();
...
...
dlls/ole32/tests/compobj.c
View file @
bbf68910
...
...
@@ -2139,32 +2139,24 @@ static void test_CoWaitForMultipleHandles(void)
PostMessageA
(
hWnd
,
WM_DDE_FIRST
,
0
,
0
);
hr
=
CoWaitForMultipleHandles
(
0
,
50
,
0
,
handles
,
NULL
);
todo_wine
ok
(
hr
==
E_INVALIDARG
,
"expected E_INVALIDARG, got 0x%08x
\n
"
,
hr
);
success
=
PeekMessageA
(
&
msg
,
hWnd
,
WM_DDE_FIRST
,
WM_DDE_FIRST
,
PM_REMOVE
);
todo_wine
ok
(
success
,
"CoWaitForMultipleHandles unexpectedly pumped messages
\n
"
);
index
=
0xdeadbeef
;
PostMessageA
(
hWnd
,
WM_DDE_FIRST
,
0
,
0
);
hr
=
CoWaitForMultipleHandles
(
0
,
50
,
0
,
NULL
,
&
index
);
todo_wine
ok
(
hr
==
E_INVALIDARG
,
"expected E_INVALIDARG, got 0x%08x
\n
"
,
hr
);
todo_wine
ok
(
index
==
0
,
"expected index 0, got %u
\n
"
,
index
);
success
=
PeekMessageA
(
&
msg
,
hWnd
,
WM_DDE_FIRST
,
WM_DDE_FIRST
,
PM_REMOVE
);
todo_wine
ok
(
success
,
"CoWaitForMultipleHandles unexpectedly pumped messages
\n
"
);
index
=
0xdeadbeef
;
PostMessageA
(
hWnd
,
WM_DDE_FIRST
,
0
,
0
);
hr
=
CoWaitForMultipleHandles
(
0
,
50
,
0
,
handles
,
&
index
);
todo_wine
ok
(
hr
==
RPC_E_NO_SYNC
,
"expected RPC_E_NO_SYNC, got 0x%08x
\n
"
,
hr
);
todo_wine
ok
(
index
==
0
,
"expected index 0, got %u
\n
"
,
index
);
success
=
PeekMessageA
(
&
msg
,
hWnd
,
WM_DDE_FIRST
,
WM_DDE_FIRST
,
PM_REMOVE
);
todo_wine
ok
(
success
,
"CoWaitForMultipleHandles unexpectedly pumped messages
\n
"
);
index
=
0xdeadbeef
;
...
...
@@ -2187,7 +2179,6 @@ static void test_CoWaitForMultipleHandles(void)
PostMessageA
(
hWnd
,
WM_DDE_FIRST
,
0
,
0
);
hr
=
CoWaitForMultipleHandles
(
0
,
50
,
2
,
handles
,
&
index
);
ok
(
hr
==
RPC_S_CALLPENDING
,
"expected RPC_S_CALLPENDING, got 0x%08x
\n
"
,
hr
);
todo_wine
ok
(
index
==
0
||
broken
(
index
==
0xdeadbeef
)
/* Win 8 */
,
"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
"
);
...
...
@@ -2209,7 +2200,6 @@ static void test_CoWaitForMultipleHandles(void)
PostMessageA
(
hWnd
,
WM_DDE_FIRST
,
0
,
0
);
hr
=
CoWaitForMultipleHandles
(
0
,
50
,
2
,
handles
,
&
index
);
ok
(
hr
==
RPC_S_CALLPENDING
,
"expected RPC_S_CALLPENDING, got 0x%08x
\n
"
,
hr
);
todo_wine
ok
(
index
==
0
||
broken
(
index
==
0xdeadbeef
)
/* Win 8 */
,
"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
"
);
...
...
@@ -2239,7 +2229,6 @@ static void test_CoWaitForMultipleHandles(void)
PostMessageA
(
hWnd
,
WM_DDE_FIRST
,
0
,
0
);
hr
=
CoWaitForMultipleHandles
(
COWAIT_ALERTABLE
,
50
,
2
,
handles
,
&
index
);
ok
(
hr
==
RPC_S_CALLPENDING
,
"expected RPC_S_CALLPENDING, got 0x%08x
\n
"
,
hr
);
todo_wine
ok
(
index
==
0
||
broken
(
index
==
0xdeadbeef
)
/* Win 8 */
,
"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
"
);
...
...
@@ -2263,7 +2252,6 @@ static void test_CoWaitForMultipleHandles(void)
ok
(
success
,
"PeekMessageA returned FALSE
\n
"
);
hr
=
CoWaitForMultipleHandles
(
0
,
50
,
2
,
handles
,
&
index
);
ok
(
hr
==
RPC_S_CALLPENDING
,
"expected RPC_S_CALLPENDING, got 0x%08x
\n
"
,
hr
);
todo_wine
ok
(
index
==
0
||
broken
(
index
==
0xdeadbeef
)
/* Win 8 */
,
"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
"
);
...
...
@@ -2278,7 +2266,6 @@ static void test_CoWaitForMultipleHandles(void)
ok
(
hr
==
RPC_S_CALLPENDING
||
broken
(
hr
==
E_INVALIDARG
)
||
broken
(
hr
==
S_OK
)
/* Win 8 */
,
"expected RPC_S_CALLPENDING, got 0x%08x
\n
"
,
hr
);
ReleaseSemaphore
(
handles
[
1
],
1
,
NULL
);
todo_wine
ok
(
index
==
0
||
broken
(
index
==
1
)
/* Win 8 */
,
"expected index 0, got %u
\n
"
,
index
);
success
=
PeekMessageA
(
&
msg
,
hWnd
,
WM_DDE_FIRST
,
WM_DDE_FIRST
,
PM_REMOVE
);
ok
(
!
success
||
broken
(
success
&&
hr
==
E_INVALIDARG
),
...
...
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