Commit dd2fcd6a authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

scrobj: Add GetDispID implementation.

parent b3b78b42
......@@ -1046,8 +1046,26 @@ static HRESULT WINAPI scriptlet_Invoke(IDispatchEx *iface, DISPID dispIdMember,
static HRESULT WINAPI scriptlet_GetDispID(IDispatchEx *iface, BSTR bstrName, DWORD grfdex, DISPID *pid)
{
struct scriptlet_instance *This = impl_from_IDispatchEx(iface);
FIXME("(%p)->(%s %x %p)\n", This, debugstr_w(bstrName), grfdex, pid);
return E_NOTIMPL;
unsigned i;
TRACE("(%p)->(%s %x %p)\n", This, debugstr_w(bstrName), grfdex, pid);
if (grfdex & ~(fdexNameCaseInsensitive|fdexNameCaseSensitive))
FIXME("Unsupported grfdex %x\n", grfdex);
for (i = 0; i < This->member_cnt; i++)
{
if (grfdex & fdexNameCaseInsensitive)
{
if (wcsicmp(This->members[i].name, bstrName)) continue;
}
else if (wcscmp(This->members[i].name, bstrName)) continue;
*pid = i + 1;
return S_OK;
}
WARN("Unknown property %s\n", debugstr_w(bstrName));
return DISP_E_UNKNOWNNAME;
}
static HRESULT WINAPI scriptlet_InvokeEx(IDispatchEx *iface, DISPID id, LCID lcid, WORD flags, DISPPARAMS *pdp,
......
......@@ -848,45 +848,37 @@ static void test_create_object(void)
str = SysAllocString(L"vbAddOne");
hres = IDispatchEx_GetDispID(dispex, str, fdexNameCaseSensitive, &vb_add_one_id);
todo_wine
ok(hres == S_OK, "Could not get vkAddOne id: %08x\n", hres);
SysFreeString(str);
str = SysAllocString(L"jsAddTwo");
hres = IDispatchEx_GetDispID(dispex, str, fdexNameCaseSensitive, &js_add_two_id);
todo_wine
ok(hres == S_OK, "Could not get jsAddTwo id: %08x\n", hres);
SysFreeString(str);
str = SysAllocString(L"wtTest");
hres = IDispatchEx_GetDispID(dispex, str, fdexNameCaseSensitive, &wt_test_id);
todo_wine
ok(hres == S_OK, "Could not get wtTest id: %08x\n", hres);
SysFreeString(str);
str = SysAllocString(L"gsProp");
hres = IDispatchEx_GetDispID(dispex, str, fdexNameCaseSensitive, &wt_gsprop_id);
todo_wine
ok(hres == S_OK, "Could not get wtTest id: %08x\n", hres);
SysFreeString(str);
str = SysAllocString(L"vbaddone");
hres = IDispatchEx_GetDispID(dispex, str, fdexNameCaseSensitive, &id);
todo_wine
ok(hres == DISP_E_UNKNOWNNAME, "invalid case returned: %08x\n", hres);
SysFreeString(str);
str = SysAllocString(L"vbaddone");
hres = IDispatchEx_GetDispID(dispex, str, 0, &id);
todo_wine
ok(hres == DISP_E_UNKNOWNNAME, "invalid case returned: %08x\n", hres);
SysFreeString(str);
str = SysAllocString(L"vbaddone");
hres = IDispatchEx_GetDispID(dispex, str, fdexNameCaseInsensitive, &id);
todo_wine
ok(hres == S_OK, "case insensitive returned: %08x\n", hres);
todo_wine
ok(id == vb_add_one_id, "id = %u, expected %u\n", id, vb_add_one_id);
SysFreeString(str);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment