Commit df41a9a5 authored by Hans Leidekker's avatar Hans Leidekker Committed by Alexandre Julliard

Implement LdapGetLastError, cldap_open*, ldap_abandon,

ldap_check_filter*, ldap_cleanup, ldap_conn_from_msg and ldap_connect.
parent 6235c076
......@@ -94,6 +94,12 @@ ULONG WLDAP32_ldap_result2error( WLDAP32_LDAP *ld, WLDAP32_LDAPMessage *res, ULO
return ret;
}
ULONG LdapGetLastError( void )
{
TRACE( "\n" );
return GetLastError();
}
static const ULONG WLDAP32_errormap[] = {
/* LDAP_SUCCESS */ ERROR_SUCCESS,
/* LDAP_OPERATIONS_ERROR */ ERROR_OPEN_FAILED,
......
......@@ -44,6 +44,30 @@ static const WCHAR defaulthost[] = { 'l','o','c','a','l','h','o','s','t',0 };
WINE_DEFAULT_DEBUG_CHANNEL(wldap32);
WLDAP32_LDAP *cldap_openA( PCHAR hostname, ULONG portnumber )
{
TRACE( "(%s, %ld)\n", debugstr_a(hostname), portnumber );
/* FIXME: should use UDP instead of TCP */
return ldap_openA( hostname, portnumber );
}
WLDAP32_LDAP *cldap_openW( PWCHAR hostname, ULONG portnumber )
{
TRACE( "(%s, %ld)\n", debugstr_w(hostname), portnumber );
/* FIXME: should use UDP instead of TCP */
return ldap_openW( hostname, portnumber );
}
ULONG ldap_connect( WLDAP32_LDAP *ld, LDAP_TIMEVAL *timeout )
{
TRACE( "(%p, %p)\n", ld, timeout );
if (!ld || !timeout) return WLDAP32_LDAP_PARAM_ERROR;
return LDAP_SUCCESS;
}
WLDAP32_LDAP *ldap_initA( PCHAR hostname, ULONG portnumber )
{
#ifdef HAVE_LDAP
......
......@@ -33,6 +33,7 @@
#include <ldap.h>
#else
#define LDAP_SUCCESS 0x00
#define LDAP_NOT_SUPPORTED 0x5c
#endif
#include "winldap_private.h"
......@@ -40,6 +41,62 @@
WINE_DEFAULT_DEBUG_CHANNEL(wldap32);
ULONG WLDAP32_ldap_abandon( WLDAP32_LDAP *ld, ULONG msgid )
{
ULONG ret = LDAP_NOT_SUPPORTED;
#ifdef HAVE_LDAP
TRACE( "(%p, 0x%08lx)\n", ld, msgid );
if (!ld) return ~0UL;
ret = ldap_abandon( ld, msgid );
#endif
return ret;
}
ULONG ldap_check_filterA( WLDAP32_LDAP *ld, PCHAR filter )
{
ULONG ret;
WCHAR *filterW = NULL;
TRACE( "(%p, %s)\n", ld, debugstr_a(filter) );
if (!ld) return WLDAP32_LDAP_PARAM_ERROR;
if (filter) {
filterW = strAtoW( filter );
if (!filterW) return WLDAP32_LDAP_NO_MEMORY;
}
ret = ldap_check_filterW( ld, filterW );
strfreeW( filterW );
return ret;
}
ULONG ldap_check_filterW( WLDAP32_LDAP *ld, PWCHAR filter )
{
TRACE( "(%p, %s)\n", ld, debugstr_w(filter) );
if (!ld) return WLDAP32_LDAP_PARAM_ERROR;
return LDAP_SUCCESS;
}
ULONG ldap_cleanup( HANDLE instance )
{
TRACE( "(%p)\n", instance );
return LDAP_SUCCESS;
}
WLDAP32_LDAP *ldap_conn_from_msg( WLDAP32_LDAP *ld, WLDAP32_LDAPMessage *res )
{
TRACE( "(%p, %p)\n", ld, res );
if (!ld || !res) return NULL;
return ld; /* FIXME: not always correct */
}
void ldap_memfreeA( PCHAR block )
{
TRACE( "(%p)\n", block );
......
......@@ -232,6 +232,9 @@ typedef struct ldap_apifeature_infoW
int ldapaif_version;
} LDAPAPIFeatureInfoW;
WLDAP32_LDAP *cldap_openA(PCHAR,ULONG);
WLDAP32_LDAP *cldap_openW(PWCHAR,ULONG);
ULONG WLDAP32_ldap_abandon(WLDAP32_LDAP*,ULONG);
ULONG ldap_addA(WLDAP32_LDAP*,PCHAR,LDAPModA*[]);
ULONG ldap_addW(WLDAP32_LDAP*,PWCHAR,LDAPModW*[]);
ULONG ldap_add_extA(WLDAP32_LDAP*,PCHAR,LDAPModA*[],PLDAPControlA*,PLDAPControlA*,ULONG*);
......@@ -244,6 +247,9 @@ ULONG ldap_bindA(WLDAP32_LDAP*,PCHAR,PCHAR,ULONG);
ULONG ldap_bindW(WLDAP32_LDAP*,PWCHAR,PWCHAR,ULONG);
ULONG ldap_bind_sA(WLDAP32_LDAP*,PCHAR,PCHAR,ULONG);
ULONG ldap_bind_sW(WLDAP32_LDAP*,PWCHAR,PWCHAR,ULONG);
ULONG ldap_check_filterA(WLDAP32_LDAP*,PCHAR);
ULONG ldap_check_filterW(WLDAP32_LDAP*,PWCHAR);
ULONG ldap_cleanup(HANDLE);
ULONG ldap_compareA(WLDAP32_LDAP*,PCHAR,PCHAR,PCHAR);
ULONG ldap_compareW(WLDAP32_LDAP*,PWCHAR,PWCHAR,PWCHAR);
ULONG ldap_compare_extA(WLDAP32_LDAP*,PCHAR,PCHAR,PCHAR,struct WLDAP32_berval*,PLDAPControlA*,PLDAPControlA*,ULONG*);
......@@ -252,6 +258,8 @@ ULONG ldap_compare_ext_sA(WLDAP32_LDAP*,PCHAR,PCHAR,PCHAR,struct WLDAP32_berval*
ULONG ldap_compare_ext_sW(WLDAP32_LDAP*,PWCHAR,PWCHAR,PWCHAR,struct WLDAP32_berval*,PLDAPControlW*,PLDAPControlW*);
ULONG ldap_compare_sA(WLDAP32_LDAP*,PCHAR,PCHAR,PCHAR);
ULONG ldap_compare_sW(WLDAP32_LDAP*,PWCHAR,PWCHAR,PWCHAR);
ULONG ldap_connect(WLDAP32_LDAP*,LDAP_TIMEVAL*);
WLDAP32_LDAP *ldap_conn_from_msg(WLDAP32_LDAP*,WLDAP32_LDAPMessage*);
ULONG ldap_deleteA(WLDAP32_LDAP*,PCHAR);
ULONG ldap_deleteW(WLDAP32_LDAP*,PWCHAR);
ULONG ldap_delete_extA(WLDAP32_LDAP*,PCHAR,PLDAPControlA*,PLDAPControlA*,ULONG*);
......
@ stub LdapGetLastError
@ cdecl LdapGetLastError()
@ cdecl LdapMapErrorToWin32(long)
@ cdecl LdapUTF8ToUnicode(str long ptr long)
@ cdecl LdapUnicodeToUTF8(wstr long ptr long)
......@@ -15,10 +15,10 @@
@ varargs ber_printf(ptr str)
@ varargs ber_scanf(ptr str)
@ cdecl ber_skip_tag(ptr ptr)
@ stub cldap_open
@ stub cldap_openA
@ stub cldap_openW
@ stub ldap_abandon
@ cdecl cldap_open(str long) cldap_openA
@ cdecl cldap_openA(str long)
@ cdecl cldap_openW(wstr long)
@ cdecl ldap_abandon(ptr long) WLDAP32_ldap_abandon
@ cdecl ldap_add(ptr str ptr) ldap_addA
@ cdecl ldap_addA(ptr str ptr)
@ cdecl ldap_addW(ptr wstr ptr)
......@@ -37,9 +37,9 @@
@ cdecl ldap_bind_s(ptr str str long) ldap_bind_sA
@ cdecl ldap_bind_sA(ptr str str long)
@ cdecl ldap_bind_sW(ptr wstr wstr long)
@ stub ldap_check_filterA
@ stub ldap_check_filterW
@ stub ldap_cleanup
@ cdecl ldap_check_filterA(ptr str)
@ cdecl ldap_check_filterW(ptr wstr)
@ cdecl ldap_cleanup(long)
@ stub ldap_close_extended_op
@ cdecl ldap_compare(ptr str str str) ldap_compareA
@ cdecl ldap_compareA(ptr str str str)
......@@ -53,8 +53,8 @@
@ cdecl ldap_compare_s(ptr str str str) ldap_compare_sA
@ cdecl ldap_compare_sA(ptr str str str)
@ cdecl ldap_compare_sW(ptr wstr wstr wstr)
@ stub ldap_conn_from_msg
@ stub ldap_connect
@ cdecl ldap_conn_from_msg(ptr ptr)
@ cdecl ldap_connect(ptr ptr)
@ stub ldap_control_free
@ stub ldap_control_freeA
@ stub ldap_control_freeW
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment