Commit 29967463 authored by Dmitry Timoshkov's avatar Dmitry Timoshkov Committed by Alexandre Julliard

activeds: Implement IADsPathname::Retrieve(ADS_FORMAT_X500).

parent 606ececd
......@@ -234,13 +234,39 @@ static HRESULT WINAPI path_SetDisplayType(IADsPathname *iface, LONG type)
static HRESULT WINAPI path_Retrieve(IADsPathname *iface, LONG type, BSTR *adspath)
{
Pathname *path = impl_from_IADsPathname(iface);
int len;
FIXME("%p,%d,%p: stub\n", iface, type, adspath);
TRACE("%p,%d,%p\n", iface, type, adspath);
if (!adspath) return E_INVALIDARG;
*adspath = SysAllocString(path->provider);
return *adspath ? S_OK : E_OUTOFMEMORY;
switch (type)
{
default:
FIXME("type %d not implemented\n", type);
/* fall through */
case ADS_FORMAT_X500:
len = wcslen(path->provider) + 3;
if (path->server) len += wcslen(path->server) + 1;
if (path->dn) len += wcslen(path->dn);
*adspath = SysAllocStringLen(NULL, len);
if (!*adspath) return E_OUTOFMEMORY;
wcscpy(*adspath, path->provider);
wcscat(*adspath, L"://");
if (path->server)
{
wcscat(*adspath, path->server);
wcscat(*adspath, L"/");
}
if (path->dn) wcscat(*adspath, path->dn);
break;
}
TRACE("=> %s\n", debugstr_w(*adspath));
return S_OK;
}
static HRESULT WINAPI path_GetNumElements(IADsPathname *iface, LONG *count)
......
......@@ -105,7 +105,6 @@ todo_wine
bstr = NULL;
hr = IADsPathname_Retrieve(path, ADS_FORMAT_X500, &bstr);
ok(hr == S_OK, "got %#x\n", hr);
todo_wine
ok(bstr && !wcscmp(bstr, L"LDAP://"), "got %s\n", wine_dbgstr_w(bstr));
SysFreeString(bstr);
......@@ -147,12 +146,12 @@ todo_wine
hr = IADsPathname_Retrieve(path, ADS_FORMAT_X500, &bstr);
ok(hr == S_OK, "got %#x\n", hr);
todo_wine
ok(!wcscmp(bstr, L"LDAP://sample:123/a=b,c=d,e=f"), "got %s\n", wine_dbgstr_w(bstr));
SysFreeString(bstr);
hr = IADsPathname_Retrieve(path, ADS_FORMAT_PROVIDER, &bstr);
ok(hr == S_OK, "got %#x\n", hr);
todo_wine
ok(!wcscmp(bstr, L"LDAP"), "got %s\n", wine_dbgstr_w(bstr));
SysFreeString(bstr);
......
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