https://git.reactos.org/?p=reactos.git;a=commitdiff;h=87c506bacaf7088c2b73b9d31b972e56fca5fc38

commit 87c506bacaf7088c2b73b9d31b972e56fca5fc38
Author:     Amine Khaldi <[email protected]>
AuthorDate: Sun Jan 21 21:57:04 2018 +0100
Commit:     Amine Khaldi <[email protected]>
CommitDate: Sun Jan 21 21:57:04 2018 +0100

    [WLDAP32] Sync with Wine 3.0. CORE-14225
---
 dll/win32/wldap32/ber.c  |  4 ++--
 dll/win32/wldap32/init.c | 17 ++++++++++++++---
 media/doc/README.WINE    |  2 +-
 3 files changed, 17 insertions(+), 6 deletions(-)

diff --git a/dll/win32/wldap32/ber.c b/dll/win32/wldap32/ber.c
index 5d3ac648d4..6687fe11ed 100644
--- a/dll/win32/wldap32/ber.c
+++ b/dll/win32/wldap32/ber.c
@@ -323,7 +323,7 @@ ULONG CDECL WLDAP32_ber_skip_tag( BerElement *berelement, 
ULONG *len )
  *  berelement must have been allocated with ber_alloc_t. This function
  *  can be called multiple times to append data.
  */
-INT CDECL WLDAP32_ber_printf( BerElement *berelement, PCHAR fmt, ... )
+INT WINAPIV WLDAP32_ber_printf( BerElement *berelement, PCHAR fmt, ... )
 {
 #ifdef HAVE_LDAP
     __ms_va_list list;
@@ -418,7 +418,7 @@ INT CDECL WLDAP32_ber_printf( BerElement *berelement, PCHAR 
fmt, ... )
  *  berelement must have been allocated with ber_init. This function
  *  can be called multiple times to decode data.
  */
-INT CDECL WLDAP32_ber_scanf( BerElement *berelement, PCHAR fmt, ... )
+INT WINAPIV WLDAP32_ber_scanf( BerElement *berelement, PCHAR fmt, ... )
 {
 #ifdef HAVE_LDAP
     __ms_va_list list;
diff --git a/dll/win32/wldap32/init.c b/dll/win32/wldap32/init.c
index ff6f3ced51..7b3e467ec8 100644
--- a/dll/win32/wldap32/init.c
+++ b/dll/win32/wldap32/init.c
@@ -189,6 +189,17 @@ static char *urlify_hostnames( const char *scheme, char 
*hostnames, ULONG port )
 }
 #endif
 
+#ifdef HAVE_LDAP
+static LDAP *create_context( const char *url )
+{
+    LDAP *ld;
+    int version = LDAP_VERSION3;
+    if (ldap_initialize( &ld, url ) != LDAP_SUCCESS) return NULL;
+    ldap_set_option( ld, LDAP_OPT_PROTOCOL_VERSION, &version );
+    return ld;
+}
+#endif
+
 /***********************************************************************
  *      cldap_openA     (WLDAP32.@)
  *
@@ -259,7 +270,7 @@ WLDAP32_LDAP * CDECL cldap_openW( PWCHAR hostname, ULONG 
portnumber )
     url = urlify_hostnames( "cldap://";, hostnameU, portnumber );
     if (!url) goto exit;
 
-    ldap_initialize( &ld, url );
+    ld = create_context( url );
 
 exit:
     strfreeU( hostnameU );
@@ -368,7 +379,7 @@ WLDAP32_LDAP * CDECL ldap_initW( const PWCHAR hostname, 
ULONG portnumber )
     url = urlify_hostnames( "ldap://";, hostnameU, portnumber );
     if (!url) goto exit;
 
-    ldap_initialize( &ld, url );
+    ld = create_context( url );
 
 exit:
     strfreeU( hostnameU );
@@ -450,7 +461,7 @@ WLDAP32_LDAP * CDECL ldap_openW( PWCHAR hostname, ULONG 
portnumber )
     url = urlify_hostnames( "ldap://";, hostnameU, portnumber );
     if (!url) goto exit;
 
-    ldap_initialize( &ld, url );
+    ld = create_context( url );
 
 exit:
     strfreeU( hostnameU );
diff --git a/media/doc/README.WINE b/media/doc/README.WINE
index 09843a93df..7f10d52dea 100644
--- a/media/doc/README.WINE
+++ b/media/doc/README.WINE
@@ -207,7 +207,7 @@ reactos/dll/win32/winmm/midimap       # Forked at 
Wine-20050628
 reactos/dll/win32/winmm/wavemap       # Forked at Wine-20050628
 reactos/dll/win32/winscard            # Synced to WineStaging-2.9
 reactos/dll/win32/wintrust            # Synced to WineStaging-2.16
-reactos/dll/win32/wldap32             # Synced to WineStaging-2.9
+reactos/dll/win32/wldap32             # Synced to Wine-3.0
 reactos/dll/win32/wmi                 # Synced to WineStaging-2.9
 reactos/dll/win32/wmiutils            # Synced to WineStaging-2.9
 reactos/dll/win32/wmvcore             # Synced to WineStaging-2.16

Reply via email to