windows-afs-svrmgr-20070719
[openafs.git] / src / WINNT / afsclass / c_svr.cpp
index 9fd8eab..2cad619 100644 (file)
@@ -7,6 +7,9 @@
  * directory or online at http://www.openafs.org/dl/license10.html
  */
 
+#include <winsock2.h>
+#include <ws2tcpip.h>
+
 extern "C" {
 #include <afs/param.h>
 #include <afs/stds.h>
@@ -760,7 +763,7 @@ void AfsClass_SkipRefresh (int idSection)
 
 DWORD WINAPI SERVER::CanTalkToServer_ThreadProc (PVOID lp)
 {
-   int idSection = (int)lp;
+   int idSection = PtrToInt(lp);
 
    // Until we post a notification saying that we've entered
    // a section, we don't need to worry about the aRefSec[] entry
@@ -783,8 +786,8 @@ DWORD WINAPI SERVER::CanTalkToServer_ThreadProc (PVOID lp)
    // the lpServer pointer won't have been freed.)
    // 
    PVOID hCell;
-   PVOID hBOS;
-   PVOID hVOS;
+   PVOID hBOS = NULL;
+   PVOID hVOS = NULL;
 
    TCHAR szServer[ cchNAME ];
 
@@ -984,7 +987,7 @@ BOOL SERVER::CanTalkToServer (ULONG *pStatus)
    //
    DWORD dwThreadID;
    HANDLE hThread;
-   if ((hThread = CreateThread (NULL, 0, (LPTHREAD_START_ROUTINE)CanTalkToServer_ThreadProc, (PVOID)idSection, 0, &dwThreadID)) == NULL)
+   if ((hThread = CreateThread (NULL, 0, (LPTHREAD_START_ROUTINE)CanTalkToServer_ThreadProc, IntToPtr(idSection), 0, &dwThreadID)) == NULL)
       {
       EnterCriticalSection (pcsRefSec);
       aRefSec[ idSection ].fInUse = FALSE;