From 89c0b42fc6d71577bb34480c58e27a2630eac7b7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gabriel=20Iv=C4=83ncescu?= Date: Thu, 12 Dec 2019 14:53:56 +0200 Subject: [PATCH] jscript: Implement ScriptTypeInfo_GetTypeAttr. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Gabriel Ivăncescu Signed-off-by: Jacek Caban Signed-off-by: Alexandre Julliard --- dlls/jscript/dispex.c | 32 +++++++++++++++++++++++++++++--- 1 file changed, 29 insertions(+), 3 deletions(-) diff --git a/dlls/jscript/dispex.c b/dlls/jscript/dispex.c index 6c6d25a9c16..ef002e4c7e7 100644 --- a/dlls/jscript/dispex.c +++ b/dlls/jscript/dispex.c @@ -25,6 +25,8 @@ WINE_DEFAULT_DEBUG_CHANNEL(jscript); +static const GUID GUID_JScriptTypeInfo = {0xc59c6b12,0xf6c1,0x11cf,{0x88,0x35,0x00,0xa0,0xc9,0x11,0xe8,0xb2}}; + #define FDEX_VERSION_MASK 0xf0000000 #define GOLDEN_RATIO 0x9E3779B9U @@ -678,10 +680,32 @@ static ULONG WINAPI ScriptTypeInfo_Release(ITypeInfo *iface) static HRESULT WINAPI ScriptTypeInfo_GetTypeAttr(ITypeInfo *iface, TYPEATTR **ppTypeAttr) { ScriptTypeInfo *This = ScriptTypeInfo_from_ITypeInfo(iface); + TYPEATTR *attr; - FIXME("(%p)->(%p)\n", This, ppTypeAttr); + TRACE("(%p)->(%p)\n", This, ppTypeAttr); - return E_NOTIMPL; + if (!ppTypeAttr) return E_INVALIDARG; + + attr = heap_alloc_zero(sizeof(*attr)); + if (!attr) return E_OUTOFMEMORY; + + attr->guid = GUID_JScriptTypeInfo; + attr->lcid = LOCALE_USER_DEFAULT; + attr->memidConstructor = MEMBERID_NIL; + attr->memidDestructor = MEMBERID_NIL; + attr->cbSizeInstance = 4; + attr->typekind = TKIND_DISPATCH; + attr->cFuncs = This->num_funcs; + attr->cVars = This->num_vars; + attr->cImplTypes = 1; + attr->cbSizeVft = sizeof(IDispatchVtbl); + attr->cbAlignment = 4; + attr->wTypeFlags = TYPEFLAG_FDISPATCHABLE; + attr->wMajorVerNum = JSCRIPT_MAJOR_VERSION; + attr->wMinorVerNum = JSCRIPT_MINOR_VERSION; + + *ppTypeAttr = attr; + return S_OK; } static HRESULT WINAPI ScriptTypeInfo_GetTypeComp(ITypeInfo *iface, ITypeComp **ppTComp) @@ -829,7 +853,9 @@ static void WINAPI ScriptTypeInfo_ReleaseTypeAttr(ITypeInfo *iface, TYPEATTR *pT { ScriptTypeInfo *This = ScriptTypeInfo_from_ITypeInfo(iface); - FIXME("(%p)->(%p)\n", This, pTypeAttr); + TRACE("(%p)->(%p)\n", This, pTypeAttr); + + heap_free(pTypeAttr); } static void WINAPI ScriptTypeInfo_ReleaseFuncDesc(ITypeInfo *iface, FUNCDESC *pFuncDesc)