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
9fd2d34d
Commit
9fd2d34d
authored
Apr 25, 2012
by
Henri Verbeet
Committed by
Alexandre Julliard
Apr 26, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ddraw: Get rid of IClassFactoryImpl.
parent
3e2d9462
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
30 additions
and
35 deletions
+30
-35
main.c
dlls/ddraw/main.c
+30
-35
No files found.
dlls/ddraw/main.c
View file @
9fd2d34d
...
...
@@ -511,21 +511,17 @@ static const struct object_creation_info object_creation[] =
{
&
CLSID_DirectDrawClipper
,
CF_CreateDirectDrawClipper
}
};
/******************************************************************************
* DirectDraw ClassFactory implementation
******************************************************************************/
typedef
struct
struct
ddraw_class_factory
{
IClassFactory
IClassFactory_iface
;
LONG
ref
;
HRESULT
(
*
pfnCreateInstance
)(
IUnknown
*
pUnkOuter
,
REFIID
iid
,
LPVOID
*
ppObj
);
}
IClassFactoryImpl
;
};
static
inline
IClassFactoryImpl
*
impl_from_IClassFactory
(
IClassFactory
*
iface
)
static
inline
struct
ddraw_class_factory
*
impl_from_IClassFactory
(
IClassFactory
*
iface
)
{
return
CONTAINING_RECORD
(
iface
,
IClassFactoryImpl
,
IClassFactory_iface
);
return
CONTAINING_RECORD
(
iface
,
struct
ddraw_class_factory
,
IClassFactory_iface
);
}
/*******************************************************************************
...
...
@@ -542,16 +538,15 @@ static inline IClassFactoryImpl *impl_from_IClassFactory(IClassFactory *iface)
* Failure: E_NOINTERFACE
*
*******************************************************************************/
static
HRESULT
WINAPI
IDirectDrawClassFactoryImpl_QueryInterface
(
IClassFactory
*
iface
,
REFIID
riid
,
void
**
obj
)
static
HRESULT
WINAPI
ddraw_class_factory_QueryInterface
(
IClassFactory
*
iface
,
REFIID
riid
,
void
**
out
)
{
TRACE
(
"iface %p, riid %s, o
bject %p.
\n
"
,
iface
,
debugstr_guid
(
riid
),
obj
);
TRACE
(
"iface %p, riid %s, o
ut %p.
\n
"
,
iface
,
debugstr_guid
(
riid
),
out
);
if
(
IsEqualGUID
(
riid
,
&
IID_IUnknown
)
||
IsEqualGUID
(
riid
,
&
IID_IClassFactory
))
{
IClassFactory_AddRef
(
iface
);
*
o
bj
=
iface
;
*
o
ut
=
iface
;
return
S_OK
;
}
...
...
@@ -569,12 +564,12 @@ static HRESULT WINAPI IDirectDrawClassFactoryImpl_QueryInterface(IClassFactory *
* The new refcount
*
*******************************************************************************/
static
ULONG
WINAPI
IDirectDrawClassFactoryImpl
_AddRef
(
IClassFactory
*
iface
)
static
ULONG
WINAPI
ddraw_class_factory
_AddRef
(
IClassFactory
*
iface
)
{
IClassFactoryImpl
*
This
=
impl_from_IClassFactory
(
iface
);
ULONG
ref
=
InterlockedIncrement
(
&
This
->
ref
);
struct
ddraw_class_factory
*
factory
=
impl_from_IClassFactory
(
iface
);
ULONG
ref
=
InterlockedIncrement
(
&
factory
->
ref
);
TRACE
(
"%p increasing refcount to %u.
\n
"
,
This
,
ref
);
TRACE
(
"%p increasing refcount to %u.
\n
"
,
factory
,
ref
);
return
ref
;
}
...
...
@@ -589,15 +584,15 @@ static ULONG WINAPI IDirectDrawClassFactoryImpl_AddRef(IClassFactory *iface)
* The new refcount
*
*******************************************************************************/
static
ULONG
WINAPI
IDirectDrawClassFactoryImpl
_Release
(
IClassFactory
*
iface
)
static
ULONG
WINAPI
ddraw_class_factory
_Release
(
IClassFactory
*
iface
)
{
IClassFactoryImpl
*
This
=
impl_from_IClassFactory
(
iface
);
ULONG
ref
=
InterlockedDecrement
(
&
This
->
ref
);
struct
ddraw_class_factory
*
factory
=
impl_from_IClassFactory
(
iface
);
ULONG
ref
=
InterlockedDecrement
(
&
factory
->
ref
);
TRACE
(
"%p decreasing refcount to %u.
\n
"
,
This
,
ref
);
TRACE
(
"%p decreasing refcount to %u.
\n
"
,
factory
,
ref
);
if
(
ref
==
0
)
HeapFree
(
GetProcessHeap
(),
0
,
This
);
if
(
!
ref
)
HeapFree
(
GetProcessHeap
(),
0
,
factory
);
return
ref
;
}
...
...
@@ -615,15 +610,15 @@ static ULONG WINAPI IDirectDrawClassFactoryImpl_Release(IClassFactory *iface)
* ???
*
*******************************************************************************/
static
HRESULT
WINAPI
IDirectDrawClassFactoryImpl
_CreateInstance
(
IClassFactory
*
iface
,
IUnknown
*
UnkOuter
,
REFIID
riid
,
void
**
obj
)
static
HRESULT
WINAPI
ddraw_class_factory
_CreateInstance
(
IClassFactory
*
iface
,
IUnknown
*
outer_unknown
,
REFIID
riid
,
void
**
out
)
{
IClassFactoryImpl
*
This
=
impl_from_IClassFactory
(
iface
);
struct
ddraw_class_factory
*
factory
=
impl_from_IClassFactory
(
iface
);
TRACE
(
"iface %p, outer_unknown %p, riid %s, o
bjec
t %p.
\n
"
,
iface
,
UnkOuter
,
debugstr_guid
(
riid
),
obj
);
TRACE
(
"iface %p, outer_unknown %p, riid %s, o
u
t %p.
\n
"
,
iface
,
outer_unknown
,
debugstr_guid
(
riid
),
out
);
return
This
->
pfnCreateInstance
(
UnkOuter
,
riid
,
obj
);
return
factory
->
pfnCreateInstance
(
outer_unknown
,
riid
,
out
);
}
/*******************************************************************************
...
...
@@ -638,7 +633,7 @@ static HRESULT WINAPI IDirectDrawClassFactoryImpl_CreateInstance(IClassFactory *
* S_OK, because it's a stub
*
*******************************************************************************/
static
HRESULT
WINAPI
IDirectDrawClassFactoryImpl
_LockServer
(
IClassFactory
*
iface
,
BOOL
dolock
)
static
HRESULT
WINAPI
ddraw_class_factory
_LockServer
(
IClassFactory
*
iface
,
BOOL
dolock
)
{
FIXME
(
"iface %p, dolock %#x stub!
\n
"
,
iface
,
dolock
);
...
...
@@ -650,11 +645,11 @@ static HRESULT WINAPI IDirectDrawClassFactoryImpl_LockServer(IClassFactory *ifac
*******************************************************************************/
static
const
IClassFactoryVtbl
IClassFactory_Vtbl
=
{
IDirectDrawClassFactoryImpl
_QueryInterface
,
IDirectDrawClassFactoryImpl
_AddRef
,
IDirectDrawClassFactoryImpl
_Release
,
IDirectDrawClassFactoryImpl
_CreateInstance
,
IDirectDrawClassFactoryImpl
_LockServer
ddraw_class_factory
_QueryInterface
,
ddraw_class_factory
_AddRef
,
ddraw_class_factory
_Release
,
ddraw_class_factory
_CreateInstance
,
ddraw_class_factory
_LockServer
};
/*******************************************************************************
...
...
@@ -676,8 +671,8 @@ static const IClassFactoryVtbl IClassFactory_Vtbl =
*/
HRESULT
WINAPI
DllGetClassObject
(
REFCLSID
rclsid
,
REFIID
riid
,
LPVOID
*
ppv
)
{
struct
ddraw_class_factory
*
factory
;
unsigned
int
i
;
IClassFactoryImpl
*
factory
;
TRACE
(
"rclsid %s, riid %s, object %p.
\n
"
,
debugstr_guid
(
rclsid
),
debugstr_guid
(
riid
),
ppv
);
...
...
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