X-Git-Url: http://www.project-moonshot.org/gitweb/?p=moonshot.git;a=blobdiff_plain;f=moonshot%2Fmech_eap%2Futil_tld.c;h=e3710f94fae30b119b6afd3f9e7857127c89f142;hp=f6feeba964ea895d1ab1312a515ae4c23c6b0afc;hb=8188926d28cbf07474a662a97bfb504984311e16;hpb=d01cd29143dde56784b7249c27ebd1f4b99434a7 diff --git a/moonshot/mech_eap/util_tld.c b/moonshot/mech_eap/util_tld.c index f6feeba..e3710f9 100644 --- a/moonshot/mech_eap/util_tld.c +++ b/moonshot/mech_eap/util_tld.c @@ -51,7 +51,7 @@ destroyThreadLocalData(struct gss_eap_thread_local_data *tld) #ifdef WIN32 /* - * This is the tls index returned by TlsAlloc() on process init. + * This is the TLS index returned by TlsAlloc() on process init. * Each thread, on thread attach in DllMain(), allocates its thread-local * data and uses this index with TlsSetValue() to store it. * It can then subsequently be retrieved with TlsGetValue(). @@ -71,11 +71,15 @@ DllMain(HINSTANCE hDLL, /* DLL module handle */ LPVOID reserved) /* reserved */ { struct gss_eap_thread_local_data *tlsData; + OM_uint32 major, minor; switch (reason) { case DLL_PROCESS_ATTACH: /* Allocate a TLS index. */ - gssEapInitiatorInit(); + major = gssEapInitiatorInit(&minor); + if (GSS_ERROR(major)) + return FALSE; + tlsIndex = TlsAlloc(); if (tlsIndex == TLS_OUT_OF_INDEXES) return FALSE;