Hans Leidekker : wldap32: Use wide character string literals.

Alexandre Julliard julliard at winehq.org
Mon Apr 19 15:38:10 CDT 2021


Module: wine
Branch: master
Commit: 81e418efaf5ded55311385d3868c36a01dc9e432
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=81e418efaf5ded55311385d3868c36a01dc9e432

Author: Hans Leidekker <hans at codeweavers.com>
Date:   Mon Apr 19 10:04:53 2021 +0200

wldap32: Use wide character string literals.

Signed-off-by: Hans Leidekker <hans at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/wldap32/init.c            | 11 ++++-------
 dlls/wldap32/winldap_private.h |  6 ------
 2 files changed, 4 insertions(+), 13 deletions(-)

diff --git a/dlls/wldap32/init.c b/dlls/wldap32/init.c
index 28e62ba6de2..8043164ad30 100644
--- a/dlls/wldap32/init.c
+++ b/dlls/wldap32/init.c
@@ -30,9 +30,6 @@
 
 WINE_DEFAULT_DEBUG_CHANNEL(wldap32);
 
-/* Should eventually be determined by the algorithm documented on MSDN. */
-static const WCHAR defaulthost[] = { 'l','o','c','a','l','h','o','s','t',0 };
-
 /* Split a space separated string of hostnames into a string array */
 static char **split_hostnames( const char *hostnames )
 {
@@ -256,7 +253,7 @@ WLDAP32_LDAP * CDECL cldap_openW( WCHAR *hostname, ULONG portnumber )
 
     TRACE( "(%s, %d)\n", debugstr_w(hostname), portnumber );
 
-    if (!(hostnameU = strWtoU( hostname ? hostname : defaulthost ))) return NULL;
+    if (!(hostnameU = strWtoU( hostname ? hostname : L"localhost" ))) return NULL;
     if (!(url = urlify_hostnames( "cldap://", hostnameU, portnumber ))) goto exit;
 
     ld = create_context( url );
@@ -342,7 +339,7 @@ WLDAP32_LDAP * CDECL ldap_initW( const PWCHAR hostname, ULONG portnumber )
 
     TRACE( "(%s, %d)\n", debugstr_w(hostname), portnumber );
 
-    if (!(hostnameU = strWtoU( hostname ? hostname : defaulthost ))) return NULL;
+    if (!(hostnameU = strWtoU( hostname ? hostname : L"localhost" ))) return NULL;
     if (!(url = urlify_hostnames( "ldap://", hostnameU, portnumber ))) goto exit;
 
     ld = create_context( url );
@@ -401,7 +398,7 @@ WLDAP32_LDAP * CDECL ldap_openW( WCHAR *hostname, ULONG portnumber )
 
     TRACE( "(%s, %d)\n", debugstr_w(hostname), portnumber );
 
-    if (!(hostnameU = strWtoU( hostname ? hostname : defaulthost ))) return NULL;
+    if (!(hostnameU = strWtoU( hostname ? hostname : L"localhost" ))) return NULL;
     if (!(url = urlify_hostnames( "ldap://", hostnameU, portnumber ))) goto exit;
 
     ld = create_context( url );
@@ -462,7 +459,7 @@ WLDAP32_LDAP * CDECL ldap_sslinitW( WCHAR *hostname, ULONG portnumber, int secur
 
     TRACE( "(%s, %d, 0x%08x)\n", debugstr_w(hostname), portnumber, secure );
 
-    if (!(hostnameU = strWtoU( hostname ? hostname : defaulthost ))) return NULL;
+    if (!(hostnameU = strWtoU( hostname ? hostname : L"localhost" ))) return NULL;
 
     if (secure)
         url = urlify_hostnames( "ldaps://", hostnameU, portnumber );
diff --git a/dlls/wldap32/winldap_private.h b/dlls/wldap32/winldap_private.h
index 6777c114d81..0d528471b0c 100644
--- a/dlls/wldap32/winldap_private.h
+++ b/dlls/wldap32/winldap_private.h
@@ -220,15 +220,9 @@ typedef struct ldap_version_info
 #define LDAP_SERVER_RESP_SORT_OID "1.2.840.113556.1.4.474"
 #define LDAP_CONTROL_VLVRESPONSE "2.16.840.1.113730.3.4.10"
 
-#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
 {




More information about the wine-cvs mailing list