* License. For details, see the LICENSE file in the top-level source
* directory or online at http://www.openafs.org/dl/license10.html
*/
-/* copyright (c) 2005
+/* AFSIFS Portions copyright (c) 2005
* the regents of the university of michigan
* all rights reserved
*
#endif
if (!InitClass(hInstance))
- return (FALSE);
+ return (FALSE);
- if (!InitInstance(hInstance, nCmdShow))
- return (FALSE);
+ if (!InitInstance(hInstance, nCmdShow))
+ return (FALSE);
- while (GetMessage(&msg, NULL, 0, 0)) {
- TranslateMessage(&msg);
- DispatchMessage(&msg);
- }
+ while (GetMessage(&msg, NULL, 0, 0)) {
+ TranslateMessage(&msg);
+ DispatchMessage(&msg);
+ }
#ifdef AFSIFS
- WaitForMultipleObjects(WORKER_THREADS, hAFSDWorkerThread, TRUE, INFINITE);
- for (i = 0; i < WORKER_THREADS; i++)
- CloseHandle(hAFSDWorkerThread[i]);
- //CloseHandle(hAFSDMainThread);
- RpcMgmtStopServerListening(NULL);
+ WaitForMultipleObjects(WORKER_THREADS, hAFSDWorkerThread, TRUE, INFINITE);
+ for (i = 0; i < WORKER_THREADS; i++)
+ CloseHandle(hAFSDWorkerThread[i]);
+ //CloseHandle(hAFSDMainThread);
+ RpcMgmtStopServerListening(NULL);
#endif
- return (msg.wParam);
+ return (msg.wParam);
}
osi_panic(reason, __FILE__, __LINE__);
#ifndef AFSIFS
- code = afsd_InitSMB(&reason, MessageBox);
+ code = afsd_InitSMB(&reason, MessageBox);
#else
code = ifs_Init(&reason);
#endif
if (code != 0)
- osi_panic(reason, __FILE__, __LINE__);
+ osi_panic(reason, __FILE__, __LINE__);
#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"));
+ if ( GetLastError() == ERROR_ALREADY_EXISTS )
+ afsi_log("Event Object Already Exists: %s", TEXT("afsd_service_DoTerminate"));
for (cnt = 0; cnt < WORKER_THREADS; cnt++)
- hAFSDWorkerThread[cnt] = CreateThread(NULL, 0, ifs_MainLoop, 0, 0, NULL);
+ hAFSDWorkerThread[cnt] = CreateThread(NULL, 0, ifs_MainLoop, 0, 0, NULL);
#endif
ShowWindow(hWnd, SW_SHOWMINNOACTIVE);
* License. For details, see the LICENSE file in the top-level source
* directory or online at http://www.openafs.org/dl/license10.html
*/
-/* copyright (c) 2005
+/* AFSIFS portions copyright (c) 2005
* the regents of the university of michigan
* all rights reserved
*
#endif
#ifndef AFSIFS
- SetEvent(WaitToTerminate);
+ SetEvent(WaitToTerminate);
#else
- SetEvent(DoTerminate);
- WaitForMultipleObjects(WORKER_THREADS, hAFSDWorkerThread, TRUE, INFINITE);
- for (i = 0; i < WORKER_THREADS; i++)
- CloseHandle(hAFSDWorkerThread[i]);
+ SetEvent(DoTerminate);
+ WaitForMultipleObjects(WORKER_THREADS, hAFSDWorkerThread, TRUE, INFINITE);
+ for (i = 0; i < WORKER_THREADS; i++)
+ CloseHandle(hAFSDWorkerThread[i]);
#endif
#ifdef JUMP
#ifndef AFSIFS
SetEvent(WaitToTerminate);
#else
- SetEvent(DoTerminate);
+ SetEvent(DoTerminate);
#endif
break;
#ifndef AFSIFS
SetEvent(WaitToTerminate);
#else
- SetEvent(DoTerminate);
+ SetEvent(DoTerminate);
#endif
dwRet = NO_ERROR;
break;
return;
#ifndef AFSIFS
- while (1) {
+ while (1) {
dwDriveSize = sizeof(szDriveToMapTo);
dwSubMountSize = sizeof(szSubMount);
dwResult = RegEnumValue(hKey, dwIndex++, szDriveToMapTo, &dwDriveSize, 0, &dwType, szSubMount, &dwSubMountSize);
afsi_log("Event Object Already Exists: %s", TEXT("afsd_service_WaitToTerminate"));
#ifdef AFSIFS
- DoTerminate = CreateEvent(NULL, TRUE, FALSE, TEXT("afsd_service_DoTerminate"));
+ 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
osi_panic(reason, __FILE__, __LINE__);
}
#else
- code = ifs_Init(&reason);
- if (code != 0) {
- afsi_log("ifs_Init failed: %s (code = %d)", reason, code);
- osi_panic(reason, __FILE__, __LINE__);
- }
- for (cnt = 0; cnt < WORKER_THREADS; cnt++)
- hAFSDWorkerThread[cnt] = CreateThread(NULL, 0, ifs_MainLoop, 0, 0, NULL);
-#endif
+ code = ifs_Init(&reason);
+ if (code != 0) {
+ afsi_log("ifs_Init failed: %s (code = %d)", reason, code);
+ osi_panic(reason, __FILE__, __LINE__);
+ }
+ for (cnt = 0; cnt < WORKER_THREADS; cnt++)
+ hAFSDWorkerThread[cnt] = CreateThread(NULL, 0, ifs_MainLoop, 0, 0, NULL);
+#endif
/* allow an exit to be called post smb initialization */
hHookDll = LoadLibrary(AFSD_HOOK_DLL);
}
#ifndef AFSIFS
- WaitForSingleObject(WaitToTerminate, INFINITE);
+ WaitForSingleObject(WaitToTerminate, INFINITE);
#else
- WaitForMultipleObjects(WORKER_THREADS, hAFSDWorkerThread, TRUE, INFINITE);
- for (cnt = 0; cnt < WORKER_THREADS; cnt++)
- CloseHandle(hAFSDWorkerThread[cnt]);
+ WaitForMultipleObjects(WORKER_THREADS, hAFSDWorkerThread, TRUE, INFINITE);
+ for (cnt = 0; cnt < WORKER_THREADS; cnt++)
+ CloseHandle(hAFSDWorkerThread[cnt]);
#endif
afsi_log("Received Termination Signal, Stopping Service");