Dmitry Timoshkov : adsldp: Fix IDirectorySearch::GetColumn() behaviour for not found case.
Alexandre Julliard
julliard at winehq.org
Mon Mar 30 16:24:27 CDT 2020
Module: wine
Branch: master
Commit: 57f3d503c42138a41cfd2b7ba69cb2369faf9c00
URL: https://source.winehq.org/git/wine.git/?a=commit;h=57f3d503c42138a41cfd2b7ba69cb2369faf9c00
Author: Dmitry Timoshkov <dmitry at baikal.ru>
Date: Mon Mar 30 15:58:06 2020 +0800
adsldp: Fix IDirectorySearch::GetColumn() behaviour for not found case.
Signed-off-by: Dmitry Timoshkov <dmitry at baikal.ru>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
---
dlls/adsldp/adsldp.c | 6 +++++-
dlls/adsldp/tests/ldap.c | 12 ++++++++++++
2 files changed, 17 insertions(+), 1 deletion(-)
diff --git a/dlls/adsldp/adsldp.c b/dlls/adsldp/adsldp.c
index 61162f08a3..5ab7948b1f 100644
--- a/dlls/adsldp/adsldp.c
+++ b/dlls/adsldp/adsldp.c
@@ -1434,7 +1434,11 @@ exit:
}
values = ldap_get_values_lenW(ldap->ld, ldap_ctx->entry, name);
- if (!values) return ERROR_DS_NO_ATTRIBUTE_OR_VALUE;
+ if (!values)
+ {
+ memset(col, 0, sizeof(*col));
+ return E_ADS_COLUMN_NOT_SET;
+ }
count = ldap_count_values_len(values);
diff --git a/dlls/adsldp/tests/ldap.c b/dlls/adsldp/tests/ldap.c
index 3abbbdadb0..aec5bf89ee 100644
--- a/dlls/adsldp/tests/ldap.c
+++ b/dlls/adsldp/tests/ldap.c
@@ -417,6 +417,18 @@ todo_wine
ok(hr == E_ADS_BAD_PARAMETER, "got %#x\n", hr);
}
+ hr = IDirectorySearch_GetFirstRow(ds, sh);
+ ok(hr == S_OK, "got %#x\n", hr);
+
+ memset(&col, 0x55, sizeof(col));
+ hr = IDirectorySearch_GetColumn(ds, sh, (WCHAR *)L"deadbeef", &col);
+ ok(hr == E_ADS_COLUMN_NOT_SET, "got %#x\n", hr);
+ ok(!col.pszAttrName, "got %p\n", col.pszAttrName);
+ ok(col.dwADsType == ADSTYPE_INVALID || broken(col.dwADsType != ADSTYPE_INVALID) /* XP */, "got %d\n", col.dwADsType);
+ ok(!col.pADsValues, "got %p\n", col.pADsValues);
+ ok(!col.dwNumValues, "got %u\n", col.dwNumValues);
+ ok(!col.hReserved, "got %p\n", col.hReserved);
+
hr = IDirectorySearch_CloseSearchHandle(ds, sh);
ok(hr == S_OK, "got %#x\n", hr);
More information about the wine-cvs
mailing list