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