HANDLE hAFSDWorkerThread[WORKER_THREADS];
#endif
-/* for the IFS version, set the event DoTerminate, on which all
- worker threads wait. they will exit, and then everything else
- can uninitialize. */
-HANDLE WaitToTerminate, DoTerminate;
+HANDLE WaitToTerminate;
int GlobalStatus;
DebugBreak();
#endif
-#ifndef AFSIFS
SetEvent(WaitToTerminate);
-#else
- SetEvent(DoTerminate);
+#ifdef AFSIFS
WaitForMultipleObjects(WORKER_THREADS, hAFSDWorkerThread, TRUE, INFINITE);
for (i = 0; i < WORKER_THREADS; i++)
CloseHandle(hAFSDWorkerThread[i]);
}
doneTrace:
-#ifndef AFSIFS
SetEvent(WaitToTerminate);
-#else
- SetEvent(DoTerminate);
-#endif
break;
case SERVICE_CONTROL_INTERROGATE:
}
doneTrace:
-#ifndef AFSIFS
SetEvent(WaitToTerminate);
-#else
- SetEvent(DoTerminate);
-#endif
dwRet = NO_ERROR;
break;
#define MAX_RETRIES 30
static void MountGlobalDrives(void)
{
+#ifndef AFSIFS
char szAfsPath[_MAX_PATH];
+#endif
char szDriveToMapTo[5];
DWORD dwResult;
char szKeyName[256];
static void DismountGlobalDrives()
{
+#ifndef AFSIFS
char szAfsPath[_MAX_PATH];
char szDriveToMapTo[5];
- DWORD dwResult;
- char szKeyName[256];
- HKEY hKey;
- DWORD dwIndex = 0;
DWORD dwDriveSize;
DWORD dwSubMountSize;
char szSubMount[256];
DWORD dwType;
+#endif
+ DWORD dwResult;
+ char szKeyName[256];
+ HKEY hKey;
+ DWORD dwIndex = 0;
sprintf(szKeyName, "%s\\GlobalAutoMapper", AFSREG_CLT_SVC_PARAM_SUBKEY);
if (dwResult != ERROR_SUCCESS)
return;
-#ifndef AFSIFS
+#ifdef AFSIFS
+ /* FIXFIX: implement */
+#else
while (1) {
dwDriveSize = sizeof(szDriveToMapTo);
dwSubMountSize = sizeof(szSubMount);
afsi_log("Disconnect from GlobalAutoMap of %s to %s %s", szDriveToMapTo, szSubMount, dwResult ? "succeeded" : "failed");
}
-#else
- /* FIXFIX: implement */
#endif
RegCloseKey(hKey);
if ( GetLastError() == ERROR_ALREADY_EXISTS )
afsi_log("Event Object Already Exists: %s", TEXT("afsd_service_WaitToTerminate"));
-#ifdef AFSIFS
- DoTerminate = CreateEvent(NULL, TRUE, FALSE, TEXT("afsd_service_DoTerminate"));
- if ( GetLastError() == ERROR_ALREADY_EXISTS )
- afsi_log("Event Object Already Exists: %s", TEXT("afsd_service_DoTerminate"));
-#endif
-
#ifndef NOTSERVICE
hAdvApi32 = LoadLibrary("advapi32.dll");
if (hAdvApi32 == NULL)
printf("Hit <Enter> to terminate OpenAFS Client Service\n");
getchar();
-#ifndef AFSIFS
SetEvent(WaitToTerminate);
-#else
- SetEvent(DoTerminate);
- dc_release_hooks();
+#ifdef AFSIFS
+ dc_release_hooks();
#endif
}
}