2006-07-11 04:13:18 +02:00
|
|
|
/*
|
|
|
|
* Word splitter Implementation
|
|
|
|
*
|
|
|
|
* Copyright 2006 Mike McCormack
|
|
|
|
*
|
|
|
|
* 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
|
|
|
|
*/
|
|
|
|
|
|
|
|
#define COBJMACROS
|
|
|
|
|
|
|
|
|
|
|
|
#include <stdarg.h>
|
2006-08-10 15:40:39 +02:00
|
|
|
#include <stdio.h>
|
2006-07-11 04:13:18 +02:00
|
|
|
|
|
|
|
#include "windef.h"
|
|
|
|
#include "winbase.h"
|
|
|
|
#include "winuser.h"
|
|
|
|
#include "ole2.h"
|
2010-12-07 14:50:56 +01:00
|
|
|
#include "rpcproxy.h"
|
2006-08-11 13:21:46 +02:00
|
|
|
#include "indexsrv.h"
|
2006-07-11 04:13:18 +02:00
|
|
|
#include "initguid.h"
|
2010-12-07 14:50:56 +01:00
|
|
|
#include "infosoft.h"
|
2006-07-11 04:13:18 +02:00
|
|
|
|
|
|
|
#include "wine/debug.h"
|
|
|
|
|
|
|
|
WINE_DEFAULT_DEBUG_CHANNEL(infosoft);
|
|
|
|
|
2011-05-13 17:16:53 +02:00
|
|
|
DECLSPEC_HIDDEN extern HRESULT WINAPI wb_Constructor(IUnknown*, REFIID, LPVOID *);
|
2006-07-11 04:13:18 +02:00
|
|
|
|
|
|
|
typedef HRESULT (CALLBACK *LPFNCREATEINSTANCE)(IUnknown*, REFIID, LPVOID*);
|
|
|
|
|
|
|
|
typedef struct
|
|
|
|
{
|
2010-12-05 15:16:17 +01:00
|
|
|
IClassFactory IClassFactory_iface;
|
|
|
|
LPFNCREATEINSTANCE lpfnCI;
|
2006-07-11 04:13:18 +02:00
|
|
|
} CFImpl;
|
|
|
|
|
2010-12-05 15:16:17 +01:00
|
|
|
static inline CFImpl *impl_from_IClassFactory(IClassFactory *iface)
|
|
|
|
{
|
|
|
|
return CONTAINING_RECORD(iface, CFImpl, IClassFactory_iface);
|
|
|
|
}
|
|
|
|
|
2006-07-11 04:13:18 +02:00
|
|
|
static HRESULT WINAPI infosoftcf_fnQueryInterface ( LPCLASSFACTORY iface,
|
|
|
|
REFIID riid, LPVOID *ppvObj)
|
|
|
|
{
|
2010-12-05 15:16:17 +01:00
|
|
|
CFImpl *This = impl_from_IClassFactory(iface);
|
2006-07-11 04:13:18 +02:00
|
|
|
|
|
|
|
TRACE("(%p)->(%s)\n",This,debugstr_guid(riid));
|
|
|
|
|
|
|
|
*ppvObj = NULL;
|
|
|
|
|
|
|
|
if (IsEqualIID(riid, &IID_IUnknown) ||
|
|
|
|
IsEqualIID(riid, &IID_IClassFactory))
|
|
|
|
{
|
2017-02-13 12:16:04 +01:00
|
|
|
*ppvObj = &This->IClassFactory_iface;
|
2006-07-11 04:13:18 +02:00
|
|
|
return S_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
TRACE("-- E_NOINTERFACE\n");
|
|
|
|
return E_NOINTERFACE;
|
|
|
|
}
|
|
|
|
|
|
|
|
static ULONG WINAPI infosoftcf_fnAddRef (LPCLASSFACTORY iface)
|
|
|
|
{
|
|
|
|
return 2;
|
|
|
|
}
|
|
|
|
|
|
|
|
static ULONG WINAPI infosoftcf_fnRelease(LPCLASSFACTORY iface)
|
|
|
|
{
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI infosoftcf_fnCreateInstance( LPCLASSFACTORY iface,
|
|
|
|
LPUNKNOWN pUnkOuter, REFIID riid, LPVOID *ppvObject)
|
|
|
|
{
|
2010-12-05 15:16:17 +01:00
|
|
|
CFImpl *This = impl_from_IClassFactory(iface);
|
2006-07-11 04:13:18 +02:00
|
|
|
|
|
|
|
TRACE("%p->(%p,%s,%p)\n", This, pUnkOuter, debugstr_guid(riid), ppvObject);
|
|
|
|
|
|
|
|
*ppvObject = NULL;
|
|
|
|
|
|
|
|
return This->lpfnCI(pUnkOuter, riid, ppvObject);
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI infosoftcf_fnLockServer(LPCLASSFACTORY iface, BOOL fLock)
|
|
|
|
{
|
|
|
|
FIXME("%p %d\n", iface, fLock);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static const IClassFactoryVtbl infosoft_cfvt =
|
|
|
|
{
|
|
|
|
infosoftcf_fnQueryInterface,
|
|
|
|
infosoftcf_fnAddRef,
|
|
|
|
infosoftcf_fnRelease,
|
|
|
|
infosoftcf_fnCreateInstance,
|
|
|
|
infosoftcf_fnLockServer
|
|
|
|
};
|
|
|
|
|
2010-12-05 15:16:17 +01:00
|
|
|
static CFImpl wb_cf = { { &infosoft_cfvt }, wb_Constructor };
|
2006-07-11 04:13:18 +02:00
|
|
|
|
2006-11-12 20:23:28 +01:00
|
|
|
/***********************************************************************
|
|
|
|
* DllGetClassObject (INFOSOFT.@)
|
|
|
|
*/
|
2006-07-11 04:13:18 +02:00
|
|
|
HRESULT WINAPI DllGetClassObject(REFCLSID rclsid, REFIID iid, LPVOID *ppv)
|
|
|
|
{
|
|
|
|
IClassFactory *pcf = NULL;
|
|
|
|
|
|
|
|
TRACE("%s %s %p\n", debugstr_guid(rclsid), debugstr_guid(iid), ppv);
|
|
|
|
|
|
|
|
if (!ppv)
|
|
|
|
return E_INVALIDARG;
|
|
|
|
*ppv = NULL;
|
|
|
|
|
2006-08-10 15:40:39 +02:00
|
|
|
if (IsEqualIID(rclsid, &CLSID_wb_Neutral))
|
2010-12-05 15:16:17 +01:00
|
|
|
pcf = &wb_cf.IClassFactory_iface;
|
2006-07-11 04:13:18 +02:00
|
|
|
else
|
|
|
|
return CLASS_E_CLASSNOTAVAILABLE;
|
|
|
|
|
|
|
|
return IClassFactory_QueryInterface(pcf, iid, ppv);
|
|
|
|
}
|