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
IMPORTS = uuid ole32 user32 advapi32 kernel32
C_SRCS = \
comcat_main.c \
factory.c \
information.c \
register.c
comcat_main.c
RC_SRCS = \
version.rc
......
@ stdcall -private DllCanUnloadNow()
@ stdcall -private DllGetClassObject(ptr ptr ptr)
@ stdcall -private DllGetClassObject(ptr ptr ptr) ole32.DllGetClassObject
@ stdcall -private DllRegisterServer()
@ stdcall -private DllUnregisterServer()
......@@ -18,38 +18,23 @@
* 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);
LONG dll_ref = 0;
/***********************************************************************
* Global string constant definitions
*/
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;
}
#include "windef.h"
#include "winbase.h"
#include "winuser.h"
#include "winreg.h"
#include "winerror.h"
#include "ole2.h"
/***********************************************************************
* DllCanUnloadNow (COMCAT.@)
*/
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 = \
bindctx.c \
classmoniker.c \
clipboard.c \
comcat.c \
compobj.c \
compositemoniker.c \
datacache.c \
......
......@@ -36,6 +36,7 @@ HRESULT AntiMonikerCF_Create(REFIID riid, LPVOID *ppv);
HRESULT CompositeMonikerCF_Create(REFIID riid, LPVOID *ppv);
HRESULT ClassMonikerCF_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 */
int FileMonikerImpl_DecomposePath(LPCOLESTR str, LPOLESTR** stringTable);
......
......@@ -40,6 +40,7 @@
#include "compobj_private.h"
#include "moniker.h"
#include "comcat.h"
#include "wine/debug.h"
......@@ -88,6 +89,8 @@ HRESULT WINAPI DllGetClassObject(REFCLSID rclsid, REFIID iid,LPVOID *ppv)
return ClassMonikerCF_Create(iid, ppv);
if (IsEqualCLSID(rclsid, &CLSID_PointerMoniker))
return PointerMonikerCF_Create(iid, ppv);
if (IsEqualGUID(rclsid, &CLSID_StdComponentCategoriesMgr))
return ComCatCF_Create(iid, ppv);
return NdrDllGetClassObject(rclsid, iid, ppv, OLE32_ProxyFileList,
&CLSID_PSFactoryBuffer, &PSFactoryBuffer);
......
......@@ -499,7 +499,7 @@ static struct regsvr_coclass const coclass_list[] = {
{ &CLSID_StdComponentCategoriesMgr,
"Component Categories Manager",
NULL,
"comcat.dll", /* FIXME: should be in ole32.dll */
"ole32.dll",
"Both"
},
{ 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