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
b01ce6b6
Commit
b01ce6b6
authored
Mar 22, 2012
by
Michael Stefaniuc
Committed by
Alexandre Julliard
Mar 26, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
d3d10core: Standardize COM aggregation for d3d10_device.
parent
280af526
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
31 additions
and
38 deletions
+31
-38
d3d10core_main.c
dlls/d3d10core/d3d10core_main.c
+1
-1
d3d10core_private.h
dlls/d3d10core/d3d10core_private.h
+2
-2
device.c
dlls/d3d10core/device.c
+28
-35
No files found.
dlls/d3d10core/d3d10core_main.c
View file @
b01ce6b6
...
...
@@ -82,7 +82,7 @@ static HRESULT WINAPI layer_create(enum dxgi_device_layer_id id, void **layer_ba
object
=
*
layer_base
;
d3d10_device_init
(
object
,
device_object
);
*
device_layer
=
&
object
->
inner_unknown_vtbl
;
*
device_layer
=
&
object
->
IUnknown_inner
;
TRACE
(
"Created d3d10 device at %p
\n
"
,
object
);
...
...
dlls/d3d10core/d3d10core_private.h
View file @
b01ce6b6
...
...
@@ -69,10 +69,10 @@ HRESULT parse_dxbc(const char *data, SIZE_T data_size,
/* IDirect3D10Device */
struct
d3d10_device
{
IUnknown
IUnknown_inner
;
ID3D10Device
ID3D10Device_iface
;
const
struct
IUnknownVtbl
*
inner_unknown_vtbl
;
IWineDXGIDeviceParent
IWineDXGIDeviceParent_iface
;
IUnknown
*
outer_unk
nown
;
IUnknown
*
outer_unk
;
LONG
refcount
;
struct
wined3d_device_parent
device_parent
;
...
...
dlls/d3d10core/device.c
View file @
b01ce6b6
...
...
@@ -26,41 +26,36 @@ WINE_DEFAULT_DEBUG_CHANNEL(d3d10core);
/* Inner IUnknown methods */
static
inline
struct
d3d10_device
*
d3d10_device_from_inner_u
nknown
(
IUnknown
*
iface
)
static
inline
struct
d3d10_device
*
impl_from_IU
nknown
(
IUnknown
*
iface
)
{
return
(
struct
d3d10_device
*
)((
char
*
)
iface
-
FIELD_OFFSET
(
struct
d3d10_device
,
inner_unknown_vtbl
)
);
return
CONTAINING_RECORD
(
iface
,
struct
d3d10_device
,
IUnknown_inner
);
}
static
HRESULT
STDMETHODCALLTYPE
d3d10_device_inner_QueryInterface
(
IUnknown
*
iface
,
REFIID
riid
,
void
**
object
)
static
HRESULT
STDMETHODCALLTYPE
d3d10_device_inner_QueryInterface
(
IUnknown
*
iface
,
REFIID
riid
,
void
**
ppv
)
{
struct
d3d10_device
*
This
=
d3d10_device_from_inner_u
nknown
(
iface
);
struct
d3d10_device
*
This
=
impl_from_IU
nknown
(
iface
);
TRACE
(
"iface %p, riid %s,
object %p
\n
"
,
iface
,
debugstr_guid
(
riid
),
object
);
TRACE
(
"iface %p, riid %s,
ppv %p
\n
"
,
iface
,
debugstr_guid
(
riid
),
ppv
);
if
(
IsEqualGUID
(
riid
,
&
IID_IUnknown
)
||
IsEqualGUID
(
riid
,
&
IID_ID3D10Device
))
if
(
IsEqualGUID
(
riid
,
&
IID_IUnknown
)
||
IsEqualGUID
(
riid
,
&
IID_ID3D10Device
))
*
ppv
=
&
This
->
ID3D10Device_iface
;
else
if
(
IsEqualGUID
(
riid
,
&
IID_IWineDXGIDeviceParent
))
*
ppv
=
&
This
->
IWineDXGIDeviceParent_iface
;
else
{
ID3D10Device_AddRef
(
&
This
->
ID3D10Device_iface
);
*
object
=
This
;
return
S_OK
;
WARN
(
"%s not implemented, returning E_NOINTERFACE
\n
"
,
debugstr_guid
(
riid
)
);
*
ppv
=
NULL
;
return
E_NOINTERFACE
;
}
if
(
IsEqualGUID
(
riid
,
&
IID_IWineDXGIDeviceParent
))
{
IWineDXGIDeviceParent_AddRef
(
&
This
->
IWineDXGIDeviceParent_iface
);
*
object
=
&
This
->
IWineDXGIDeviceParent_iface
;
IUnknown_AddRef
((
IUnknown
*
)
*
ppv
);
return
S_OK
;
}
WARN
(
"%s not implemented, returning E_NOINTERFACE
\n
"
,
debugstr_guid
(
riid
));
*
object
=
NULL
;
return
E_NOINTERFACE
;
}
static
ULONG
STDMETHODCALLTYPE
d3d10_device_inner_AddRef
(
IUnknown
*
iface
)
{
struct
d3d10_device
*
This
=
d3d10_device_from_inner_u
nknown
(
iface
);
struct
d3d10_device
*
This
=
impl_from_IU
nknown
(
iface
);
ULONG
refcount
=
InterlockedIncrement
(
&
This
->
refcount
);
TRACE
(
"%p increasing refcount to %u
\n
"
,
This
,
refcount
);
...
...
@@ -70,7 +65,7 @@ static ULONG STDMETHODCALLTYPE d3d10_device_inner_AddRef(IUnknown *iface)
static
ULONG
STDMETHODCALLTYPE
d3d10_device_inner_Release
(
IUnknown
*
iface
)
{
struct
d3d10_device
*
This
=
d3d10_device_from_inner_u
nknown
(
iface
);
struct
d3d10_device
*
This
=
impl_from_IU
nknown
(
iface
);
ULONG
refcount
=
InterlockedDecrement
(
&
This
->
refcount
);
TRACE
(
"%p decreasing refcount to %u
\n
"
,
This
,
refcount
);
...
...
@@ -92,25 +87,22 @@ static inline struct d3d10_device *impl_from_ID3D10Device(ID3D10Device *iface)
}
static
HRESULT
STDMETHODCALLTYPE
d3d10_device_QueryInterface
(
ID3D10Device
*
iface
,
REFIID
riid
,
void
**
object
)
void
**
ppv
)
{
struct
d3d10_device
*
This
=
impl_from_ID3D10Device
(
iface
);
TRACE
(
"Forwarding to outer IUnknown
\n
"
);
return
IUnknown_QueryInterface
(
This
->
outer_unknown
,
riid
,
object
);
return
IUnknown_QueryInterface
(
This
->
outer_unk
,
riid
,
ppv
);
}
static
ULONG
STDMETHODCALLTYPE
d3d10_device_AddRef
(
ID3D10Device
*
iface
)
{
struct
d3d10_device
*
This
=
impl_from_ID3D10Device
(
iface
);
TRACE
(
"Forwarding to outer IUnknown
\n
"
);
return
IUnknown_AddRef
(
This
->
outer_unknown
);
return
IUnknown_AddRef
(
This
->
outer_unk
);
}
static
ULONG
STDMETHODCALLTYPE
d3d10_device_Release
(
ID3D10Device
*
iface
)
{
struct
d3d10_device
*
This
=
impl_from_ID3D10Device
(
iface
);
TRACE
(
"Forwarding to outer IUnknown
\n
"
);
return
IUnknown_Release
(
This
->
outer_unknown
);
return
IUnknown_Release
(
This
->
outer_unk
);
}
/* ID3D10Device methods */
...
...
@@ -1306,22 +1298,22 @@ static inline struct d3d10_device *device_from_dxgi_device_parent(IWineDXGIDevic
}
static
HRESULT
STDMETHODCALLTYPE
dxgi_device_parent_QueryInterface
(
IWineDXGIDeviceParent
*
iface
,
REFIID
riid
,
void
**
object
)
REFIID
riid
,
void
**
ppv
)
{
struct
d3d10_device
*
device
=
device_from_dxgi_device_parent
(
iface
);
return
d3d10_device_QueryInterface
(
&
device
->
ID3D10Device_iface
,
riid
,
object
);
return
IUnknown_QueryInterface
(
device
->
outer_unk
,
riid
,
ppv
);
}
static
ULONG
STDMETHODCALLTYPE
dxgi_device_parent_AddRef
(
IWineDXGIDeviceParent
*
iface
)
{
struct
d3d10_device
*
device
=
device_from_dxgi_device_parent
(
iface
);
return
d3d10_device_AddRef
(
&
device
->
ID3D10Device_iface
);
return
IUnknown_AddRef
(
device
->
outer_unk
);
}
static
ULONG
STDMETHODCALLTYPE
dxgi_device_parent_Release
(
IWineDXGIDeviceParent
*
iface
)
{
struct
d3d10_device
*
device
=
device_from_dxgi_device_parent
(
iface
);
return
d3d10_device_Release
(
&
device
->
ID3D10Device_iface
);
return
IUnknown_Release
(
device
->
outer_unk
);
}
static
struct
wined3d_device_parent
*
STDMETHODCALLTYPE
dxgi_device_parent_get_wined3d_device_parent
(
...
...
@@ -1554,9 +1546,10 @@ static const struct wined3d_device_parent_ops d3d10_wined3d_device_parent_ops =
void
d3d10_device_init
(
struct
d3d10_device
*
device
,
void
*
outer_unknown
)
{
device
->
ID3D10Device_iface
.
lpVtbl
=
&
d3d10_device_vtbl
;
device
->
inner_unknown_v
tbl
=
&
d3d10_device_inner_unknown_vtbl
;
device
->
IUnknown_inner
.
lpV
tbl
=
&
d3d10_device_inner_unknown_vtbl
;
device
->
IWineDXGIDeviceParent_iface
.
lpVtbl
=
&
d3d10_dxgi_device_parent_vtbl
;
device
->
device_parent
.
ops
=
&
d3d10_wined3d_device_parent_ops
;
device
->
refcount
=
1
;
device
->
outer_unknown
=
outer_unknown
;
/* COM aggregation always takes place */
device
->
outer_unk
=
outer_unknown
;
}
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