jscript: Added IDispatchEx::GeleteMemberByDispID implementation.

This commit is contained in:
Jacek Caban 2008-09-30 17:48:36 +02:00 committed by Alexandre Julliard
parent 84d8cddcae
commit 65a207466d
1 changed files with 21 additions and 6 deletions

View File

@ -571,6 +571,15 @@ static HRESULT WINAPI DispatchEx_InvokeEx(IDispatchEx *iface, DISPID id, LCID lc
return hres; return hres;
} }
static HRESULT delete_prop(dispex_prop_t *prop)
{
heap_free(prop->name);
prop->name = NULL;
prop->type = PROP_DELETED;
return S_OK;
}
static HRESULT WINAPI DispatchEx_DeleteMemberByName(IDispatchEx *iface, BSTR bstrName, DWORD grfdex) static HRESULT WINAPI DispatchEx_DeleteMemberByName(IDispatchEx *iface, BSTR bstrName, DWORD grfdex)
{ {
DispatchEx *This = DISPATCHEX_THIS(iface); DispatchEx *This = DISPATCHEX_THIS(iface);
@ -590,17 +599,23 @@ static HRESULT WINAPI DispatchEx_DeleteMemberByName(IDispatchEx *iface, BSTR bst
return S_OK; return S_OK;
} }
heap_free(prop->name); return delete_prop(prop);
prop->name = NULL;
prop->type = PROP_DELETED;
return S_OK;
} }
static HRESULT WINAPI DispatchEx_DeleteMemberByDispID(IDispatchEx *iface, DISPID id) static HRESULT WINAPI DispatchEx_DeleteMemberByDispID(IDispatchEx *iface, DISPID id)
{ {
DispatchEx *This = DISPATCHEX_THIS(iface); DispatchEx *This = DISPATCHEX_THIS(iface);
FIXME("(%p)->(%x)\n", This, id); dispex_prop_t *prop;
return E_NOTIMPL;
TRACE("(%p)->(%x)\n", This, id);
prop = get_prop(This, id);
if(!prop) {
WARN("invalid id\n");
return DISP_E_MEMBERNOTFOUND;
}
return delete_prop(prop);
} }
static HRESULT WINAPI DispatchEx_GetMemberProperties(IDispatchEx *iface, DISPID id, DWORD grfdexFetch, DWORD *pgrfdex) static HRESULT WINAPI DispatchEx_GetMemberProperties(IDispatchEx *iface, DISPID id, DWORD grfdexFetch, DWORD *pgrfdex)