diff options
author | burlex <burlex@e03df62e-2008-0410-955e-edbf42e46eb7> | 2007-06-11 20:35:28 +0000 |
---|---|---|
committer | burlex <burlex@e03df62e-2008-0410-955e-edbf42e46eb7> | 2007-06-11 20:35:28 +0000 |
commit | 9a9a39c9782737f503db220d0a71659d227fc106 (patch) | |
tree | 2b63ea5f5ee92675d85f24adb078ea6a2ded8db7 /src | |
parent | 895c3dcdf043b8f36219b228c36612282be602b0 (diff) |
- Added more debug output to windows fork in order to help debug problems encountered.
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@7270 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src')
-rw-r--r-- | src/inspircd.cpp | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/inspircd.cpp b/src/inspircd.cpp index dee4ece10..3fed0470f 100644 --- a/src/inspircd.cpp +++ b/src/inspircd.cpp @@ -58,7 +58,10 @@ DWORD WindowsForkStart(InspIRCd * Instance) char module[MAX_PATH]; if(!GetModuleFileName(NULL, module, MAX_PATH)) + { + printf("GetModuleFileName() failed.\n"); return false; + } STARTUPINFO startupinfo; PROCESS_INFORMATION procinfo; @@ -81,13 +84,19 @@ DWORD WindowsForkStart(InspIRCd * Instance) &procinfo); // process info if(!bSuccess) + { + printf("CreateProcess() failed.\n"); return false; + } // Set the owner process id in the target process. SIZE_T written = 0; DWORD pid = GetCurrentProcessId(); if(!WriteProcessMemory(procinfo.hProcess, &owner_processid, &pid, sizeof(DWORD), &written) || written != sizeof(DWORD)) + { + printf("WriteProcessMemory() failed.\n"); return false; + } // Resume the other thread (let it start) ResumeThread(procinfo.hThread); @@ -98,6 +107,7 @@ DWORD WindowsForkStart(InspIRCd * Instance) // If we hit this it means startup failed, default to 14 if this fails. DWORD ExitCode = 14; GetExitCodeProcess(procinfo.hProcess, &ExitCode); + printf("Startup failed, exitcode was %u.\n", ExitCode); CloseHandle(procinfo.hThread); CloseHandle(procinfo.hProcess); return ExitCode; @@ -107,11 +117,17 @@ void WindowsForkKillOwner(InspIRCd * Instance) { HANDLE hProcess = OpenProcess(PROCESS_TERMINATE, FALSE, owner_processid); if(!hProcess || !owner_processid) + { + printf("Could not open process id %u.\n", owner_processid); Instance->Exit(14); + } // die die die if(!TerminateProcess(hProcess, 0)) + { + printf("Could not TerminateProcess().\n"); Instance->Exit(14); + } CloseHandle(hProcess); } |