diff options
Diffstat (limited to 'inject/injectee.cpp')
-rw-r--r-- | inject/injectee.cpp | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/inject/injectee.cpp b/inject/injectee.cpp index c0f417e7..05fc5ab7 100644 --- a/inject/injectee.cpp +++ b/inject/injectee.cpp @@ -118,16 +118,23 @@ MyCreateProcessCommon(BOOL bRet, LPPROCESS_INFORMATION lpProcessInformation) { if (!bRet) { + debugPrintf("inject: warning: failed to create child process\n"); return; } DWORD dwLastError = GetLastError(); - char szDllPath[MAX_PATH]; - GetModuleFileNameA(g_hThisModule, szDllPath, sizeof szDllPath); + if (isDifferentArch(lpProcessInformation->hProcess)) { + debugPrintf("inject: error: child process %lu has different architecture\n", + GetProcessId(lpProcessInformation->hProcess)); + } else { + char szDllPath[MAX_PATH]; + GetModuleFileNameA(g_hThisModule, szDllPath, sizeof szDllPath); - if (!injectDll(lpProcessInformation->hProcess, szDllPath)) { - debugPrintf("inject: warning: failed to inject child process\n"); + if (!injectDll(lpProcessInformation->hProcess, szDllPath)) { + debugPrintf("inject: warning: failed to inject into child process %lu\n", + GetProcessId(lpProcessInformation->hProcess)); + } } if (!(dwCreationFlags & CREATE_SUSPENDED)) { |