Jacek Caban : jscript: Added IObjectSafety implementation.
Module: wine Branch: master Commit: 7d95c210c891755cdc1c0eb0608c91ee2e108dec URL: http://source.winehq.org/git/wine.git/?a=commit;h=7d95c210c891755cdc1c0eb060... Author: Jacek Caban <jacek(a)codeweavers.com> Date: Mon Apr 7 12:35:41 2008 +0200 jscript: Added IObjectSafety implementation. --- dlls/jscript/jscript.c | 25 ++++++++++++++++++++++--- 1 files changed, 22 insertions(+), 3 deletions(-) diff --git a/dlls/jscript/jscript.c b/dlls/jscript/jscript.c index 7d7385a..f058e26 100644 --- a/dlls/jscript/jscript.c +++ b/dlls/jscript/jscript.c @@ -32,6 +32,8 @@ typedef struct { const IObjectSafetyVtbl *lpIObjectSafetyVtbl; LONG ref; + + DWORD safeopt; } JScript; #define ACTSCRIPT(x) ((IActiveScript*) &(x)->lpIActiveScriptVtbl) @@ -395,19 +397,35 @@ static ULONG WINAPI JScriptSafety_Release(IObjectSafety *iface) return IActiveScript_Release(ACTSCRIPT(This)); } +#define SUPPORTED_OPTIONS (INTERFACESAFE_FOR_UNTRUSTED_DATA|INTERFACE_USES_DISPEX|INTERFACE_USES_SECURITY_MANAGER) + static HRESULT WINAPI JScriptSafety_GetInterfaceSafetyOptions(IObjectSafety *iface, REFIID riid, DWORD *pdwSupportedOptions, DWORD *pdwEnabledOptions) { JScript *This = OBJSAFETY_THIS(iface); - FIXME("(%p)->(%s %p %p)\n", This, debugstr_guid(riid), pdwSupportedOptions, pdwEnabledOptions); - return E_NOTIMPL; + + TRACE("(%p)->(%s %p %p)\n", This, debugstr_guid(riid), pdwSupportedOptions, pdwEnabledOptions); + + if(!pdwSupportedOptions || !pdwEnabledOptions) + return E_POINTER; + + *pdwSupportedOptions = SUPPORTED_OPTIONS; + *pdwEnabledOptions = This->safeopt; + + return S_OK; } static HRESULT WINAPI JScriptSafety_SetInterfaceSafetyOptions(IObjectSafety *iface, REFIID riid, DWORD dwOptionSetMask, DWORD dwEnabledOptions) { JScript *This = OBJSAFETY_THIS(iface); - FIXME("(%p)->(%s %x %x)\n", This, debugstr_guid(riid), dwOptionSetMask, dwEnabledOptions); + + TRACE("(%p)->(%s %x %x)\n", This, debugstr_guid(riid), dwOptionSetMask, dwEnabledOptions); + + if(dwOptionSetMask & ~SUPPORTED_OPTIONS) + return E_FAIL; + + This->safeopt = dwEnabledOptions & dwEnabledOptions; return S_OK; } @@ -439,6 +457,7 @@ HRESULT WINAPI JScriptFactory_CreateInstance(IClassFactory *iface, IUnknown *pUn ret->lpIActiveScriptPropertyVtbl = &JScriptPropertyVtbl; ret->lpIObjectSafetyVtbl = &JScriptSafetyVtbl; ret->ref = 1; + ret->safeopt = INTERFACE_USES_DISPEX; hres = IActiveScript_QueryInterface(ACTSCRIPT(ret), riid, ppv); IActiveScript_Release(ACTSCRIPT(ret));
participants (1)
-
Alexandre Julliard