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
c15d89c8
Commit
c15d89c8
authored
Dec 03, 2013
by
Stefan Dösinger
Committed by
Alexandre Julliard
Dec 03, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ddraw: SetSurfaceDesc accepts DDSD_CAPS with dwCaps=0.
parent
1f366058
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
34 additions
and
4 deletions
+34
-4
surface.c
dlls/ddraw/surface.c
+1
-1
ddraw2.c
dlls/ddraw/tests/ddraw2.c
+9
-1
ddraw4.c
dlls/ddraw/tests/ddraw4.c
+12
-1
ddraw7.c
dlls/ddraw/tests/ddraw7.c
+12
-1
No files found.
dlls/ddraw/surface.c
View file @
c15d89c8
...
...
@@ -4264,7 +4264,7 @@ static HRESULT WINAPI ddraw_surface7_SetSurfaceDesc(IDirectDrawSurface7 *iface,
WARN
(
"DDSD_LPSURFACE is not set, returning DDERR_INVALIDPARAMS
\n
"
);
return
DDERR_INVALIDPARAMS
;
}
if
(
DDSD
->
dwFlags
&
DDSD_CAPS
)
if
(
(
DDSD
->
dwFlags
&
DDSD_CAPS
)
&&
DDSD
->
ddsCaps
.
dwCaps
)
{
WARN
(
"DDSD_CAPS is set, returning DDERR_INVALIDCAPS.
\n
"
);
return
DDERR_INVALIDCAPS
;
...
...
dlls/ddraw/tests/ddraw2.c
View file @
c15d89c8
...
...
@@ -4476,6 +4476,7 @@ static void test_set_surface_desc(void)
hr
=
IDirectDrawSurface3_GetSurfaceDesc
(
surface3
,
&
ddsd
);
ok
(
SUCCEEDED
(
hr
),
"Failed to get surface desc, hr %#x.
\n
"
,
hr
);
ok
(
ddsd
.
ddsCaps
.
dwCaps
==
DDSCAPS_SYSTEMMEMORY
,
"Got unexpected caps %#x.
\n
"
,
ddsd
.
ddsCaps
.
dwCaps
);
/* Setting the caps is an error. This also means the original description cannot be reapplied. */
hr
=
IDirectDrawSurface3_SetSurfaceDesc
(
surface3
,
&
ddsd
,
0
);
...
...
@@ -4485,7 +4486,7 @@ static void test_set_surface_desc(void)
hr
=
IDirectDrawSurface3_SetSurfaceDesc
(
surface3
,
&
ddsd
,
0
);
ok
(
hr
==
DDERR_INVALIDPARAMS
,
"Setting DDSD_CAPS returned %#x.
\n
"
,
hr
);
/*
TODO: The INVALIDCAPS return value suggests that some caps can be set
. */
/*
dwCaps = 0 is allowed, but ignored
. */
ddsd
.
dwFlags
=
DDSD_CAPS
|
DDSD_LPSURFACE
;
ddsd
.
lpSurface
=
data
;
hr
=
IDirectDrawSurface3_SetSurfaceDesc
(
surface3
,
&
ddsd
,
0
);
...
...
@@ -4493,6 +4494,13 @@ static void test_set_surface_desc(void)
ddsd
.
ddsCaps
.
dwCaps
=
DDSCAPS_SYSTEMMEMORY
;
hr
=
IDirectDrawSurface3_SetSurfaceDesc
(
surface3
,
&
ddsd
,
0
);
ok
(
hr
==
DDERR_INVALIDCAPS
,
"Setting DDSD_CAPS returned %#x.
\n
"
,
hr
);
ddsd
.
ddsCaps
.
dwCaps
=
0
;
hr
=
IDirectDrawSurface3_SetSurfaceDesc
(
surface3
,
&
ddsd
,
0
);
ok
(
SUCCEEDED
(
hr
),
"Failed to set surface desc, hr %#x.
\n
"
,
hr
);
hr
=
IDirectDrawSurface3_GetSurfaceDesc
(
surface3
,
&
ddsd
);
ok
(
SUCCEEDED
(
hr
),
"Failed to get surface desc, hr %#x.
\n
"
,
hr
);
ok
(
ddsd
.
ddsCaps
.
dwCaps
==
DDSCAPS_SYSTEMMEMORY
,
"Got unexpected caps %#x.
\n
"
,
ddsd
.
ddsCaps
.
dwCaps
);
/* Setting the height is allowed, but it cannot be set to 0, and only if LPSURFACE is set too. */
reset_ddsd
(
&
ddsd
);
...
...
dlls/ddraw/tests/ddraw4.c
View file @
c15d89c8
...
...
@@ -5077,6 +5077,8 @@ static void test_set_surface_desc(void)
hr
=
IDirectDrawSurface4_GetSurfaceDesc
(
surface
,
&
ddsd
);
ok
(
SUCCEEDED
(
hr
),
"Failed to get surface desc, hr %#x.
\n
"
,
hr
);
ok
(
ddsd
.
ddsCaps
.
dwCaps
==
DDSCAPS_SYSTEMMEMORY
,
"Got unexpected caps %#x.
\n
"
,
ddsd
.
ddsCaps
.
dwCaps
);
ok
(
ddsd
.
ddsCaps
.
dwCaps2
==
0
,
"Got unexpected caps2 %#x.
\n
"
,
0
);
/* Setting the caps is an error. This also means the original description cannot be reapplied. */
hr
=
IDirectDrawSurface4_SetSurfaceDesc
(
surface
,
&
ddsd
,
0
);
...
...
@@ -5086,7 +5088,7 @@ static void test_set_surface_desc(void)
hr
=
IDirectDrawSurface4_SetSurfaceDesc
(
surface
,
&
ddsd
,
0
);
ok
(
hr
==
DDERR_INVALIDPARAMS
,
"Setting DDSD_CAPS returned %#x.
\n
"
,
hr
);
/*
TODO: The INVALIDCAPS return value suggests that some caps can be set
. */
/*
dwCaps = 0 is allowed, but ignored. Caps2 can be anything and is ignored too
. */
ddsd
.
dwFlags
=
DDSD_CAPS
|
DDSD_LPSURFACE
;
ddsd
.
lpSurface
=
data
;
hr
=
IDirectDrawSurface4_SetSurfaceDesc
(
surface
,
&
ddsd
,
0
);
...
...
@@ -5094,6 +5096,15 @@ static void test_set_surface_desc(void)
ddsd
.
ddsCaps
.
dwCaps
=
DDSCAPS_SYSTEMMEMORY
;
hr
=
IDirectDrawSurface4_SetSurfaceDesc
(
surface
,
&
ddsd
,
0
);
ok
(
hr
==
DDERR_INVALIDCAPS
,
"Setting DDSD_CAPS returned %#x.
\n
"
,
hr
);
ddsd
.
ddsCaps
.
dwCaps
=
0
;
ddsd
.
ddsCaps
.
dwCaps2
=
0xdeadbeef
;
hr
=
IDirectDrawSurface4_SetSurfaceDesc
(
surface
,
&
ddsd
,
0
);
ok
(
SUCCEEDED
(
hr
),
"Failed to set surface desc, hr %#x.
\n
"
,
hr
);
hr
=
IDirectDrawSurface4_GetSurfaceDesc
(
surface
,
&
ddsd
);
ok
(
SUCCEEDED
(
hr
),
"Failed to get surface desc, hr %#x.
\n
"
,
hr
);
ok
(
ddsd
.
ddsCaps
.
dwCaps
==
DDSCAPS_SYSTEMMEMORY
,
"Got unexpected caps %#x.
\n
"
,
ddsd
.
ddsCaps
.
dwCaps
);
ok
(
ddsd
.
ddsCaps
.
dwCaps2
==
0
,
"Got unexpected caps2 %#x.
\n
"
,
0
);
/* Setting the height is allowed, but it cannot be set to 0, and only if LPSURFACE is set too. */
reset_ddsd
(
&
ddsd
);
...
...
dlls/ddraw/tests/ddraw7.c
View file @
c15d89c8
...
...
@@ -4964,6 +4964,8 @@ static void test_set_surface_desc(void)
hr
=
IDirectDrawSurface7_GetSurfaceDesc
(
surface
,
&
ddsd
);
ok
(
SUCCEEDED
(
hr
),
"Failed to get surface desc, hr %#x.
\n
"
,
hr
);
ok
(
ddsd
.
ddsCaps
.
dwCaps
==
DDSCAPS_SYSTEMMEMORY
,
"Got unexpected caps %#x.
\n
"
,
ddsd
.
ddsCaps
.
dwCaps
);
ok
(
ddsd
.
ddsCaps
.
dwCaps2
==
0
,
"Got unexpected caps2 %#x.
\n
"
,
0
);
/* Setting the caps is an error. This also means the original description cannot be reapplied. */
hr
=
IDirectDrawSurface7_SetSurfaceDesc
(
surface
,
&
ddsd
,
0
);
...
...
@@ -4973,7 +4975,7 @@ static void test_set_surface_desc(void)
hr
=
IDirectDrawSurface7_SetSurfaceDesc
(
surface
,
&
ddsd
,
0
);
ok
(
hr
==
DDERR_INVALIDPARAMS
,
"Setting DDSD_CAPS returned %#x.
\n
"
,
hr
);
/*
TODO: The INVALIDCAPS return value suggests that some caps can be set
. */
/*
dwCaps = 0 is allowed, but ignored. Caps2 can be anything and is ignored too
. */
ddsd
.
dwFlags
=
DDSD_CAPS
|
DDSD_LPSURFACE
;
ddsd
.
lpSurface
=
data
;
hr
=
IDirectDrawSurface7_SetSurfaceDesc
(
surface
,
&
ddsd
,
0
);
...
...
@@ -4981,6 +4983,15 @@ static void test_set_surface_desc(void)
ddsd
.
ddsCaps
.
dwCaps
=
DDSCAPS_SYSTEMMEMORY
;
hr
=
IDirectDrawSurface7_SetSurfaceDesc
(
surface
,
&
ddsd
,
0
);
ok
(
hr
==
DDERR_INVALIDCAPS
,
"Setting DDSD_CAPS returned %#x.
\n
"
,
hr
);
ddsd
.
ddsCaps
.
dwCaps
=
0
;
ddsd
.
ddsCaps
.
dwCaps2
=
0xdeadbeef
;
hr
=
IDirectDrawSurface7_SetSurfaceDesc
(
surface
,
&
ddsd
,
0
);
ok
(
SUCCEEDED
(
hr
),
"Failed to set surface desc, hr %#x.
\n
"
,
hr
);
hr
=
IDirectDrawSurface7_GetSurfaceDesc
(
surface
,
&
ddsd
);
ok
(
SUCCEEDED
(
hr
),
"Failed to get surface desc, hr %#x.
\n
"
,
hr
);
ok
(
ddsd
.
ddsCaps
.
dwCaps
==
DDSCAPS_SYSTEMMEMORY
,
"Got unexpected caps %#x.
\n
"
,
ddsd
.
ddsCaps
.
dwCaps
);
ok
(
ddsd
.
ddsCaps
.
dwCaps2
==
0
,
"Got unexpected caps2 %#x.
\n
"
,
0
);
/* Setting the height is allowed, but it cannot be set to 0, and only if LPSURFACE is set too. */
reset_ddsd
(
&
ddsd
);
...
...
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