Skip to content
This repository has been archived by the owner on Jul 19, 2024. It is now read-only.

Commit

Permalink
Return E_CREATE_PROCESS_FAILED on CreateProcess failure
Browse files Browse the repository at this point in the history
  • Loading branch information
garyttierney committed Mar 27, 2024
1 parent 9129a79 commit b90d6f0
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion launcher/launcher.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ enum LauncherError : int {
E_OS_ERROR = -1,
E_APP_NOT_FOUND = -2,
E_MODENGINE_NOT_FOUND = -3,
E_CREATE_PROCESS_FAILED = -4,
};

struct LaunchTargetParams {
Expand Down Expand Up @@ -227,12 +228,15 @@ int main()
fs::absolute(modengine_dll_path).native().c_str(),
reinterpret_cast<PDETOUR_CREATE_PROCESS_ROUTINEW>(create_process_addr));

auto status = E_OK;

if (!success) {
logger->error("Couldn't create process: {:x}", GetLastError());
status = E_CREATE_PROCESS_FAILED;
}

CloseHandle(pi.hProcess);
CloseHandle(pi.hThread);

return E_OK;
return status;
}

0 comments on commit b90d6f0

Please sign in to comment.