Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
5d358a2b
Commit
5d358a2b
authored
Apr 19, 2012
by
Henri Verbeet
Committed by
Alexandre Julliard
Apr 20, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dxgi: COM cleanup for the surface IUnknown interface.
parent
230c5fc7
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
20 additions
and
20 deletions
+20
-20
device.c
dlls/dxgi/device.c
+1
-1
dxgi_private.h
dlls/dxgi/dxgi_private.h
+1
-1
surface.c
dlls/dxgi/surface.c
+18
-18
No files found.
dlls/dxgi/device.c
View file @
5d358a2b
...
...
@@ -284,7 +284,7 @@ static HRESULT STDMETHODCALLTYPE dxgi_device_create_surface(IWineDXGIDevice *ifa
}
TRACE
(
"Created IDXGISurface %p
\n
"
,
object
);
*
surface
=
outer
?
(
void
*
)
&
object
->
inner_unknown_vtbl
:
object
;
*
surface
=
outer
?
&
object
->
IUnknown_iface
:
(
IUnknown
*
)
&
object
->
IDXGISurface_iface
;
return
S_OK
;
}
...
...
dlls/dxgi/dxgi_private.h
View file @
5d358a2b
...
...
@@ -136,7 +136,7 @@ HRESULT dxgi_swapchain_init(struct dxgi_swapchain *swapchain, struct dxgi_device
struct
dxgi_surface
{
IDXGISurface
IDXGISurface_iface
;
const
struct
IUnknownVtbl
*
inner_unknown_vtbl
;
IUnknown
IUnknown_iface
;
IUnknown
*
outer_unknown
;
LONG
refcount
;
IDXGIDevice
*
device
;
...
...
dlls/dxgi/surface.c
View file @
5d358a2b
...
...
@@ -26,54 +26,54 @@ WINE_DEFAULT_DEBUG_CHANNEL(dxgi);
/* Inner IUnknown methods */
static
inline
struct
dxgi_surface
*
dxgi_surface_from_inner_u
nknown
(
IUnknown
*
iface
)
static
inline
struct
dxgi_surface
*
impl_from_IU
nknown
(
IUnknown
*
iface
)
{
return
(
struct
dxgi_surface
*
)((
char
*
)
iface
-
FIELD_OFFSET
(
struct
dxgi_surface
,
inner_unknown_vtbl
)
);
return
CONTAINING_RECORD
(
iface
,
struct
dxgi_surface
,
IUnknown_iface
);
}
static
HRESULT
STDMETHODCALLTYPE
dxgi_surface_inner_QueryInterface
(
IUnknown
*
iface
,
REFIID
riid
,
void
**
o
bjec
t
)
static
HRESULT
STDMETHODCALLTYPE
dxgi_surface_inner_QueryInterface
(
IUnknown
*
iface
,
REFIID
riid
,
void
**
o
u
t
)
{
struct
dxgi_surface
*
This
=
dxgi_surface_from_inner_u
nknown
(
iface
);
struct
dxgi_surface
*
surface
=
impl_from_IU
nknown
(
iface
);
TRACE
(
"iface %p, riid %s, o
bject %p
\n
"
,
iface
,
debugstr_guid
(
riid
),
objec
t
);
TRACE
(
"iface %p, riid %s, o
ut %p.
\n
"
,
iface
,
debugstr_guid
(
riid
),
ou
t
);
if
(
IsEqualGUID
(
riid
,
&
IID_IDXGISurface
)
||
IsEqualGUID
(
riid
,
&
IID_IDXGIDeviceSubObject
)
||
IsEqualGUID
(
riid
,
&
IID_IDXGIObject
)
||
IsEqualGUID
(
riid
,
&
IID_IUnknown
))
{
IDXGISurface_AddRef
(
&
This
->
IDXGISurface_iface
);
*
o
bject
=
&
This
->
IDXGISurface_iface
;
IDXGISurface_AddRef
(
&
surface
->
IDXGISurface_iface
);
*
o
ut
=
&
surface
->
IDXGISurface_iface
;
return
S_OK
;
}
WARN
(
"%s not implemented, returning E_NOINTERFACE
\n
"
,
debugstr_guid
(
riid
));
*
o
bjec
t
=
NULL
;
*
o
u
t
=
NULL
;
return
E_NOINTERFACE
;
}
static
ULONG
STDMETHODCALLTYPE
dxgi_surface_inner_AddRef
(
IUnknown
*
iface
)
{
struct
dxgi_surface
*
This
=
dxgi_surface_from_inner_u
nknown
(
iface
);
ULONG
refcount
=
InterlockedIncrement
(
&
This
->
refcount
);
struct
dxgi_surface
*
surface
=
impl_from_IU
nknown
(
iface
);
ULONG
refcount
=
InterlockedIncrement
(
&
surface
->
refcount
);
TRACE
(
"%p increasing refcount to %u
\n
"
,
This
,
refcount
);
TRACE
(
"%p increasing refcount to %u
.
\n
"
,
surface
,
refcount
);
return
refcount
;
}
static
ULONG
STDMETHODCALLTYPE
dxgi_surface_inner_Release
(
IUnknown
*
iface
)
{
struct
dxgi_surface
*
This
=
dxgi_surface_from_inner_u
nknown
(
iface
);
ULONG
refcount
=
InterlockedDecrement
(
&
This
->
refcount
);
struct
dxgi_surface
*
surface
=
impl_from_IU
nknown
(
iface
);
ULONG
refcount
=
InterlockedDecrement
(
&
surface
->
refcount
);
TRACE
(
"%p decreasing refcount to %u
\n
"
,
This
,
refcount
);
TRACE
(
"%p decreasing refcount to %u
.
\n
"
,
surface
,
refcount
);
if
(
!
refcount
)
{
IDXGIDevice_Release
(
This
->
device
);
HeapFree
(
GetProcessHeap
(),
0
,
This
);
IDXGIDevice_Release
(
surface
->
device
);
HeapFree
(
GetProcessHeap
(),
0
,
surface
);
}
return
refcount
;
...
...
@@ -206,9 +206,9 @@ static const struct IUnknownVtbl dxgi_surface_inner_unknown_vtbl =
HRESULT
dxgi_surface_init
(
struct
dxgi_surface
*
surface
,
IDXGIDevice
*
device
,
IUnknown
*
outer
)
{
surface
->
IDXGISurface_iface
.
lpVtbl
=
&
dxgi_surface_vtbl
;
surface
->
inner_unknown_v
tbl
=
&
dxgi_surface_inner_unknown_vtbl
;
surface
->
IUnknown_iface
.
lpV
tbl
=
&
dxgi_surface_inner_unknown_vtbl
;
surface
->
refcount
=
1
;
surface
->
outer_unknown
=
outer
?
outer
:
(
IUnknown
*
)
&
surface
->
inner_unknown_vtbl
;
surface
->
outer_unknown
=
outer
?
outer
:
&
surface
->
IUnknown_iface
;
surface
->
device
=
device
;
IDXGIDevice_AddRef
(
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