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
31510a1a
Commit
31510a1a
authored
Jun 07, 2011
by
Michael Stefaniuc
Committed by
Alexandre Julliard
Jun 07, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dxgi: COM cleanup for the IWineDXGIDevice iface.
parent
a26925d3
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
9 deletions
+16
-9
device.c
dlls/dxgi/device.c
+15
-8
dxgi_private.h
dlls/dxgi/dxgi_private.h
+1
-1
No files found.
dlls/dxgi/device.c
View file @
31510a1a
...
...
@@ -24,11 +24,16 @@
WINE_DEFAULT_DEBUG_CHANNEL
(
dxgi
);
static
inline
struct
dxgi_device
*
impl_from_IWineDXGIDevice
(
IWineDXGIDevice
*
iface
)
{
return
CONTAINING_RECORD
(
iface
,
struct
dxgi_device
,
IWineDXGIDevice_iface
);
}
/* IUnknown methods */
static
HRESULT
STDMETHODCALLTYPE
dxgi_device_QueryInterface
(
IWineDXGIDevice
*
iface
,
REFIID
riid
,
void
**
object
)
{
struct
dxgi_device
*
This
=
(
struct
dxgi_device
*
)
iface
;
struct
dxgi_device
*
This
=
impl_from_IWineDXGIDevice
(
iface
)
;
TRACE
(
"iface %p, riid %s, object %p
\n
"
,
iface
,
debugstr_guid
(
riid
),
object
);
...
...
@@ -56,7 +61,7 @@ static HRESULT STDMETHODCALLTYPE dxgi_device_QueryInterface(IWineDXGIDevice *ifa
static
ULONG
STDMETHODCALLTYPE
dxgi_device_AddRef
(
IWineDXGIDevice
*
iface
)
{
struct
dxgi_device
*
This
=
(
struct
dxgi_device
*
)
iface
;
struct
dxgi_device
*
This
=
impl_from_IWineDXGIDevice
(
iface
)
;
ULONG
refcount
=
InterlockedIncrement
(
&
This
->
refcount
);
TRACE
(
"%p increasing refcount to %u
\n
"
,
This
,
refcount
);
...
...
@@ -66,7 +71,7 @@ static ULONG STDMETHODCALLTYPE dxgi_device_AddRef(IWineDXGIDevice *iface)
static
ULONG
STDMETHODCALLTYPE
dxgi_device_Release
(
IWineDXGIDevice
*
iface
)
{
struct
dxgi_device
*
This
=
(
struct
dxgi_device
*
)
iface
;
struct
dxgi_device
*
This
=
impl_from_IWineDXGIDevice
(
iface
)
;
ULONG
refcount
=
InterlockedDecrement
(
&
This
->
refcount
);
TRACE
(
"%p decreasing refcount to %u
\n
"
,
This
,
refcount
);
...
...
@@ -134,7 +139,7 @@ static HRESULT STDMETHODCALLTYPE dxgi_device_GetParent(IWineDXGIDevice *iface, R
static
HRESULT
STDMETHODCALLTYPE
dxgi_device_GetAdapter
(
IWineDXGIDevice
*
iface
,
IDXGIAdapter
**
adapter
)
{
struct
dxgi_device
*
This
=
(
struct
dxgi_device
*
)
iface
;
struct
dxgi_device
*
This
=
impl_from_IWineDXGIDevice
(
iface
)
;
WINED3DDEVICE_CREATION_PARAMETERS
create_parameters
;
HRESULT
hr
;
...
...
@@ -244,7 +249,7 @@ static HRESULT STDMETHODCALLTYPE dxgi_device_GetGPUThreadPriority(IWineDXGIDevic
static
struct
wined3d_device
*
STDMETHODCALLTYPE
dxgi_device_get_wined3d_device
(
IWineDXGIDevice
*
iface
)
{
struct
dxgi_device
*
This
=
(
struct
dxgi_device
*
)
iface
;
struct
dxgi_device
*
This
=
impl_from_IWineDXGIDevice
(
iface
)
;
TRACE
(
"iface %p
\n
"
,
iface
);
...
...
@@ -287,6 +292,7 @@ static HRESULT STDMETHODCALLTYPE dxgi_device_create_surface(IWineDXGIDevice *ifa
static
HRESULT
STDMETHODCALLTYPE
dxgi_device_create_swapchain
(
IWineDXGIDevice
*
iface
,
WINED3DPRESENT_PARAMETERS
*
present_parameters
,
struct
wined3d_swapchain
**
wined3d_swapchain
)
{
struct
dxgi_device
*
This
=
impl_from_IWineDXGIDevice
(
iface
);
struct
dxgi_swapchain
*
object
;
HRESULT
hr
;
...
...
@@ -300,7 +306,7 @@ static HRESULT STDMETHODCALLTYPE dxgi_device_create_swapchain(IWineDXGIDevice *i
return
E_OUTOFMEMORY
;
}
hr
=
dxgi_swapchain_init
(
object
,
(
struct
dxgi_device
*
)
iface
,
present_parameters
);
hr
=
dxgi_swapchain_init
(
object
,
This
,
present_parameters
);
if
(
FAILED
(
hr
))
{
WARN
(
"Failed to initialize swapchain, hr %#x.
\n
"
,
hr
);
...
...
@@ -348,7 +354,7 @@ HRESULT dxgi_device_init(struct dxgi_device *device, struct dxgi_device_layer *l
void
*
layer_base
;
HRESULT
hr
;
device
->
v
tbl
=
&
dxgi_device_vtbl
;
device
->
IWineDXGIDevice_iface
.
lpV
tbl
=
&
dxgi_device_vtbl
;
device
->
refcount
=
1
;
layer_base
=
device
+
1
;
...
...
@@ -381,7 +387,8 @@ HRESULT dxgi_device_init(struct dxgi_device *device, struct dxgi_device_layer *l
adapter_ordinal
=
IWineDXGIAdapter_get_ordinal
(
wine_adapter
);
IWineDXGIAdapter_Release
(
wine_adapter
);
hr
=
IUnknown_QueryInterface
((
IUnknown
*
)
device
,
&
IID_IWineDXGIDeviceParent
,
(
void
**
)
&
dxgi_device_parent
);
hr
=
IWineDXGIDevice_QueryInterface
(
&
device
->
IWineDXGIDevice_iface
,
&
IID_IWineDXGIDeviceParent
,
(
void
**
)
&
dxgi_device_parent
);
if
(
FAILED
(
hr
))
{
ERR
(
"DXGI device should implement IWineD3DDeviceParent.
\n
"
);
...
...
dlls/dxgi/dxgi_private.h
View file @
31510a1a
...
...
@@ -89,7 +89,7 @@ HRESULT dxgi_factory_init(struct dxgi_factory *factory) DECLSPEC_HIDDEN;
/* IDXGIDevice */
struct
dxgi_device
{
const
struct
IWineDXGIDeviceVtbl
*
vtbl
;
IWineDXGIDevice
IWineDXGIDevice_iface
;
IUnknown
*
child_layer
;
LONG
refcount
;
struct
wined3d_device
*
wined3d_device
;
...
...
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