[PATCH 7/8] wldap32: Use wide character string literals.
Signed-off-by: Hans Leidekker <hans(a)codeweavers.com> --- 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 { -- 2.30.2
participants (1)
-
Hans Leidekker