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
10a076ad
Commit
10a076ad
authored
Jun 21, 2010
by
Andrew Nguyen
Committed by
Alexandre Julliard
Jun 22, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ddraw: Validate structure pointers and sizes in IDirect3D3::FindDevice.
parent
cdad4e4a
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
42 additions
and
0 deletions
+42
-0
direct3d.c
dlls/ddraw/direct3d.c
+7
-0
d3d.c
dlls/ddraw/tests/d3d.c
+35
-0
No files found.
dlls/ddraw/direct3d.c
View file @
10a076ad
...
...
@@ -666,6 +666,13 @@ IDirect3DImpl_3_FindDevice(IDirect3D3 *iface,
TRACE
(
"(%p)->(%p,%p)
\n
"
,
This
,
D3DDFS
,
D3DFDR
);
if
(
!
D3DDFS
||
!
D3DFDR
)
return
DDERR_INVALIDPARAMS
;
if
(
D3DDFS
->
dwSize
!=
sizeof
(
D3DFINDDEVICESEARCH
)
||
D3DFDR
->
dwSize
!=
sizeof
(
D3DFINDDEVICERESULT
))
return
DDERR_INVALIDPARAMS
;
if
((
D3DDFS
->
dwFlags
&
D3DFDS_COLORMODEL
)
&&
(
D3DDFS
->
dcmColorModel
!=
D3DCOLOR_RGB
))
{
...
...
dlls/ddraw/tests/d3d.c
View file @
10a076ad
...
...
@@ -3391,6 +3391,40 @@ static void VertexBufferLockRest(void)
IDirect3DVertexBuffer7_Release
(
buffer
);
}
static
void
FindDevice
(
void
)
{
D3DFINDDEVICESEARCH
search
=
{
0
};
D3DFINDDEVICERESULT
result
=
{
0
};
HRESULT
hr
;
/* Test invalid parameters. */
hr
=
IDirect3D_FindDevice
(
Direct3D1
,
NULL
,
NULL
);
ok
(
hr
==
DDERR_INVALIDPARAMS
,
"Expected IDirect3D1::FindDevice to return DDERR_INVALIDPARAMS, got 0x%08x
\n
"
,
hr
);
hr
=
IDirect3D_FindDevice
(
Direct3D1
,
NULL
,
&
result
);
ok
(
hr
==
DDERR_INVALIDPARAMS
,
"Expected IDirect3D1::FindDevice to return DDERR_INVALIDPARAMS, got 0x%08x
\n
"
,
hr
);
hr
=
IDirect3D_FindDevice
(
Direct3D1
,
&
search
,
NULL
);
ok
(
hr
==
DDERR_INVALIDPARAMS
,
"Expected IDirect3D1::FindDevice to return DDERR_INVALIDPARAMS, got 0x%08x
\n
"
,
hr
);
search
.
dwSize
=
0
;
result
.
dwSize
=
0
;
hr
=
IDirect3D_FindDevice
(
Direct3D1
,
&
search
,
&
result
);
ok
(
hr
==
DDERR_INVALIDPARAMS
,
"Expected IDirect3D1::FindDevice to return DDERR_INVALIDPARAMS, got 0x%08x
\n
"
,
hr
);
search
.
dwSize
=
sizeof
(
search
)
+
1
;
result
.
dwSize
=
sizeof
(
result
)
+
1
;
hr
=
IDirect3D_FindDevice
(
Direct3D1
,
&
search
,
&
result
);
ok
(
hr
==
DDERR_INVALIDPARAMS
,
"Expected IDirect3D1::FindDevice to return DDERR_INVALIDPARAMS, got 0x%08x
\n
"
,
hr
);
}
START_TEST
(
d3d
)
{
init_function_pointers
();
...
...
@@ -3425,6 +3459,7 @@ START_TEST(d3d)
Direct3D1Test
();
TextureLoadTest
();
ViewportTest
();
FindDevice
();
D3D1_releaseObjects
();
}
...
...
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