Revert "sspi - Small code tidy up"

This reverts commit 46cd5f1daddad3b3e542e6d93eee52e8bb9a8687.
This commit is contained in:
Yang Tse 2012-04-23 16:27:47 +02:00
parent d83233501f
commit 071f8d4182

View File

@ -35,6 +35,7 @@
/* The last #include file should be: */ /* The last #include file should be: */
#include "memdebug.h" #include "memdebug.h"
/* We use our own typedef here since some headers might lack these */ /* We use our own typedef here since some headers might lack these */
typedef PSecurityFunctionTableA (APIENTRY *INITSECURITYINTERFACE_FN_A)(VOID); typedef PSecurityFunctionTableA (APIENTRY *INITSECURITYINTERFACE_FN_A)(VOID);
@ -44,6 +45,7 @@ HMODULE s_hSecDll = NULL;
/* Pointer to SSPI dispatch table */ /* Pointer to SSPI dispatch table */
PSecurityFunctionTableA s_pSecFn = NULL; PSecurityFunctionTableA s_pSecFn = NULL;
/* /*
* Curl_sspi_global_init() * Curl_sspi_global_init()
* *
@ -56,13 +58,15 @@ PSecurityFunctionTableA s_pSecFn = NULL;
* called through the Security Service Provider Interface dispatch table. * called through the Security Service Provider Interface dispatch table.
*/ */
CURLcode Curl_sspi_global_init(void) CURLcode
Curl_sspi_global_init(void)
{ {
OSVERSIONINFO osver; OSVERSIONINFO osver;
INITSECURITYINTERFACE_FN_A pInitSecurityInterface; INITSECURITYINTERFACE_FN_A pInitSecurityInterface;
/* If security interface is not yet initialized try to do this */ /* If security interface is not yet initialized try to do this */
if(!s_hSecDll) { if(s_hSecDll == NULL) {
/* Find out Windows version */ /* Find out Windows version */
memset(&osver, 0, sizeof(osver)); memset(&osver, 0, sizeof(osver));
osver.dwOSVersionInfoSize = sizeof(osver); osver.dwOSVersionInfoSize = sizeof(osver);
@ -92,8 +96,8 @@ CURLcode Curl_sspi_global_init(void)
s_pSecFn = pInitSecurityInterface(); s_pSecFn = pInitSecurityInterface();
if(! s_pSecFn) if(! s_pSecFn)
return CURLE_FAILED_INIT; return CURLE_FAILED_INIT;
}
}
return CURLE_OK; return CURLE_OK;
} }
@ -166,7 +170,8 @@ CURLcode Curl_sspi_version(int *major, int *minor, int *build, int *special)
* This deinitializes the Security Service Provider Interface from libcurl. * This deinitializes the Security Service Provider Interface from libcurl.
*/ */
void Curl_sspi_global_cleanup(void) void
Curl_sspi_global_cleanup(void)
{ {
if(s_hSecDll) { if(s_hSecDll) {
FreeLibrary(s_hSecDll); FreeLibrary(s_hSecDll);