1 /***********************************************************************\ 2 * winldap.d * 3 * * 4 * Windows API header module * 5 * * 6 * Translated from MinGW Windows headers * 7 * by Stewart Gordon * 8 * * 9 * Placed into public domain * 10 \***********************************************************************/ 11 module win32.winldap; 12 13 /* Comment from MinGW 14 winldap.h - Header file for the Windows LDAP API 15 16 Written by Filip Navara <xnavara@volny.cz> 17 18 References: 19 The C LDAP Application Program Interface 20 http://www.watersprings.org/pub/id/draft-ietf-ldapext-ldap-c-api-05.txt 21 22 Lightweight Directory Access Protocol Reference 23 http://msdn.microsoft.com/library/en-us/netdir/ldap/ldap_reference.asp 24 25 This library is distributed in the hope that it will be useful, 26 but WITHOUT ANY WARRANTY; without even the implied warranty of 27 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 28 */ 29 30 import win32.schannel, win32.winber; 31 private import win32.wincrypt, win32.windef; 32 version(Tango){ 33 private import tango.stdc.stdio; 34 } 35 36 align(4): 37 38 enum { 39 LDAP_VERSION1 = 1, 40 LDAP_VERSION2 = 2, 41 LDAP_VERSION3 = 3, 42 LDAP_VERSION = LDAP_VERSION2, 43 LDAP_VERSION_MIN = LDAP_VERSION2, 44 LDAP_VERSION_MAX = LDAP_VERSION3 45 } 46 47 /* MinGW defines ANSI and Unicode versions as LDAP_VENDOR_NAME and 48 * LDAP_VENDOR_NAME_W respectively; similarly with other string constants 49 * defined in this module. 50 */ 51 const TCHAR[] LDAP_VENDOR_NAME = "Microsoft Corporation."; 52 53 const LDAP_API_VERSION = 2004; 54 const LDAP_VENDOR_VERSION = 510; 55 const LDAP_API_INFO_VERSION = 1; 56 const LDAP_FEATURE_INFO_VERSION = 1; 57 58 enum { 59 LDAP_SUCCESS = 0x00, 60 LDAP_OPT_SUCCESS = LDAP_SUCCESS, 61 LDAP_OPERATIONS_ERROR, 62 LDAP_PROTOCOL_ERROR, 63 LDAP_TIMELIMIT_EXCEEDED, 64 LDAP_SIZELIMIT_EXCEEDED, 65 LDAP_COMPARE_FALSE, 66 LDAP_COMPARE_TRUE, 67 LDAP_STRONG_AUTH_NOT_SUPPORTED, 68 LDAP_AUTH_METHOD_NOT_SUPPORTED = LDAP_STRONG_AUTH_NOT_SUPPORTED, 69 LDAP_STRONG_AUTH_REQUIRED, 70 LDAP_REFERRAL_V2, 71 LDAP_PARTIAL_RESULTS = LDAP_REFERRAL_V2, 72 LDAP_REFERRAL, 73 LDAP_ADMIN_LIMIT_EXCEEDED, 74 LDAP_UNAVAILABLE_CRIT_EXTENSION, 75 LDAP_CONFIDENTIALITY_REQUIRED, 76 LDAP_SASL_BIND_IN_PROGRESS, // = 0x0e 77 LDAP_NO_SUCH_ATTRIBUTE = 0x10, 78 LDAP_UNDEFINED_TYPE, 79 LDAP_INAPPROPRIATE_MATCHING, 80 LDAP_CONSTRAINT_VIOLATION, 81 LDAP_TYPE_OR_VALUE_EXISTS, 82 LDAP_ATTRIBUTE_OR_VALUE_EXISTS = LDAP_TYPE_OR_VALUE_EXISTS, 83 LDAP_INVALID_SYNTAX, // = 0x15 84 LDAP_NO_SUCH_OBJECT = 0x20, 85 LDAP_ALIAS_PROBLEM, 86 LDAP_INVALID_DN_SYNTAX, 87 LDAP_IS_LEAF, 88 LDAP_ALIAS_DEREF_PROBLEM, // = 0x24 89 LDAP_INAPPROPRIATE_AUTH = 0x30, 90 LDAP_INVALID_CREDENTIALS, 91 LDAP_INSUFFICIENT_ACCESS, 92 LDAP_INSUFFICIENT_RIGHTS = LDAP_INSUFFICIENT_ACCESS, 93 LDAP_BUSY, 94 LDAP_UNAVAILABLE, 95 LDAP_UNWILLING_TO_PERFORM, 96 LDAP_LOOP_DETECT, // = 0x36 97 LDAP_NAMING_VIOLATION = 0x40, 98 LDAP_OBJECT_CLASS_VIOLATION, 99 LDAP_NOT_ALLOWED_ON_NONLEAF, 100 LDAP_NOT_ALLOWED_ON_RDN, 101 LDAP_ALREADY_EXISTS, 102 LDAP_NO_OBJECT_CLASS_MODS, 103 LDAP_RESULTS_TOO_LARGE, 104 LDAP_AFFECTS_MULTIPLE_DSAS, // = 0x47 105 LDAP_OTHER = 0x50, 106 LDAP_SERVER_DOWN, 107 LDAP_LOCAL_ERROR, 108 LDAP_ENCODING_ERROR, 109 LDAP_DECODING_ERROR, 110 LDAP_TIMEOUT, 111 LDAP_AUTH_UNKNOWN, 112 LDAP_FILTER_ERROR, 113 LDAP_USER_CANCELLED, 114 LDAP_PARAM_ERROR, 115 LDAP_NO_MEMORY, 116 LDAP_CONNECT_ERROR, 117 LDAP_NOT_SUPPORTED, 118 LDAP_CONTROL_NOT_FOUND, 119 LDAP_NO_RESULTS_RETURNED, 120 LDAP_MORE_RESULTS_TO_RETURN, 121 LDAP_CLIENT_LOOP, 122 LDAP_REFERRAL_LIMIT_EXCEEDED // = 0x61 123 } 124 125 enum { 126 LDAP_PORT = 389, 127 LDAP_SSL_PORT = 636, 128 LDAP_GC_PORT = 3268, 129 LDAP_SSL_GC_PORT = 3269 130 } 131 132 const void* 133 LDAP_OPT_OFF = null, 134 LDAP_OPT_ON = cast(void*) 1; 135 136 enum { 137 LDAP_OPT_API_INFO = 0x00, 138 LDAP_OPT_DESC, 139 LDAP_OPT_DEREF, 140 LDAP_OPT_SIZELIMIT, 141 LDAP_OPT_TIMELIMIT, 142 LDAP_OPT_THREAD_FN_PTRS, 143 LDAP_OPT_REBIND_FN, 144 LDAP_OPT_REBIND_ARG, 145 LDAP_OPT_REFERRALS, 146 LDAP_OPT_RESTART, 147 LDAP_OPT_SSL, 148 LDAP_OPT_TLS = LDAP_OPT_SSL, 149 LDAP_OPT_IO_FN_PTRS, // = 0x0b 150 LDAP_OPT_CACHE_FN_PTRS = 0x0d, 151 LDAP_OPT_CACHE_STRATEGY, 152 LDAP_OPT_CACHE_ENABLE, 153 LDAP_OPT_REFERRAL_HOP_LIMIT, 154 LDAP_OPT_PROTOCOL_VERSION, 155 LDAP_OPT_VERSION = LDAP_OPT_PROTOCOL_VERSION, 156 LDAP_OPT_SERVER_CONTROLS, 157 LDAP_OPT_CLIENT_CONTROLS, // = 0x13 158 LDAP_OPT_API_FEATURE_INFO = 0x15, 159 LDAP_OPT_HOST_NAME = 0x30, 160 LDAP_OPT_ERROR_NUMBER, 161 LDAP_OPT_ERROR_STRING, 162 LDAP_OPT_SERVER_ERROR, 163 LDAP_OPT_SERVER_EXT_ERROR, // = 0x34 164 LDAP_OPT_PING_KEEP_ALIVE = 0x36, 165 LDAP_OPT_PING_WAIT_TIME, 166 LDAP_OPT_PING_LIMIT, // = 0x38 167 LDAP_OPT_DNSDOMAIN_NAME = 0x3b, 168 LDAP_OPT_GETDSNAME_FLAGS = 0x3d, 169 LDAP_OPT_HOST_REACHABLE, 170 LDAP_OPT_PROMPT_CREDENTIALS, 171 LDAP_OPT_TCP_KEEPALIVE, // = 0x40 172 LDAP_OPT_REFERRAL_CALLBACK = 0x70, 173 LDAP_OPT_CLIENT_CERTIFICATE = 0x80, 174 LDAP_OPT_SERVER_CERTIFICATE, // = 0x81 175 LDAP_OPT_AUTO_RECONNECT = 0x91, 176 LDAP_OPT_SSPI_FLAGS, 177 LDAP_OPT_SSL_INFO, 178 LDAP_OPT_TLS_INFO = LDAP_OPT_SSL_INFO, 179 LDAP_OPT_REF_DEREF_CONN_PER_MSG, 180 LDAP_OPT_SIGN, 181 LDAP_OPT_ENCRYPT, 182 LDAP_OPT_SASL_METHOD, 183 LDAP_OPT_AREC_EXCLUSIVE, 184 LDAP_OPT_SECURITY_CONTEXT, 185 LDAP_OPT_ROOTDSE_CACHE // = 0x9a 186 } 187 188 enum { 189 LDAP_DEREF_NEVER, 190 LDAP_DEREF_SEARCHING, 191 LDAP_DEREF_FINDING, 192 LDAP_DEREF_ALWAYS 193 } 194 195 const LDAP_NO_LIMIT = 0; 196 197 const TCHAR[] LDAP_CONTROL_REFERRALS = "1.2.840.113556.1.4.616"; 198 199 // FIXME: check type (declared with U suffix in MinGW) 200 enum : uint { 201 LDAP_CHASE_SUBORDINATE_REFERRALS = 0x20, 202 LDAP_CHASE_EXTERNAL_REFERRALS = 0x40 203 } 204 205 enum { 206 LDAP_SCOPE_DEFAULT = -1, 207 LDAP_SCOPE_BASE, 208 LDAP_SCOPE_ONELEVEL, 209 LDAP_SCOPE_SUBTREE 210 } 211 212 enum { 213 LDAP_MOD_ADD, 214 LDAP_MOD_DELETE, 215 LDAP_MOD_REPLACE, 216 LDAP_MOD_BVALUES = 0x80 217 } 218 219 enum : int { 220 LDAP_RES_BIND = 0x61, 221 LDAP_RES_SEARCH_ENTRY = 0x64, 222 LDAP_RES_SEARCH_RESULT = 0x65, 223 LDAP_RES_MODIFY = 0x67, 224 LDAP_RES_ADD = 0x69, 225 LDAP_RES_DELETE = 0x6b, 226 LDAP_RES_MODRDN = 0x6d, 227 LDAP_RES_COMPARE = 0x6f, 228 LDAP_RES_SEARCH_REFERENCE = 0x73, 229 LDAP_RES_EXTENDED = 0x78, 230 LDAP_RES_ANY = -1 231 } 232 233 enum { 234 LDAP_MSG_ONE, 235 LDAP_MSG_ALL, 236 LDAP_MSG_RECEIVED 237 } 238 239 const TCHAR[] 240 LDAP_SERVER_SORT_OID = "1.2.840.113556.1.4.473", 241 LDAP_SERVER_RESP_SORT_OID = "1.2.840.113556.1.4.474", 242 LDAP_PAGED_RESULT_OID_STRING = "1.2.840.113556.1.4.319", 243 LDAP_CONTROL_VLVREQUEST = "2.16.840.1.113730.3.4.9", 244 LDAP_CONTROL_VLVRESPONSE = "2.16.840.1.113730.3.4.10", 245 LDAP_START_TLS_OID = "1.3.6.1.4.1.1466.20037", 246 LDAP_TTL_EXTENDED_OP_OID = "1.3.6.1.4.1.1466.101.119.1"; 247 248 enum { 249 LDAP_AUTH_NONE = 0x00U, 250 LDAP_AUTH_SIMPLE = 0x80U, 251 LDAP_AUTH_SASL = 0x83U, 252 LDAP_AUTH_OTHERKIND = 0x86U, 253 LDAP_AUTH_EXTERNAL = LDAP_AUTH_OTHERKIND | 0x0020U, 254 LDAP_AUTH_SICILY = LDAP_AUTH_OTHERKIND | 0x0200U, 255 LDAP_AUTH_NEGOTIATE = LDAP_AUTH_OTHERKIND | 0x0400U, 256 LDAP_AUTH_MSN = LDAP_AUTH_OTHERKIND | 0x0800U, 257 LDAP_AUTH_NTLM = LDAP_AUTH_OTHERKIND | 0x1000U, 258 LDAP_AUTH_DIGEST = LDAP_AUTH_OTHERKIND | 0x4000U, 259 LDAP_AUTH_DPA = LDAP_AUTH_OTHERKIND | 0x2000U, 260 LDAP_AUTH_SSPI = LDAP_AUTH_NEGOTIATE 261 } 262 263 enum { 264 LDAP_FILTER_AND = 0xa0, 265 LDAP_FILTER_OR, 266 LDAP_FILTER_NOT, 267 LDAP_FILTER_EQUALITY, 268 LDAP_FILTER_SUBSTRINGS, 269 LDAP_FILTER_GE, 270 LDAP_FILTER_LE, // = 0xa6 271 LDAP_FILTER_APPROX = 0xa8, 272 LDAP_FILTER_EXTENSIBLE, 273 LDAP_FILTER_PRESENT = 0x87 274 } 275 276 enum { 277 LDAP_SUBSTRING_INITIAL = 0x80, 278 LDAP_SUBSTRING_ANY, 279 LDAP_SUBSTRING_FINAL 280 } 281 282 struct LDAP { 283 char[76] Reserved; 284 PCHAR ld_host; 285 ULONG ld_version; 286 UCHAR ld_lberoptions; 287 int ld_deref; 288 int ld_timelimit; 289 int ld_sizelimit; 290 int ld_errno; 291 PCHAR ld_matched; 292 PCHAR ld_error; 293 } 294 alias LDAP* PLDAP; 295 296 struct LDAPMessage { 297 ULONG lm_msgid; 298 ULONG lm_msgtype; 299 BerElement* lm_ber; 300 LDAPMessage* lm_chain; 301 LDAPMessage* lm_next; 302 ULONG lm_time; 303 } 304 alias LDAPMessage* PLDAPMessage; 305 306 struct LDAP_TIMEVAL { 307 LONG tv_sec; 308 LONG tv_usec; 309 } 310 alias LDAP_TIMEVAL* PLDAP_TIMEVAL; 311 312 struct LDAPAPIInfoA { 313 int ldapai_info_version; 314 int ldapai_api_version; 315 int ldapai_protocol_version; 316 char** ldapai_extensions; 317 char* ldapai_vendor_name; 318 int ldapai_vendor_version; 319 } 320 alias LDAPAPIInfoA* PLDAPAPIInfoA; 321 322 struct LDAPAPIInfoW { 323 int ldapai_info_version; 324 int ldapai_api_version; 325 int ldapai_protocol_version; 326 PWCHAR* ldapai_extensions; 327 PWCHAR ldapai_vendor_name; 328 int ldapai_vendor_version; 329 } 330 alias LDAPAPIInfoW* PLDAPAPIInfoW; 331 332 struct LDAPAPIFeatureInfoA { 333 int ldapaif_info_version; 334 char* ldapaif_name; 335 int ldapaif_version; 336 } 337 alias LDAPAPIFeatureInfoA* PLDAPAPIFeatureInfoA; 338 339 struct LDAPAPIFeatureInfoW { 340 int ldapaif_info_version; 341 PWCHAR ldapaif_name; 342 int ldapaif_version; 343 } 344 alias LDAPAPIFeatureInfoW* PLDAPAPIFeatureInfoW; 345 346 struct LDAPControlA { 347 PCHAR ldctl_oid; 348 BerValue ldctl_value; 349 BOOLEAN ldctl_iscritical; 350 } 351 alias LDAPControlA* PLDAPControlA; 352 353 struct LDAPControlW { 354 PWCHAR ldctl_oid; 355 BerValue ldctl_value; 356 BOOLEAN ldctl_iscritical; 357 } 358 alias LDAPControlW* PLDAPControlW; 359 360 /* Do we really need these? In MinGW, LDAPModA/W have only mod_op, mod_type 361 * and mod_vals, and macros are used to simulate anonymous unions in those 362 * structures. 363 */ 364 union mod_vals_u_tA { 365 PCHAR* modv_strvals; 366 BerValue** modv_bvals; 367 } 368 369 union mod_vals_u_tW { 370 PWCHAR* modv_strvals; 371 BerValue** modv_bvals; 372 } 373 374 struct LDAPModA { 375 ULONG mod_op; 376 PCHAR mod_type; 377 378 union { 379 mod_vals_u_tA mod_vals; 380 // The following members are defined as macros in MinGW. 381 PCHAR* mod_values; 382 BerValue** mod_bvalues; 383 } 384 } 385 alias LDAPModA* PLDAPModA; 386 387 struct LDAPModW { 388 ULONG mod_op; 389 PWCHAR mod_type; 390 391 union { 392 mod_vals_u_tW mod_vals; 393 // The following members are defined as macros in MinGW. 394 PWCHAR* mod_values; 395 BerValue** mod_bvalues; 396 } 397 } 398 alias LDAPModW* PLDAPModW; 399 400 /* Opaque structure 401 * http://msdn.microsoft.com/library/en-us/ldap/ldap/ldapsearch.asp 402 */ 403 struct LDAPSearch; 404 alias LDAPSearch* PLDAPSearch; 405 406 struct LDAPSortKeyA { 407 PCHAR sk_attrtype; 408 PCHAR sk_matchruleoid; 409 BOOLEAN sk_reverseorder; 410 } 411 alias LDAPSortKeyA* PLDAPSortKeyA; 412 413 struct LDAPSortKeyW { 414 PWCHAR sk_attrtype; 415 PWCHAR sk_matchruleoid; 416 BOOLEAN sk_reverseorder; 417 } 418 alias LDAPSortKeyW* PLDAPSortKeyW; 419 420 /* MinGW defines these as immediate function typedefs, which don't translate 421 * well into D. 422 */ 423 extern (C) { 424 alias ULONG function(PLDAP, PLDAP, PWCHAR, PCHAR, ULONG, PVOID, PVOID, 425 PLDAP*) QUERYFORCONNECTION; 426 alias BOOLEAN function(PLDAP, PLDAP, PWCHAR, PCHAR, PLDAP, ULONG, PVOID, 427 PVOID, ULONG) NOTIFYOFNEWCONNECTION; 428 alias ULONG function(PLDAP, PLDAP) DEREFERENCECONNECTION; 429 alias BOOLEAN function(PLDAP, PSecPkgContext_IssuerListInfoEx, 430 PCCERT_CONTEXT*) QUERYCLIENTCERT; 431 } 432 433 struct LDAP_REFERRAL_CALLBACK { 434 ULONG SizeOfCallbacks; 435 QUERYFORCONNECTION* QueryForConnection; 436 NOTIFYOFNEWCONNECTION* NotifyRoutine; 437 DEREFERENCECONNECTION* DereferenceRoutine; 438 } 439 alias LDAP_REFERRAL_CALLBACK* PLDAP_REFERRAL_CALLBACK; 440 441 struct LDAPVLVInfo { 442 int ldvlv_version; 443 uint ldvlv_before_count; 444 uint ldvlv_after_count; 445 uint ldvlv_offset; 446 uint ldvlv_count; 447 BerValue* ldvlv_attrvalue; 448 BerValue* ldvlv_context; 449 void* ldvlv_extradata; 450 } 451 452 /* 453 * Under Microsoft WinLDAP the function ldap_error is only stub. 454 * This macro uses LDAP structure to get error string and pass it to the user. 455 */ 456 private extern (C) int printf(in char* format, ...); 457 int ldap_perror(LDAP* handle, char* message) { 458 return printf("%s: %s\n", message, handle.ld_error); 459 } 460 461 /* FIXME: In MinGW, these are WINLDAPAPI == DECLSPEC_IMPORT. Linkage 462 * attribute? 463 */ 464 extern (C) { 465 PLDAP ldap_initA(PCHAR, ULONG); 466 PLDAP ldap_initW(PWCHAR, ULONG); 467 PLDAP ldap_openA(PCHAR, ULONG); 468 PLDAP ldap_openW(PWCHAR, ULONG); 469 PLDAP cldap_openA(PCHAR, ULONG); 470 PLDAP cldap_openW(PWCHAR, ULONG); 471 ULONG ldap_connect(LDAP*, LDAP_TIMEVAL*); 472 PLDAP ldap_sslinitA(PCHAR, ULONG, int); 473 PLDAP ldap_sslinitW(PWCHAR, ULONG, int); 474 ULONG ldap_start_tls_sA(LDAP*, PLDAPControlA*, PLDAPControlA*); 475 ULONG ldap_start_tls_sW(LDAP*, PLDAPControlW*, PLDAPControlW*); 476 BOOLEAN ldap_stop_tls_s(LDAP*); 477 ULONG ldap_get_optionA(LDAP*, int, void*); 478 ULONG ldap_get_optionW(LDAP*, int, void*); 479 ULONG ldap_set_optionA(LDAP*, int, void*); 480 ULONG ldap_set_optionW(LDAP*, int, void*); 481 ULONG ldap_control_freeA(LDAPControlA*); 482 ULONG ldap_control_freeW(LDAPControlW*); 483 ULONG ldap_controls_freeA(LDAPControlA**); 484 ULONG ldap_controls_freeW(LDAPControlW**); 485 ULONG ldap_free_controlsA(LDAPControlA**); 486 ULONG ldap_free_controlsW(LDAPControlW**); 487 ULONG ldap_sasl_bindA(LDAP*, PCHAR, PCHAR, BERVAL*, PLDAPControlA*, 488 PLDAPControlA*, int*); 489 ULONG ldap_sasl_bindW(LDAP*, PWCHAR, PWCHAR, BERVAL*, PLDAPControlW*, 490 PLDAPControlW*, int*); 491 ULONG ldap_sasl_bind_sA(LDAP*, PCHAR, PCHAR, BERVAL*, PLDAPControlA*, 492 PLDAPControlA*, PBERVAL*); 493 ULONG ldap_sasl_bind_sW(LDAP*, PWCHAR, PWCHAR, BERVAL*, PLDAPControlW*, 494 PLDAPControlW*, PBERVAL*); 495 ULONG ldap_simple_bindA(LDAP*, PCHAR, PCHAR); 496 ULONG ldap_simple_bindW(LDAP*, PWCHAR, PWCHAR); 497 ULONG ldap_simple_bind_sA(LDAP*, PCHAR, PCHAR); 498 ULONG ldap_simple_bind_sW(LDAP*, PWCHAR, PWCHAR); 499 ULONG ldap_unbind(LDAP*); 500 ULONG ldap_unbind_s(LDAP*); 501 ULONG ldap_search_extA(LDAP*, PCHAR, ULONG, PCHAR, PCHAR[], ULONG, 502 PLDAPControlW*, PLDAPControlW*, ULONG, ULONG, ULONG*); 503 ULONG ldap_search_extW(LDAP*, PWCHAR, ULONG, PWCHAR, PWCHAR[], ULONG, 504 PLDAPControlW*, PLDAPControlW*, ULONG, ULONG, ULONG*); 505 ULONG ldap_search_ext_sA(LDAP*, PCHAR, ULONG, PCHAR, PCHAR[], ULONG, 506 PLDAPControlA*, PLDAPControlA*, LDAP_TIMEVAL*, ULONG, LDAPMessage**); 507 ULONG ldap_search_ext_sW(LDAP*, PWCHAR, ULONG, PWCHAR, PWCHAR[], ULONG, 508 PLDAPControlW*, PLDAPControlW*, LDAP_TIMEVAL*, ULONG, LDAPMessage**); 509 ULONG ldap_searchA(LDAP*, PCHAR, ULONG, PCHAR, PCHAR[], ULONG); 510 ULONG ldap_searchW(LDAP*, PWCHAR, ULONG, PWCHAR, PWCHAR[], ULONG); 511 ULONG ldap_search_sA(LDAP*, PCHAR, ULONG, PCHAR, PCHAR[], ULONG, 512 LDAPMessage**); 513 ULONG ldap_search_sW(LDAP*, PWCHAR, ULONG, PWCHAR, PWCHAR[], ULONG, 514 LDAPMessage**); 515 ULONG ldap_search_stA(LDAP*, PCHAR, ULONG, PCHAR, PCHAR[], ULONG, 516 LDAP_TIMEVAL*, LDAPMessage**); 517 ULONG ldap_search_stW(LDAP*, PWCHAR, ULONG, PWCHAR, PWCHAR[], ULONG, 518 LDAP_TIMEVAL*, LDAPMessage**); 519 ULONG ldap_compare_extA(LDAP*, PCHAR, PCHAR, PCHAR, BerValue*, 520 PLDAPControlA*, PLDAPControlA*, ULONG*); 521 ULONG ldap_compare_extW(LDAP*, PWCHAR, PWCHAR, PWCHAR, BerValue*, 522 PLDAPControlW*, PLDAPControlW*, ULONG*); 523 ULONG ldap_compare_ext_sA(LDAP*, PCHAR, PCHAR, PCHAR, BerValue*, 524 PLDAPControlA*, PLDAPControlA*); 525 ULONG ldap_compare_ext_sW(LDAP*, PWCHAR, PWCHAR, PWCHAR, BerValue*, 526 PLDAPControlW*, PLDAPControlW*); 527 ULONG ldap_compareA(LDAP*, PCHAR, PCHAR, PCHAR); 528 ULONG ldap_compareW(LDAP*, PWCHAR, PWCHAR, PWCHAR); 529 ULONG ldap_compare_sA(LDAP*, PCHAR, PCHAR, PCHAR); 530 ULONG ldap_compare_sW(LDAP*, PWCHAR, PWCHAR, PWCHAR); 531 ULONG ldap_modify_extA(LDAP*, PCHAR, LDAPModA*[], PLDAPControlA*, 532 PLDAPControlA*, ULONG*); 533 ULONG ldap_modify_extW(LDAP*, PWCHAR, LDAPModW*[], PLDAPControlW*, 534 PLDAPControlW*, ULONG*); 535 ULONG ldap_modify_ext_sA(LDAP*, PCHAR, LDAPModA*[], PLDAPControlA*, 536 PLDAPControlA*); 537 ULONG ldap_modify_ext_sW(LDAP*, PWCHAR, LDAPModW*[], PLDAPControlW*, 538 PLDAPControlW*); 539 ULONG ldap_modifyA(LDAP*, PCHAR, LDAPModA*[]); 540 ULONG ldap_modifyW(LDAP*, PWCHAR, LDAPModW*[]); 541 ULONG ldap_modify_sA(LDAP*, PCHAR, LDAPModA*[]); 542 ULONG ldap_modify_sW(LDAP*, PWCHAR, LDAPModW*[]); 543 ULONG ldap_rename_extA(LDAP*, PCHAR, PCHAR, PCHAR, INT, PLDAPControlA*, 544 PLDAPControlA*, ULONG*); 545 ULONG ldap_rename_extW(LDAP*, PWCHAR, PWCHAR, PWCHAR, INT, PLDAPControlW*, 546 PLDAPControlW*, ULONG*); 547 ULONG ldap_rename_ext_sA(LDAP*, PCHAR, PCHAR, PCHAR, INT, 548 PLDAPControlA*, PLDAPControlA*); 549 ULONG ldap_rename_ext_sW(LDAP*, PWCHAR, PWCHAR, PWCHAR, INT, 550 PLDAPControlW*, PLDAPControlW*); 551 ULONG ldap_add_extA(LDAP*, PCHAR, LDAPModA*[], PLDAPControlA*, 552 PLDAPControlA*, ULONG*); 553 ULONG ldap_add_extW(LDAP*, PWCHAR, LDAPModW*[], PLDAPControlW*, 554 PLDAPControlW*, ULONG*); 555 ULONG ldap_add_ext_sA(LDAP*, PCHAR, LDAPModA*[], PLDAPControlA*, 556 PLDAPControlA*); 557 ULONG ldap_add_ext_sW(LDAP*, PWCHAR, LDAPModW*[], PLDAPControlW*, 558 PLDAPControlW*); 559 ULONG ldap_addA(LDAP*, PCHAR, LDAPModA*[]); 560 ULONG ldap_addW(LDAP*, PWCHAR, LDAPModW*[]); 561 ULONG ldap_add_sA(LDAP*, PCHAR, LDAPModA*[]); 562 ULONG ldap_add_sW(LDAP*, PWCHAR, LDAPModW*[]); 563 ULONG ldap_delete_extA(LDAP*, PCHAR, PLDAPControlA*, PLDAPControlA*, 564 ULONG*); 565 ULONG ldap_delete_extW(LDAP*, PWCHAR, PLDAPControlW*, PLDAPControlW*, 566 ULONG*); 567 ULONG ldap_delete_ext_sA(LDAP*, PCHAR, PLDAPControlA*, PLDAPControlA*); 568 ULONG ldap_delete_ext_sW(LDAP*, PWCHAR, PLDAPControlW*, PLDAPControlW*); 569 ULONG ldap_deleteA(LDAP*, PCHAR); 570 ULONG ldap_deleteW(LDAP*, PWCHAR); 571 ULONG ldap_delete_sA(LDAP*, PCHAR); 572 ULONG ldap_delete_sW(LDAP*, PWCHAR); 573 ULONG ldap_extended_operationA(LDAP*, PCHAR, BerValue*, PLDAPControlA*, 574 PLDAPControlA*, ULONG*); 575 ULONG ldap_extended_operationW(LDAP*, PWCHAR, BerValue*, PLDAPControlW*, 576 PLDAPControlW*, ULONG*); 577 ULONG ldap_extended_operation_sA(LDAP*, PCHAR, BerValue*, PLDAPControlA*, 578 PLDAPControlA*, PCHAR*, BerValue**); 579 ULONG ldap_extended_operation_sW(LDAP*, PWCHAR, BerValue*, PLDAPControlW*, 580 PLDAPControlW*, PWCHAR*, BerValue**); 581 ULONG ldap_close_extended_op(LDAP*, ULONG); 582 ULONG ldap_abandon(LDAP*, ULONG); 583 ULONG ldap_result(LDAP*, ULONG, ULONG, LDAP_TIMEVAL*, LDAPMessage**); 584 ULONG ldap_msgfree(LDAPMessage*); 585 ULONG ldap_parse_resultA(LDAP*, LDAPMessage*, ULONG*, PCHAR*, PCHAR*, 586 PCHAR**, PLDAPControlA**, BOOLEAN); 587 ULONG ldap_parse_resultW(LDAP*, LDAPMessage*, ULONG*, PWCHAR*, PWCHAR*, 588 PWCHAR**, PLDAPControlW**, BOOLEAN); 589 ULONG ldap_parse_extended_resultA(LDAP, LDAPMessage*, PCHAR*, BerValue**, 590 BOOLEAN); 591 ULONG ldap_parse_extended_resultW(LDAP, LDAPMessage*, PWCHAR*, BerValue**, 592 BOOLEAN); 593 PCHAR ldap_err2stringA(ULONG); 594 PWCHAR ldap_err2stringW(ULONG); 595 ULONG LdapGetLastError(); 596 ULONG LdapMapErrorToWin32(ULONG); 597 ULONG ldap_result2error(LDAP*, LDAPMessage*, ULONG); 598 PLDAPMessage ldap_first_entry(LDAP*, LDAPMessage*); 599 PLDAPMessage ldap_next_entry(LDAP*, LDAPMessage*); 600 PLDAPMessage ldap_first_reference(LDAP*, LDAPMessage*); 601 PLDAPMessage ldap_next_reference(LDAP*, LDAPMessage*); 602 ULONG ldap_count_entries(LDAP*, LDAPMessage*); 603 ULONG ldap_count_references(LDAP*, LDAPMessage*); 604 PCHAR ldap_first_attributeA(LDAP*, LDAPMessage*, BerElement**); 605 PWCHAR ldap_first_attributeW(LDAP*, LDAPMessage*, BerElement**); 606 PCHAR ldap_next_attributeA(LDAP*, LDAPMessage*, BerElement*); 607 PWCHAR ldap_next_attributeW(LDAP*, LDAPMessage*, BerElement*); 608 VOID ldap_memfreeA(PCHAR); 609 VOID ldap_memfreeW(PWCHAR); 610 PCHAR* ldap_get_valuesA(LDAP*, LDAPMessage*, PCHAR); 611 PWCHAR* ldap_get_valuesW(LDAP*, LDAPMessage*, PWCHAR); 612 BerValue** ldap_get_values_lenA(LDAP*, LDAPMessage*, PCHAR); 613 BerValue** ldap_get_values_lenW(LDAP*, LDAPMessage*, PWCHAR); 614 ULONG ldap_count_valuesA(PCHAR*); 615 ULONG ldap_count_valuesW(PWCHAR*); 616 ULONG ldap_count_values_len(BerValue**); 617 ULONG ldap_value_freeA(PCHAR*); 618 ULONG ldap_value_freeW(PWCHAR*); 619 ULONG ldap_value_free_len(BerValue**); 620 PCHAR ldap_get_dnA(LDAP*, LDAPMessage*); 621 PWCHAR ldap_get_dnW(LDAP*, LDAPMessage*); 622 PCHAR ldap_explode_dnA(PCHAR, ULONG); 623 PWCHAR ldap_explode_dnW(PWCHAR, ULONG); 624 PCHAR ldap_dn2ufnA(PCHAR); 625 PWCHAR ldap_dn2ufnW(PWCHAR); 626 ULONG ldap_ufn2dnA(PCHAR, PCHAR*); 627 ULONG ldap_ufn2dnW(PWCHAR, PWCHAR*); 628 ULONG ldap_parse_referenceA(LDAP*, LDAPMessage*, PCHAR**); 629 ULONG ldap_parse_referenceW(LDAP*, LDAPMessage*, PWCHAR**); 630 ULONG ldap_check_filterA(LDAP*, PCHAR); 631 ULONG ldap_check_filterW(LDAP*, PWCHAR); 632 ULONG ldap_create_page_controlA(PLDAP, ULONG, BerValue*, UCHAR, 633 PLDAPControlA*); 634 ULONG ldap_create_page_controlW(PLDAP, ULONG, BerValue*, UCHAR, 635 PLDAPControlW*); 636 ULONG ldap_create_sort_controlA(PLDAP, PLDAPSortKeyA*, UCHAR, 637 PLDAPControlA*); 638 ULONG ldap_create_sort_controlW(PLDAP, PLDAPSortKeyW*, UCHAR, 639 PLDAPControlW*); 640 INT ldap_create_vlv_controlA(LDAP*, LDAPVLVInfo*, UCHAR, LDAPControlA**); 641 INT ldap_create_vlv_controlW(LDAP*, LDAPVLVInfo*, UCHAR, LDAPControlW**); 642 ULONG ldap_encode_sort_controlA(PLDAP, PLDAPSortKeyA*, PLDAPControlA, 643 BOOLEAN); 644 ULONG ldap_encode_sort_controlW(PLDAP, PLDAPSortKeyW*, PLDAPControlW, 645 BOOLEAN); 646 ULONG ldap_escape_filter_elementA(PCHAR, ULONG, PCHAR, ULONG); 647 ULONG ldap_escape_filter_elementW(PWCHAR, ULONG, PWCHAR, ULONG); 648 ULONG ldap_get_next_page(PLDAP, PLDAPSearch, ULONG, ULONG*); 649 ULONG ldap_get_next_page_s(PLDAP, PLDAPSearch, LDAP_TIMEVAL*, ULONG, 650 ULONG*, LDAPMessage**); 651 ULONG ldap_get_paged_count(PLDAP, PLDAPSearch, ULONG*, PLDAPMessage); 652 ULONG ldap_parse_page_controlA(PLDAP, PLDAPControlA*, ULONG*, BerValue**); 653 ULONG ldap_parse_page_controlW(PLDAP, PLDAPControlW*, ULONG*, BerValue**); 654 ULONG ldap_parse_sort_controlA(PLDAP, PLDAPControlA*, ULONG*, PCHAR*); 655 ULONG ldap_parse_sort_controlW(PLDAP, PLDAPControlW*, ULONG*, PWCHAR*); 656 INT ldap_parse_vlv_controlA(LDAP*, LDAPControlA**, uint*, uint*, 657 BerValue**, int*); 658 INT ldap_parse_vlv_controlW(LDAP*, LDAPControlW**, uint*, uint*, 659 BerValue**, int*); 660 PLDAPSearch ldap_search_init_pageA(PLDAP, PCHAR, ULONG, PCHAR, PCHAR[], 661 ULONG, PLDAPControlA*, PLDAPControlA*, ULONG, ULONG, PLDAPSortKeyA*); 662 PLDAPSearch ldap_search_init_pageW(PLDAP, PWCHAR, ULONG, PWCHAR, PWCHAR[], 663 ULONG, PLDAPControlW*, PLDAPControlW*, ULONG, ULONG, PLDAPSortKeyW*); 664 ULONG ldap_search_abandon_page(PLDAP, PLDAPSearch); 665 LDAP ldap_conn_from_msg(LDAP*, LDAPMessage*); 666 INT LdapUnicodeToUTF8(LPCWSTR, int, LPSTR, int); 667 INT LdapUTF8ToUnicode(LPCSTR, int, LPWSTR, int); 668 deprecated { 669 ULONG ldap_bindA(LDAP*, PCHAR, PCHAR, ULONG); 670 ULONG ldap_bindW(LDAP*, PWCHAR, PWCHAR, ULONG); 671 ULONG ldap_bind_sA(LDAP*, PCHAR, PCHAR, ULONG); 672 ULONG ldap_bind_sW(LDAP*, PWCHAR, PWCHAR, ULONG); 673 ULONG ldap_modrdnA(LDAP*, PCHAR, PCHAR); 674 ULONG ldap_modrdnW(LDAP*, PWCHAR, PWCHAR); 675 ULONG ldap_modrdn_sA(LDAP*, PCHAR, PCHAR); 676 ULONG ldap_modrdn_sW(LDAP*, PWCHAR, PWCHAR); 677 ULONG ldap_modrdn2A(LDAP*, PCHAR, PCHAR, INT); 678 ULONG ldap_modrdn2W(LDAP*, PWCHAR, PWCHAR, INT); 679 ULONG ldap_modrdn2_sA(LDAP*, PCHAR, PCHAR, INT); 680 ULONG ldap_modrdn2_sW(LDAP*, PWCHAR, PWCHAR, INT); 681 } 682 } 683 684 version (Unicode) { 685 alias LDAPControlW LDAPControl; 686 alias PLDAPControlW PLDAPControl; 687 alias LDAPModW LDAPMod; 688 alias LDAPModW PLDAPMod; 689 alias LDAPSortKeyW LDAPSortKey; 690 alias PLDAPSortKeyW PLDAPSortKey; 691 alias LDAPAPIInfoW LDAPAPIInfo; 692 alias PLDAPAPIInfoW PLDAPAPIInfo; 693 alias LDAPAPIFeatureInfoW LDAPAPIFeatureInfo; 694 alias PLDAPAPIFeatureInfoW PLDAPAPIFeatureInfo; 695 alias cldap_openW cldap_open; 696 alias ldap_openW ldap_open; 697 alias ldap_simple_bindW ldap_simple_bind; 698 alias ldap_simple_bind_sW ldap_simple_bind_s; 699 alias ldap_sasl_bindW ldap_sasl_bind; 700 alias ldap_sasl_bind_sW ldap_sasl_bind_s; 701 alias ldap_initW ldap_init; 702 alias ldap_sslinitW ldap_sslinit; 703 alias ldap_get_optionW ldap_get_option; 704 alias ldap_set_optionW ldap_set_option; 705 alias ldap_start_tls_sW ldap_start_tls_s; 706 alias ldap_addW ldap_add; 707 alias ldap_add_extW ldap_add_ext; 708 alias ldap_add_sW ldap_add_s; 709 alias ldap_add_ext_sW ldap_add_ext_s; 710 alias ldap_compareW ldap_compare; 711 alias ldap_compare_extW ldap_compare_ext; 712 alias ldap_compare_sW ldap_compare_s; 713 alias ldap_compare_ext_sW ldap_compare_ext_s; 714 alias ldap_deleteW ldap_delete; 715 alias ldap_delete_extW ldap_delete_ext; 716 alias ldap_delete_sW ldap_delete_s; 717 alias ldap_delete_ext_sW ldap_delete_ext_s; 718 alias ldap_extended_operation_sW ldap_extended_operation_s; 719 alias ldap_extended_operationW ldap_extended_operation; 720 alias ldap_modifyW ldap_modify; 721 alias ldap_modify_extW ldap_modify_ext; 722 alias ldap_modify_sW ldap_modify_s; 723 alias ldap_modify_ext_sW ldap_modify_ext_s; 724 alias ldap_check_filterW ldap_check_filter; 725 alias ldap_count_valuesW ldap_count_values; 726 alias ldap_create_page_controlW ldap_create_page_control; 727 alias ldap_create_sort_controlW ldap_create_sort_control; 728 alias ldap_create_vlv_controlW ldap_create_vlv_control; 729 alias ldap_encode_sort_controlW ldap_encode_sort_control; 730 alias ldap_escape_filter_elementW ldap_escape_filter_element; 731 alias ldap_first_attributeW ldap_first_attribute; 732 alias ldap_next_attributeW ldap_next_attribute; 733 alias ldap_get_valuesW ldap_get_values; 734 alias ldap_get_values_lenW ldap_get_values_len; 735 alias ldap_parse_extended_resultW ldap_parse_extended_result; 736 alias ldap_parse_page_controlW ldap_parse_page_control; 737 alias ldap_parse_referenceW ldap_parse_reference; 738 alias ldap_parse_resultW ldap_parse_result; 739 alias ldap_parse_sort_controlW ldap_parse_sort_control; 740 alias ldap_parse_vlv_controlW ldap_parse_vlv_control; 741 alias ldap_searchW ldap_search; 742 alias ldap_search_sW ldap_search_s; 743 alias ldap_search_stW ldap_search_st; 744 alias ldap_search_extW ldap_search_ext; 745 alias ldap_search_ext_sW ldap_search_ext_s; 746 alias ldap_search_init_pageW ldap_search_init_page; 747 alias ldap_err2stringW ldap_err2string; 748 alias ldap_control_freeW ldap_control_free; 749 alias ldap_controls_freeW ldap_controls_free; 750 alias ldap_free_controlsW ldap_free_controls; 751 alias ldap_memfreeW ldap_memfree; 752 alias ldap_value_freeW ldap_value_free; 753 alias ldap_dn2ufnW ldap_dn2ufn; 754 alias ldap_ufn2dnW ldap_ufn2dn; 755 alias ldap_explode_dnW ldap_explode_dn; 756 alias ldap_get_dnW ldap_get_dn; 757 alias ldap_rename_extW ldap_rename; 758 alias ldap_rename_ext_sW ldap_rename_s; 759 alias ldap_rename_extW ldap_rename_ext; 760 alias ldap_rename_ext_sW ldap_rename_ext_s; 761 deprecated { 762 alias ldap_bindW ldap_bind; 763 alias ldap_bind_sW ldap_bind_s; 764 alias ldap_modrdnW ldap_modrdn; 765 alias ldap_modrdn_sW ldap_modrdn_s; 766 alias ldap_modrdn2W ldap_modrdn2; 767 alias ldap_modrdn2_sW ldap_modrdn2_s; 768 } 769 } else { 770 alias LDAPControlA LDAPControl; 771 alias PLDAPControlA PLDAPControl; 772 alias LDAPModA LDAPMod; 773 alias LDAPModA PLDAPMod; 774 alias LDAPSortKeyA LDAPSortKey; 775 alias PLDAPSortKeyA PLDAPSortKey; 776 alias LDAPAPIInfoA LDAPAPIInfo; 777 alias PLDAPAPIInfoA PLDAPAPIInfo; 778 alias LDAPAPIFeatureInfoA LDAPAPIFeatureInfo; 779 alias PLDAPAPIFeatureInfoA PLDAPAPIFeatureInfo; 780 alias cldap_openA cldap_open; 781 alias ldap_openA ldap_open; 782 alias ldap_simple_bindA ldap_simple_bind; 783 alias ldap_simple_bind_sA ldap_simple_bind_s; 784 alias ldap_sasl_bindA ldap_sasl_bind; 785 alias ldap_sasl_bind_sA ldap_sasl_bind_s; 786 alias ldap_initA ldap_init; 787 alias ldap_sslinitA ldap_sslinit; 788 alias ldap_get_optionA ldap_get_option; 789 alias ldap_set_optionA ldap_set_option; 790 alias ldap_start_tls_sA ldap_start_tls_s; 791 alias ldap_addA ldap_add; 792 alias ldap_add_extA ldap_add_ext; 793 alias ldap_add_sA ldap_add_s; 794 alias ldap_add_ext_sA ldap_add_ext_s; 795 alias ldap_compareA ldap_compare; 796 alias ldap_compare_extA ldap_compare_ext; 797 alias ldap_compare_sA ldap_compare_s; 798 alias ldap_compare_ext_sA ldap_compare_ext_s; 799 alias ldap_deleteA ldap_delete; 800 alias ldap_delete_extA ldap_delete_ext; 801 alias ldap_delete_sA ldap_delete_s; 802 alias ldap_delete_ext_sA ldap_delete_ext_s; 803 alias ldap_extended_operation_sA ldap_extended_operation_s; 804 alias ldap_extended_operationA ldap_extended_operation; 805 alias ldap_modifyA ldap_modify; 806 alias ldap_modify_extA ldap_modify_ext; 807 alias ldap_modify_sA ldap_modify_s; 808 alias ldap_modify_ext_sA ldap_modify_ext_s; 809 alias ldap_check_filterA ldap_check_filter; 810 alias ldap_count_valuesA ldap_count_values; 811 alias ldap_create_page_controlA ldap_create_page_control; 812 alias ldap_create_sort_controlA ldap_create_sort_control; 813 alias ldap_create_vlv_controlA ldap_create_vlv_control; 814 alias ldap_encode_sort_controlA ldap_encode_sort_control; 815 alias ldap_escape_filter_elementA ldap_escape_filter_element; 816 alias ldap_first_attributeA ldap_first_attribute; 817 alias ldap_next_attributeA ldap_next_attribute; 818 alias ldap_get_valuesA ldap_get_values; 819 alias ldap_get_values_lenA ldap_get_values_len; 820 alias ldap_parse_extended_resultA ldap_parse_extended_result; 821 alias ldap_parse_page_controlA ldap_parse_page_control; 822 alias ldap_parse_referenceA ldap_parse_reference; 823 alias ldap_parse_resultA ldap_parse_result; 824 alias ldap_parse_sort_controlA ldap_parse_sort_control; 825 alias ldap_parse_vlv_controlA ldap_parse_vlv_control; 826 alias ldap_searchA ldap_search; 827 alias ldap_search_sA ldap_search_s; 828 alias ldap_search_stA ldap_search_st; 829 alias ldap_search_extA ldap_search_ext; 830 alias ldap_search_ext_sA ldap_search_ext_s; 831 alias ldap_search_init_pageA ldap_search_init_page; 832 alias ldap_err2stringA ldap_err2string; 833 alias ldap_control_freeA ldap_control_free; 834 alias ldap_controls_freeA ldap_controls_free; 835 alias ldap_free_controlsA ldap_free_controls; 836 alias ldap_memfreeA ldap_memfree; 837 alias ldap_value_freeA ldap_value_free; 838 alias ldap_dn2ufnA ldap_dn2ufn; 839 alias ldap_ufn2dnA ldap_ufn2dn; 840 alias ldap_explode_dnA ldap_explode_dn; 841 alias ldap_get_dnA ldap_get_dn; 842 alias ldap_rename_extA ldap_rename; 843 alias ldap_rename_ext_sA ldap_rename_s; 844 alias ldap_rename_extA ldap_rename_ext; 845 alias ldap_rename_ext_sA ldap_rename_ext_s; 846 deprecated { 847 alias ldap_bindA ldap_bind; 848 alias ldap_bind_sA ldap_bind_s; 849 alias ldap_modrdnA ldap_modrdn; 850 alias ldap_modrdn_sA ldap_modrdn_s; 851 alias ldap_modrdn2A ldap_modrdn2; 852 alias ldap_modrdn2_sA ldap_modrdn2_s; 853 } 854 }