Commit 19966f8c authored by Alexandre Julliard's avatar Alexandre Julliard

comcat: Moved all the implementation to ole32 where it belongs.

parent 67fe27d0
...@@ -6,10 +6,7 @@ MODULE = comcat.dll ...@@ -6,10 +6,7 @@ MODULE = comcat.dll
IMPORTS = uuid ole32 user32 advapi32 kernel32 IMPORTS = uuid ole32 user32 advapi32 kernel32
C_SRCS = \ C_SRCS = \
comcat_main.c \ comcat_main.c
factory.c \
information.c \
register.c
RC_SRCS = \ RC_SRCS = \
version.rc version.rc
......
@ stdcall -private DllCanUnloadNow() @ stdcall -private DllCanUnloadNow()
@ stdcall -private DllGetClassObject(ptr ptr ptr) @ stdcall -private DllGetClassObject(ptr ptr ptr) ole32.DllGetClassObject
@ stdcall -private DllRegisterServer() @ stdcall -private DllRegisterServer()
@ stdcall -private DllUnregisterServer() @ stdcall -private DllUnregisterServer()
...@@ -18,38 +18,23 @@ ...@@ -18,38 +18,23 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/ */
#include "comcat_private.h" #include <stdarg.h>
#include "wine/debug.h" #define COBJMACROS
WINE_DEFAULT_DEBUG_CHANNEL(ole); #include "windef.h"
#include "winbase.h"
LONG dll_ref = 0; #include "winuser.h"
#include "winreg.h"
/*********************************************************************** #include "winerror.h"
* Global string constant definitions #include "ole2.h"
*/
const WCHAR clsid_keyname[6] = { 'C', 'L', 'S', 'I', 'D', 0 };
/***********************************************************************
* DllGetClassObject (COMCAT.@)
*/
HRESULT WINAPI DllGetClassObject(REFCLSID rclsid, REFIID iid, LPVOID *ppv)
{
*ppv = NULL;
if (IsEqualGUID(rclsid, &CLSID_StdComponentCategoriesMgr)) {
return ComCatCF_Create(iid, ppv);
}
FIXME("\n\tCLSID:\t%s,\n\tIID:\t%s\n",debugstr_guid(rclsid),debugstr_guid(iid));
return CLASS_E_CLASSNOTAVAILABLE;
}
/*********************************************************************** /***********************************************************************
* DllCanUnloadNow (COMCAT.@) * DllCanUnloadNow (COMCAT.@)
*/ */
HRESULT WINAPI DllCanUnloadNow(void) HRESULT WINAPI DllCanUnloadNow(void)
{ {
return dll_ref != 0 ? S_FALSE : S_OK; return S_FALSE;
} }
/*********************************************************************** /***********************************************************************
......
/*
* includes for comcat.dll
*
* Copyright (C) 2002 John K. Hohm
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include <stdarg.h>
#define COBJMACROS
#include "windef.h"
#include "winbase.h"
#include "winuser.h"
#include "winreg.h"
#include "winerror.h"
#include "ole2.h"
#include "comcat.h"
#include "wine/unicode.h"
/**********************************************************************
* Dll lifetime tracking declaration for comcat.dll
*/
extern LONG dll_ref;
extern HRESULT ComCatCF_Create(REFIID riid, LPVOID *ppv);
/**********************************************************************
* StdComponentCategoriesMgr declaration for comcat.dll
*/
typedef struct
{
const ICatRegisterVtbl *lpVtbl;
const ICatInformationVtbl *infVtbl;
} ComCatMgrImpl;
extern ComCatMgrImpl COMCAT_ComCatMgr;
extern const ICatInformationVtbl COMCAT_ICatInformation_Vtbl;
/**********************************************************************
* Global string constant declarations
*/
extern const WCHAR clsid_keyname[6];
/*
* ClassFactory implementation for comcat.dll
*
* Copyright (C) 2002 John K. Hohm
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include "comcat_private.h"
#include "wine/debug.h"
WINE_DEFAULT_DEBUG_CHANNEL(ole);
/**********************************************************************
* COMCAT_IClassFactory_QueryInterface (also IUnknown)
*/
static HRESULT WINAPI COMCAT_IClassFactory_QueryInterface(
LPCLASSFACTORY iface,
REFIID riid,
LPVOID *ppvObj)
{
TRACE("\n\tIID:\t%s\n",debugstr_guid(riid));
if (ppvObj == NULL) return E_POINTER;
if (IsEqualGUID(riid, &IID_IUnknown) ||
IsEqualGUID(riid, &IID_IClassFactory))
{
*ppvObj = (LPVOID)iface;
IUnknown_AddRef(iface);
return S_OK;
}
return E_NOINTERFACE;
}
/**********************************************************************
* COMCAT_IClassFactory_AddRef (also IUnknown)
*/
static ULONG WINAPI COMCAT_IClassFactory_AddRef(LPCLASSFACTORY iface)
{
return 2; /* non-heap based object */
}
/**********************************************************************
* COMCAT_IClassFactory_Release (also IUnknown)
*/
static ULONG WINAPI COMCAT_IClassFactory_Release(LPCLASSFACTORY iface)
{
return 1; /* non-heap based object */
}
/**********************************************************************
* COMCAT_IClassFactory_CreateInstance
*/
static HRESULT WINAPI COMCAT_IClassFactory_CreateInstance(
LPCLASSFACTORY iface,
LPUNKNOWN pUnkOuter,
REFIID riid,
LPVOID *ppvObj)
{
HRESULT res;
TRACE("\n\tIID:\t%s\n",debugstr_guid(riid));
if (ppvObj == NULL) return E_POINTER;
/* Don't support aggregation (Windows doesn't) */
if (pUnkOuter != NULL) return CLASS_E_NOAGGREGATION;
res = IUnknown_QueryInterface((LPUNKNOWN)&COMCAT_ComCatMgr, riid, ppvObj);
if (SUCCEEDED(res)) {
return res;
}
return CLASS_E_CLASSNOTAVAILABLE;
}
/**********************************************************************
* COMCAT_IClassFactory_LockServer
*/
static HRESULT WINAPI COMCAT_IClassFactory_LockServer(
LPCLASSFACTORY iface,
BOOL fLock)
{
FIXME("(%d), stub!\n",fLock);
return S_OK;
}
/**********************************************************************
* static ClassFactory instance
*/
static const IClassFactoryVtbl ComCatCFVtbl =
{
COMCAT_IClassFactory_QueryInterface,
COMCAT_IClassFactory_AddRef,
COMCAT_IClassFactory_Release,
COMCAT_IClassFactory_CreateInstance,
COMCAT_IClassFactory_LockServer
};
static const IClassFactoryVtbl *ComCatCF = &ComCatCFVtbl;
HRESULT ComCatCF_Create(REFIID riid, LPVOID *ppv)
{
return IClassFactory_QueryInterface((IClassFactory *)&ComCatCF, riid, ppv);
}
...@@ -12,6 +12,7 @@ C_SRCS = \ ...@@ -12,6 +12,7 @@ C_SRCS = \
bindctx.c \ bindctx.c \
classmoniker.c \ classmoniker.c \
clipboard.c \ clipboard.c \
comcat.c \
compobj.c \ compobj.c \
compositemoniker.c \ compositemoniker.c \
datacache.c \ datacache.c \
......
...@@ -36,6 +36,7 @@ HRESULT AntiMonikerCF_Create(REFIID riid, LPVOID *ppv); ...@@ -36,6 +36,7 @@ HRESULT AntiMonikerCF_Create(REFIID riid, LPVOID *ppv);
HRESULT CompositeMonikerCF_Create(REFIID riid, LPVOID *ppv); HRESULT CompositeMonikerCF_Create(REFIID riid, LPVOID *ppv);
HRESULT ClassMonikerCF_Create(REFIID riid, LPVOID *ppv); HRESULT ClassMonikerCF_Create(REFIID riid, LPVOID *ppv);
HRESULT PointerMonikerCF_Create(REFIID riid, LPVOID *ppv); HRESULT PointerMonikerCF_Create(REFIID riid, LPVOID *ppv);
HRESULT ComCatCF_Create(REFIID riid, LPVOID *ppv);
/* This function decomposes a String path to a String Table containing all the elements ("\" or "subDirectory" or "Directory" or "FileName") of the path */ /* This function decomposes a String path to a String Table containing all the elements ("\" or "subDirectory" or "Directory" or "FileName") of the path */
int FileMonikerImpl_DecomposePath(LPCOLESTR str, LPOLESTR** stringTable); int FileMonikerImpl_DecomposePath(LPCOLESTR str, LPOLESTR** stringTable);
......
...@@ -40,6 +40,7 @@ ...@@ -40,6 +40,7 @@
#include "compobj_private.h" #include "compobj_private.h"
#include "moniker.h" #include "moniker.h"
#include "comcat.h"
#include "wine/debug.h" #include "wine/debug.h"
...@@ -88,6 +89,8 @@ HRESULT WINAPI DllGetClassObject(REFCLSID rclsid, REFIID iid,LPVOID *ppv) ...@@ -88,6 +89,8 @@ HRESULT WINAPI DllGetClassObject(REFCLSID rclsid, REFIID iid,LPVOID *ppv)
return ClassMonikerCF_Create(iid, ppv); return ClassMonikerCF_Create(iid, ppv);
if (IsEqualCLSID(rclsid, &CLSID_PointerMoniker)) if (IsEqualCLSID(rclsid, &CLSID_PointerMoniker))
return PointerMonikerCF_Create(iid, ppv); return PointerMonikerCF_Create(iid, ppv);
if (IsEqualGUID(rclsid, &CLSID_StdComponentCategoriesMgr))
return ComCatCF_Create(iid, ppv);
return NdrDllGetClassObject(rclsid, iid, ppv, OLE32_ProxyFileList, return NdrDllGetClassObject(rclsid, iid, ppv, OLE32_ProxyFileList,
&CLSID_PSFactoryBuffer, &PSFactoryBuffer); &CLSID_PSFactoryBuffer, &PSFactoryBuffer);
......
...@@ -499,7 +499,7 @@ static struct regsvr_coclass const coclass_list[] = { ...@@ -499,7 +499,7 @@ static struct regsvr_coclass const coclass_list[] = {
{ &CLSID_StdComponentCategoriesMgr, { &CLSID_StdComponentCategoriesMgr,
"Component Categories Manager", "Component Categories Manager",
NULL, NULL,
"comcat.dll", /* FIXME: should be in ole32.dll */ "ole32.dll",
"Both" "Both"
}, },
{ NULL } /* list terminator */ { NULL } /* list terminator */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment