Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
wine-mirror
GitHub Repository: wine-mirror/wine
Path: blob/master/dlls/adsldp/adsldp_private.h
4389 views
1
/*
2
* Copyright 2020 Dmitry Timoshkov
3
*
4
* This library is free software; you can redistribute it and/or
5
* modify it under the terms of the GNU Lesser General Public
6
* License as published by the Free Software Foundation; either
7
* version 2.1 of the License, or (at your option) any later version.
8
*
9
* This library is distributed in the hope that it will be useful,
10
* but WITHOUT ANY WARRANTY; without even the implied warranty of
11
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12
* Lesser General Public License for more details.
13
*
14
* You should have received a copy of the GNU Lesser General Public
15
* License along with this library; if not, write to the Free Software
16
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
17
*/
18
19
#ifndef _ADSLDP_PRIVATE_H
20
#define _ADSLDP_PRIVATE_H
21
22
static inline LPWSTR strnUtoW( LPCSTR str, DWORD inlen, DWORD *outlen )
23
{
24
LPWSTR ret = NULL;
25
*outlen = 0;
26
if (str)
27
{
28
DWORD len = MultiByteToWideChar( CP_UTF8, 0, str, inlen, NULL, 0 );
29
if ((ret = malloc( (len + 1) * sizeof(WCHAR) )))
30
{
31
MultiByteToWideChar( CP_UTF8, 0, str, inlen, ret, len );
32
ret[len] = 0;
33
*outlen = len;
34
}
35
}
36
return ret;
37
}
38
39
struct attribute_type
40
{
41
WCHAR *oid;
42
WCHAR *name;
43
ULONG name_count;
44
WCHAR *syntax;
45
int single_value;
46
};
47
48
DWORD map_ldap_error(DWORD);
49
struct attribute_type *load_schema(LDAP *ld, ULONG *, ULONG *);
50
ADSTYPEENUM get_schema_type(const WCHAR *, const struct attribute_type *, ULONG, ULONG);
51
void free_attribute_types(struct attribute_type *, ULONG);
52
53
#endif
54
55