afsd_printStack(GetCurrentThread(), &context);
}
+#ifdef DEBUG
+ if (IsDebuggerPresent())
+ DebugBreak();
+#endif
+
afsi_log("--- begin dump ---");
cm_MemDumpDirStats(afsi_file, "a", 0);
cm_MemDumpBPlusStats(afsi_file, "a", 0);
cm_DumpVolumes(afsi_file, "a", 0);
cm_DumpSCache(afsi_file, "a", 0);
cm_DumpBufHashTable(afsi_file, "a", 0);
+ cm_DumpServers(afsi_file, "a", 0);
smb_DumpVCP(afsi_file, "a", 0);
+ rx_DumpPackets(afsi_file, "a");
+ rx_DumpCalls(afsi_file, "a");
afsi_log("--- end dump ---");
-#ifdef DEBUG
- if (IsDebuggerPresent())
- DebugBreak();
-#endif
-
GenerateMiniDump(NULL);
SetEvent(WaitToTerminate);
nr.dwScope = RESOURCE_GLOBALNET; /* ignored parameter */
nr.dwType=RESOURCETYPE_DISK;
- nr.lpLocalName=szDriveToMapTo;
+ nr.lpLocalName=strlen(szDriveToMapTo) > 0 ? szDriveToMapTo : NULL;
nr.lpRemoteName=szAfsPath;
nr.dwDisplayType = RESOURCEDISPLAYTYPE_SHARE; /* ignored parameter */
nr.dwUsage = RESOURCEUSAGE_CONNECTABLE; /* ignored parameter */
}
/* allow an exit to be called prior to any initialization */
- hHookDll = LoadLibrary(AFSD_HOOK_DLL);
+ hHookDll = cm_LoadAfsdHookLib();
if (hHookDll)
{
BOOL hookRc = TRUE;
SetServiceStatus(StatusHandle, &ServiceStatus);
}
#endif
- code = afsd_InitDaemons(&reason);
- if (code != 0) {
- afsi_log("afsd_InitDaemons failed: %s (code = %d)", reason, code);
- osi_panic(reason, __FILE__, __LINE__);
- }
-
/* allow an exit to be called post rx initialization */
- hHookDll = LoadLibrary(AFSD_HOOK_DLL);
+ hHookDll = cm_LoadAfsdHookLib();
if (hHookDll)
{
BOOL hookRc = TRUE;
/* Notify any volume status handlers that the cache manager has started */
cm_VolStatus_Service_Started();
-/* the following ifdef chooses the mode of operation for the service. to enable
- * a runtime flag (instead of compile-time), pioctl() would need to dynamically
- * determine the mode, in order to use the correct ioctl special-file path. */
code = afsd_InitSMB(&reason, MessageBox);
if (code != 0) {
afsi_log("afsd_InitSMB failed: %s (code = %d)", reason, code);
}
/* allow an exit to be called post smb initialization */
- hHookDll = LoadLibrary(AFSD_HOOK_DLL);
+ hHookDll = cm_LoadAfsdHookLib();
if (hHookDll)
{
BOOL hookRc = TRUE;
MountGlobalDrives();
+ code = afsd_InitDaemons(&reason);
+ if (code != 0) {
+ afsi_log("afsd_InitDaemons failed: %s (code = %d)", reason, code);
+ osi_panic(reason, __FILE__, __LINE__);
+ }
+
#ifndef NOTSERVICE
if (bRunningAsService) {
ServiceStatus.dwCurrentState = SERVICE_RUNNING;
}
/* allow an exit to be called when started */
- hHookDll = LoadLibrary(AFSD_HOOK_DLL);
+ hHookDll = cm_LoadAfsdHookLib();
if (hHookDll)
{
BOOL hookRc = TRUE;
LogEvent(EVENTLOG_INFORMATION_TYPE, MSG_SERVICE_STOPPING);
/* allow an exit to be called prior to stopping the service */
- hHookDll = LoadLibrary(AFSD_HOOK_DLL);
+ hHookDll = cm_LoadAfsdHookLib();
if (hHookDll)
{
BOOL hookRc = TRUE;
DismountGlobalDrives();
afsi_log("Global Drives dismounted");
+ smb_Shutdown();
+ afsi_log("smb shutdown complete");
+
+ RpcShutdown();
+
+ cm_ReleaseAllLocks();
+
cm_DaemonShutdown();
afsi_log("Daemon shutdown complete");
- afsd_ShutdownCM();
-
buf_Shutdown();
afsi_log("Buffer shutdown complete");
- rx_Finalize();
- afsi_log("rx finalization complete");
-
- smb_Shutdown();
- afsi_log("smb shutdown complete");
-
- RpcShutdown();
+ afsd_ShutdownCM();
- cm_ReleaseAllLocks();
+ cm_ShutdownMappedMemory();
rx_Finalize();
afsi_log("rx finalization complete");
- cm_ShutdownMappedMemory();
-
#ifdef REGISTER_POWER_NOTIFICATIONS
/* terminate thread used to flush cache */
if (powerEventsRegistered)
cm_VolStatus_Finalize();
/* allow an exit to be called after stopping the service */
- hHookDll = LoadLibrary(AFSD_HOOK_DLL);
+ hHookDll = cm_LoadAfsdHookLib();
if (hHookDll)
{
BOOL hookRc = TRUE;