- increment vboxwrapper filename in Win project files

- client (Win): if process creation fails,
    show the exec path in the error message (rather than '%1')
This commit is contained in:
davidpanderson 2023-12-12 16:53:45 -08:00
parent ed352ec16b
commit 5c62c35114
4 changed files with 16 additions and 15 deletions

View File

@ -748,7 +748,7 @@ int ACTIVE_TASK::start(bool test) {
} else {
prio_mask = get_priority(high_priority);
}
for (i=0; i<5; i++) {
last_error = 0;
if (sandbox_account_service_token != NULL) {
@ -779,7 +779,7 @@ int ACTIVE_TASK::start(bool test) {
break;
} else {
last_error = GetLastError();
windows_format_error_string(last_error, error_msg, sizeof(error_msg));
windows_format_error_string(last_error, error_msg, sizeof(error_msg), exec_path);
msg_printf(wup->project, MSG_INTERNAL_ERROR,
"Process creation failed: %s - error code %d (0x%x)",
error_msg, last_error, last_error
@ -813,7 +813,7 @@ int ACTIVE_TASK::start(bool test) {
break;
} else {
last_error = GetLastError();
windows_format_error_string(last_error, error_msg, sizeof(error_msg));
windows_format_error_string(last_error, error_msg, sizeof(error_msg), exec_path);
msg_printf(wup->project, MSG_INTERNAL_ERROR,
"Process creation failed: %s - error code %d (0x%x)",
error_msg, last_error, last_error

View File

@ -137,23 +137,24 @@ std::string boinc_wide_to_ascii(const std::wstring& str) {
// get message for given error
//
char* windows_format_error_string(
unsigned long dwError, char* pszBuf, int iSize
unsigned long dwError, char* pszBuf, int iSize ...
) {
DWORD dwRet;
LPWSTR lpszTemp = NULL;
LPSTR lpszTemp = NULL;
dwRet = FormatMessageW(
FORMAT_MESSAGE_IGNORE_INSERTS |
va_list args;
va_start(args, iSize);
dwRet = FormatMessage(
FORMAT_MESSAGE_ALLOCATE_BUFFER |
FORMAT_MESSAGE_FROM_SYSTEM |
FORMAT_MESSAGE_ARGUMENT_ARRAY,
FORMAT_MESSAGE_FROM_SYSTEM ,
NULL,
dwError,
LANG_NEUTRAL,
(LPWSTR)&lpszTemp,
(LPSTR)&lpszTemp,
0,
NULL
&args
);
va_end(args);
if (dwRet != 0) {
// include the hex error code as well

View File

@ -25,7 +25,7 @@ extern std::wstring boinc_ascii_to_wide(const std::string& str);
extern std::string boinc_wide_to_ascii(const std::wstring& str);
extern char* windows_format_error_string(
unsigned long dwError, char* pszBuf, int iSize
unsigned long dwError, char* pszBuf, int iSize ...
);
#endif

View File

@ -97,9 +97,9 @@
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Release|x64'" />
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'" />
<TargetName Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">vboxwrapper_26207_windows_x86_64</TargetName>
<TargetName Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'">vboxwrapper_26206_windows_arm64</TargetName>
<TargetName Condition="'$(Configuration)|$(Platform)'=='Release|x64'">vboxwrapper_26206_windows_x86_64</TargetName>
<TargetName Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'">vboxwrapper_26206_windows_arm64</TargetName>
<TargetName Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'">vboxwrapper_26207_windows_arm64</TargetName>
<TargetName Condition="'$(Configuration)|$(Platform)'=='Release|x64'">vboxwrapper_26207_windows_x86_64</TargetName>
<TargetName Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'">vboxwrapper_26207_windows_arm64</TargetName>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<Midl>