vbscript: Added VBScript class factory implementation.

This commit is contained in:
Jacek Caban 2011-06-21 16:14:37 +02:00 committed by Alexandre Julliard
parent bab84c0ebe
commit 0ac5c7d5d2
3 changed files with 65 additions and 0 deletions

1
.gitignore vendored
View File

@ -137,6 +137,7 @@ dlls/sti/sti_wia.h
dlls/sti/sti_wia_p.c dlls/sti/sti_wia_p.c
dlls/urlmon/urlmon_urlmon.h dlls/urlmon/urlmon_urlmon.h
dlls/urlmon/urlmon_urlmon_p.c dlls/urlmon/urlmon_urlmon_p.c
dlls/vbscript/vbscript_classes.h
dlls/windowscodecs/windowscodecs_wincodec.h dlls/windowscodecs/windowscodecs_wincodec.h
dlls/windowscodecs/windowscodecs_wincodec_p.c dlls/windowscodecs/windowscodecs_wincodec_p.c
dlls/wuapi/wuapi_tlb.tlb dlls/wuapi/wuapi_tlb.tlb

View File

@ -5,6 +5,7 @@ C_SRCS = \
RC_SRCS = vbscript.rc RC_SRCS = vbscript.rc
IDL_H_SRCS = vbscript_classes.idl
IDL_R_SRCS = vbscript_classes.idl IDL_R_SRCS = vbscript_classes.idl
@MAKE_DLL_RULES@ @MAKE_DLL_RULES@

View File

@ -24,8 +24,11 @@
#include "windef.h" #include "windef.h"
#include "winbase.h" #include "winbase.h"
#include "initguid.h"
#include "ole2.h" #include "ole2.h"
#include "rpcproxy.h" #include "rpcproxy.h"
#include "vbscript_classes.h"
#include "wine/debug.h" #include "wine/debug.h"
@ -33,6 +36,61 @@ WINE_DEFAULT_DEBUG_CHANNEL(vbscript);
static HINSTANCE vbscript_hinstance; static HINSTANCE vbscript_hinstance;
HRESULT WINAPI VBScriptFactory_CreateInstance(IClassFactory *iface, IUnknown *pUnkOuter, REFIID riid, void **ppv)
{
FIXME("(%p %s %p)\n", pUnkOuter, debugstr_guid(riid), ppv);
return E_NOINTERFACE;
}
static HRESULT WINAPI ClassFactory_QueryInterface(IClassFactory *iface, REFIID riid, void **ppv)
{
*ppv = NULL;
if(IsEqualGUID(&IID_IUnknown, riid)) {
TRACE("(%p)->(IID_IUnknown %p)\n", iface, ppv);
*ppv = iface;
}else if(IsEqualGUID(&IID_IClassFactory, riid)) {
TRACE("(%p)->(IID_IClassFactory %p)\n", iface, ppv);
*ppv = iface;
}
if(*ppv) {
IUnknown_AddRef((IUnknown*)*ppv);
return S_OK;
}
FIXME("(%p)->(%s %p)\n", iface, debugstr_guid(riid), ppv);
return E_NOINTERFACE;
}
static ULONG WINAPI ClassFactory_AddRef(IClassFactory *iface)
{
TRACE("(%p)\n", iface);
return 2;
}
static ULONG WINAPI ClassFactory_Release(IClassFactory *iface)
{
TRACE("(%p)\n", iface);
return 1;
}
static HRESULT WINAPI ClassFactory_LockServer(IClassFactory *iface, BOOL fLock)
{
TRACE("(%p)->(%x)\n", iface, fLock);
return S_OK;
}
static const IClassFactoryVtbl VBScriptFactoryVtbl = {
ClassFactory_QueryInterface,
ClassFactory_AddRef,
ClassFactory_Release,
VBScriptFactory_CreateInstance,
ClassFactory_LockServer
};
static IClassFactory VBScriptFactory = { &VBScriptFactoryVtbl };
/****************************************************************** /******************************************************************
* DllMain (vbscript.@) * DllMain (vbscript.@)
*/ */
@ -58,6 +116,11 @@ BOOL WINAPI DllMain(HINSTANCE hInstDLL, DWORD fdwReason, LPVOID lpv)
*/ */
HRESULT WINAPI DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID *ppv) HRESULT WINAPI DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID *ppv)
{ {
if(IsEqualGUID(&CLSID_VBScript, rclsid)) {
TRACE("(CLSID_VBScript %s %p)\n", debugstr_guid(riid), ppv);
return IClassFactory_QueryInterface(&VBScriptFactory, riid, ppv);
}
FIXME("%s %s %p\n", debugstr_guid(rclsid), debugstr_guid(riid), ppv); FIXME("%s %s %p\n", debugstr_guid(rclsid), debugstr_guid(riid), ppv);
return CLASS_E_CLASSNOTAVAILABLE; return CLASS_E_CLASSNOTAVAILABLE;
} }