Skip to content
Snippets Groups Projects
Commit 91a50a4b authored by Rom Walton's avatar Rom Walton
Browse files

VBOX: Explicitly check the return value if CreateProcess fails while...

VBOX: Explicitly check the return value if CreateProcess fails while attempting to launch vboxsvc.exe.
parent 699f22d0
No related branches found
No related tags found
No related merge requests found
......@@ -2287,7 +2287,8 @@ int VBOX_VM::launch_vboxsvc() {
command = "\"VBoxSVC.exe\" --logrotate 1";
CreateProcess(
// Execute command
if (!CreateProcess(
NULL,
(LPTSTR)command.c_str(),
NULL,
......@@ -2298,7 +2299,16 @@ int VBOX_VM::launch_vboxsvc() {
virtualbox_home_directory.c_str(),
&si,
&pi
)) {
vboxlog_msg(
"Status Report: Launching vboxsvc.exe failed!."
);
vboxlog_msg(
" Error: %s (%d)",
windows_format_error_string(GetLastError(), buf, sizeof(buf)),
GetLastError()
);
}
if (pi.hThread) CloseHandle(pi.hThread);
if (pi.hProcess) {
......@@ -2306,9 +2316,6 @@ int VBOX_VM::launch_vboxsvc() {
vboxsvc_pid = pi.dwProcessId;
vboxsvc_pid_handle = pi.hProcess;
retval = BOINC_SUCCESS;
} else {
vboxlog_msg("Status Report: Launching vboxsvc.exe failed!.");
vboxlog_msg(" Error: %s", windows_format_error_string(GetLastError(), buf, sizeof(buf)));
}
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment