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
ee57e19b
Commit
ee57e19b
authored
Apr 07, 2014
by
Stefan Dösinger
Committed by
Alexandre Julliard
Apr 08, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ddraw: SetPrivateData(..., data = NULL, ...) is not valid.
parent
7983d997
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
24 additions
and
0 deletions
+24
-0
surface.c
dlls/ddraw/surface.c
+6
-0
ddraw4.c
dlls/ddraw/tests/ddraw4.c
+9
-0
ddraw7.c
dlls/ddraw/tests/ddraw7.c
+9
-0
No files found.
dlls/ddraw/surface.c
View file @
ee57e19b
...
...
@@ -2254,6 +2254,12 @@ static HRESULT WINAPI ddraw_surface7_SetPrivateData(IDirectDrawSurface7 *iface,
TRACE
(
"iface %p, tag %s, data %p, data_size %u, flags %#x.
\n
"
,
iface
,
debugstr_guid
(
tag
),
data
,
size
,
flags
);
if
(
!
data
)
{
WARN
(
"data is NULL, returning DDERR_INVALIDPARAMS.
\n
"
);
return
DDERR_INVALIDPARAMS
;
}
wined3d_mutex_lock
();
hr
=
wined3d_private_store_set_private_data
(
&
surface
->
private_store
,
tag
,
data
,
size
,
flags
);
wined3d_mutex_unlock
();
...
...
dlls/ddraw/tests/ddraw4.c
View file @
ee57e19b
...
...
@@ -6103,6 +6103,15 @@ static void test_private_data(void)
hr
=
IDirectDraw4_CreateSurface
(
ddraw
,
&
surface_desc
,
&
surface
,
NULL
);
ok
(
SUCCEEDED
(
hr
),
"Failed to create surface, hr %#x.
\n
"
,
hr
);
/* NULL pointers are not valid, but don't cause a crash. */
hr
=
IDirectDrawSurface7_SetPrivateData
(
surface
,
&
ddraw_private_data_test_guid
,
NULL
,
sizeof
(
IUnknown
*
),
DDSPD_IUNKNOWNPOINTER
);
ok
(
hr
==
DDERR_INVALIDPARAMS
,
"Got unexpected hr %#x.
\n
"
,
hr
);
hr
=
IDirectDrawSurface7_SetPrivateData
(
surface
,
&
ddraw_private_data_test_guid
,
NULL
,
0
,
0
);
ok
(
hr
==
DDERR_INVALIDPARAMS
,
"Got unexpected hr %#x.
\n
"
,
hr
);
hr
=
IDirectDrawSurface7_SetPrivateData
(
surface
,
&
ddraw_private_data_test_guid
,
NULL
,
1
,
0
);
ok
(
hr
==
DDERR_INVALIDPARAMS
,
"Got unexpected hr %#x.
\n
"
,
hr
);
/* DDSPD_IUNKNOWNPOINTER needs sizeof(IUnknown *) bytes of data. */
hr
=
IDirectDrawSurface4_SetPrivateData
(
surface
,
&
ddraw_private_data_test_guid
,
ddraw
,
0
,
DDSPD_IUNKNOWNPOINTER
);
...
...
dlls/ddraw/tests/ddraw7.c
View file @
ee57e19b
...
...
@@ -5958,6 +5958,15 @@ static void test_private_data(void)
hr
=
IDirectDraw7_CreateSurface
(
ddraw
,
&
surface_desc
,
&
surface
,
NULL
);
ok
(
SUCCEEDED
(
hr
),
"Failed to create surface, hr %#x.
\n
"
,
hr
);
/* NULL pointers are not valid, but don't cause a crash. */
hr
=
IDirectDrawSurface7_SetPrivateData
(
surface
,
&
ddraw_private_data_test_guid
,
NULL
,
sizeof
(
IUnknown
*
),
DDSPD_IUNKNOWNPOINTER
);
ok
(
hr
==
DDERR_INVALIDPARAMS
,
"Got unexpected hr %#x.
\n
"
,
hr
);
hr
=
IDirectDrawSurface7_SetPrivateData
(
surface
,
&
ddraw_private_data_test_guid
,
NULL
,
0
,
0
);
ok
(
hr
==
DDERR_INVALIDPARAMS
,
"Got unexpected hr %#x.
\n
"
,
hr
);
hr
=
IDirectDrawSurface7_SetPrivateData
(
surface
,
&
ddraw_private_data_test_guid
,
NULL
,
1
,
0
);
ok
(
hr
==
DDERR_INVALIDPARAMS
,
"Got unexpected hr %#x.
\n
"
,
hr
);
/* DDSPD_IUNKNOWNPOINTER needs sizeof(IUnknown *) bytes of data. */
hr
=
IDirectDrawSurface7_SetPrivateData
(
surface
,
&
ddraw_private_data_test_guid
,
ddraw
,
0
,
DDSPD_IUNKNOWNPOINTER
);
...
...
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