mirror of
https://github.com/reactos/wine.git
synced 2024-11-28 22:20:26 +00:00
vbscript: Added VBScript class factory implementation.
This commit is contained in:
parent
bab84c0ebe
commit
0ac5c7d5d2
1
.gitignore
vendored
1
.gitignore
vendored
@ -137,6 +137,7 @@ dlls/sti/sti_wia.h
|
||||
dlls/sti/sti_wia_p.c
|
||||
dlls/urlmon/urlmon_urlmon.h
|
||||
dlls/urlmon/urlmon_urlmon_p.c
|
||||
dlls/vbscript/vbscript_classes.h
|
||||
dlls/windowscodecs/windowscodecs_wincodec.h
|
||||
dlls/windowscodecs/windowscodecs_wincodec_p.c
|
||||
dlls/wuapi/wuapi_tlb.tlb
|
||||
|
@ -5,6 +5,7 @@ C_SRCS = \
|
||||
|
||||
RC_SRCS = vbscript.rc
|
||||
|
||||
IDL_H_SRCS = vbscript_classes.idl
|
||||
IDL_R_SRCS = vbscript_classes.idl
|
||||
|
||||
@MAKE_DLL_RULES@
|
||||
|
@ -24,8 +24,11 @@
|
||||
|
||||
#include "windef.h"
|
||||
#include "winbase.h"
|
||||
#include "initguid.h"
|
||||
|
||||
#include "ole2.h"
|
||||
#include "rpcproxy.h"
|
||||
#include "vbscript_classes.h"
|
||||
|
||||
#include "wine/debug.h"
|
||||
|
||||
@ -33,6 +36,61 @@ WINE_DEFAULT_DEBUG_CHANNEL(vbscript);
|
||||
|
||||
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.@)
|
||||
*/
|
||||
@ -58,6 +116,11 @@ BOOL WINAPI DllMain(HINSTANCE hInstDLL, DWORD fdwReason, LPVOID lpv)
|
||||
*/
|
||||
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);
|
||||
return CLASS_E_CLASSNOTAVAILABLE;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user