adsldp: Map "1.2.840.113556.1.4.906" to ADSTYPE_LARGE_INTEGER.

Signed-off-by: Dmitry Timoshkov <dmitry@baikal.ru>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Dmitry Timoshkov 2020-04-07 18:14:05 +08:00 committed by Alexandre Julliard
parent c7656ffd18
commit 38e95ed222
2 changed files with 19 additions and 6 deletions

View File

@ -1478,26 +1478,37 @@ static HRESULT add_column_values(LDAP_namespace *ldap, struct ldap_search_contex
}
case ADSTYPE_INTEGER:
case ADSTYPE_LARGE_INTEGER:
{
WCHAR **values = ldap_get_valuesW(ldap->ld, ldap_ctx->entry, name);
struct berval **values = ldap_get_values_lenW(ldap->ld, ldap_ctx->entry, name);
if (!values)
return E_ADS_COLUMN_NOT_SET;
count = ldap_count_valuesW(values);
count = ldap_count_values_len(values);
col->pADsValues = heap_alloc_zero(count * sizeof(col->pADsValues[0]));
if (!col->pADsValues)
{
ldap_value_freeW(values);
ldap_value_free_len(values);
return E_OUTOFMEMORY;
}
for (i = 0; i < count; i++)
{
col->pADsValues[i].u.Integer = wcstol(values[i], NULL, 10);
TRACE("%s => %d\n", debugstr_w(values[i]), col->pADsValues[i].u.Integer);
col->pADsValues[i].dwType = type;
if (type == ADSTYPE_LARGE_INTEGER)
{
col->pADsValues[i].u.LargeInteger.QuadPart = _atoi64(values[i]->bv_val);
TRACE("%s => %s\n", debugstr_an(values[i]->bv_val, values[i]->bv_len), wine_dbgstr_longlong(col->pADsValues[i].u.LargeInteger.QuadPart));
}
else
{
col->pADsValues[i].u.Integer = atol(values[i]->bv_val);
TRACE("%s => %d\n", debugstr_an(values[i]->bv_val, values[i]->bv_len), col->pADsValues[i].u.Integer);
}
}
ldap_value_freeW(values);
ldap_value_free_len(values);
col->hReserved = NULL;
break;
}

View File

@ -101,6 +101,8 @@ ADSTYPEENUM get_schema_type(const WCHAR *name, const struct attribute_type *at,
return ADSTYPE_CASE_IGNORE_STRING;
if (!wcscmp(type->syntax, L"1.3.6.1.4.1.1466.115.121.1.40"))
return ADSTYPE_OCTET_STRING;
if (!wcscmp(type->syntax, L"1.2.840.113556.1.4.906"))
return ADSTYPE_LARGE_INTEGER;
if (!wcscmp(type->syntax, L"1.2.840.113556.1.4.907"))
return ADSTYPE_NT_SECURITY_DESCRIPTOR;