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
e415b382
Commit
e415b382
authored
Jan 25, 2011
by
Michael Stefaniuc
Committed by
Alexandre Julliard
Jan 25, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ddrawex: COM cleanup for the IDirectDrawSurface3 iface.
parent
3d559eb1
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
14 deletions
+9
-14
ddrawex_private.h
dlls/ddrawex/ddrawex_private.h
+1
-1
surface.c
dlls/ddrawex/surface.c
+8
-13
No files found.
dlls/ddrawex/ddrawex_private.h
View file @
e415b382
...
...
@@ -74,7 +74,7 @@ IDirectDraw4 *dd_get_inner(IDirectDraw4 *outer);
******************************************************************************/
typedef
struct
{
const
IDirectDrawSurface3Vtbl
*
IDirectDrawSurface3_Vtbl
;
IDirectDrawSurface3
IDirectDrawSurface3_iface
;
const
IDirectDrawSurface4Vtbl
*
IDirectDrawSurface4_Vtbl
;
LONG
ref
;
...
...
dlls/ddrawex/surface.c
View file @
e415b382
...
...
@@ -35,17 +35,11 @@ WINE_DEFAULT_DEBUG_CHANNEL(ddrawex);
******************************************************************************/
static
IDirectDrawSurfaceImpl
*
impl_from_IDirectDrawSurface3
(
IDirectDrawSurface3
*
iface
)
{
return
(
IDirectDrawSurfaceImpl
*
)((
char
*
)
iface
-
FIELD_OFFSET
(
IDirectDrawSurfaceImpl
,
IDirectDrawSurface3_Vtbl
)
);
return
CONTAINING_RECORD
(
iface
,
IDirectDrawSurfaceImpl
,
IDirectDrawSurface3_iface
);
}
static
IDirectDrawSurfaceImpl
*
unsafe_impl_from_IDirectDrawSurface3
(
IDirectDrawSurface3
*
iface
);
static
IDirectDrawSurface3
*
dds3_from_impl
(
IDirectDrawSurfaceImpl
*
This
)
{
if
(
!
This
)
return
NULL
;
return
(
IDirectDrawSurface3
*
)
&
This
->
IDirectDrawSurface3_Vtbl
;
}
static
IDirectDrawSurfaceImpl
*
impl_from_dds4
(
IDirectDrawSurface4
*
iface
)
{
if
(
!
iface
)
return
NULL
;
...
...
@@ -83,8 +77,8 @@ IDirectDrawSurface4Impl_QueryInterface(IDirectDrawSurface4 *iface,
||
IsEqualGUID
(
riid
,
&
IID_IDirectDrawSurface2
)
||
IsEqualGUID
(
riid
,
&
IID_IDirectDrawSurface
)
)
{
*
obj
=
dds3_from_impl
(
This
)
;
IDirectDrawSurface3_AddRef
(
(
IDirectDrawSurface3
*
)
*
obj
);
*
obj
=
&
This
->
IDirectDrawSurface3_iface
;
IDirectDrawSurface3_AddRef
(
&
This
->
IDirectDrawSurface3_iface
);
TRACE
(
"(%p) returning IDirectDrawSurface3 interface at %p
\n
"
,
This
,
*
obj
);
return
S_OK
;
}
...
...
@@ -335,10 +329,11 @@ enumsurfaces_thunk_cb(IDirectDrawSurface4 *surf, DDSURFACEDESC2 *desc2, void *vc
DDSURFACEDESC
desc
;
TRACE
(
"Thunking back to IDirectDrawSurface3
\n
"
);
IDirectDrawSurface3_AddRef
(
dds3_from_impl
(
This
)
);
IDirectDrawSurface3_AddRef
(
&
This
->
IDirectDrawSurface3_iface
);
IDirectDrawSurface3_Release
(
surf
);
DDSD2_to_DDSD
(
desc2
,
&
desc
);
return
ctx
->
orig_cb
((
IDirectDrawSurface
*
)
dds3_from_impl
(
This
),
&
desc
,
ctx
->
orig_ctx
);
return
ctx
->
orig_cb
((
IDirectDrawSurface
*
)
&
This
->
IDirectDrawSurface3_iface
,
&
desc
,
ctx
->
orig_ctx
);
}
static
HRESULT
WINAPI
IDirectDrawSurface3Impl_EnumAttachedSurfaces
(
IDirectDrawSurface3
*
iface
,
...
...
@@ -1166,7 +1161,7 @@ static IDirectDrawSurfaceImpl *unsafe_impl_from_IDirectDrawSurface3(IDirectDrawS
{
if
(
!
iface
)
return
NULL
;
if
(
iface
->
lpVtbl
!=
&
IDirectDrawSurface3_Vtbl
)
return
NULL
;
return
CONTAINING_RECORD
(
iface
,
IDirectDrawSurfaceImpl
,
IDirectDrawSurface3_
Vtbl
);
return
CONTAINING_RECORD
(
iface
,
IDirectDrawSurfaceImpl
,
IDirectDrawSurface3_
iface
);
}
/* dds_get_outer
...
...
@@ -1197,7 +1192,7 @@ IDirectDrawSurface4 *dds_get_outer(IDirectDrawSurface4 *inner)
TRACE
(
"Creating new ddrawex surface wrapper for surface %p
\n
"
,
inner
);
impl
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
sizeof
(
*
impl
));
impl
->
ref
=
1
;
impl
->
IDirectDrawSurface3_Vtbl
=
&
IDirectDrawSurface3_Vtbl
;
impl
->
IDirectDrawSurface3_
iface
.
lp
Vtbl
=
&
IDirectDrawSurface3_Vtbl
;
impl
->
IDirectDrawSurface4_Vtbl
=
&
IDirectDrawSurface4_Vtbl
;
IDirectDrawSurface4_AddRef
(
inner
);
impl
->
parent
=
inner
;
...
...
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