Gabriel Ivăncescu : jscript: Implement ScriptTypeInfo_GetVarDesc.
Alexandre Julliard
julliard at winehq.org
Thu Dec 12 16:29:42 CST 2019
Module: wine
Branch: master
Commit: 93cc9e557d35703b6248ed5f361f3e935fe13044
URL: https://source.winehq.org/git/wine.git/?a=commit;h=93cc9e557d35703b6248ed5f361f3e935fe13044
Author: Gabriel Ivăncescu <gabrielopcode at gmail.com>
Date: Thu Dec 12 14:53:58 2019 +0200
jscript: Implement ScriptTypeInfo_GetVarDesc.
Signed-off-by: Gabriel Ivăncescu <gabrielopcode at gmail.com>
Signed-off-by: Jacek Caban <jacek at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
---
dlls/jscript/dispex.c | 20 +++++++++++++++++---
1 file changed, 17 insertions(+), 3 deletions(-)
diff --git a/dlls/jscript/dispex.c b/dlls/jscript/dispex.c
index 1f062fe22e..df87aedcac 100644
--- a/dlls/jscript/dispex.c
+++ b/dlls/jscript/dispex.c
@@ -752,10 +752,22 @@ static HRESULT WINAPI ScriptTypeInfo_GetFuncDesc(ITypeInfo *iface, UINT index, F
static HRESULT WINAPI ScriptTypeInfo_GetVarDesc(ITypeInfo *iface, UINT index, VARDESC **ppVarDesc)
{
ScriptTypeInfo *This = ScriptTypeInfo_from_ITypeInfo(iface);
+ VARDESC *desc;
- FIXME("(%p)->(%u %p)\n", This, index, ppVarDesc);
+ TRACE("(%p)->(%u %p)\n", This, index, ppVarDesc);
- return E_NOTIMPL;
+ if (!ppVarDesc) return E_INVALIDARG;
+ if (index >= This->num_vars) return TYPE_E_ELEMENTNOTFOUND;
+
+ desc = heap_alloc_zero(sizeof(*desc));
+ if (!desc) return E_OUTOFMEMORY;
+
+ desc->memid = prop_to_id(This->jsdisp, This->vars[index]);
+ desc->varkind = VAR_DISPATCH;
+ desc->elemdescVar.tdesc.vt = VT_VARIANT;
+
+ *ppVarDesc = desc;
+ return S_OK;
}
static HRESULT WINAPI ScriptTypeInfo_GetNames(ITypeInfo *iface, MEMBERID memid, BSTR *rgBstrNames,
@@ -894,7 +906,9 @@ static void WINAPI ScriptTypeInfo_ReleaseVarDesc(ITypeInfo *iface, VARDESC *pVar
{
ScriptTypeInfo *This = ScriptTypeInfo_from_ITypeInfo(iface);
- FIXME("(%p)->(%p)\n", This, pVarDesc);
+ TRACE("(%p)->(%p)\n", This, pVarDesc);
+
+ heap_free(pVarDesc);
}
static const ITypeInfoVtbl ScriptTypeInfoVtbl = {
More information about the wine-cvs
mailing list