unicode NTLM SSPI: cleanup

Reduce the number of #ifdef UNICODE directives used in source files.
This commit is contained in:
Yang Tse
2012-07-05 22:16:15 +02:00
parent 1b27bb446f
commit e77d867068
10 changed files with 195 additions and 162 deletions

View File

@@ -161,13 +161,11 @@ CURLcode Curl_SOCKS5_gssapi_negotiate(int sockindex,
/* errors, keep sending it... */
for(;;) {
TCHAR *sname;
#ifdef UNICODE
sname = Curl_convert_UTF8_to_wchar(service_name);
sname = Curl_convert_UTF8_to_tchar(service_name);
if(!sname)
return CURLE_OUT_OF_MEMORY;
#else
sname = service_name;
#endif
status = s_pSecFn->InitializeSecurityContext(&cred_handle,
context_handle,
sname,
@@ -184,9 +182,7 @@ CURLcode Curl_SOCKS5_gssapi_negotiate(int sockindex,
&sspi_ret_flags,
&expiry);
#ifdef UNICODE
Curl_safefree(sname);
#endif
Curl_unicodefree(sname);
if(sspi_recv_token.pvBuffer) {
s_pSecFn->FreeContextBuffer(sspi_recv_token.pvBuffer);