diff --git a/client/app_start.cpp b/client/app_start.cpp
index d6b9073b35..3fc136b42e 100644
--- a/client/app_start.cpp
+++ b/client/app_start.cpp
@@ -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
diff --git a/lib/win_util.cpp b/lib/win_util.cpp
index 82b17f4425..6124fe641b 100644
--- a/lib/win_util.cpp
+++ b/lib/win_util.cpp
@@ -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
diff --git a/lib/win_util.h b/lib/win_util.h
index 6b76779bf8..35345e70e4 100644
--- a/lib/win_util.h
+++ b/lib/win_util.h
@@ -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
diff --git a/win_build/vboxwrapper.vcxproj b/win_build/vboxwrapper.vcxproj
index 56ce484f49..e78510cf08 100644
--- a/win_build/vboxwrapper.vcxproj
+++ b/win_build/vboxwrapper.vcxproj
@@ -97,9 +97,9 @@
vboxwrapper_26207_windows_x86_64
- vboxwrapper_26206_windows_arm64
- vboxwrapper_26206_windows_x86_64
- vboxwrapper_26206_windows_arm64
+ vboxwrapper_26207_windows_arm64
+ vboxwrapper_26207_windows_x86_64
+ vboxwrapper_26207_windows_arm64