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
ec37ac6f
Commit
ec37ac6f
authored
Nov 04, 2013
by
Henri Verbeet
Committed by
Alexandre Julliard
Nov 04, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ddrawex: Get rid of the IClassFactoryImpl typedef.
parent
ceb4d259
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
38 additions
and
68 deletions
+38
-68
main.c
dlls/ddrawex/main.c
+38
-68
No files found.
dlls/ddrawex/main.c
View file @
ec37ac6f
...
...
@@ -36,114 +36,84 @@ WINE_DEFAULT_DEBUG_CHANNEL(ddrawex);
static
HINSTANCE
instance
;
/******************************************************************************
* DirectDraw ClassFactory implementation
******************************************************************************/
typedef
struct
struct
ddrawex_class_factory
{
IClassFactory
IClassFactory_iface
;
LONG
ref
;
HRESULT
(
*
pfnCreateInstance
)(
IUnknown
*
outer
,
REFIID
iid
,
void
**
out
);
}
IClassFactoryImpl
;
};
static
inline
IClassFactoryImpl
*
impl_from_IClassFactory
(
IClassFactory
*
iface
)
static
inline
struct
ddrawex_class_factory
*
impl_from_IClassFactory
(
IClassFactory
*
iface
)
{
return
CONTAINING_RECORD
(
iface
,
IClassFactoryImpl
,
IClassFactory_iface
);
return
CONTAINING_RECORD
(
iface
,
struct
ddrawex_class_factory
,
IClassFactory_iface
);
}
/*******************************************************************************
* IDirectDrawClassFactory::QueryInterface
*
*******************************************************************************/
static
HRESULT
WINAPI
IDirectDrawClassFactoryImpl_QueryInterface
(
IClassFactory
*
iface
,
REFIID
riid
,
void
**
obj
)
static
HRESULT
WINAPI
ddrawex_class_factory_QueryInterface
(
IClassFactory
*
iface
,
REFIID
riid
,
void
**
out
)
{
TRACE
(
"
(%p)->(%s,%p)
\n
"
,
iface
,
debugstr_guid
(
riid
),
obj
);
TRACE
(
"
iface %p, riid %s, out %p.
\n
"
,
iface
,
debugstr_guid
(
riid
),
out
);
if
(
IsEqualGUID
(
riid
,
&
IID_I
Unknown
)
||
IsEqualGUID
(
riid
,
&
IID_IClassFactory
))
if
(
IsEqualGUID
(
riid
,
&
IID_I
ClassFactory
)
||
IsEqualGUID
(
riid
,
&
IID_IUnknown
))
{
IClassFactory_AddRef
(
iface
);
*
o
bj
=
iface
;
*
o
ut
=
iface
;
return
S_OK
;
}
WARN
(
"%s not implemented, returning E_NOINTERFACE.
\n
"
,
debugstr_guid
(
riid
));
*
o
bj
=
NULL
;
*
o
ut
=
NULL
;
return
E_NOINTERFACE
;
}
/*******************************************************************************
* IDirectDrawClassFactory::AddRef
*
*******************************************************************************/
static
ULONG
WINAPI
IDirectDrawClassFactoryImpl_AddRef
(
IClassFactory
*
iface
)
static
ULONG
WINAPI
ddrawex_class_factory_AddRef
(
IClassFactory
*
iface
)
{
IClassFactoryImpl
*
This
=
impl_from_IClassFactory
(
iface
);
ULONG
ref
=
InterlockedIncrement
(
&
This
->
ref
);
struct
ddrawex_class_factory
*
factory
=
impl_from_IClassFactory
(
iface
);
ULONG
ref
count
=
InterlockedIncrement
(
&
factory
->
ref
);
TRACE
(
"
(%p)->() incrementing from %d.
\n
"
,
This
,
ref
-
1
);
TRACE
(
"
%p increasing refcount to %u.
\n
"
,
iface
,
refcount
);
return
ref
;
return
ref
count
;
}
/*******************************************************************************
* IDirectDrawClassFactory::Release
*
*******************************************************************************/
static
ULONG
WINAPI
IDirectDrawClassFactoryImpl_Release
(
IClassFactory
*
iface
)
static
ULONG
WINAPI
ddrawex_class_factory_Release
(
IClassFactory
*
iface
)
{
IClassFactoryImpl
*
This
=
impl_from_IClassFactory
(
iface
);
ULONG
ref
=
InterlockedDecrement
(
&
This
->
ref
);
struct
ddrawex_class_factory
*
factory
=
impl_from_IClassFactory
(
iface
);
ULONG
ref
count
=
InterlockedDecrement
(
&
factory
->
ref
);
TRACE
(
"
(%p)->() decrementing from %d.
\n
"
,
This
,
ref
+
1
);
TRACE
(
"
%p decreasing refcount to %u.
\n
"
,
iface
,
refcount
);
if
(
ref
==
0
)
HeapFree
(
GetProcessHeap
(),
0
,
This
);
if
(
!
refcount
)
HeapFree
(
GetProcessHeap
(),
0
,
factory
);
return
ref
;
return
ref
count
;
}
/*******************************************************************************
* IDirectDrawClassFactory::CreateInstance
*
*******************************************************************************/
static
HRESULT
WINAPI
IDirectDrawClassFactoryImpl_CreateInstance
(
IClassFactory
*
iface
,
IUnknown
*
UnkOuter
,
REFIID
riid
,
void
**
obj
)
static
HRESULT
WINAPI
ddrawex_class_factory_CreateInstance
(
IClassFactory
*
iface
,
IUnknown
*
outer_unknown
,
REFIID
riid
,
void
**
out
)
{
IClassFactoryImpl
*
This
=
impl_from_IClassFactory
(
iface
);
struct
ddrawex_class_factory
*
factory
=
impl_from_IClassFactory
(
iface
);
TRACE
(
"(%p)->(%p,%s,%p)
\n
"
,
This
,
UnkOuter
,
debugstr_guid
(
riid
),
obj
);
TRACE
(
"iface %p, outer_unknown %p, riid %s, out %p.
\n
"
,
iface
,
outer_unknown
,
debugstr_guid
(
riid
),
out
);
return
This
->
pfnCreateInstance
(
UnkOuter
,
riid
,
obj
);
return
factory
->
pfnCreateInstance
(
outer_unknown
,
riid
,
out
);
}
/*******************************************************************************
* IDirectDrawClassFactory::LockServer
*
*******************************************************************************/
static
HRESULT
WINAPI
IDirectDrawClassFactoryImpl_LockServer
(
IClassFactory
*
iface
,
BOOL
dolock
)
static
HRESULT
WINAPI
ddrawex_class_factory_LockServer
(
IClassFactory
*
iface
,
BOOL
dolock
)
{
IClassFactoryImpl
*
This
=
impl_from_IClassFactory
(
iface
);
FIXME
(
"(%p)->(%d),stub!
\n
"
,
This
,
dolock
);
FIXME
(
"iface %p, dolock %#x stub!
\n
"
,
iface
,
dolock
);
return
S_OK
;
}
/*******************************************************************************
* The class factory VTable
*******************************************************************************/
static
const
IClassFactoryVtbl
IClassFactory_Vtbl
=
static
const
IClassFactoryVtbl
ddrawex_class_factory_vtbl
=
{
IDirectDrawClassFactoryImpl
_QueryInterface
,
IDirectDrawClassFactoryImpl
_AddRef
,
IDirectDrawClassFactoryImpl
_Release
,
IDirectDrawClassFactoryImpl
_CreateInstance
,
IDirectDrawClassFactoryImpl_LockServer
ddrawex_class_factory
_QueryInterface
,
ddrawex_class_factory
_AddRef
,
ddrawex_class_factory
_Release
,
ddrawex_class_factory
_CreateInstance
,
ddrawex_class_factory_LockServer
,
};
...
...
@@ -283,7 +253,7 @@ HRESULT WINAPI DllCanUnloadNow(void)
*/
HRESULT
WINAPI
DllGetClassObject
(
REFCLSID
rclsid
,
REFIID
riid
,
void
**
out
)
{
IClassFactoryImpl
*
factory
;
struct
ddrawex_class_factory
*
factory
;
TRACE
(
"rclsid %s, riid %s, out %p.
\n
"
,
debugstr_guid
(
rclsid
),
debugstr_guid
(
riid
),
out
);
...
...
@@ -300,7 +270,7 @@ HRESULT WINAPI DllGetClassObject(REFCLSID rclsid, REFIID riid, void **out)
factory
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
sizeof
(
*
factory
));
if
(
factory
==
NULL
)
return
E_OUTOFMEMORY
;
factory
->
IClassFactory_iface
.
lpVtbl
=
&
IClassFactory_V
tbl
;
factory
->
IClassFactory_iface
.
lpVtbl
=
&
ddrawex_class_factory_v
tbl
;
factory
->
ref
=
1
;
factory
->
pfnCreateInstance
=
CreateDirectDrawFactory
;
...
...
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