33#include "wine/winternl.h"
41static const WCHAR defaulthost[] = {
'l',
'o',
'c',
'a',
'l',
'h',
'o',
's',
't',0 };
44static char **split_hostnames(
const char *hostnames )
86 if (!
res[
i])
goto oom;
96 if (!
res[
i])
goto oom;
116static BOOL has_ldap_scheme(
char *
url )
128static char *join_hostnames(
const char *
scheme,
char **hostnames,
ULONG portnumber )
131 unsigned int i = 0,
size = 0;
132 static const char sep[] =
" ",
fmt[] =
":%d";
137 for (
v = hostnames; *
v;
v++)
139 if (!has_ldap_scheme( *
v ))
160 for (
v = hostnames; *
v;
v++)
168 if (!has_ldap_scheme( *
v ))
190static char *urlify_hostnames(
const char *
scheme,
char *hostnames,
ULONG port )
194 strarray = split_hostnames( hostnames );
208static LDAP *create_context(
const char *
url )
233 if (!hostnameW)
goto exit;
278 if (!hostnameU)
goto exit;
281 hostnameU =
strWtoU( defaulthost );
282 if (!hostnameU)
goto exit;
285 url = urlify_hostnames(
"cldap://", hostnameU, portnumber );
288 ld = create_context(
url );
341 if (!hostnameW)
goto exit;
387 if (!hostnameU)
goto exit;
390 hostnameU =
strWtoU( defaulthost );
391 if (!hostnameU)
goto exit;
394 url = urlify_hostnames(
"ldap://", hostnameU, portnumber );
397 ld = create_context(
url );
424 if (!hostnameW)
goto exit;
469 if (!hostnameU)
goto exit;
472 hostnameU =
strWtoU( defaulthost );
473 if (!hostnameU)
goto exit;
476 url = urlify_hostnames(
"ldap://", hostnameU, portnumber );
479 ld = create_context(
url );
506 if (!hostnameW)
return NULL;
552 if (!hostnameU)
goto exit;
555 hostnameU =
strWtoU( defaulthost );
556 if (!hostnameU)
goto exit;
560 url = urlify_hostnames(
"ldaps://", hostnameU, portnumber );
562 url = urlify_hostnames(
"ldap://", hostnameU, portnumber );
565 ldap_initialize( &ld,
url );
591 TRACE(
"(%p, %p, %p, %p, %p)\n", ld, retval,
result, serverctrls, clientctrls );
596 serverctrlsW = controlarrayAtoW( serverctrls );
597 if (!serverctrlsW)
goto exit;
600 clientctrlsW = controlarrayAtoW( clientctrls );
601 if (!clientctrlsW)
goto exit;
607 controlarrayfreeW( serverctrlsW );
608 controlarrayfreeW( clientctrlsW );
642 TRACE(
"(%p, %p, %p, %p, %p)\n", ld, retval,
result, serverctrls, clientctrls );
647 serverctrlsU = controlarrayWtoU( serverctrls );
648 if (!serverctrlsU)
goto exit;
651 clientctrlsU = controlarrayWtoU( clientctrls );
652 if (!clientctrlsU)
goto exit;
658 controlarrayfreeU( serverctrlsU );
659 controlarrayfreeU( clientctrlsU );
688 TRACE(
"(%p)\n", ld );
ACPI_SIZE strlen(const char *String)
char * strcpy(char *DstString, const char *SrcString)
char * strchr(const char *String, int ch)
static void * heap_alloc(size_t len)
static BOOL heap_free(void *mem)
#define WINE_DEFAULT_DEBUG_CHANNEL(t)
static HINSTANCE instance
#define _strnicmp(_String1, _String2, _MaxCount)
static const WCHAR version[]
static UINT map_error(DWORD error)
WLDAP32_LDAP *CDECL ldap_openA(PCHAR hostname, ULONG portnumber)
WLDAP32_LDAP *CDECL ldap_sslinitW(PWCHAR hostname, ULONG portnumber, int secure)
ULONG CDECL ldap_connect(WLDAP32_LDAP *ld, struct l_timeval *timeout)
WLDAP32_LDAP *CDECL cldap_openW(PWCHAR hostname, ULONG portnumber)
WLDAP32_LDAP *CDECL ldap_openW(PWCHAR hostname, ULONG portnumber)
BOOLEAN CDECL ldap_stop_tls_s(WLDAP32_LDAP *ld)
WLDAP32_LDAP *CDECL cldap_openA(PCHAR hostname, ULONG portnumber)
ULONG CDECL ldap_start_tls_sA(WLDAP32_LDAP *ld, PULONG retval, WLDAP32_LDAPMessage **result, PLDAPControlA *serverctrls, PLDAPControlA *clientctrls)
WLDAP32_LDAP *CDECL ldap_initW(const PWCHAR hostname, ULONG portnumber)
ULONG CDECL ldap_start_tls_sW(WLDAP32_LDAP *ld, PULONG retval, WLDAP32_LDAPMessage **result, PLDAPControlW *serverctrls, PLDAPControlW *clientctrls)
WLDAP32_LDAP *CDECL ldap_initA(const PCHAR hostname, ULONG portnumber)
WLDAP32_LDAP *CDECL ldap_sslinitA(PCHAR hostname, ULONG portnumber, int secure)
ULONG CDECL ldap_startup(PLDAP_VERSION_INFO version, HANDLE *instance)
GLdouble GLdouble GLdouble GLdouble q
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble * u
static LPWSTR strAtoW(const char *str)
#define sprintf(buf, format,...)
#define LDAP_OPT_PROTOCOL_VERSION
@ WLDAP32_LDAP_PARAM_ERROR
@ WLDAP32_LDAP_NOT_SUPPORTED
static char * strdupU(const char *src)
static void strfreeU(char *str)
static void strfreeW(LPWSTR str)
static void strarrayfreeU(char **strarray)
static char * strWtoU(LPCWSTR str)