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
cf6d56a4
Commit
cf6d56a4
authored
May 31, 2011
by
Andrew Nguyen
Committed by
Alexandre Julliard
May 31, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ddraw: Add a NULL callback pointer check in the EnumDevices implementations.
parent
7cd97b2e
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
0 deletions
+18
-0
ddraw.c
dlls/ddraw/ddraw.c
+6
-0
d3d.c
dlls/ddraw/tests/d3d.c
+12
-0
No files found.
dlls/ddraw/ddraw.c
View file @
cf6d56a4
...
...
@@ -4234,6 +4234,9 @@ static HRESULT WINAPI d3d7_EnumDevices(IDirect3D7 *iface, LPD3DENUMDEVICESCALLBA
TRACE
(
"iface %p, callback %p, context %p.
\n
"
,
iface
,
callback
,
context
);
if
(
!
callback
)
return
DDERR_INVALIDPARAMS
;
EnterCriticalSection
(
&
ddraw_cs
);
hr
=
IDirect3DImpl_GetCaps
(
This
->
wineD3D
,
&
device_desc1
,
&
device_desc7
);
...
...
@@ -4291,6 +4294,9 @@ static HRESULT WINAPI d3d3_EnumDevices(IDirect3D3 *iface, LPD3DENUMDEVICESCALLBA
TRACE
(
"iface %p, callback %p, context %p.
\n
"
,
iface
,
callback
,
context
);
if
(
!
callback
)
return
DDERR_INVALIDPARAMS
;
EnterCriticalSection
(
&
ddraw_cs
);
hr
=
IDirect3DImpl_GetCaps
(
This
->
wineD3D
,
&
device_desc1
,
&
device_desc7
);
...
...
dlls/ddraw/tests/d3d.c
View file @
cf6d56a4
...
...
@@ -865,8 +865,12 @@ static HRESULT WINAPI enumDevicesCallbackTest7(LPSTR DeviceDescription, LPSTR De
IDirect3D7_EnumDevices. */
static
void
D3D7EnumTest
(
void
)
{
HRESULT
hr
;
D3D7ETest
d3d7et
;
hr
=
IDirect3D7_EnumDevices
(
lpD3D
,
NULL
,
NULL
);
ok
(
hr
==
DDERR_INVALIDPARAMS
,
"IDirect3D7_EnumDevices returned 0x%08x
\n
"
,
hr
);
memset
(
&
d3d7et
,
0
,
sizeof
(
d3d7et
));
IDirect3D7_EnumDevices
(
lpD3D
,
enumDevicesCallbackTest7
,
&
d3d7et
);
...
...
@@ -892,6 +896,10 @@ static void CapsTest(void)
ok
(
hr
==
DD_OK
,
"Cannot create a DirectDraw 1 interface, hr = %08x
\n
"
,
hr
);
hr
=
IDirectDraw_QueryInterface
(
dd1
,
&
IID_IDirect3D3
,
(
void
**
)
&
d3d3
);
ok
(
hr
==
D3D_OK
,
"IDirectDraw_QueryInterface returned %08x
\n
"
,
hr
);
hr
=
IDirect3D3_EnumDevices
(
d3d3
,
NULL
,
NULL
);
ok
(
hr
==
DDERR_INVALIDPARAMS
,
"IDirect3D3_EnumDevices returned 0x%08x
\n
"
,
hr
);
ver
=
3
;
IDirect3D3_EnumDevices
(
d3d3
,
enumDevicesCallback
,
&
ver
);
...
...
@@ -902,6 +910,10 @@ static void CapsTest(void)
ok
(
hr
==
DD_OK
,
"Cannot create a DirectDraw 1 interface, hr = %08x
\n
"
,
hr
);
hr
=
IDirectDraw_QueryInterface
(
dd1
,
&
IID_IDirect3D2
,
(
void
**
)
&
d3d2
);
ok
(
hr
==
D3D_OK
,
"IDirectDraw_QueryInterface returned %08x
\n
"
,
hr
);
hr
=
IDirect3D2_EnumDevices
(
d3d2
,
NULL
,
NULL
);
ok
(
hr
==
DDERR_INVALIDPARAMS
,
"IDirect3D2_EnumDevices returned 0x%08x
\n
"
,
hr
);
ver
=
2
;
IDirect3D2_EnumDevices
(
d3d2
,
enumDevicesCallback
,
&
ver
);
...
...
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