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
8d91f8b6
Commit
8d91f8b6
authored
Jun 08, 2011
by
Michael Stefaniuc
Committed by
Alexandre Julliard
Jun 08, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ddraw: Avoid "unsafe" IDirect3DMaterial3 to object casts.
parent
db15ce65
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
15 deletions
+24
-15
ddraw.c
dlls/ddraw/ddraw.c
+24
-15
No files found.
dlls/ddraw/ddraw.c
View file @
8d91f8b6
...
...
@@ -4616,37 +4616,46 @@ static HRESULT WINAPI d3d3_CreateMaterial(IDirect3D3 *iface, IDirect3DMaterial3
return
D3D_OK
;
}
static
HRESULT
WINAPI
d3d2_CreateMaterial
(
IDirect3D2
*
iface
,
IDirect3DMaterial2
**
material
,
IUnknown
*
outer_unknown
)
static
HRESULT
WINAPI
d3d2_CreateMaterial
(
IDirect3D2
*
iface
,
IDirect3DMaterial2
**
material
,
IUnknown
*
outer_unknown
)
{
IDirectDrawImpl
*
This
=
impl_from_IDirect3D2
(
iface
);
IDirect3DMaterial3
*
material3
;
HRESULT
hr
;
IDirect3DMaterialImpl
*
object
;
TRACE
(
"iface %p, material %p, outer_unknown %p.
\n
"
,
iface
,
material
,
outer_unknown
);
hr
=
d3d3_CreateMaterial
(
&
This
->
IDirect3D3_iface
,
&
material3
,
outer_unknown
);
*
material
=
material3
?
&
((
IDirect3DMaterialImpl
*
)
material3
)
->
IDirect3DMaterial2_iface
:
NULL
;
object
=
d3d_material_create
(
This
);
if
(
!
object
)
{
ERR
(
"Failed to allocate material memory.
\n
"
);
return
DDERR_OUTOFMEMORY
;
}
TRACE
(
"Returning material %p.
\n
"
,
*
material
);
TRACE
(
"Created material %p.
\n
"
,
object
);
*
material
=
&
object
->
IDirect3DMaterial2_iface
;
return
hr
;
return
D3D_OK
;
}
static
HRESULT
WINAPI
d3d1_CreateMaterial
(
IDirect3D
*
iface
,
IDirect3DMaterial
**
material
,
IUnknown
*
outer_unknown
)
static
HRESULT
WINAPI
d3d1_CreateMaterial
(
IDirect3D
*
iface
,
IDirect3DMaterial
**
material
,
IUnknown
*
outer_unknown
)
{
IDirect3DMaterial3
*
material3
;
HRESULT
hr
;
IDirectDrawImpl
*
This
=
impl_from_IDirect3D
(
iface
);
IDirect3DMaterialImpl
*
object
;
TRACE
(
"iface %p, material %p, outer_unknown %p.
\n
"
,
iface
,
material
,
outer_unknown
);
hr
=
d3d3_CreateMaterial
(
&
This
->
IDirect3D3_iface
,
&
material3
,
outer_unknown
);
*
material
=
material3
?
&
((
IDirect3DMaterialImpl
*
)
material3
)
->
IDirect3DMaterial_iface
:
NULL
;
object
=
d3d_material_create
(
This
);
if
(
!
object
)
{
ERR
(
"Failed to allocate material memory.
\n
"
);
return
DDERR_OUTOFMEMORY
;
}
TRACE
(
"Returning material %p.
\n
"
,
*
material
);
TRACE
(
"Created material %p.
\n
"
,
object
);
*
material
=
&
object
->
IDirect3DMaterial_iface
;
return
hr
;
return
D3D_OK
;
}
/*****************************************************************************
...
...
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