Module: wine Branch: master Commit: 65a207466dd3422e69e2dce302384414f23e67f0 URL: http://source.winehq.org/git/wine.git/?a=commit;h=65a207466dd3422e69e2dce302...
Author: Jacek Caban jacek@codeweavers.com Date: Tue Sep 30 17:48:36 2008 +0200
jscript: Added IDispatchEx::GeleteMemberByDispID implementation.
---
dlls/jscript/dispex.c | 27 +++++++++++++++++++++------ 1 files changed, 21 insertions(+), 6 deletions(-)
diff --git a/dlls/jscript/dispex.c b/dlls/jscript/dispex.c index 81fec89..76caf1c 100644 --- a/dlls/jscript/dispex.c +++ b/dlls/jscript/dispex.c @@ -571,6 +571,15 @@ static HRESULT WINAPI DispatchEx_InvokeEx(IDispatchEx *iface, DISPID id, LCID lc 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) { DispatchEx *This = DISPATCHEX_THIS(iface); @@ -590,17 +599,23 @@ static HRESULT WINAPI DispatchEx_DeleteMemberByName(IDispatchEx *iface, BSTR bst return S_OK; }
- heap_free(prop->name); - prop->name = NULL; - prop->type = PROP_DELETED; - return S_OK; + return delete_prop(prop); }
static HRESULT WINAPI DispatchEx_DeleteMemberByDispID(IDispatchEx *iface, DISPID id) { DispatchEx *This = DISPATCHEX_THIS(iface); - FIXME("(%p)->(%x)\n", This, id); - return E_NOTIMPL; + dispex_prop_t *prop; + + 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)