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
6c9e1a47
Commit
6c9e1a47
authored
Jan 25, 2016
by
Henri Verbeet
Committed by
Alexandre Julliard
Jan 26, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ddraw: DDSD_LPSURFACE requires a non-NULL lpSurface.
Signed-off-by:
Henri Verbeet
<
hverbeet@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
43c43179
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
36 additions
and
5 deletions
+36
-5
surface.c
dlls/ddraw/surface.c
+8
-1
ddraw1.c
dlls/ddraw/tests/ddraw1.c
+7
-1
ddraw2.c
dlls/ddraw/tests/ddraw2.c
+7
-1
ddraw4.c
dlls/ddraw/tests/ddraw4.c
+7
-1
ddraw7.c
dlls/ddraw/tests/ddraw7.c
+7
-1
No files found.
dlls/ddraw/surface.c
View file @
6c9e1a47
...
...
@@ -5970,7 +5970,7 @@ HRESULT ddraw_surface_create(struct ddraw *ddraw, const DDSURFACEDESC2 *surface_
/* If the surface is of the 'ALLOCONLOAD' type, ignore the LPSURFACE
* field. Frank Herbert's Dune specifies a NULL pointer for lpSurface. */
if
(
(
desc
->
ddsCaps
.
dwCaps
&
DDSCAPS_ALLOCONLOAD
)
||
!
desc
->
lpSurface
)
if
(
desc
->
ddsCaps
.
dwCaps
&
DDSCAPS_ALLOCONLOAD
)
desc
->
dwFlags
&=
~
DDSD_LPSURFACE
;
if
(
desc
->
dwFlags
&
DDSD_LPSURFACE
)
{
...
...
@@ -5988,6 +5988,13 @@ HRESULT ddraw_surface_create(struct ddraw *ddraw, const DDSURFACEDESC2 *surface_
return
DDERR_INVALIDPARAMS
;
}
if
(
!
desc
->
lpSurface
)
{
WARN
(
"NULL surface memory pointer specified.
\n
"
);
HeapFree
(
GetProcessHeap
(),
0
,
texture
);
return
DDERR_INVALIDPARAMS
;
}
if
(
format_is_compressed
(
&
desc
->
u4
.
ddpfPixelFormat
))
{
if
(
version
!=
4
&&
(
desc
->
dwFlags
&
DDSD_PITCH
))
...
...
dlls/ddraw/tests/ddraw1.c
View file @
6c9e1a47
...
...
@@ -4937,7 +4937,6 @@ static void test_create_surface_pitch(void)
surface_desc
.
dwWidth
=
63
;
surface_desc
.
dwHeight
=
63
;
U1
(
surface_desc
).
lPitch
=
test_data
[
i
].
pitch_in
;
surface_desc
.
lpSurface
=
mem
;
surface_desc
.
ddpfPixelFormat
.
dwSize
=
sizeof
(
surface_desc
.
ddpfPixelFormat
);
surface_desc
.
ddpfPixelFormat
.
dwFlags
=
DDPF_RGB
;
U1
(
surface_desc
.
ddpfPixelFormat
).
dwRGBBitCount
=
32
;
...
...
@@ -4945,6 +4944,13 @@ static void test_create_surface_pitch(void)
U3
(
surface_desc
.
ddpfPixelFormat
).
dwGBitMask
=
0x0000ff00
;
U4
(
surface_desc
.
ddpfPixelFormat
).
dwBBitMask
=
0x000000ff
;
hr
=
IDirectDraw_CreateSurface
(
ddraw
,
&
surface_desc
,
&
surface
,
NULL
);
if
(
test_data
[
i
].
flags_in
&
DDSD_LPSURFACE
)
{
HRESULT
expected_hr
=
SUCCEEDED
(
test_data
[
i
].
hr
)
?
DDERR_INVALIDPARAMS
:
test_data
[
i
].
hr
;
ok
(
hr
==
expected_hr
,
"Test %u: Got unexpected hr %#x, expected %#x.
\n
"
,
i
,
hr
,
expected_hr
);
surface_desc
.
lpSurface
=
mem
;
hr
=
IDirectDraw_CreateSurface
(
ddraw
,
&
surface_desc
,
&
surface
,
NULL
);
}
ok
(
hr
==
test_data
[
i
].
hr
||
(
test_data
[
i
].
placement
==
DDSCAPS_VIDEOMEMORY
&&
hr
==
DDERR_NODIRECTDRAWHW
),
"Test %u: Got unexpected hr %#x, expected %#x.
\n
"
,
i
,
hr
,
test_data
[
i
].
hr
);
if
(
FAILED
(
hr
))
...
...
dlls/ddraw/tests/ddraw2.c
View file @
6c9e1a47
...
...
@@ -5979,7 +5979,6 @@ static void test_create_surface_pitch(void)
surface_desc
.
dwWidth
=
63
;
surface_desc
.
dwHeight
=
63
;
U1
(
surface_desc
).
lPitch
=
test_data
[
i
].
pitch_in
;
surface_desc
.
lpSurface
=
mem
;
surface_desc
.
ddpfPixelFormat
.
dwSize
=
sizeof
(
surface_desc
.
ddpfPixelFormat
);
surface_desc
.
ddpfPixelFormat
.
dwFlags
=
DDPF_RGB
;
U1
(
surface_desc
.
ddpfPixelFormat
).
dwRGBBitCount
=
32
;
...
...
@@ -5987,6 +5986,13 @@ static void test_create_surface_pitch(void)
U3
(
surface_desc
.
ddpfPixelFormat
).
dwGBitMask
=
0x0000ff00
;
U4
(
surface_desc
.
ddpfPixelFormat
).
dwBBitMask
=
0x000000ff
;
hr
=
IDirectDraw2_CreateSurface
(
ddraw
,
&
surface_desc
,
&
surface
,
NULL
);
if
(
test_data
[
i
].
flags_in
&
DDSD_LPSURFACE
)
{
HRESULT
expected_hr
=
SUCCEEDED
(
test_data
[
i
].
hr
)
?
DDERR_INVALIDPARAMS
:
test_data
[
i
].
hr
;
ok
(
hr
==
expected_hr
,
"Test %u: Got unexpected hr %#x, expected %#x.
\n
"
,
i
,
hr
,
expected_hr
);
surface_desc
.
lpSurface
=
mem
;
hr
=
IDirectDraw2_CreateSurface
(
ddraw
,
&
surface_desc
,
&
surface
,
NULL
);
}
ok
(
hr
==
test_data
[
i
].
hr
||
(
test_data
[
i
].
placement
==
DDSCAPS_VIDEOMEMORY
&&
hr
==
DDERR_NODIRECTDRAWHW
),
"Test %u: Got unexpected hr %#x, expected %#x.
\n
"
,
i
,
hr
,
test_data
[
i
].
hr
);
if
(
FAILED
(
hr
))
...
...
dlls/ddraw/tests/ddraw4.c
View file @
6c9e1a47
...
...
@@ -7512,7 +7512,6 @@ static void test_create_surface_pitch(void)
surface_desc
.
dwWidth
=
63
;
surface_desc
.
dwHeight
=
63
;
U1
(
surface_desc
).
lPitch
=
test_data
[
i
].
pitch_in
;
surface_desc
.
lpSurface
=
mem
;
U4
(
surface_desc
).
ddpfPixelFormat
.
dwSize
=
sizeof
(
U4
(
surface_desc
).
ddpfPixelFormat
);
U4
(
surface_desc
).
ddpfPixelFormat
.
dwFlags
=
DDPF_RGB
;
U1
(
U4
(
surface_desc
).
ddpfPixelFormat
).
dwRGBBitCount
=
32
;
...
...
@@ -7520,6 +7519,13 @@ static void test_create_surface_pitch(void)
U3
(
U4
(
surface_desc
).
ddpfPixelFormat
).
dwGBitMask
=
0x0000ff00
;
U4
(
U4
(
surface_desc
).
ddpfPixelFormat
).
dwBBitMask
=
0x000000ff
;
hr
=
IDirectDraw4_CreateSurface
(
ddraw
,
&
surface_desc
,
&
surface
,
NULL
);
if
(
test_data
[
i
].
flags_in
&
DDSD_LPSURFACE
)
{
HRESULT
expected_hr
=
SUCCEEDED
(
test_data
[
i
].
hr
)
?
DDERR_INVALIDPARAMS
:
test_data
[
i
].
hr
;
ok
(
hr
==
expected_hr
,
"Test %u: Got unexpected hr %#x, expected %#x.
\n
"
,
i
,
hr
,
expected_hr
);
surface_desc
.
lpSurface
=
mem
;
hr
=
IDirectDraw4_CreateSurface
(
ddraw
,
&
surface_desc
,
&
surface
,
NULL
);
}
ok
(
hr
==
test_data
[
i
].
hr
||
(
test_data
[
i
].
placement
==
DDSCAPS_VIDEOMEMORY
&&
hr
==
DDERR_NODIRECTDRAWHW
),
"Test %u: Got unexpected hr %#x, expected %#x.
\n
"
,
i
,
hr
,
test_data
[
i
].
hr
);
if
(
FAILED
(
hr
))
...
...
dlls/ddraw/tests/ddraw7.c
View file @
6c9e1a47
...
...
@@ -7361,7 +7361,6 @@ static void test_create_surface_pitch(void)
surface_desc
.
dwWidth
=
63
;
surface_desc
.
dwHeight
=
63
;
U1
(
surface_desc
).
lPitch
=
test_data
[
i
].
pitch_in
;
surface_desc
.
lpSurface
=
mem
;
U4
(
surface_desc
).
ddpfPixelFormat
.
dwSize
=
sizeof
(
U4
(
surface_desc
).
ddpfPixelFormat
);
U4
(
surface_desc
).
ddpfPixelFormat
.
dwFlags
=
DDPF_RGB
;
U1
(
U4
(
surface_desc
).
ddpfPixelFormat
).
dwRGBBitCount
=
32
;
...
...
@@ -7369,6 +7368,13 @@ static void test_create_surface_pitch(void)
U3
(
U4
(
surface_desc
).
ddpfPixelFormat
).
dwGBitMask
=
0x0000ff00
;
U4
(
U4
(
surface_desc
).
ddpfPixelFormat
).
dwBBitMask
=
0x000000ff
;
hr
=
IDirectDraw7_CreateSurface
(
ddraw
,
&
surface_desc
,
&
surface
,
NULL
);
if
(
test_data
[
i
].
flags_in
&
DDSD_LPSURFACE
)
{
HRESULT
expected_hr
=
SUCCEEDED
(
test_data
[
i
].
hr
)
?
DDERR_INVALIDPARAMS
:
test_data
[
i
].
hr
;
ok
(
hr
==
expected_hr
,
"Test %u: Got unexpected hr %#x, expected %#x.
\n
"
,
i
,
hr
,
expected_hr
);
surface_desc
.
lpSurface
=
mem
;
hr
=
IDirectDraw7_CreateSurface
(
ddraw
,
&
surface_desc
,
&
surface
,
NULL
);
}
ok
(
hr
==
test_data
[
i
].
hr
||
(
test_data
[
i
].
placement
==
DDSCAPS_VIDEOMEMORY
&&
hr
==
DDERR_NODIRECTDRAWHW
),
"Test %u: Got unexpected hr %#x, expected %#x.
\n
"
,
i
,
hr
,
test_data
[
i
].
hr
);
if
(
FAILED
(
hr
))
...
...
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