]> git.michaelhowe.org Git - packages/o/openafs.git/commitdiff
STABLE14-windows-afslogon-20061219
authorJeffrey Altman <jaltman@secure-endpoints.com>
Tue, 19 Dec 2006 18:02:26 +0000 (18:02 +0000)
committerJeffrey Altman <jaltman@secure-endpoints.com>
Tue, 19 Dec 2006 18:02:26 +0000 (18:02 +0000)
Initialize Winsock from within afslogon.c so that ka_UserAuth will
work again.

(cherry picked from commit ea60a4dd395d0b14db1da2e5fec7d8dea48b2e70)

src/WINNT/afsd/afslogon.c

index d5c403a91f51c2be2e81bccc900b4c9429a60851..1446b60854487d5f295a412281d1f6e8ecd5cfcd 100644 (file)
@@ -74,19 +74,24 @@ static BOOL bInit = FALSE;
 
 BOOLEAN APIENTRY DllEntryPoint(HANDLE dll, DWORD reason, PVOID reserved)
 {
+    WSADATA wsaData;
     hDLL = dll;
+    
     switch (reason) {
     case DLL_PROCESS_ATTACH:
         /* Initialization Mutex */
-       if (!bInit) {
+       if (!bInitMutex) {
            hInitMutex = CreateMutex(NULL, FALSE, NULL);
        }
+
+       WSAStartup( MAKEWORD(2,2), &wsaData );
         break;
 
     case DLL_PROCESS_DETACH:
        /* do nothing on unload because we might 
         * be reloaded.
         */
+        WSACleanup();
        CloseHandle(hInitMutex);
        hInitMutex = NULL;
        bInit = FALSE;