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
Show 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);
...
@@ -36,114 +36,84 @@ WINE_DEFAULT_DEBUG_CHANNEL(ddrawex);
static
HINSTANCE
instance
;
static
HINSTANCE
instance
;
/******************************************************************************
struct
ddrawex_class_factory
* DirectDraw ClassFactory implementation
******************************************************************************/
typedef
struct
{
{
IClassFactory
IClassFactory_iface
;
IClassFactory
IClassFactory_iface
;
LONG
ref
;
LONG
ref
;
HRESULT
(
*
pfnCreateInstance
)(
IUnknown
*
outer
,
REFIID
iid
,
void
**
out
);
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
);
}
}
/*******************************************************************************
static
HRESULT
WINAPI
ddrawex_class_factory_QueryInterface
(
IClassFactory
*
iface
,
REFIID
riid
,
void
**
out
)
* IDirectDrawClassFactory::QueryInterface
*
*******************************************************************************/
static
HRESULT
WINAPI
IDirectDrawClassFactoryImpl_QueryInterface
(
IClassFactory
*
iface
,
REFIID
riid
,
void
**
obj
)
{
{
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
)
if
(
IsEqualGUID
(
riid
,
&
IID_I
ClassFactory
)
||
IsEqualGUID
(
riid
,
&
IID_IClassFactory
))
||
IsEqualGUID
(
riid
,
&
IID_IUnknown
))
{
{
IClassFactory_AddRef
(
iface
);
IClassFactory_AddRef
(
iface
);
*
o
bj
=
iface
;
*
o
ut
=
iface
;
return
S_OK
;
return
S_OK
;
}
}
WARN
(
"%s not implemented, returning E_NOINTERFACE.
\n
"
,
debugstr_guid
(
riid
));
WARN
(
"%s not implemented, returning E_NOINTERFACE.
\n
"
,
debugstr_guid
(
riid
));
*
o
bj
=
NULL
;
*
o
ut
=
NULL
;
return
E_NOINTERFACE
;
return
E_NOINTERFACE
;
}
}
/*******************************************************************************
static
ULONG
WINAPI
ddrawex_class_factory_AddRef
(
IClassFactory
*
iface
)
* IDirectDrawClassFactory::AddRef
*
*******************************************************************************/
static
ULONG
WINAPI
IDirectDrawClassFactoryImpl_AddRef
(
IClassFactory
*
iface
)
{
{
IClassFactoryImpl
*
This
=
impl_from_IClassFactory
(
iface
);
struct
ddrawex_class_factory
*
factory
=
impl_from_IClassFactory
(
iface
);
ULONG
ref
=
InterlockedIncrement
(
&
This
->
ref
);
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
;
}
}
/*******************************************************************************
static
ULONG
WINAPI
ddrawex_class_factory_Release
(
IClassFactory
*
iface
)
* IDirectDrawClassFactory::Release
*
*******************************************************************************/
static
ULONG
WINAPI
IDirectDrawClassFactoryImpl_Release
(
IClassFactory
*
iface
)
{
{
IClassFactoryImpl
*
This
=
impl_from_IClassFactory
(
iface
);
struct
ddrawex_class_factory
*
factory
=
impl_from_IClassFactory
(
iface
);
ULONG
ref
=
InterlockedDecrement
(
&
This
->
ref
);
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
)
if
(
!
refcount
)
HeapFree
(
GetProcessHeap
(),
0
,
This
);
HeapFree
(
GetProcessHeap
(),
0
,
factory
);
return
ref
;
return
ref
count
;
}
}
static
HRESULT
WINAPI
ddrawex_class_factory_CreateInstance
(
IClassFactory
*
iface
,
/*******************************************************************************
IUnknown
*
outer_unknown
,
REFIID
riid
,
void
**
out
)
* IDirectDrawClassFactory::CreateInstance
*
*******************************************************************************/
static
HRESULT
WINAPI
IDirectDrawClassFactoryImpl_CreateInstance
(
IClassFactory
*
iface
,
IUnknown
*
UnkOuter
,
REFIID
riid
,
void
**
obj
)
{
{
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
);
}
}
/*******************************************************************************
static
HRESULT
WINAPI
ddrawex_class_factory_LockServer
(
IClassFactory
*
iface
,
BOOL
dolock
)
* IDirectDrawClassFactory::LockServer
*
*******************************************************************************/
static
HRESULT
WINAPI
IDirectDrawClassFactoryImpl_LockServer
(
IClassFactory
*
iface
,
BOOL
dolock
)
{
{
IClassFactoryImpl
*
This
=
impl_from_IClassFactory
(
iface
);
FIXME
(
"iface %p, dolock %#x stub!
\n
"
,
iface
,
dolock
);
FIXME
(
"(%p)->(%d),stub!
\n
"
,
This
,
dolock
);
return
S_OK
;
return
S_OK
;
}
}
static
const
IClassFactoryVtbl
ddrawex_class_factory_vtbl
=
/*******************************************************************************
* The class factory VTable
*******************************************************************************/
static
const
IClassFactoryVtbl
IClassFactory_Vtbl
=
{
{
IDirectDrawClassFactoryImpl
_QueryInterface
,
ddrawex_class_factory
_QueryInterface
,
IDirectDrawClassFactoryImpl
_AddRef
,
ddrawex_class_factory
_AddRef
,
IDirectDrawClassFactoryImpl
_Release
,
ddrawex_class_factory
_Release
,
IDirectDrawClassFactoryImpl
_CreateInstance
,
ddrawex_class_factory
_CreateInstance
,
IDirectDrawClassFactoryImpl_LockServer
ddrawex_class_factory_LockServer
,
};
};
...
@@ -283,7 +253,7 @@ HRESULT WINAPI DllCanUnloadNow(void)
...
@@ -283,7 +253,7 @@ HRESULT WINAPI DllCanUnloadNow(void)
*/
*/
HRESULT
WINAPI
DllGetClassObject
(
REFCLSID
rclsid
,
REFIID
riid
,
void
**
out
)
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
);
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)
...
@@ -300,7 +270,7 @@ HRESULT WINAPI DllGetClassObject(REFCLSID rclsid, REFIID riid, void **out)
factory
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
sizeof
(
*
factory
));
factory
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
sizeof
(
*
factory
));
if
(
factory
==
NULL
)
return
E_OUTOFMEMORY
;
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
->
ref
=
1
;
factory
->
pfnCreateInstance
=
CreateDirectDrawFactory
;
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