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
e5d69ba9
Commit
e5d69ba9
authored
Jun 28, 2011
by
Ričardas Barkauskas
Committed by
Alexandre Julliard
Jun 28, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ddraw: Separate IDirectDrawGammaControl reference count.
parent
90112e97
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
20 additions
and
8 deletions
+20
-8
ddraw_private.h
dlls/ddraw/ddraw_private.h
+1
-1
surface.c
dlls/ddraw/surface.c
+17
-5
dsurface.c
dlls/ddraw/tests/dsurface.c
+2
-2
No files found.
dlls/ddraw/ddraw_private.h
View file @
e5d69ba9
...
...
@@ -161,7 +161,7 @@ struct IDirectDrawSurfaceImpl
const
IDirect3DTexture2Vtbl
*
IDirect3DTexture2_vtbl
;
const
IDirect3DTextureVtbl
*
IDirect3DTexture_vtbl
;
LONG
ref7
,
ref4
,
ref3
,
ref2
,
ref1
,
iface_count
;
LONG
ref7
,
ref4
,
ref3
,
ref2
,
ref1
,
iface_count
,
gamma_count
;
IUnknown
*
ifaceToRelease
;
int
version
;
...
...
dlls/ddraw/surface.c
View file @
e5d69ba9
...
...
@@ -111,7 +111,7 @@ static HRESULT WINAPI ddraw_surface7_QueryInterface(IDirectDrawSurface7 *iface,
}
else
if
(
IsEqualGUID
(
riid
,
&
IID_IDirectDrawGammaControl
)
)
{
I
Unknown_AddRef
(
iface
);
I
DirectDrawGammaControl_AddRef
(
&
This
->
IDirectDrawGammaControl_
iface
);
*
obj
=
&
This
->
IDirectDrawGammaControl_iface
;
TRACE
(
"(%p) returning IDirectDrawGammaControl interface at %p
\n
"
,
This
,
*
obj
);
return
S_OK
;
...
...
@@ -318,10 +318,16 @@ static ULONG WINAPI ddraw_surface1_AddRef(IDirectDrawSurface *iface)
static
ULONG
WINAPI
ddraw_gamma_control_AddRef
(
IDirectDrawGammaControl
*
iface
)
{
IDirectDrawSurfaceImpl
*
This
=
impl_from_IDirectDrawGammaControl
(
iface
);
ULONG
refcount
=
InterlockedIncrement
(
&
This
->
gamma_count
);
TRACE
(
"iface %p.
\n
"
,
iface
);
TRACE
(
"iface %p increasing refcount to %u.
\n
"
,
iface
,
refcount
);
if
(
refcount
==
1
)
{
ddraw_surface_add_iface
(
This
);
}
return
ddraw_surface7_AddRef
(
&
This
->
IDirectDrawSurface7_iface
)
;
return
refcount
;
}
static
ULONG
WINAPI
d3d_texture2_AddRef
(
IDirect3DTexture2
*
iface
)
...
...
@@ -595,10 +601,16 @@ static ULONG WINAPI ddraw_surface1_Release(IDirectDrawSurface *iface)
static
ULONG
WINAPI
ddraw_gamma_control_Release
(
IDirectDrawGammaControl
*
iface
)
{
IDirectDrawSurfaceImpl
*
This
=
impl_from_IDirectDrawGammaControl
(
iface
);
ULONG
refcount
=
InterlockedDecrement
(
&
This
->
gamma_count
);
TRACE
(
"iface %p.
\n
"
,
iface
);
TRACE
(
"iface %p decreasing refcount to %u.
\n
"
,
iface
,
refcount
);
if
(
refcount
==
0
)
{
ddraw_surface_release_iface
(
This
);
}
return
ddraw_surface7_Release
(
&
This
->
IDirectDrawSurface7_iface
)
;
return
refcount
;
}
static
ULONG
WINAPI
d3d_texture2_Release
(
IDirect3DTexture2
*
iface
)
...
...
dlls/ddraw/tests/dsurface.c
View file @
e5d69ba9
...
...
@@ -1125,7 +1125,7 @@ static void IFaceRefCount(void)
IDirectDrawSurface_QueryInterface
(
surf
,
&
IID_IDirectDrawGammaControl
,
(
void
**
)
&
gamma
);
ref
=
getRefcount
((
IUnknown
*
)
gamma
);
todo_wine
ok
(
ref
==
1
,
"Refcount is %u, expected 1
\n
"
,
ref
);
ok
(
ref
==
1
,
"Refcount is %u, expected 1
\n
"
,
ref
);
ref
=
IDirect3DTexture2_Release
(
tex2
);
/* Release the texture */
ok
(
ref
==
2
,
"Refcount is %u, expected 2
\n
"
,
ref
);
...
...
@@ -1138,7 +1138,7 @@ static void IFaceRefCount(void)
ok
(
ref
==
1
,
"Refcount is %u, expected 1
\n
"
,
ref
);
ref
=
IDirectDrawGammaControl_Release
(
gamma
);
/* Release the gamma control */
todo_wine
ok
(
ref
==
0
,
"Refcount is %u, expected 0
\n
"
,
ref
);
ok
(
ref
==
0
,
"Refcount is %u, expected 0
\n
"
,
ref
);
}
ref
=
IDirectDrawSurface2_Release
(
surf2
);
/* Release one of the 2 surf2 interfaces */
...
...
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