2015-06-23 11:09:32 +00:00
|
|
|
/*
|
|
|
|
* Copyright 2015 Jacek Caban for CodeWeavers
|
|
|
|
*
|
|
|
|
* 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
|
|
|
|
*/
|
|
|
|
|
2015-06-25 11:31:19 +00:00
|
|
|
#define COBJMACROS
|
|
|
|
|
2015-06-23 11:09:32 +00:00
|
|
|
#include "windows.h"
|
2015-06-25 11:31:19 +00:00
|
|
|
#include "initguid.h"
|
2015-06-24 08:26:12 +00:00
|
|
|
#include "ole2.h"
|
2016-06-08 04:47:26 +00:00
|
|
|
#include "olectl.h"
|
2015-06-24 08:26:12 +00:00
|
|
|
#include "rpcproxy.h"
|
2015-06-25 11:31:19 +00:00
|
|
|
#include "msscript.h"
|
2015-06-23 11:09:32 +00:00
|
|
|
|
|
|
|
#include "wine/debug.h"
|
|
|
|
|
|
|
|
WINE_DEFAULT_DEBUG_CHANNEL(msscript);
|
|
|
|
|
2016-06-20 11:00:27 +00:00
|
|
|
struct ScriptControl;
|
|
|
|
typedef struct ConnectionPoint ConnectionPoint;
|
|
|
|
|
|
|
|
struct ConnectionPoint {
|
|
|
|
IConnectionPoint IConnectionPoint_iface;
|
|
|
|
ScriptControl *control;
|
|
|
|
const IID *riid;
|
|
|
|
ConnectionPoint *next;
|
|
|
|
};
|
|
|
|
|
2015-06-30 12:09:03 +00:00
|
|
|
struct ScriptControl {
|
|
|
|
IScriptControl IScriptControl_iface;
|
2016-06-08 04:47:26 +00:00
|
|
|
IPersistStreamInit IPersistStreamInit_iface;
|
2016-06-06 09:45:54 +00:00
|
|
|
IOleObject IOleObject_iface;
|
2016-06-09 17:40:14 +00:00
|
|
|
IOleControl IOleControl_iface;
|
2016-06-20 11:00:28 +00:00
|
|
|
IQuickActivate IQuickActivate_iface;
|
2016-06-16 09:17:11 +00:00
|
|
|
IConnectionPointContainer IConnectionPointContainer_iface;
|
2015-06-30 12:09:03 +00:00
|
|
|
LONG ref;
|
2016-06-07 08:29:36 +00:00
|
|
|
IOleClientSite *site;
|
2016-06-08 04:47:27 +00:00
|
|
|
SIZEL extent;
|
2016-06-20 11:00:27 +00:00
|
|
|
|
|
|
|
/* connection points */
|
|
|
|
ConnectionPoint *cp_list;
|
|
|
|
ConnectionPoint cp_scsource;
|
|
|
|
ConnectionPoint cp_propnotif;
|
2015-06-30 12:09:03 +00:00
|
|
|
};
|
|
|
|
|
2015-06-24 08:26:12 +00:00
|
|
|
static HINSTANCE msscript_instance;
|
|
|
|
|
2015-06-30 12:09:03 +00:00
|
|
|
static inline void * __WINE_ALLOC_SIZE(1) heap_alloc(size_t len)
|
|
|
|
{
|
|
|
|
return HeapAlloc(GetProcessHeap(), 0, len);
|
|
|
|
}
|
|
|
|
|
|
|
|
static inline BOOL heap_free(void *mem)
|
|
|
|
{
|
|
|
|
return HeapFree(GetProcessHeap(), 0, mem);
|
|
|
|
}
|
|
|
|
|
2015-07-07 10:35:44 +00:00
|
|
|
typedef enum tid_t {
|
|
|
|
IScriptControl_tid,
|
|
|
|
LAST_tid
|
|
|
|
} tid_t;
|
|
|
|
|
|
|
|
static ITypeLib *typelib;
|
|
|
|
static ITypeInfo *typeinfos[LAST_tid];
|
|
|
|
|
|
|
|
static REFIID tid_ids[] = {
|
|
|
|
&IID_IScriptControl
|
|
|
|
};
|
|
|
|
|
|
|
|
static HRESULT load_typelib(void)
|
|
|
|
{
|
|
|
|
HRESULT hres;
|
|
|
|
ITypeLib *tl;
|
|
|
|
|
|
|
|
hres = LoadRegTypeLib(&LIBID_MSScriptControl, 1, 0, LOCALE_SYSTEM_DEFAULT, &tl);
|
|
|
|
if(FAILED(hres)) {
|
|
|
|
ERR("LoadRegTypeLib failed: %08x\n", hres);
|
|
|
|
return hres;
|
|
|
|
}
|
|
|
|
|
|
|
|
if(InterlockedCompareExchangePointer((void**)&typelib, tl, NULL))
|
|
|
|
ITypeLib_Release(tl);
|
|
|
|
return hres;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT get_typeinfo(tid_t tid, ITypeInfo **typeinfo)
|
|
|
|
{
|
|
|
|
HRESULT hres;
|
|
|
|
|
|
|
|
if (!typelib)
|
|
|
|
hres = load_typelib();
|
|
|
|
if (!typelib)
|
|
|
|
return hres;
|
|
|
|
|
|
|
|
if(!typeinfos[tid]) {
|
|
|
|
ITypeInfo *ti;
|
|
|
|
|
|
|
|
hres = ITypeLib_GetTypeInfoOfGuid(typelib, tid_ids[tid], &ti);
|
|
|
|
if(FAILED(hres)) {
|
|
|
|
ERR("GetTypeInfoOfGuid(%s) failed: %08x\n", debugstr_guid(tid_ids[tid]), hres);
|
|
|
|
return hres;
|
|
|
|
}
|
|
|
|
|
|
|
|
if(InterlockedCompareExchangePointer((void**)(typeinfos+tid), ti, NULL))
|
|
|
|
ITypeInfo_Release(ti);
|
|
|
|
}
|
|
|
|
|
|
|
|
*typeinfo = typeinfos[tid];
|
|
|
|
ITypeInfo_AddRef(typeinfos[tid]);
|
|
|
|
return S_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void release_typelib(void)
|
|
|
|
{
|
|
|
|
unsigned i;
|
|
|
|
|
|
|
|
if(!typelib)
|
|
|
|
return;
|
|
|
|
|
|
|
|
for(i=0; i < sizeof(typeinfos)/sizeof(*typeinfos); i++)
|
|
|
|
if(typeinfos[i])
|
|
|
|
ITypeInfo_Release(typeinfos[i]);
|
|
|
|
|
|
|
|
ITypeLib_Release(typelib);
|
|
|
|
}
|
|
|
|
|
2015-06-30 12:09:03 +00:00
|
|
|
static inline ScriptControl *impl_from_IScriptControl(IScriptControl *iface)
|
|
|
|
{
|
|
|
|
return CONTAINING_RECORD(iface, ScriptControl, IScriptControl_iface);
|
|
|
|
}
|
|
|
|
|
2016-06-06 09:45:54 +00:00
|
|
|
static inline ScriptControl *impl_from_IOleObject(IOleObject *iface)
|
|
|
|
{
|
|
|
|
return CONTAINING_RECORD(iface, ScriptControl, IOleObject_iface);
|
|
|
|
}
|
|
|
|
|
2016-06-08 04:47:26 +00:00
|
|
|
static inline ScriptControl *impl_from_IPersistStreamInit(IPersistStreamInit *iface)
|
|
|
|
{
|
|
|
|
return CONTAINING_RECORD(iface, ScriptControl, IPersistStreamInit_iface);
|
|
|
|
}
|
|
|
|
|
2016-06-09 17:40:14 +00:00
|
|
|
static inline ScriptControl *impl_from_IOleControl(IOleControl *iface)
|
|
|
|
{
|
|
|
|
return CONTAINING_RECORD(iface, ScriptControl, IOleControl_iface);
|
|
|
|
}
|
|
|
|
|
2016-06-20 11:00:28 +00:00
|
|
|
static inline ScriptControl *impl_from_IQuickActivate(IQuickActivate *iface)
|
|
|
|
{
|
|
|
|
return CONTAINING_RECORD(iface, ScriptControl, IQuickActivate_iface);
|
|
|
|
}
|
|
|
|
|
2016-06-16 09:17:11 +00:00
|
|
|
static inline ScriptControl *impl_from_IConnectionPointContainer(IConnectionPointContainer *iface)
|
|
|
|
{
|
|
|
|
return CONTAINING_RECORD(iface, ScriptControl, IConnectionPointContainer_iface);
|
|
|
|
}
|
|
|
|
|
2016-06-20 11:00:27 +00:00
|
|
|
static inline ConnectionPoint *impl_from_IConnectionPoint(IConnectionPoint *iface)
|
|
|
|
{
|
|
|
|
return CONTAINING_RECORD(iface, ConnectionPoint, IConnectionPoint_iface);
|
|
|
|
}
|
|
|
|
|
2015-06-30 12:09:03 +00:00
|
|
|
static HRESULT WINAPI ScriptControl_QueryInterface(IScriptControl *iface, REFIID riid, void **ppv)
|
|
|
|
{
|
|
|
|
ScriptControl *This = impl_from_IScriptControl(iface);
|
|
|
|
|
|
|
|
if(IsEqualGUID(&IID_IUnknown, riid)) {
|
|
|
|
TRACE("(%p)->(IID_IUnknown %p)\n", This, ppv);
|
|
|
|
*ppv = &This->IScriptControl_iface;
|
|
|
|
}else if(IsEqualGUID(&IID_IDispatch, riid)) {
|
|
|
|
TRACE("(%p)->(IID_IDispatch %p)\n", This, ppv);
|
|
|
|
*ppv = &This->IScriptControl_iface;
|
|
|
|
}else if(IsEqualGUID(&IID_IScriptControl, riid)) {
|
|
|
|
TRACE("(%p)->(IID_IScriptControl %p)\n", This, ppv);
|
|
|
|
*ppv = &This->IScriptControl_iface;
|
2016-06-06 09:45:54 +00:00
|
|
|
}else if(IsEqualGUID(&IID_IOleObject, riid)) {
|
2016-06-09 17:40:14 +00:00
|
|
|
TRACE("(%p)->(IID_IOleObject %p)\n", This, ppv);
|
2016-06-06 09:45:54 +00:00
|
|
|
*ppv = &This->IOleObject_iface;
|
2016-06-08 04:47:26 +00:00
|
|
|
}else if(IsEqualGUID(&IID_IPersistStreamInit, riid)) {
|
2016-06-09 17:40:14 +00:00
|
|
|
TRACE("(%p)->(IID_IPersistStreamInit %p)\n", This, ppv);
|
2016-06-08 04:47:26 +00:00
|
|
|
*ppv = &This->IPersistStreamInit_iface;
|
|
|
|
}else if(IsEqualGUID(&IID_IPersist, riid)) {
|
2016-06-09 17:40:14 +00:00
|
|
|
TRACE("(%p)->(IID_IPersist %p)\n", This, ppv);
|
2016-06-08 04:47:26 +00:00
|
|
|
*ppv = &This->IPersistStreamInit_iface;
|
2016-06-09 17:40:14 +00:00
|
|
|
}else if(IsEqualGUID(&IID_IOleControl, riid)) {
|
|
|
|
TRACE("(%p)->(IID_IOleControl %p)\n", This, ppv);
|
|
|
|
*ppv = &This->IOleControl_iface;
|
2016-06-20 11:00:28 +00:00
|
|
|
}else if(IsEqualGUID(&IID_IQuickActivate, riid)) {
|
|
|
|
TRACE("(%p)->(IID_IQuickActivate %p)\n", This, ppv);
|
|
|
|
*ppv = &This->IQuickActivate_iface;
|
2016-06-16 09:17:11 +00:00
|
|
|
}else if(IsEqualGUID(&IID_IConnectionPointContainer, riid)) {
|
|
|
|
TRACE("(%p)->(IID_IConnectionPointContainer %p)\n", This, ppv);
|
|
|
|
*ppv = &This->IConnectionPointContainer_iface;
|
2015-06-30 12:09:03 +00:00
|
|
|
}else {
|
|
|
|
FIXME("(%p)->(%s %p)\n", This, debugstr_guid(riid), ppv);
|
|
|
|
*ppv = NULL;
|
|
|
|
return E_NOINTERFACE;
|
|
|
|
}
|
|
|
|
|
|
|
|
IUnknown_AddRef((IUnknown*)*ppv);
|
|
|
|
return S_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
static ULONG WINAPI ScriptControl_AddRef(IScriptControl *iface)
|
|
|
|
{
|
|
|
|
ScriptControl *This = impl_from_IScriptControl(iface);
|
|
|
|
LONG ref = InterlockedIncrement(&This->ref);
|
|
|
|
|
|
|
|
TRACE("(%p) ref=%d\n", This, ref);
|
|
|
|
|
|
|
|
return ref;
|
|
|
|
}
|
|
|
|
|
|
|
|
static ULONG WINAPI ScriptControl_Release(IScriptControl *iface)
|
|
|
|
{
|
|
|
|
ScriptControl *This = impl_from_IScriptControl(iface);
|
|
|
|
LONG ref = InterlockedDecrement(&This->ref);
|
|
|
|
|
|
|
|
TRACE("(%p) ref=%d\n", This, ref);
|
|
|
|
|
2016-06-07 08:29:36 +00:00
|
|
|
if(!ref) {
|
|
|
|
if (This->site)
|
|
|
|
IOleClientSite_Release(This->site);
|
2015-06-30 12:09:03 +00:00
|
|
|
heap_free(This);
|
2016-06-07 08:29:36 +00:00
|
|
|
}
|
2015-06-30 12:09:03 +00:00
|
|
|
|
|
|
|
return ref;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI ScriptControl_GetTypeInfoCount(IScriptControl *iface, UINT *pctinfo)
|
|
|
|
{
|
|
|
|
ScriptControl *This = impl_from_IScriptControl(iface);
|
2015-07-07 10:35:44 +00:00
|
|
|
TRACE("(%p)->(%p)\n", This, pctinfo);
|
|
|
|
*pctinfo = 1;
|
|
|
|
return S_OK;
|
2015-06-30 12:09:03 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI ScriptControl_GetTypeInfo(IScriptControl *iface, UINT iTInfo,
|
|
|
|
LCID lcid, ITypeInfo **ppTInfo)
|
|
|
|
{
|
|
|
|
ScriptControl *This = impl_from_IScriptControl(iface);
|
2015-07-07 10:35:44 +00:00
|
|
|
TRACE("(%p)->(%u %u %p)\n", This, iTInfo, lcid, ppTInfo);
|
|
|
|
return get_typeinfo(IScriptControl_tid, ppTInfo);
|
2015-06-30 12:09:03 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI ScriptControl_GetIDsOfNames(IScriptControl *iface, REFIID riid,
|
|
|
|
LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId)
|
|
|
|
{
|
|
|
|
ScriptControl *This = impl_from_IScriptControl(iface);
|
2015-07-07 10:35:44 +00:00
|
|
|
ITypeInfo *typeinfo;
|
|
|
|
HRESULT hres;
|
|
|
|
|
|
|
|
TRACE("(%p)->(%s %p %u %u %p)\n", This, debugstr_guid(riid), rgszNames, cNames, lcid, rgDispId);
|
|
|
|
|
|
|
|
hres = get_typeinfo(IScriptControl_tid, &typeinfo);
|
|
|
|
if(SUCCEEDED(hres)) {
|
|
|
|
hres = ITypeInfo_GetIDsOfNames(typeinfo, rgszNames, cNames, rgDispId);
|
|
|
|
ITypeInfo_Release(typeinfo);
|
|
|
|
}
|
|
|
|
|
|
|
|
return hres;
|
2015-06-30 12:09:03 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI ScriptControl_Invoke(IScriptControl *iface, DISPID dispIdMember,
|
|
|
|
REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult,
|
|
|
|
EXCEPINFO *pExcepInfo, UINT *puArgErr)
|
|
|
|
{
|
|
|
|
ScriptControl *This = impl_from_IScriptControl(iface);
|
2015-07-07 10:35:44 +00:00
|
|
|
ITypeInfo *typeinfo;
|
|
|
|
HRESULT hres;
|
|
|
|
|
|
|
|
TRACE("(%p)->(%d %s %d %d %p %p %p %p)\n", This, dispIdMember, debugstr_guid(riid),
|
|
|
|
lcid, wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr);
|
|
|
|
|
|
|
|
hres = get_typeinfo(IScriptControl_tid, &typeinfo);
|
|
|
|
if(SUCCEEDED(hres)) {
|
|
|
|
hres = ITypeInfo_Invoke(typeinfo, iface, dispIdMember, wFlags,
|
|
|
|
pDispParams, pVarResult, pExcepInfo, puArgErr);
|
|
|
|
ITypeInfo_Release(typeinfo);
|
|
|
|
}
|
|
|
|
|
|
|
|
return hres;
|
2015-06-30 12:09:03 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI ScriptControl_get_Language(IScriptControl *iface, BSTR *p)
|
|
|
|
{
|
|
|
|
ScriptControl *This = impl_from_IScriptControl(iface);
|
|
|
|
FIXME("(%p)->(%p)\n", This, p);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI ScriptControl_put_Language(IScriptControl *iface, BSTR language)
|
|
|
|
{
|
|
|
|
ScriptControl *This = impl_from_IScriptControl(iface);
|
|
|
|
FIXME("(%p)->(%s)\n", This, debugstr_w(language));
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI ScriptControl_get_State(IScriptControl *iface, ScriptControlStates *p)
|
|
|
|
{
|
|
|
|
ScriptControl *This = impl_from_IScriptControl(iface);
|
|
|
|
FIXME("(%p)->(%p)\n", This, p);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI ScriptControl_put_State(IScriptControl *iface, ScriptControlStates state)
|
|
|
|
{
|
|
|
|
ScriptControl *This = impl_from_IScriptControl(iface);
|
|
|
|
FIXME("(%p)->(%x)\n", This, state);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI ScriptControl_put_SitehWnd(IScriptControl *iface, LONG hwnd)
|
|
|
|
{
|
|
|
|
ScriptControl *This = impl_from_IScriptControl(iface);
|
|
|
|
FIXME("(%p)->(%x)\n", This, hwnd);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI ScriptControl_get_SitehWnd(IScriptControl *iface, LONG *p)
|
|
|
|
{
|
|
|
|
ScriptControl *This = impl_from_IScriptControl(iface);
|
|
|
|
FIXME("(%p)->(%p)\n", This, p);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI ScriptControl_get_Timeout(IScriptControl *iface, LONG *p)
|
|
|
|
{
|
|
|
|
ScriptControl *This = impl_from_IScriptControl(iface);
|
|
|
|
FIXME("(%p)->(%p)\n", This, p);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI ScriptControl_put_Timeout(IScriptControl *iface, LONG milliseconds)
|
2015-06-25 11:31:19 +00:00
|
|
|
{
|
2015-06-30 12:09:03 +00:00
|
|
|
ScriptControl *This = impl_from_IScriptControl(iface);
|
|
|
|
FIXME("(%p)->(%d)\n", This, milliseconds);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI ScriptControl_get_AllowUI(IScriptControl *iface, VARIANT_BOOL *p)
|
|
|
|
{
|
|
|
|
ScriptControl *This = impl_from_IScriptControl(iface);
|
|
|
|
FIXME("(%p)->(%p)\n", This, p);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI ScriptControl_put_AllowUI(IScriptControl *iface, VARIANT_BOOL allow_ui)
|
|
|
|
{
|
|
|
|
ScriptControl *This = impl_from_IScriptControl(iface);
|
|
|
|
FIXME("(%p)->(%x)\n", This, allow_ui);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI ScriptControl_get_UseSafeSubset(IScriptControl *iface, VARIANT_BOOL *p)
|
|
|
|
{
|
|
|
|
ScriptControl *This = impl_from_IScriptControl(iface);
|
|
|
|
FIXME("(%p)->(%p)\n", This, p);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI ScriptControl_put_UseSafeSubset(IScriptControl *iface, VARIANT_BOOL v)
|
|
|
|
{
|
|
|
|
ScriptControl *This = impl_from_IScriptControl(iface);
|
|
|
|
FIXME("(%p)->(%x)\n", This, v);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI ScriptControl_get_Modules(IScriptControl *iface, IScriptModuleCollection **p)
|
|
|
|
{
|
|
|
|
ScriptControl *This = impl_from_IScriptControl(iface);
|
|
|
|
FIXME("(%p)->(%p)\n", This, p);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI ScriptControl_get_Error(IScriptControl *iface, IScriptError **p)
|
|
|
|
{
|
|
|
|
ScriptControl *This = impl_from_IScriptControl(iface);
|
|
|
|
FIXME("(%p)->(%p)\n", This, p);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI ScriptControl_get_CodeObject(IScriptControl *iface, IDispatch **p)
|
|
|
|
{
|
|
|
|
ScriptControl *This = impl_from_IScriptControl(iface);
|
|
|
|
FIXME("(%p)->(%p)\n", This, p);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI ScriptControl_get_Procedures(IScriptControl *iface, IScriptProcedureCollection **p)
|
|
|
|
{
|
|
|
|
ScriptControl *This = impl_from_IScriptControl(iface);
|
|
|
|
FIXME("(%p)->(%p)\n", This, p);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI ScriptControl__AboutBox(IScriptControl *iface)
|
|
|
|
{
|
|
|
|
ScriptControl *This = impl_from_IScriptControl(iface);
|
|
|
|
FIXME("(%p)\n", This);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI ScriptControl_AddObject(IScriptControl *iface, BSTR name, IDispatch *object, VARIANT_BOOL add_members)
|
|
|
|
{
|
|
|
|
ScriptControl *This = impl_from_IScriptControl(iface);
|
|
|
|
FIXME("(%p)->(%s %p %x)\n", This, debugstr_w(name), object, add_members);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI ScriptControl_Reset(IScriptControl *iface)
|
|
|
|
{
|
|
|
|
ScriptControl *This = impl_from_IScriptControl(iface);
|
|
|
|
FIXME("(%p)\n", This);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI ScriptControl_AddCode(IScriptControl *iface, BSTR code)
|
|
|
|
{
|
|
|
|
ScriptControl *This = impl_from_IScriptControl(iface);
|
|
|
|
FIXME("(%p)->(%s)\n", This, debugstr_w(code));
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI ScriptControl_Eval(IScriptControl *iface, BSTR expression, VARIANT *res)
|
|
|
|
{
|
|
|
|
ScriptControl *This = impl_from_IScriptControl(iface);
|
|
|
|
FIXME("(%p)->(%s %p)\n", This, debugstr_w(expression), res);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI ScriptControl_ExecuteStatement(IScriptControl *iface, BSTR statement)
|
|
|
|
{
|
|
|
|
ScriptControl *This = impl_from_IScriptControl(iface);
|
|
|
|
FIXME("(%p)->(%s)\n", This, debugstr_w(statement));
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI ScriptControl_Run(IScriptControl *iface, BSTR procedure_name, SAFEARRAY **parameters, VARIANT *res)
|
|
|
|
{
|
|
|
|
ScriptControl *This = impl_from_IScriptControl(iface);
|
|
|
|
FIXME("(%p)->(%s %p %p)\n", This, debugstr_w(procedure_name), parameters, res);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static const IScriptControlVtbl ScriptControlVtbl = {
|
|
|
|
ScriptControl_QueryInterface,
|
|
|
|
ScriptControl_AddRef,
|
|
|
|
ScriptControl_Release,
|
|
|
|
ScriptControl_GetTypeInfoCount,
|
|
|
|
ScriptControl_GetTypeInfo,
|
|
|
|
ScriptControl_GetIDsOfNames,
|
|
|
|
ScriptControl_Invoke,
|
|
|
|
ScriptControl_get_Language,
|
|
|
|
ScriptControl_put_Language,
|
|
|
|
ScriptControl_get_State,
|
|
|
|
ScriptControl_put_State,
|
|
|
|
ScriptControl_put_SitehWnd,
|
|
|
|
ScriptControl_get_SitehWnd,
|
|
|
|
ScriptControl_get_Timeout,
|
|
|
|
ScriptControl_put_Timeout,
|
|
|
|
ScriptControl_get_AllowUI,
|
|
|
|
ScriptControl_put_AllowUI,
|
|
|
|
ScriptControl_get_UseSafeSubset,
|
|
|
|
ScriptControl_put_UseSafeSubset,
|
|
|
|
ScriptControl_get_Modules,
|
|
|
|
ScriptControl_get_Error,
|
|
|
|
ScriptControl_get_CodeObject,
|
|
|
|
ScriptControl_get_Procedures,
|
|
|
|
ScriptControl__AboutBox,
|
|
|
|
ScriptControl_AddObject,
|
|
|
|
ScriptControl_Reset,
|
|
|
|
ScriptControl_AddCode,
|
|
|
|
ScriptControl_Eval,
|
|
|
|
ScriptControl_ExecuteStatement,
|
|
|
|
ScriptControl_Run
|
|
|
|
};
|
|
|
|
|
2016-06-06 09:45:54 +00:00
|
|
|
static HRESULT WINAPI OleObject_QueryInterface(IOleObject *iface, REFIID riid, void **obj)
|
|
|
|
{
|
|
|
|
ScriptControl *This = impl_from_IOleObject(iface);
|
|
|
|
return IScriptControl_QueryInterface(&This->IScriptControl_iface, riid, obj);
|
|
|
|
}
|
|
|
|
|
|
|
|
static ULONG WINAPI OleObject_AddRef(IOleObject *iface)
|
|
|
|
{
|
|
|
|
ScriptControl *This = impl_from_IOleObject(iface);
|
|
|
|
return IScriptControl_AddRef(&This->IScriptControl_iface);
|
|
|
|
}
|
|
|
|
|
|
|
|
static ULONG WINAPI OleObject_Release(IOleObject *iface)
|
|
|
|
{
|
|
|
|
ScriptControl *This = impl_from_IOleObject(iface);
|
|
|
|
return IScriptControl_Release(&This->IScriptControl_iface);
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI OleObject_SetClientSite(IOleObject *iface, IOleClientSite *site)
|
|
|
|
{
|
|
|
|
ScriptControl *This = impl_from_IOleObject(iface);
|
|
|
|
|
2016-06-07 08:29:36 +00:00
|
|
|
TRACE("(%p)->(%p)\n", This, site);
|
2016-06-06 09:45:54 +00:00
|
|
|
|
2016-06-07 08:29:36 +00:00
|
|
|
if (This->site)
|
|
|
|
IOleClientSite_Release(This->site);
|
|
|
|
|
|
|
|
if ((This->site = site))
|
|
|
|
IOleClientSite_AddRef(site);
|
|
|
|
|
|
|
|
return S_OK;
|
2016-06-06 09:45:54 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI OleObject_GetClientSite(IOleObject *iface, IOleClientSite **site)
|
|
|
|
{
|
|
|
|
ScriptControl *This = impl_from_IOleObject(iface);
|
|
|
|
|
2016-06-07 08:29:36 +00:00
|
|
|
TRACE("(%p)->(%p)\n", This, site);
|
2016-06-06 09:45:54 +00:00
|
|
|
|
2016-06-07 08:29:36 +00:00
|
|
|
if (!site)
|
|
|
|
return E_POINTER;
|
|
|
|
|
|
|
|
if ((*site = This->site))
|
|
|
|
IOleClientSite_AddRef(*site);
|
|
|
|
|
|
|
|
return S_OK;
|
2016-06-06 09:45:54 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI OleObject_SetHostNames(IOleObject *iface, LPCOLESTR containerapp, LPCOLESTR containerobj)
|
|
|
|
{
|
|
|
|
ScriptControl *This = impl_from_IOleObject(iface);
|
|
|
|
|
|
|
|
FIXME("(%p)->(%s %s)\n", This, debugstr_w(containerapp), debugstr_w(containerobj));
|
|
|
|
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI OleObject_Close(IOleObject *iface, DWORD save)
|
|
|
|
{
|
|
|
|
ScriptControl *This = impl_from_IOleObject(iface);
|
|
|
|
|
|
|
|
FIXME("(%p)->(%d)\n", This, save);
|
|
|
|
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI OleObject_SetMoniker(IOleObject *iface, DWORD which, IMoniker *moniker)
|
|
|
|
{
|
|
|
|
ScriptControl *This = impl_from_IOleObject(iface);
|
|
|
|
|
|
|
|
FIXME("(%p)->(%d %p)\n", This, which, moniker);
|
|
|
|
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI OleObject_GetMoniker(IOleObject *iface, DWORD assign, DWORD which, IMoniker **moniker)
|
|
|
|
{
|
|
|
|
ScriptControl *This = impl_from_IOleObject(iface);
|
|
|
|
|
|
|
|
FIXME("(%p)->(%d %d %p)\n", This, assign, which, moniker);
|
|
|
|
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI OleObject_InitFromData(IOleObject *iface, IDataObject *dataobj, BOOL creation,
|
|
|
|
DWORD reserved)
|
|
|
|
{
|
|
|
|
ScriptControl *This = impl_from_IOleObject(iface);
|
|
|
|
|
|
|
|
FIXME("(%p)->(%p %d %d)\n", This, dataobj, creation, reserved);
|
|
|
|
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI OleObject_GetClipboardData(IOleObject *iface, DWORD reserved, IDataObject **dataobj)
|
|
|
|
{
|
|
|
|
ScriptControl *This = impl_from_IOleObject(iface);
|
|
|
|
|
|
|
|
FIXME("(%p)->(%d %p)\n", This, reserved, dataobj);
|
|
|
|
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI OleObject_DoVerb(IOleObject *iface, LONG verb, LPMSG msg, IOleClientSite *active_site,
|
|
|
|
LONG index, HWND hwndParent, LPCRECT rect)
|
|
|
|
{
|
|
|
|
ScriptControl *This = impl_from_IOleObject(iface);
|
|
|
|
|
|
|
|
FIXME("(%p)->(%d %p %p %d %p %p)\n", This, verb, msg, active_site, index, hwndParent, rect);
|
|
|
|
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI OleObject_EnumVerbs(IOleObject *iface, IEnumOLEVERB **enumoleverb)
|
|
|
|
{
|
|
|
|
ScriptControl *This = impl_from_IOleObject(iface);
|
|
|
|
|
|
|
|
FIXME("(%p)->(%p)\n", This, enumoleverb);
|
|
|
|
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI OleObject_Update(IOleObject *iface)
|
|
|
|
{
|
|
|
|
ScriptControl *This = impl_from_IOleObject(iface);
|
|
|
|
|
|
|
|
FIXME("(%p)\n", This);
|
|
|
|
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI OleObject_IsUpToDate(IOleObject *iface)
|
|
|
|
{
|
|
|
|
ScriptControl *This = impl_from_IOleObject(iface);
|
|
|
|
|
|
|
|
FIXME("(%p)\n", This);
|
|
|
|
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI OleObject_GetUserClassID(IOleObject *iface, CLSID *clsid)
|
|
|
|
{
|
|
|
|
ScriptControl *This = impl_from_IOleObject(iface);
|
|
|
|
|
|
|
|
FIXME("(%p)->(%p)\n", This, clsid);
|
|
|
|
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI OleObject_GetUserType(IOleObject *iface, DWORD form_of_type, LPOLESTR *usertype)
|
|
|
|
{
|
|
|
|
ScriptControl *This = impl_from_IOleObject(iface);
|
|
|
|
|
|
|
|
FIXME("(%p)->(%d %p)\n", This, form_of_type, usertype);
|
|
|
|
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI OleObject_SetExtent(IOleObject *iface, DWORD aspect, SIZEL *size)
|
|
|
|
{
|
|
|
|
ScriptControl *This = impl_from_IOleObject(iface);
|
|
|
|
|
|
|
|
FIXME("(%p)->(%d %p)\n", This, aspect, size);
|
|
|
|
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI OleObject_GetExtent(IOleObject *iface, DWORD aspect, SIZEL *size)
|
|
|
|
{
|
|
|
|
ScriptControl *This = impl_from_IOleObject(iface);
|
|
|
|
|
2016-06-08 04:47:27 +00:00
|
|
|
TRACE("(%p)->(%d %p)\n", This, aspect, size);
|
2016-06-06 09:45:54 +00:00
|
|
|
|
2016-06-08 04:47:27 +00:00
|
|
|
if (aspect != DVASPECT_CONTENT)
|
|
|
|
return DV_E_DVASPECT;
|
|
|
|
|
|
|
|
*size = This->extent;
|
|
|
|
return S_OK;
|
2016-06-06 09:45:54 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI OleObject_Advise(IOleObject *iface, IAdviseSink *sink, DWORD *connection)
|
|
|
|
{
|
|
|
|
ScriptControl *This = impl_from_IOleObject(iface);
|
|
|
|
|
|
|
|
FIXME("(%p)->(%p %p)\n", This, sink, connection);
|
|
|
|
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI OleObject_Unadvise(IOleObject *iface, DWORD connection)
|
|
|
|
{
|
|
|
|
ScriptControl *This = impl_from_IOleObject(iface);
|
|
|
|
|
|
|
|
FIXME("(%p)->(%d)\n", This, connection);
|
|
|
|
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI OleObject_EnumAdvise(IOleObject *iface, IEnumSTATDATA **enumadvise)
|
|
|
|
{
|
|
|
|
ScriptControl *This = impl_from_IOleObject(iface);
|
|
|
|
|
|
|
|
FIXME("(%p)->(%p)\n", This, enumadvise);
|
|
|
|
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI OleObject_GetMiscStatus(IOleObject *iface, DWORD aspect, DWORD *status)
|
|
|
|
{
|
|
|
|
ScriptControl *This = impl_from_IOleObject(iface);
|
|
|
|
|
2016-06-07 08:29:35 +00:00
|
|
|
TRACE("(%p)->(%d %p)\n", This, aspect, status);
|
2016-06-06 09:45:54 +00:00
|
|
|
|
2016-06-07 08:29:35 +00:00
|
|
|
return OleRegGetMiscStatus(&CLSID_ScriptControl, aspect, status);
|
2016-06-06 09:45:54 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI OleObject_SetColorScheme(IOleObject *iface, LOGPALETTE *logpal)
|
|
|
|
{
|
|
|
|
ScriptControl *This = impl_from_IOleObject(iface);
|
|
|
|
|
|
|
|
FIXME("(%p)->(%p)\n", This, logpal);
|
|
|
|
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static const IOleObjectVtbl OleObjectVtbl = {
|
|
|
|
OleObject_QueryInterface,
|
|
|
|
OleObject_AddRef,
|
|
|
|
OleObject_Release,
|
|
|
|
OleObject_SetClientSite,
|
|
|
|
OleObject_GetClientSite,
|
|
|
|
OleObject_SetHostNames,
|
|
|
|
OleObject_Close,
|
|
|
|
OleObject_SetMoniker,
|
|
|
|
OleObject_GetMoniker,
|
|
|
|
OleObject_InitFromData,
|
|
|
|
OleObject_GetClipboardData,
|
|
|
|
OleObject_DoVerb,
|
|
|
|
OleObject_EnumVerbs,
|
|
|
|
OleObject_Update,
|
|
|
|
OleObject_IsUpToDate,
|
|
|
|
OleObject_GetUserClassID,
|
|
|
|
OleObject_GetUserType,
|
|
|
|
OleObject_SetExtent,
|
|
|
|
OleObject_GetExtent,
|
|
|
|
OleObject_Advise,
|
|
|
|
OleObject_Unadvise,
|
|
|
|
OleObject_EnumAdvise,
|
|
|
|
OleObject_GetMiscStatus,
|
|
|
|
OleObject_SetColorScheme
|
|
|
|
};
|
|
|
|
|
2016-06-08 04:47:26 +00:00
|
|
|
static HRESULT WINAPI PersistStreamInit_QueryInterface(IPersistStreamInit *iface, REFIID riid, void **obj)
|
|
|
|
{
|
|
|
|
ScriptControl *This = impl_from_IPersistStreamInit(iface);
|
|
|
|
return IScriptControl_QueryInterface(&This->IScriptControl_iface, riid, obj);
|
|
|
|
}
|
|
|
|
|
|
|
|
static ULONG WINAPI PersistStreamInit_AddRef(IPersistStreamInit *iface)
|
|
|
|
{
|
|
|
|
ScriptControl *This = impl_from_IPersistStreamInit(iface);
|
|
|
|
return IScriptControl_AddRef(&This->IScriptControl_iface);
|
|
|
|
}
|
|
|
|
|
|
|
|
static ULONG WINAPI PersistStreamInit_Release(IPersistStreamInit *iface)
|
|
|
|
{
|
|
|
|
ScriptControl *This = impl_from_IPersistStreamInit(iface);
|
|
|
|
return IScriptControl_Release(&This->IScriptControl_iface);
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI PersistStreamInit_GetClassID(IPersistStreamInit *iface, CLSID *clsid)
|
|
|
|
{
|
|
|
|
ScriptControl *This = impl_from_IPersistStreamInit(iface);
|
|
|
|
|
|
|
|
FIXME("(%p)->(%p)\n", This, clsid);
|
|
|
|
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI PersistStreamInit_IsDirty(IPersistStreamInit *iface)
|
|
|
|
{
|
|
|
|
ScriptControl *This = impl_from_IPersistStreamInit(iface);
|
|
|
|
|
|
|
|
FIXME("(%p)\n", This);
|
|
|
|
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI PersistStreamInit_Load(IPersistStreamInit *iface, IStream *stream)
|
|
|
|
{
|
|
|
|
ScriptControl *This = impl_from_IPersistStreamInit(iface);
|
|
|
|
|
|
|
|
FIXME("(%p)->(%p)\n", This, stream);
|
|
|
|
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI PersistStreamInit_Save(IPersistStreamInit *iface, IStream *stream, BOOL clear_dirty)
|
|
|
|
{
|
|
|
|
ScriptControl *This = impl_from_IPersistStreamInit(iface);
|
|
|
|
|
|
|
|
FIXME("(%p)->(%p %d)\n", This, stream, clear_dirty);
|
|
|
|
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI PersistStreamInit_GetSizeMax(IPersistStreamInit *iface, ULARGE_INTEGER *size)
|
|
|
|
{
|
|
|
|
ScriptControl *This = impl_from_IPersistStreamInit(iface);
|
|
|
|
|
|
|
|
FIXME("(%p)->(%p)\n", This, size);
|
|
|
|
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI PersistStreamInit_InitNew(IPersistStreamInit *iface)
|
|
|
|
{
|
|
|
|
ScriptControl *This = impl_from_IPersistStreamInit(iface);
|
|
|
|
|
|
|
|
FIXME("(%p)\n", This);
|
|
|
|
|
2016-06-09 17:40:13 +00:00
|
|
|
return S_OK;
|
2016-06-08 04:47:26 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static const IPersistStreamInitVtbl PersistStreamInitVtbl = {
|
|
|
|
PersistStreamInit_QueryInterface,
|
|
|
|
PersistStreamInit_AddRef,
|
|
|
|
PersistStreamInit_Release,
|
|
|
|
PersistStreamInit_GetClassID,
|
|
|
|
PersistStreamInit_IsDirty,
|
|
|
|
PersistStreamInit_Load,
|
|
|
|
PersistStreamInit_Save,
|
|
|
|
PersistStreamInit_GetSizeMax,
|
|
|
|
PersistStreamInit_InitNew
|
|
|
|
};
|
|
|
|
|
2016-06-09 17:40:14 +00:00
|
|
|
static HRESULT WINAPI OleControl_QueryInterface(IOleControl *iface, REFIID riid, void **obj)
|
|
|
|
{
|
|
|
|
ScriptControl *This = impl_from_IOleControl(iface);
|
|
|
|
return IScriptControl_QueryInterface(&This->IScriptControl_iface, riid, obj);
|
|
|
|
}
|
|
|
|
|
|
|
|
static ULONG WINAPI OleControl_AddRef(IOleControl *iface)
|
|
|
|
{
|
|
|
|
ScriptControl *This = impl_from_IOleControl(iface);
|
|
|
|
return IScriptControl_AddRef(&This->IScriptControl_iface);
|
|
|
|
}
|
|
|
|
|
|
|
|
static ULONG WINAPI OleControl_Release(IOleControl *iface)
|
|
|
|
{
|
|
|
|
ScriptControl *This = impl_from_IOleControl(iface);
|
|
|
|
return IScriptControl_Release(&This->IScriptControl_iface);
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI OleControl_GetControlInfo(IOleControl *iface, CONTROLINFO *info)
|
|
|
|
{
|
|
|
|
ScriptControl *This = impl_from_IOleControl(iface);
|
|
|
|
|
2016-06-11 10:02:38 +00:00
|
|
|
TRACE("(%p)->(%p)\n", This, info);
|
2016-06-09 17:40:14 +00:00
|
|
|
|
2016-06-11 10:02:38 +00:00
|
|
|
if (!info)
|
|
|
|
return E_POINTER;
|
|
|
|
|
|
|
|
info->hAccel = NULL;
|
|
|
|
info->cAccel = 0;
|
|
|
|
|
|
|
|
return S_OK;
|
2016-06-09 17:40:14 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI OleControl_OnMnemonic(IOleControl *iface, MSG *msg)
|
|
|
|
{
|
|
|
|
ScriptControl *This = impl_from_IOleControl(iface);
|
|
|
|
|
|
|
|
FIXME("(%p)->(%p)\n", This, msg);
|
|
|
|
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI OleControl_OnAmbientPropertyChange(IOleControl *iface, DISPID dispid)
|
|
|
|
{
|
|
|
|
ScriptControl *This = impl_from_IOleControl(iface);
|
|
|
|
|
|
|
|
FIXME("(%p)->(%#x)\n", This, dispid);
|
|
|
|
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI OleControl_FreezeEvents(IOleControl *iface, BOOL freeze)
|
|
|
|
{
|
|
|
|
ScriptControl *This = impl_from_IOleControl(iface);
|
|
|
|
|
|
|
|
FIXME("(%p)->(%d)\n", This, freeze);
|
|
|
|
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static const IOleControlVtbl OleControlVtbl = {
|
|
|
|
OleControl_QueryInterface,
|
|
|
|
OleControl_AddRef,
|
|
|
|
OleControl_Release,
|
|
|
|
OleControl_GetControlInfo,
|
|
|
|
OleControl_OnMnemonic,
|
|
|
|
OleControl_OnAmbientPropertyChange,
|
|
|
|
OleControl_FreezeEvents
|
|
|
|
};
|
|
|
|
|
2016-06-20 11:00:28 +00:00
|
|
|
static HRESULT WINAPI QuickActivate_QueryInterface(IQuickActivate *iface, REFIID riid, void **obj)
|
|
|
|
{
|
|
|
|
ScriptControl *This = impl_from_IQuickActivate(iface);
|
|
|
|
return IScriptControl_QueryInterface(&This->IScriptControl_iface, riid, obj);
|
|
|
|
}
|
|
|
|
|
|
|
|
static ULONG WINAPI QuickActivate_AddRef(IQuickActivate *iface)
|
|
|
|
{
|
|
|
|
ScriptControl *This = impl_from_IQuickActivate(iface);
|
|
|
|
return IScriptControl_AddRef(&This->IScriptControl_iface);
|
|
|
|
}
|
|
|
|
|
|
|
|
static ULONG WINAPI QuickActivate_Release(IQuickActivate *iface)
|
|
|
|
{
|
|
|
|
ScriptControl *This = impl_from_IQuickActivate(iface);
|
|
|
|
return IScriptControl_Release(&This->IScriptControl_iface);
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI QuickActivate_QuickActivate(IQuickActivate *iface, QACONTAINER *container, QACONTROL *control)
|
|
|
|
{
|
|
|
|
ScriptControl *This = impl_from_IQuickActivate(iface);
|
|
|
|
|
|
|
|
FIXME("(%p)->(%p %p)\n", This, container, control);
|
|
|
|
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI QuickActivate_SetContentExtent(IQuickActivate *iface, SIZEL *size)
|
|
|
|
{
|
|
|
|
ScriptControl *This = impl_from_IQuickActivate(iface);
|
|
|
|
|
|
|
|
FIXME("(%p)->(%p)\n", This, size);
|
|
|
|
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI QuickActivate_GetContentExtent(IQuickActivate *iface, SIZEL *size)
|
|
|
|
{
|
|
|
|
ScriptControl *This = impl_from_IQuickActivate(iface);
|
|
|
|
|
|
|
|
FIXME("(%p)->(%p)\n", This, size);
|
|
|
|
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static const IQuickActivateVtbl QuickActivateVtbl = {
|
|
|
|
QuickActivate_QueryInterface,
|
|
|
|
QuickActivate_AddRef,
|
|
|
|
QuickActivate_Release,
|
|
|
|
QuickActivate_QuickActivate,
|
|
|
|
QuickActivate_SetContentExtent,
|
|
|
|
QuickActivate_GetContentExtent
|
|
|
|
};
|
|
|
|
|
2016-06-16 09:17:11 +00:00
|
|
|
static HRESULT WINAPI ConnectionPointContainer_QueryInterface(IConnectionPointContainer *iface, REFIID riid, void **obj)
|
|
|
|
{
|
|
|
|
ScriptControl *This = impl_from_IConnectionPointContainer(iface);
|
|
|
|
return IScriptControl_QueryInterface(&This->IScriptControl_iface, riid, obj);
|
|
|
|
}
|
|
|
|
|
|
|
|
static ULONG WINAPI ConnectionPointContainer_AddRef(IConnectionPointContainer *iface)
|
|
|
|
{
|
|
|
|
ScriptControl *This = impl_from_IConnectionPointContainer(iface);
|
|
|
|
return IScriptControl_AddRef(&This->IScriptControl_iface);
|
|
|
|
}
|
|
|
|
|
|
|
|
static ULONG WINAPI ConnectionPointContainer_Release(IConnectionPointContainer *iface)
|
|
|
|
{
|
|
|
|
ScriptControl *This = impl_from_IConnectionPointContainer(iface);
|
|
|
|
return IScriptControl_Release(&This->IScriptControl_iface);
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI ConnectionPointContainer_EnumConnectionPoints(IConnectionPointContainer *iface, IEnumConnectionPoints **enum_points)
|
|
|
|
{
|
|
|
|
ScriptControl *This = impl_from_IConnectionPointContainer(iface);
|
|
|
|
|
|
|
|
FIXME("(%p)->(%p)\n", This, enum_points);
|
|
|
|
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI ConnectionPointContainer_FindConnectionPoint(IConnectionPointContainer *iface, REFIID riid, IConnectionPoint **cp)
|
|
|
|
{
|
|
|
|
ScriptControl *This = impl_from_IConnectionPointContainer(iface);
|
2016-06-20 11:00:27 +00:00
|
|
|
ConnectionPoint *iter;
|
2016-06-16 09:17:11 +00:00
|
|
|
|
2016-06-20 11:00:27 +00:00
|
|
|
TRACE("(%p)->(%s %p)\n", This, debugstr_guid(riid), cp);
|
2016-06-16 09:17:11 +00:00
|
|
|
|
2016-06-20 11:00:27 +00:00
|
|
|
*cp = NULL;
|
|
|
|
|
|
|
|
for (iter = This->cp_list; iter; iter = iter->next) {
|
|
|
|
if (IsEqualIID(iter->riid, riid))
|
|
|
|
*cp = &iter->IConnectionPoint_iface;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (*cp) {
|
|
|
|
IConnectionPoint_AddRef(*cp);
|
|
|
|
return S_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
FIXME("unsupported connection point %s\n", debugstr_guid(riid));
|
|
|
|
return CONNECT_E_NOCONNECTION;
|
2016-06-16 09:17:11 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static const IConnectionPointContainerVtbl ConnectionPointContainerVtbl = {
|
|
|
|
ConnectionPointContainer_QueryInterface,
|
|
|
|
ConnectionPointContainer_AddRef,
|
|
|
|
ConnectionPointContainer_Release,
|
|
|
|
ConnectionPointContainer_EnumConnectionPoints,
|
|
|
|
ConnectionPointContainer_FindConnectionPoint
|
|
|
|
};
|
|
|
|
|
2016-06-20 11:00:27 +00:00
|
|
|
static HRESULT WINAPI ConnectionPoint_QueryInterface(IConnectionPoint *iface,
|
|
|
|
REFIID riid, void **ppv)
|
|
|
|
{
|
|
|
|
ConnectionPoint *This = impl_from_IConnectionPoint(iface);
|
|
|
|
|
|
|
|
if(IsEqualGUID(&IID_IUnknown, riid)) {
|
|
|
|
TRACE("(%p)->(IID_IUnknown %p)\n", This, ppv);
|
|
|
|
*ppv = &This->IConnectionPoint_iface;
|
|
|
|
}else if(IsEqualGUID(&IID_IConnectionPoint, riid)) {
|
|
|
|
TRACE("(%p)->(IID_IDispatch %p)\n", This, ppv);
|
|
|
|
*ppv = &This->IConnectionPoint_iface;
|
|
|
|
}else {
|
|
|
|
FIXME("(%p)->(%s %p)\n", This, debugstr_guid(riid), ppv);
|
|
|
|
*ppv = NULL;
|
|
|
|
return E_NOINTERFACE;
|
|
|
|
}
|
|
|
|
|
|
|
|
IUnknown_AddRef((IUnknown*)*ppv);
|
|
|
|
return S_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
static ULONG WINAPI ConnectionPoint_AddRef(IConnectionPoint *iface)
|
|
|
|
{
|
|
|
|
ConnectionPoint *This = impl_from_IConnectionPoint(iface);
|
|
|
|
return IConnectionPointContainer_AddRef(&This->control->IConnectionPointContainer_iface);
|
|
|
|
}
|
|
|
|
|
|
|
|
static ULONG WINAPI ConnectionPoint_Release(IConnectionPoint *iface)
|
|
|
|
{
|
|
|
|
ConnectionPoint *This = impl_from_IConnectionPoint(iface);
|
|
|
|
return IConnectionPointContainer_Release(&This->control->IConnectionPointContainer_iface);
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI ConnectionPoint_GetConnectionInterface(IConnectionPoint *iface, IID *iid)
|
|
|
|
{
|
|
|
|
ConnectionPoint *This = impl_from_IConnectionPoint(iface);
|
|
|
|
|
|
|
|
FIXME("(%p)->(%p)\n", This, iid);
|
|
|
|
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI ConnectionPoint_GetConnectionPointContainer(IConnectionPoint *iface,
|
|
|
|
IConnectionPointContainer **container)
|
|
|
|
{
|
|
|
|
ConnectionPoint *This = impl_from_IConnectionPoint(iface);
|
|
|
|
|
|
|
|
FIXME("(%p)->(%p)\n", This, container);
|
|
|
|
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI ConnectionPoint_Advise(IConnectionPoint *iface, IUnknown *unk_sink,
|
|
|
|
DWORD *cookie)
|
|
|
|
{
|
|
|
|
ConnectionPoint *This = impl_from_IConnectionPoint(iface);
|
|
|
|
|
|
|
|
FIXME("(%p)->(%p %p)\n", This, unk_sink, cookie);
|
|
|
|
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI ConnectionPoint_Unadvise(IConnectionPoint *iface, DWORD cookie)
|
|
|
|
{
|
|
|
|
ConnectionPoint *This = impl_from_IConnectionPoint(iface);
|
|
|
|
|
|
|
|
FIXME("(%p)->(%d)\n", This, cookie);
|
|
|
|
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI ConnectionPoint_EnumConnections(IConnectionPoint *iface,
|
|
|
|
IEnumConnections **ppEnum)
|
|
|
|
{
|
|
|
|
ConnectionPoint *This = impl_from_IConnectionPoint(iface);
|
|
|
|
|
|
|
|
FIXME("(%p)->(%p): stub\n", This, ppEnum);
|
|
|
|
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static const IConnectionPointVtbl ConnectionPointVtbl =
|
|
|
|
{
|
|
|
|
ConnectionPoint_QueryInterface,
|
|
|
|
ConnectionPoint_AddRef,
|
|
|
|
ConnectionPoint_Release,
|
|
|
|
ConnectionPoint_GetConnectionInterface,
|
|
|
|
ConnectionPoint_GetConnectionPointContainer,
|
|
|
|
ConnectionPoint_Advise,
|
|
|
|
ConnectionPoint_Unadvise,
|
|
|
|
ConnectionPoint_EnumConnections
|
|
|
|
};
|
|
|
|
|
|
|
|
static void ConnectionPoint_Init(ConnectionPoint *cp, ScriptControl *sc, REFIID riid)
|
|
|
|
{
|
|
|
|
cp->IConnectionPoint_iface.lpVtbl = &ConnectionPointVtbl;
|
|
|
|
cp->control = sc;
|
|
|
|
cp->riid = riid;
|
|
|
|
|
|
|
|
cp->next = sc->cp_list;
|
|
|
|
sc->cp_list = cp;
|
|
|
|
}
|
|
|
|
|
2015-06-30 12:09:03 +00:00
|
|
|
static HRESULT WINAPI ScriptControl_CreateInstance(IClassFactory *iface, IUnknown *outer, REFIID riid, void **ppv)
|
|
|
|
{
|
|
|
|
ScriptControl *script_control;
|
2016-06-08 04:47:27 +00:00
|
|
|
DWORD dpi_x, dpi_y;
|
2015-06-30 12:09:03 +00:00
|
|
|
HRESULT hres;
|
2016-06-08 04:47:27 +00:00
|
|
|
HDC hdc;
|
2015-06-30 12:09:03 +00:00
|
|
|
|
|
|
|
TRACE("(%p %s %p)\n", outer, debugstr_guid(riid), ppv);
|
|
|
|
|
|
|
|
script_control = heap_alloc(sizeof(*script_control));
|
|
|
|
if(!script_control)
|
|
|
|
return E_OUTOFMEMORY;
|
|
|
|
|
|
|
|
script_control->IScriptControl_iface.lpVtbl = &ScriptControlVtbl;
|
2016-06-08 04:47:26 +00:00
|
|
|
script_control->IPersistStreamInit_iface.lpVtbl = &PersistStreamInitVtbl;
|
2016-06-06 09:45:54 +00:00
|
|
|
script_control->IOleObject_iface.lpVtbl = &OleObjectVtbl;
|
2016-06-09 17:40:14 +00:00
|
|
|
script_control->IOleControl_iface.lpVtbl = &OleControlVtbl;
|
2016-06-20 11:00:28 +00:00
|
|
|
script_control->IQuickActivate_iface.lpVtbl = &QuickActivateVtbl;
|
2016-06-16 09:17:11 +00:00
|
|
|
script_control->IConnectionPointContainer_iface.lpVtbl = &ConnectionPointContainerVtbl;
|
2015-06-30 12:09:03 +00:00
|
|
|
script_control->ref = 1;
|
2016-06-07 08:29:36 +00:00
|
|
|
script_control->site = NULL;
|
2016-06-20 11:00:27 +00:00
|
|
|
script_control->cp_list = NULL;
|
|
|
|
|
|
|
|
ConnectionPoint_Init(&script_control->cp_scsource, script_control, &DIID_DScriptControlSource);
|
|
|
|
ConnectionPoint_Init(&script_control->cp_propnotif, script_control, &IID_IPropertyNotifySink);
|
2015-06-30 12:09:03 +00:00
|
|
|
|
2016-06-08 04:47:27 +00:00
|
|
|
hdc = GetDC(0);
|
|
|
|
dpi_x = GetDeviceCaps(hdc, LOGPIXELSX);
|
|
|
|
dpi_y = GetDeviceCaps(hdc, LOGPIXELSY);
|
|
|
|
ReleaseDC(0, hdc);
|
|
|
|
|
|
|
|
script_control->extent.cx = MulDiv(38, 2540, dpi_x);
|
|
|
|
script_control->extent.cy = MulDiv(38, 2540, dpi_y);
|
|
|
|
|
2015-06-30 12:09:03 +00:00
|
|
|
hres = IScriptControl_QueryInterface(&script_control->IScriptControl_iface, riid, ppv);
|
|
|
|
IScriptControl_Release(&script_control->IScriptControl_iface);
|
|
|
|
return hres;
|
2015-06-25 11:31:19 +00:00
|
|
|
}
|
|
|
|
|
2015-06-23 11:09:32 +00:00
|
|
|
/******************************************************************
|
|
|
|
* DllMain (msscript.ocx.@)
|
|
|
|
*/
|
2015-07-07 10:35:44 +00:00
|
|
|
BOOL WINAPI DllMain(HINSTANCE instance, DWORD reason, void *reserved)
|
2015-06-23 11:09:32 +00:00
|
|
|
{
|
2015-07-07 10:35:44 +00:00
|
|
|
TRACE("(%p %d %p)\n", instance, reason, reserved);
|
2015-06-23 11:09:32 +00:00
|
|
|
|
|
|
|
switch(reason) {
|
|
|
|
case DLL_WINE_PREATTACH:
|
|
|
|
return FALSE; /* prefer native version */
|
|
|
|
case DLL_PROCESS_ATTACH:
|
2015-06-24 08:26:12 +00:00
|
|
|
msscript_instance = instance;
|
2015-06-23 11:09:32 +00:00
|
|
|
DisableThreadLibraryCalls(instance);
|
|
|
|
break;
|
2015-07-07 10:35:44 +00:00
|
|
|
case DLL_PROCESS_DETACH:
|
|
|
|
if(!reserved)
|
|
|
|
release_typelib();
|
|
|
|
break;
|
2015-06-23 11:09:32 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
2015-06-25 11:31:19 +00:00
|
|
|
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;
|
|
|
|
}
|
|
|
|
|
|
|
|
WARN("(%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 ScriptControlFactoryVtbl = {
|
|
|
|
ClassFactory_QueryInterface,
|
|
|
|
ClassFactory_AddRef,
|
|
|
|
ClassFactory_Release,
|
|
|
|
ScriptControl_CreateInstance,
|
|
|
|
ClassFactory_LockServer
|
|
|
|
};
|
|
|
|
|
|
|
|
static IClassFactory ScriptControlFactory = { &ScriptControlFactoryVtbl };
|
|
|
|
|
2015-06-23 11:09:32 +00:00
|
|
|
/***********************************************************************
|
|
|
|
* DllGetClassObject (msscript.ocx.@)
|
|
|
|
*/
|
|
|
|
HRESULT WINAPI DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID *ppv)
|
|
|
|
{
|
2015-06-25 11:31:19 +00:00
|
|
|
if(IsEqualGUID(&CLSID_ScriptControl, rclsid)) {
|
|
|
|
TRACE("(CLSID_ScriptControl %s %p)\n", debugstr_guid(riid), ppv);
|
|
|
|
return IClassFactory_QueryInterface(&ScriptControlFactory, riid, ppv);
|
|
|
|
}
|
|
|
|
|
2015-06-23 11:09:32 +00:00
|
|
|
FIXME("%s %s %p\n", debugstr_guid(rclsid), debugstr_guid(riid), ppv);
|
|
|
|
return CLASS_E_CLASSNOTAVAILABLE;
|
|
|
|
}
|
|
|
|
|
|
|
|
/***********************************************************************
|
|
|
|
* DllCanUnloadNow (msscript.ocx.@)
|
|
|
|
*/
|
|
|
|
HRESULT WINAPI DllCanUnloadNow(void)
|
|
|
|
{
|
|
|
|
TRACE("\n");
|
|
|
|
return S_FALSE;
|
|
|
|
}
|
|
|
|
|
|
|
|
/***********************************************************************
|
|
|
|
* DllRegisterServer (msscript.ocx.@)
|
|
|
|
*/
|
|
|
|
HRESULT WINAPI DllRegisterServer(void)
|
|
|
|
{
|
2015-06-24 08:26:12 +00:00
|
|
|
TRACE("()\n");
|
|
|
|
return __wine_register_resources(msscript_instance);
|
2015-06-23 11:09:32 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/***********************************************************************
|
|
|
|
* DllUnregisterServer (msscript.ocx.@)
|
|
|
|
*/
|
|
|
|
HRESULT WINAPI DllUnregisterServer(void)
|
|
|
|
{
|
|
|
|
TRACE("()\n");
|
2015-06-24 08:26:12 +00:00
|
|
|
return __wine_unregister_resources(msscript_instance);
|
2015-06-23 11:09:32 +00:00
|
|
|
}
|