From: Jeffrey Altman Date: Mon, 20 Jun 2005 15:09:18 +0000 (+0000) Subject: windows-afsifs-20050620 X-Git-Tag: openafs-devel-1_5_0~485 X-Git-Url: http://git.openafs.org/?p=openafs.git;a=commitdiff_plain;h=6e732a8032b921b358337606ebf2972b3dbf7baa windows-afsifs-20050620 more IFS reformatting that was not committed in the window-afsifs-20050617 delta --- diff --git a/src/WINNT/afsd/afsd.c b/src/WINNT/afsd/afsd.c index 4a51af1..7acd6aa 100644 --- a/src/WINNT/afsd/afsd.c +++ b/src/WINNT/afsd/afsd.c @@ -6,7 +6,7 @@ * 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 * @@ -124,25 +124,25 @@ int WINAPI WinMain( #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); } @@ -224,20 +224,20 @@ BOOL InitInstance( 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); diff --git a/src/WINNT/afsd/afsd_service.c b/src/WINNT/afsd/afsd_service.c index 73bebb3..fedc01f 100644 --- a/src/WINNT/afsd/afsd_service.c +++ b/src/WINNT/afsd/afsd_service.c @@ -6,7 +6,7 @@ * 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 * @@ -126,12 +126,12 @@ static void afsd_notifier(char *msgp, char *filep, long line) #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 @@ -240,7 +240,7 @@ afsd_ServiceControlHandler(DWORD ctrlCode) #ifndef AFSIFS SetEvent(WaitToTerminate); #else - SetEvent(DoTerminate); + SetEvent(DoTerminate); #endif break; @@ -312,7 +312,7 @@ afsd_ServiceControlHandlerEx( #ifndef AFSIFS SetEvent(WaitToTerminate); #else - SetEvent(DoTerminate); + SetEvent(DoTerminate); #endif dwRet = NO_ERROR; break; @@ -502,7 +502,7 @@ static void DismountGlobalDrives() return; #ifndef AFSIFS - while (1) { + while (1) { dwDriveSize = sizeof(szDriveToMapTo); dwSubMountSize = sizeof(szSubMount); dwResult = RegEnumValue(hKey, dwIndex++, szDriveToMapTo, &dwDriveSize, 0, &dwType, szSubMount, &dwSubMountSize); @@ -1086,7 +1086,7 @@ afsd_Main(DWORD argc, LPTSTR *argv) 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 @@ -1274,14 +1274,14 @@ afsd_Main(DWORD argc, LPTSTR *argv) 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); @@ -1359,11 +1359,11 @@ afsd_Main(DWORD argc, LPTSTR *argv) } #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");