Module: wine Branch: master Commit: 03e3800d89663c6d6a16c9d26a3ee07d11b8a8c0 URL: https://source.winehq.org/git/wine.git/?a=commit;h=03e3800d89663c6d6a16c9d26... Author: Dmitry Timoshkov <dmitry(a)baikal.ru> Date: Fri Apr 10 15:34:29 2020 +0800 activeds: Implement some simple cases for IADsPathname::Retrieve(). Signed-off-by: Dmitry Timoshkov <dmitry(a)baikal.ru> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/activeds/pathname.c | 16 ++++++++++++++-- dlls/activeds/tests/activeds.c | 2 -- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/dlls/activeds/pathname.c b/dlls/activeds/pathname.c index 3a1d9e8c16..d89c4cb847 100644 --- a/dlls/activeds/pathname.c +++ b/dlls/activeds/pathname.c @@ -252,7 +252,7 @@ static HRESULT WINAPI path_Retrieve(IADsPathname *iface, LONG type, BSTR *adspat if (path->dn) len += wcslen(path->dn); *adspath = SysAllocStringLen(NULL, len); - if (!*adspath) return E_OUTOFMEMORY; + if (!*adspath) break; wcscpy(*adspath, path->provider); wcscat(*adspath, L"://"); @@ -263,10 +263,22 @@ static HRESULT WINAPI path_Retrieve(IADsPathname *iface, LONG type, BSTR *adspat } if (path->dn) wcscat(*adspath, path->dn); break; + + case ADS_FORMAT_PROVIDER: + *adspath = SysAllocString(path->provider); + break; + + case ADS_FORMAT_SERVER: + *adspath = path->provider ? SysAllocString(path->server) : SysAllocStringLen(NULL, 0); + break; + + case ADS_FORMAT_X500_DN: + *adspath = path->dn ? SysAllocString(path->dn) : SysAllocStringLen(NULL, 0); + break; } TRACE("=> %s\n", debugstr_w(*adspath)); - return S_OK; + return *adspath ? S_OK : E_OUTOFMEMORY; } static HRESULT WINAPI path_GetNumElements(IADsPathname *iface, LONG *count) diff --git a/dlls/activeds/tests/activeds.c b/dlls/activeds/tests/activeds.c index 6e5ecdf573..9ecab56034 100644 --- a/dlls/activeds/tests/activeds.c +++ b/dlls/activeds/tests/activeds.c @@ -151,13 +151,11 @@ todo_wine 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); hr = IADsPathname_Retrieve(path, ADS_FORMAT_SERVER, &bstr); ok(hr == S_OK, "got %#x\n", hr); -todo_wine ok(!wcscmp(bstr, L"sample:123"), "got %s\n", wine_dbgstr_w(bstr)); SysFreeString(bstr);