Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
wine
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Package registry
Container registry
Model registry
Operate
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Lorenzo Ferrillo
wine
Commits
b01ce6b6
Commit
b01ce6b6
authored
13 years ago
by
Michael Stefaniuc
Committed by
Alexandre Julliard
13 years ago
Browse files
Options
Downloads
Patches
Plain Diff
d3d10core: Standardize COM aggregation for d3d10_device.
parent
280af526
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
dlls/d3d10core/d3d10core_main.c
+1
-1
1 addition, 1 deletion
dlls/d3d10core/d3d10core_main.c
dlls/d3d10core/d3d10core_private.h
+2
-2
2 additions, 2 deletions
dlls/d3d10core/d3d10core_private.h
dlls/d3d10core/device.c
+29
-36
29 additions, 36 deletions
dlls/d3d10core/device.c
with
32 additions
and
39 deletions
dlls/d3d10core/d3d10core_main.c
+
1
−
1
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_u
nknown_
vtbl
;
*
device_layer
=
&
object
->
IU
nknown_
inner
;
TRACE
(
"Created d3d10 device at %p
\n
"
,
object
);
...
...
This diff is collapsed.
Click to expand it.
dlls/d3d10core/d3d10core_private.h
+
2
−
2
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
;
...
...
This diff is collapsed.
Click to expand it.
dlls/d3d10core/device.c
+
29
−
36
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_u
nknown_
vtbl
)
);
return
CONTAINING_RECORD
(
iface
,
struct
d3d10_device
,
IU
nknown_
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
;
return
S_OK
;
}
WARN
(
"%s not implemented, returning E_NOINTERFACE
\n
"
,
debugstr_guid
(
riid
));
*
object
=
NULL
;
return
E_NOINTERFACE
;
IUnknown_AddRef
((
IUnknown
*
)
*
ppv
);
return
S_OK
;
}
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
;
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment