mirror of
https://github.com/Ed94/raddebugger.git
synced 2026-08-05 21:38:40 +00:00
better error message if CreateProcess fails
This commit is contained in:
committed by
Ryan Fleury
parent
0705ba0a96
commit
0c999d70dc
@@ -1312,7 +1312,13 @@ dmn_ctrl_launch(DMN_CtrlCtx *ctx, OS_ProcessLaunchParams *params)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
log_user_errorf("There was an error starting %S.", params->cmd_line.first->string);
|
DWORD error = GetLastError();
|
||||||
|
LPWSTR message = 0;
|
||||||
|
FormatMessageW(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM, 0, error, MAKELANGID(LANG_NEUTRAL,SUBLANG_NEUTRAL), (LPWSTR)&message, 0, 0);
|
||||||
|
String8 message8 = message ? str8_from_16(scratch.arena, str16_cstring(message)) : str8_lit("unknown error");
|
||||||
|
LocalFree(message);
|
||||||
|
|
||||||
|
log_user_errorf("There was an error starting %S: %S", params->cmd_line.first->string, message8);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
scratch_end(scratch);
|
scratch_end(scratch);
|
||||||
|
|||||||
Reference in New Issue
Block a user