activeds: Implement IADsPathname::GetElement().
Signed-off-by: Dmitry Timoshkov <dmitry@baikal.ru> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
d0eaaea855
commit
0051bea4ec
|
@ -299,8 +299,35 @@ static HRESULT WINAPI path_GetNumElements(IADsPathname *iface, LONG *count)
|
|||
|
||||
static HRESULT WINAPI path_GetElement(IADsPathname *iface, LONG index, BSTR *element)
|
||||
{
|
||||
FIXME("%p,%d,%p: stub\n", iface, index, element);
|
||||
return E_NOTIMPL;
|
||||
Pathname *path = impl_from_IADsPathname(iface);
|
||||
HRESULT hr;
|
||||
WCHAR *p, *end;
|
||||
LONG count;
|
||||
|
||||
TRACE("%p,%d,%p\n", iface, index, element);
|
||||
|
||||
if (!element) return E_INVALIDARG;
|
||||
|
||||
count = 0;
|
||||
hr = HRESULT_FROM_WIN32(ERROR_INVALID_INDEX);
|
||||
|
||||
p = path->dn;
|
||||
while (p)
|
||||
{
|
||||
end = wcschr(p, ',');
|
||||
|
||||
if (index == count)
|
||||
{
|
||||
*element = end ? SysAllocStringLen(p, end - p) : SysAllocString(p);
|
||||
hr = *element ? S_OK : E_OUTOFMEMORY;
|
||||
break;
|
||||
}
|
||||
|
||||
p = end ? end + 1 : NULL;
|
||||
count++;
|
||||
}
|
||||
|
||||
return hr;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI path_AddLeafElement(IADsPathname *iface, BSTR element)
|
||||
|
|
|
@ -121,7 +121,6 @@ todo_wine
|
|||
ok(count == 0, "got %d\n", count);
|
||||
|
||||
hr = IADsPathname_GetElement(path, 0, &bstr);
|
||||
todo_wine
|
||||
ok(hr == HRESULT_FROM_WIN32(ERROR_INVALID_INDEX), "got %#x\n", hr);
|
||||
SysFreeString(bstr);
|
||||
|
||||
|
|
Loading…
Reference in New Issue