[WLDAP32] Sync with Wine Staging 4.18. CORE-16441
authorAmine Khaldi <amine.khaldi@reactos.org>
Sat, 7 Dec 2019 12:09:39 +0000 (13:09 +0100)
committerAmine Khaldi <amine.khaldi@reactos.org>
Sat, 7 Dec 2019 12:09:39 +0000 (13:09 +0100)
dll/win32/wldap32/error.c
dll/win32/wldap32/init.c
dll/win32/wldap32/parse.c
dll/win32/wldap32/winldap_private.h
media/doc/README.WINE

index 2e09e9e..fbbd124 100644 (file)
@@ -303,7 +303,7 @@ ULONG CDECL LdapMapErrorToWin32( ULONG err )
 {
     TRACE( "(0x%08x)\n", err );
 
-    if (err >= sizeof(WLDAP32_errormap)/sizeof(WLDAP32_errormap[0]))
+    if (err >= ARRAY_SIZE( WLDAP32_errormap ))
         return ERROR_DS_GENERIC_ERROR;
     return WLDAP32_errormap[err];
 }
index fdb7908..5b600a2 100644 (file)
@@ -30,6 +30,7 @@
 #include "windef.h"
 #include "winbase.h"
 #include "winnls.h"
+#include "wine/winternl.h"
 
 #include "winldap_private.h"
 #include "wldap32.h"
@@ -114,10 +115,10 @@ oom:
 /* Determine if a URL starts with a known LDAP scheme */
 static BOOL has_ldap_scheme( char *url )
 {
-    return !strncasecmp( url, "ldap://", 7 )  ||
-           !strncasecmp( url, "ldaps://", 8 ) ||
-           !strncasecmp( url, "ldapi://", 8 ) ||
-           !strncasecmp( url, "cldap://", 8 );
+    return !_strnicmp( url, "ldap://", 7 )  ||
+           !_strnicmp( url, "ldaps://", 8 ) ||
+           !_strnicmp( url, "ldapi://", 8 ) ||
+           !_strnicmp( url, "cldap://", 8 );
 }
 
 /* Flatten an array of hostnames into a space separated string of URLs.
index 62ffdba..e83e6d2 100644 (file)
@@ -258,7 +258,7 @@ ULONG CDECL ldap_parse_resultW( WLDAP32_LDAP *ld, WLDAP32_LDAPMessage *result,
 
     ldap_memfree( matchedU );
     ldap_memfree( errorU );
-    strarrayfreeU( referralsU );
+    ldap_memvfree( (void **)referralsU );
     ldap_controls_free( serverctrlsU );
 
 #endif
index c0039eb..4d4d358 100644 (file)
@@ -191,16 +191,18 @@ typedef struct WLDAP32_berval
 } LDAP_BERVAL, *PLDAP_BERVAL, BERVAL, *PBERVAL, WLDAP32_BerValue;
 
 #define LDAP_PAGED_RESULT_OID_STRING "1.2.840.113556.1.4.319"
-#define LDAP_PAGED_RESULT_OID_STRING_W (const WCHAR []){'1','.','2','.', \
-        '8','4','0','.','1','1','3','5','5','6','.','1','.','4','.','3','1','9',0}
-
 #define LDAP_SERVER_RESP_SORT_OID "1.2.840.113556.1.4.474"
-#define LDAP_SERVER_RESP_SORT_OID_W (const WCHAR []){'1','.','2','.', \
-        '8','4','0','.','1','1','3','5','5','6','.','1','.','4','.','4','7','4',0}
-
 #define LDAP_CONTROL_VLVRESPONSE "2.16.840.1.113730.3.4.10"
-#define LDAP_CONTROL_VLVRESPONSE_W (const WCHAR []){'2','.','1','6','.', \
-        '8','4','0','.','1','.','1','1','3','7','3','0','.','3','.','4','.','1','0',0}
+
+#if defined(_MSC_VER) || defined(__MINGW32__)
+#define LDAP_PAGED_RESULT_OID_STRING_W L"1.2.840.113556.1.4.319"
+#define LDAP_SERVER_RESP_SORT_OID_W L"1.2.840.113556.1.4.474"
+#define LDAP_CONTROL_VLVRESPONSE_W L"2.16.840.1.113730.3.4.10"
+#else
+static const WCHAR LDAP_PAGED_RESULT_OID_STRING_W[] = {'1','.','2','.','8','4','0','.','1','1','3','5','5','6','.','1','.','4','.','3','1','9',0};
+static const WCHAR LDAP_SERVER_RESP_SORT_OID_W[] = {'1','.','2','.','8','4','0','.','1','1','3','5','5','6','.','1','.','4','.','4','7','4',0};
+static const WCHAR LDAP_CONTROL_VLVRESPONSE_W[] = {'2','.','1','6','.','8','4','0','.','1','.','1','1','3','7','3','0','.','3','.','4','.','1','0',0};
+#endif
 
 typedef struct ldapcontrolA
 {
index 54c585a..127fa78 100644 (file)
@@ -208,7 +208,7 @@ dll/win32/winmm/midimap       # Forked at Wine-20050628
 dll/win32/winmm/wavemap       # Forked at Wine-20050628
 dll/win32/winscard            # Synced to WineStaging-4.18
 dll/win32/wintrust            # Synced to WineStaging-4.18
-dll/win32/wldap32             # Synced to WineStaging-3.3
+dll/win32/wldap32             # Synced to WineStaging-4.18
 dll/win32/wmi                 # Synced to WineStaging-2.9
 dll/win32/wmiutils            # Synced to WineStaging-3.3
 dll/win32/wmvcore             # Synced to WineStaging-3.9