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
7cabef14
Commit
7cabef14
authored
Apr 21, 2016
by
Henri Verbeet
Committed by
Alexandre Julliard
Apr 22, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ddraw: Require exclusive mode only for primary surface flips.
Signed-off-by:
Henri Verbeet
<
hverbeet@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
1736431c
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
66 additions
and
9 deletions
+66
-9
surface.c
dlls/ddraw/surface.c
+2
-1
ddraw1.c
dlls/ddraw/tests/ddraw1.c
+16
-2
ddraw2.c
dlls/ddraw/tests/ddraw2.c
+16
-2
ddraw4.c
dlls/ddraw/tests/ddraw4.c
+16
-2
ddraw7.c
dlls/ddraw/tests/ddraw7.c
+16
-2
No files found.
dlls/ddraw/surface.c
View file @
7cabef14
...
...
@@ -1235,7 +1235,8 @@ static HRESULT WINAPI DECLSPEC_HOTPATCH ddraw_surface7_Flip(IDirectDrawSurface7
wined3d_mutex_lock
();
if
(
!
(
dst_impl
->
ddraw
->
cooperative_level
&
DDSCL_EXCLUSIVE
))
if
((
dst_impl
->
surface_desc
.
ddsCaps
.
dwCaps
&
DDSCAPS_PRIMARYSURFACE
)
&&
!
(
dst_impl
->
ddraw
->
cooperative_level
&
DDSCL_EXCLUSIVE
))
{
WARN
(
"Not in exclusive mode.
\n
"
);
wined3d_mutex_unlock
();
...
...
dlls/ddraw/tests/ddraw1.c
View file @
7cabef14
...
...
@@ -4197,8 +4197,6 @@ static void test_flip(void)
ddraw
=
create_ddraw
();
ok
(
!!
ddraw
,
"Failed to create a ddraw object.
\n
"
);
hr
=
set_display_mode
(
ddraw
,
640
,
480
);
ok
(
SUCCEEDED
(
hr
),
"Failed to set display mode, hr %#x.
\n
"
,
hr
);
hr
=
IDirectDraw_SetCooperativeLevel
(
ddraw
,
window
,
DDSCL_EXCLUSIVE
|
DDSCL_FULLSCREEN
);
ok
(
SUCCEEDED
(
hr
),
"Failed to set cooperative level, hr %#x.
\n
"
,
hr
);
...
...
@@ -4233,6 +4231,22 @@ static void test_flip(void)
if
(
FAILED
(
hr
))
continue
;
hr
=
IDirectDraw_SetCooperativeLevel
(
ddraw
,
window
,
DDSCL_NORMAL
|
DDSCL_FULLSCREEN
);
ok
(
SUCCEEDED
(
hr
),
"%s: Failed to set cooperative level, hr %#x.
\n
"
,
test_data
[
i
].
name
,
hr
);
hr
=
IDirectDrawSurface_IsLost
(
frontbuffer
);
ok
(
hr
==
DD_OK
,
"%s: Got unexpected hr %#x.
\n
"
,
test_data
[
i
].
name
,
hr
);
hr
=
IDirectDrawSurface_Flip
(
frontbuffer
,
NULL
,
DDFLIP_WAIT
);
if
(
test_data
[
i
].
caps
&
DDSCAPS_PRIMARYSURFACE
)
ok
(
hr
==
DDERR_NOEXCLUSIVEMODE
,
"%s: Got unexpected hr %#x.
\n
"
,
test_data
[
i
].
name
,
hr
);
else
ok
(
SUCCEEDED
(
hr
),
"%s: Failed to flip, hr %#x.
\n
"
,
test_data
[
i
].
name
,
hr
);
hr
=
IDirectDraw_SetCooperativeLevel
(
ddraw
,
window
,
DDSCL_EXCLUSIVE
|
DDSCL_FULLSCREEN
);
ok
(
SUCCEEDED
(
hr
),
"%s: Failed to set cooperative level, hr %#x.
\n
"
,
test_data
[
i
].
name
,
hr
);
hr
=
IDirectDrawSurface_IsLost
(
frontbuffer
);
todo_wine
ok
(
hr
==
DDERR_SURFACELOST
,
"%s: Got unexpected hr %#x.
\n
"
,
test_data
[
i
].
name
,
hr
);
hr
=
restore_surfaces
(
ddraw
);
ok
(
SUCCEEDED
(
hr
),
"%s: Failed to restore surfaces, hr %#x.
\n
"
,
test_data
[
i
].
name
,
hr
);
memset
(
&
surface_desc
,
0
,
sizeof
(
surface_desc
));
surface_desc
.
dwSize
=
sizeof
(
surface_desc
);
hr
=
IDirectDrawSurface_GetSurfaceDesc
(
frontbuffer
,
&
surface_desc
);
...
...
dlls/ddraw/tests/ddraw2.c
View file @
7cabef14
...
...
@@ -4830,8 +4830,6 @@ static void test_flip(void)
ddraw
=
create_ddraw
();
ok
(
!!
ddraw
,
"Failed to create a ddraw object.
\n
"
);
hr
=
set_display_mode
(
ddraw
,
640
,
480
);
ok
(
SUCCEEDED
(
hr
),
"Failed to set display mode, hr %#x.
\n
"
,
hr
);
hr
=
IDirectDraw2_SetCooperativeLevel
(
ddraw
,
window
,
DDSCL_EXCLUSIVE
|
DDSCL_FULLSCREEN
);
ok
(
SUCCEEDED
(
hr
),
"Failed to set cooperative level, hr %#x.
\n
"
,
hr
);
...
...
@@ -4866,6 +4864,22 @@ static void test_flip(void)
if
(
FAILED
(
hr
))
continue
;
hr
=
IDirectDraw2_SetCooperativeLevel
(
ddraw
,
window
,
DDSCL_NORMAL
|
DDSCL_FULLSCREEN
);
ok
(
SUCCEEDED
(
hr
),
"%s: Failed to set cooperative level, hr %#x.
\n
"
,
test_data
[
i
].
name
,
hr
);
hr
=
IDirectDrawSurface_IsLost
(
frontbuffer
);
ok
(
hr
==
DD_OK
,
"%s: Got unexpected hr %#x.
\n
"
,
test_data
[
i
].
name
,
hr
);
hr
=
IDirectDrawSurface_Flip
(
frontbuffer
,
NULL
,
DDFLIP_WAIT
);
if
(
test_data
[
i
].
caps
&
DDSCAPS_PRIMARYSURFACE
)
ok
(
hr
==
DDERR_NOEXCLUSIVEMODE
,
"%s: Got unexpected hr %#x.
\n
"
,
test_data
[
i
].
name
,
hr
);
else
ok
(
SUCCEEDED
(
hr
),
"%s: Failed to flip, hr %#x.
\n
"
,
test_data
[
i
].
name
,
hr
);
hr
=
IDirectDraw2_SetCooperativeLevel
(
ddraw
,
window
,
DDSCL_EXCLUSIVE
|
DDSCL_FULLSCREEN
);
ok
(
SUCCEEDED
(
hr
),
"%s: Failed to set cooperative level, hr %#x.
\n
"
,
test_data
[
i
].
name
,
hr
);
hr
=
IDirectDrawSurface_IsLost
(
frontbuffer
);
todo_wine
ok
(
hr
==
DDERR_SURFACELOST
,
"%s: Got unexpected hr %#x.
\n
"
,
test_data
[
i
].
name
,
hr
);
hr
=
restore_surfaces
(
ddraw
);
ok
(
SUCCEEDED
(
hr
),
"%s: Failed to restore surfaces, hr %#x.
\n
"
,
test_data
[
i
].
name
,
hr
);
memset
(
&
surface_desc
,
0
,
sizeof
(
surface_desc
));
surface_desc
.
dwSize
=
sizeof
(
surface_desc
);
hr
=
IDirectDrawSurface_GetSurfaceDesc
(
frontbuffer
,
&
surface_desc
);
...
...
dlls/ddraw/tests/ddraw4.c
View file @
7cabef14
...
...
@@ -6150,8 +6150,6 @@ static void test_flip(void)
ddraw
=
create_ddraw
();
ok
(
!!
ddraw
,
"Failed to create a ddraw object.
\n
"
);
hr
=
set_display_mode
(
ddraw
,
640
,
480
);
ok
(
SUCCEEDED
(
hr
),
"Failed to set display mode, hr %#x.
\n
"
,
hr
);
hr
=
IDirectDraw4_SetCooperativeLevel
(
ddraw
,
window
,
DDSCL_EXCLUSIVE
|
DDSCL_FULLSCREEN
);
ok
(
SUCCEEDED
(
hr
),
"Failed to set cooperative level, hr %#x.
\n
"
,
hr
);
...
...
@@ -6239,6 +6237,22 @@ static void test_flip(void)
test_data
[
i
].
name
,
surface
,
frontbuffer
);
IDirectDrawSurface4_Release
(
surface
);
hr
=
IDirectDraw4_SetCooperativeLevel
(
ddraw
,
window
,
DDSCL_NORMAL
|
DDSCL_FULLSCREEN
);
ok
(
SUCCEEDED
(
hr
),
"%s: Failed to set cooperative level, hr %#x.
\n
"
,
test_data
[
i
].
name
,
hr
);
hr
=
IDirectDrawSurface4_IsLost
(
frontbuffer
);
ok
(
hr
==
DD_OK
,
"%s: Got unexpected hr %#x.
\n
"
,
test_data
[
i
].
name
,
hr
);
hr
=
IDirectDrawSurface4_Flip
(
frontbuffer
,
NULL
,
DDFLIP_WAIT
);
if
(
test_data
[
i
].
caps
&
DDSCAPS_PRIMARYSURFACE
)
ok
(
hr
==
DDERR_NOEXCLUSIVEMODE
,
"%s: Got unexpected hr %#x.
\n
"
,
test_data
[
i
].
name
,
hr
);
else
ok
(
SUCCEEDED
(
hr
),
"%s: Failed to flip, hr %#x.
\n
"
,
test_data
[
i
].
name
,
hr
);
hr
=
IDirectDraw4_SetCooperativeLevel
(
ddraw
,
window
,
DDSCL_EXCLUSIVE
|
DDSCL_FULLSCREEN
);
ok
(
SUCCEEDED
(
hr
),
"%s: Failed to set cooperative level, hr %#x.
\n
"
,
test_data
[
i
].
name
,
hr
);
hr
=
IDirectDrawSurface4_IsLost
(
frontbuffer
);
todo_wine
ok
(
hr
==
DDERR_SURFACELOST
,
"%s: Got unexpected hr %#x.
\n
"
,
test_data
[
i
].
name
,
hr
);
hr
=
IDirectDraw4_RestoreAllSurfaces
(
ddraw
);
ok
(
SUCCEEDED
(
hr
),
"%s: Failed to restore surfaces, hr %#x.
\n
"
,
test_data
[
i
].
name
,
hr
);
memset
(
&
surface_desc
,
0
,
sizeof
(
surface_desc
));
surface_desc
.
dwSize
=
sizeof
(
surface_desc
);
surface_desc
.
dwFlags
=
DDSD_CAPS
|
DDSD_WIDTH
|
DDSD_HEIGHT
;
...
...
dlls/ddraw/tests/ddraw7.c
View file @
7cabef14
...
...
@@ -6018,8 +6018,6 @@ static void test_flip(void)
ddraw
=
create_ddraw
();
ok
(
!!
ddraw
,
"Failed to create a ddraw object.
\n
"
);
hr
=
set_display_mode
(
ddraw
,
640
,
480
);
ok
(
SUCCEEDED
(
hr
),
"Failed to set display mode, hr %#x.
\n
"
,
hr
);
hr
=
IDirectDraw7_SetCooperativeLevel
(
ddraw
,
window
,
DDSCL_EXCLUSIVE
|
DDSCL_FULLSCREEN
);
ok
(
SUCCEEDED
(
hr
),
"Failed to set cooperative level, hr %#x.
\n
"
,
hr
);
...
...
@@ -6109,6 +6107,22 @@ static void test_flip(void)
test_data
[
i
].
name
,
surface
,
frontbuffer
);
IDirectDrawSurface7_Release
(
surface
);
hr
=
IDirectDraw7_SetCooperativeLevel
(
ddraw
,
window
,
DDSCL_NORMAL
|
DDSCL_FULLSCREEN
);
ok
(
SUCCEEDED
(
hr
),
"%s: Failed to set cooperative level, hr %#x.
\n
"
,
test_data
[
i
].
name
,
hr
);
hr
=
IDirectDrawSurface7_IsLost
(
frontbuffer
);
ok
(
hr
==
DD_OK
,
"%s: Got unexpected hr %#x.
\n
"
,
test_data
[
i
].
name
,
hr
);
hr
=
IDirectDrawSurface7_Flip
(
frontbuffer
,
NULL
,
DDFLIP_WAIT
);
if
(
test_data
[
i
].
caps
&
DDSCAPS_PRIMARYSURFACE
)
ok
(
hr
==
DDERR_NOEXCLUSIVEMODE
,
"%s: Got unexpected hr %#x.
\n
"
,
test_data
[
i
].
name
,
hr
);
else
ok
(
SUCCEEDED
(
hr
),
"%s: Failed to flip, hr %#x.
\n
"
,
test_data
[
i
].
name
,
hr
);
hr
=
IDirectDraw7_SetCooperativeLevel
(
ddraw
,
window
,
DDSCL_EXCLUSIVE
|
DDSCL_FULLSCREEN
);
ok
(
SUCCEEDED
(
hr
),
"%s: Failed to set cooperative level, hr %#x.
\n
"
,
test_data
[
i
].
name
,
hr
);
hr
=
IDirectDrawSurface7_IsLost
(
frontbuffer
);
todo_wine
ok
(
hr
==
DDERR_SURFACELOST
,
"%s: Got unexpected hr %#x.
\n
"
,
test_data
[
i
].
name
,
hr
);
hr
=
IDirectDraw7_RestoreAllSurfaces
(
ddraw
);
ok
(
SUCCEEDED
(
hr
),
"%s: Failed to restore surfaces, hr %#x.
\n
"
,
test_data
[
i
].
name
,
hr
);
memset
(
&
surface_desc
,
0
,
sizeof
(
surface_desc
));
surface_desc
.
dwSize
=
sizeof
(
surface_desc
);
surface_desc
.
dwFlags
=
DDSD_CAPS
|
DDSD_WIDTH
|
DDSD_HEIGHT
;
...
...
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