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
f8ff1bd6
Commit
f8ff1bd6
authored
Oct 11, 2008
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
comcat: Simplify the class factory implementation and make it more similar to…
comcat: Simplify the class factory implementation and make it more similar to the other ones in ole32.
parent
d4f107f5
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
14 additions
and
47 deletions
+14
-47
comcat_main.c
dlls/comcat/comcat_main.c
+1
-1
comcat_private.h
dlls/comcat/comcat_private.h
+1
-11
factory.c
dlls/comcat/factory.c
+12
-35
No files found.
dlls/comcat/comcat_main.c
View file @
f8ff1bd6
...
...
@@ -38,7 +38,7 @@ HRESULT WINAPI DllGetClassObject(REFCLSID rclsid, REFIID iid, LPVOID *ppv)
{
*
ppv
=
NULL
;
if
(
IsEqualGUID
(
rclsid
,
&
CLSID_StdComponentCategoriesMgr
))
{
return
IClassFactory_QueryInterface
((
LPCLASSFACTORY
)
&
COMCAT_ClassFactory
,
iid
,
ppv
);
return
ComCatCF_Create
(
iid
,
ppv
);
}
FIXME
(
"
\n\t
CLSID:
\t
%s,
\n\t
IID:
\t
%s
\n
"
,
debugstr_guid
(
rclsid
),
debugstr_guid
(
iid
));
return
CLASS_E_CLASSNOTAVAILABLE
;
...
...
dlls/comcat/comcat_private.h
View file @
f8ff1bd6
...
...
@@ -39,17 +39,7 @@
*/
extern
LONG
dll_ref
;
/**********************************************************************
* ClassFactory declaration for comcat.dll
*/
typedef
struct
{
/* IUnknown fields */
const
IClassFactoryVtbl
*
lpVtbl
;
LONG
ref
;
}
ClassFactoryImpl
;
extern
ClassFactoryImpl
COMCAT_ClassFactory
;
extern
HRESULT
ComCatCF_Create
(
REFIID
riid
,
LPVOID
*
ppv
);
/**********************************************************************
* StdComponentCategoriesMgr declaration for comcat.dll
...
...
dlls/comcat/factory.c
View file @
f8ff1bd6
...
...
@@ -24,7 +24,6 @@
WINE_DEFAULT_DEBUG_CHANNEL
(
ole
);
static
ULONG
WINAPI
COMCAT_IClassFactory_AddRef
(
LPCLASSFACTORY
iface
);
/**********************************************************************
* COMCAT_IClassFactory_QueryInterface (also IUnknown)
...
...
@@ -42,7 +41,7 @@ static HRESULT WINAPI COMCAT_IClassFactory_QueryInterface(
IsEqualGUID
(
riid
,
&
IID_IClassFactory
))
{
*
ppvObj
=
(
LPVOID
)
iface
;
COMCAT_IClassFactory
_AddRef
(
iface
);
IUnknown
_AddRef
(
iface
);
return
S_OK
;
}
...
...
@@ -54,16 +53,7 @@ static HRESULT WINAPI COMCAT_IClassFactory_QueryInterface(
*/
static
ULONG
WINAPI
COMCAT_IClassFactory_AddRef
(
LPCLASSFACTORY
iface
)
{
ClassFactoryImpl
*
This
=
(
ClassFactoryImpl
*
)
iface
;
ULONG
ref
;
TRACE
(
"
\n
"
);
ref
=
InterlockedIncrement
(
&
This
->
ref
);
if
(
ref
==
1
)
{
InterlockedIncrement
(
&
dll_ref
);
}
return
ref
;
return
2
;
/* non-heap based object */
}
/**********************************************************************
...
...
@@ -71,16 +61,7 @@ static ULONG WINAPI COMCAT_IClassFactory_AddRef(LPCLASSFACTORY iface)
*/
static
ULONG
WINAPI
COMCAT_IClassFactory_Release
(
LPCLASSFACTORY
iface
)
{
ClassFactoryImpl
*
This
=
(
ClassFactoryImpl
*
)
iface
;
ULONG
ref
;
TRACE
(
"
\n
"
);
ref
=
InterlockedDecrement
(
&
This
->
ref
);
if
(
ref
==
0
)
{
InterlockedDecrement
(
&
dll_ref
);
}
return
ref
;
return
1
;
/* non-heap based object */
}
/**********************************************************************
...
...
@@ -115,20 +96,14 @@ static HRESULT WINAPI COMCAT_IClassFactory_LockServer(
LPCLASSFACTORY
iface
,
BOOL
fLock
)
{
TRACE
(
"
\n
"
);
if
(
fLock
!=
FALSE
)
{
IClassFactory_AddRef
(
iface
);
}
else
{
IClassFactory_Release
(
iface
);
}
FIXME
(
"(%d), stub!
\n
"
,
fLock
);
return
S_OK
;
}
/**********************************************************************
*
IClassFactory_Vtbl
*
static ClassFactory instance
*/
static
const
IClassFactoryVtbl
IClassFactory_
Vtbl
=
static
const
IClassFactoryVtbl
ComCatCF
Vtbl
=
{
COMCAT_IClassFactory_QueryInterface
,
COMCAT_IClassFactory_AddRef
,
...
...
@@ -137,7 +112,9 @@ static const IClassFactoryVtbl IClassFactory_Vtbl =
COMCAT_IClassFactory_LockServer
};
/**********************************************************************
* static ClassFactory instance
*/
ClassFactoryImpl
COMCAT_ClassFactory
=
{
&
IClassFactory_Vtbl
,
0
};
static
const
IClassFactoryVtbl
*
ComCatCF
=
&
ComCatCFVtbl
;
HRESULT
ComCatCF_Create
(
REFIID
riid
,
LPVOID
*
ppv
)
{
return
IClassFactory_QueryInterface
((
IClassFactory
*
)
&
ComCatCF
,
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