2 * Copyright 2020 Dmitry Timoshkov
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.
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.
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
26 DWORD
map_ldap_error(DWORD err
)
30 case LDAP_SUCCESS
: return ERROR_SUCCESS
;
31 case LDAP_OPERATIONS_ERROR
: return ERROR_DS_OPERATIONS_ERROR
;
32 case LDAP_PROTOCOL_ERROR
: return ERROR_DS_PROTOCOL_ERROR
;
33 case LDAP_TIMELIMIT_EXCEEDED
: return ERROR_DS_TIMELIMIT_EXCEEDED
;
34 case LDAP_SIZELIMIT_EXCEEDED
: return ERROR_DS_SIZELIMIT_EXCEEDED
;
35 case LDAP_COMPARE_FALSE
: return ERROR_DS_COMPARE_FALSE
;
36 case LDAP_COMPARE_TRUE
: return ERROR_DS_COMPARE_TRUE
;
37 case LDAP_AUTH_METHOD_NOT_SUPPORTED
: return ERROR_DS_AUTH_METHOD_NOT_SUPPORTED
;
38 case LDAP_STRONG_AUTH_REQUIRED
: return ERROR_DS_STRONG_AUTH_REQUIRED
;
39 case LDAP_REFERRAL_V2
: return ERROR_DS_REFERRAL
;
40 case LDAP_REFERRAL
: return ERROR_DS_REFERRAL
;
41 case LDAP_ADMIN_LIMIT_EXCEEDED
: return ERROR_DS_ADMIN_LIMIT_EXCEEDED
;
42 case LDAP_UNAVAILABLE_CRIT_EXTENSION
: return ERROR_DS_UNAVAILABLE_CRIT_EXTENSION
;
43 case LDAP_CONFIDENTIALITY_REQUIRED
: return ERROR_DS_CONFIDENTIALITY_REQUIRED
;
44 case LDAP_NO_SUCH_ATTRIBUTE
: return ERROR_DS_NO_ATTRIBUTE_OR_VALUE
;
45 case LDAP_UNDEFINED_TYPE
: return ERROR_DS_ATTRIBUTE_TYPE_UNDEFINED
;
46 case LDAP_INAPPROPRIATE_MATCHING
: return ERROR_DS_INAPPROPRIATE_MATCHING
;
47 case LDAP_CONSTRAINT_VIOLATION
: return ERROR_DS_CONSTRAINT_VIOLATION
;
48 case LDAP_ATTRIBUTE_OR_VALUE_EXISTS
: return ERROR_DS_ATTRIBUTE_OR_VALUE_EXISTS
;
49 case LDAP_INVALID_SYNTAX
: return ERROR_DS_INVALID_ATTRIBUTE_SYNTAX
;
50 case LDAP_NO_SUCH_OBJECT
: return ERROR_DS_NO_SUCH_OBJECT
;
51 case LDAP_ALIAS_PROBLEM
: return ERROR_DS_ALIAS_PROBLEM
;
52 case LDAP_INVALID_DN_SYNTAX
: return ERROR_DS_INVALID_DN_SYNTAX
;
53 case LDAP_IS_LEAF
: return ERROR_DS_IS_LEAF
;
54 case LDAP_ALIAS_DEREF_PROBLEM
: return ERROR_DS_ALIAS_DEREF_PROBLEM
;
55 case LDAP_INAPPROPRIATE_AUTH
: return ERROR_DS_INAPPROPRIATE_AUTH
;
56 case LDAP_INVALID_CREDENTIALS
: return ERROR_DS_SEC_DESC_INVALID
;
57 case LDAP_INSUFFICIENT_RIGHTS
: return ERROR_DS_INSUFF_ACCESS_RIGHTS
;
58 case LDAP_BUSY
: return ERROR_DS_BUSY
;
59 case LDAP_UNAVAILABLE
: return ERROR_DS_UNAVAILABLE
;
60 case LDAP_UNWILLING_TO_PERFORM
: return ERROR_DS_UNWILLING_TO_PERFORM
;
61 case LDAP_LOOP_DETECT
: return ERROR_DS_LOOP_DETECT
;
62 case LDAP_SORT_CONTROL_MISSING
: return ERROR_DS_SORT_CONTROL_MISSING
;
63 case LDAP_OFFSET_RANGE_ERROR
: return ERROR_DS_OFFSET_RANGE_ERROR
;
64 case LDAP_NAMING_VIOLATION
: return ERROR_DS_NAMING_VIOLATION
;
65 case LDAP_OBJECT_CLASS_VIOLATION
: return ERROR_DS_OBJ_CLASS_VIOLATION
;
66 case LDAP_NOT_ALLOWED_ON_NONLEAF
: return ERROR_DS_CANT_ON_NON_LEAF
;
67 case LDAP_NOT_ALLOWED_ON_RDN
: return ERROR_DS_CANT_ON_RDN
;
68 case LDAP_ALREADY_EXISTS
: return ERROR_ALREADY_EXISTS
;
69 case LDAP_NO_OBJECT_CLASS_MODS
: return ERROR_DS_CANT_MOD_OBJ_CLASS
;
70 case LDAP_RESULTS_TOO_LARGE
: return ERROR_DS_OBJECT_RESULTS_TOO_LARGE
;
71 case LDAP_AFFECTS_MULTIPLE_DSAS
: return ERROR_DS_AFFECTS_MULTIPLE_DSAS
;
72 case LDAP_SERVER_DOWN
: return ERROR_DS_SERVER_DOWN
;
73 case LDAP_LOCAL_ERROR
: return ERROR_DS_LOCAL_ERROR
;
74 case LDAP_ENCODING_ERROR
: return ERROR_DS_ENCODING_ERROR
;
75 case LDAP_DECODING_ERROR
: return ERROR_DS_DECODING_ERROR
;
76 case LDAP_TIMEOUT
: return ERROR_TIMEOUT
;
77 case LDAP_AUTH_UNKNOWN
: return ERROR_DS_AUTH_UNKNOWN
;
78 case LDAP_FILTER_ERROR
: return ERROR_DS_FILTER_UNKNOWN
;
79 case LDAP_USER_CANCELLED
: return ERROR_CANCELLED
;
80 case LDAP_PARAM_ERROR
: return ERROR_DS_PARAM_ERROR
;
81 case LDAP_NO_MEMORY
: return ERROR_NOT_ENOUGH_MEMORY
;
82 case LDAP_CONNECT_ERROR
: return ERROR_CONNECTION_UNAVAIL
;
83 case LDAP_NOT_SUPPORTED
: return ERROR_DS_NOT_SUPPORTED
;
84 case LDAP_CONTROL_NOT_FOUND
: return ERROR_DS_CONTROL_NOT_FOUND
;
85 case LDAP_NO_RESULTS_RETURNED
: return ERROR_DS_NO_RESULTS_RETURNED
;
86 case LDAP_MORE_RESULTS_TO_RETURN
: return ERROR_MORE_DATA
;
87 case LDAP_CLIENT_LOOP
: return ERROR_DS_CLIENT_LOOP
;
88 case LDAP_REFERRAL_LIMIT_EXCEEDED
: return ERROR_DS_REFERRAL_LIMIT_EXCEEDED
;