diff options
author | Mounir IDRASSI <mounir.idrassi@idrix.fr> | 2024-09-02 14:02:46 +0200 |
---|---|---|
committer | Mounir IDRASSI <mounir.idrassi@idrix.fr> | 2024-09-02 14:02:46 +0200 |
commit | f024653450e3bbbd54aa98ab8dc1ad96f8afa1b6 (patch) | |
tree | 97710c4c2230ff85e66032e6b9c4d08482ce929d /src/Common | |
parent | 68ade5717bd9619ef795d235d5eb6d9c61ca5f8a (diff) | |
download | VeraCrypt-f024653450e3bbbd54aa98ab8dc1ad96f8afa1b6.tar.gz VeraCrypt-f024653450e3bbbd54aa98ab8dc1ad96f8afa1b6.zip |
Windows: Fix truncated displayed error message
Diffstat (limited to 'src/Common')
-rw-r--r-- | src/Common/BootEncryption.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/Common/BootEncryption.cpp b/src/Common/BootEncryption.cpp index fe0cdb09..c9b275dc 100644 --- a/src/Common/BootEncryption.cpp +++ b/src/Common/BootEncryption.cpp @@ -2646,7 +2646,7 @@ namespace VeraCrypt { dwLastError = GetLastError(); wchar_t szMsg[128]; - StringCbPrintfW(szMsg, ARRAYSIZE(szMsg), L"Failed to set SE_SYSTEM_ENVIRONMENT_NAME privilege (error code 0x.8X)", dwLastError); + StringCchPrintfW(szMsg, ARRAYSIZE(szMsg), L"Failed to set SE_SYSTEM_ENVIRONMENT_NAME privilege (error code 0x%.8X)", dwLastError); throw ErrorException(szMsg, SRC_POS); } // Check EFI @@ -2658,7 +2658,7 @@ namespace VeraCrypt SetPrivilege(SE_SYSTEM_ENVIRONMENT_NAME, FALSE); // format message to append the error code to the exception message wchar_t szMsg[128]; - StringCbPrintfW(szMsg, ARRAYSIZE(szMsg), L"Failed to detect EFI environment (error code 0x.8X)", dwLastError); + StringCchPrintfW(szMsg, ARRAYSIZE(szMsg), L"Failed to detect EFI environment (error code 0x%.8X)", dwLastError); throw ErrorException(szMsg, SRC_POS); } } @@ -2715,7 +2715,7 @@ namespace VeraCrypt { dwLastError = GetLastError(); wchar_t szMsg[128]; - StringCbPrintfW(szMsg, ARRAYSIZE(szMsg), L"Failed to set SE_SYSTEM_ENVIRONMENT_NAME privilege (error code 0x.8X)", dwLastError); + StringCchPrintfW(szMsg, ARRAYSIZE(szMsg), L"Failed to set SE_SYSTEM_ENVIRONMENT_NAME privilege (error code 0x%.8X)", dwLastError); throw ErrorException(szMsg, SRC_POS); } // Check EFI @@ -2727,7 +2727,7 @@ namespace VeraCrypt SetPrivilege(SE_SYSTEM_ENVIRONMENT_NAME, FALSE); // format message to append the error code to the exception message wchar_t szMsg[1024]; - StringCbPrintfW(szMsg, ARRAYSIZE(szMsg), L"Failed to detect EFI environment (error code 0x.8X)", dwLastError); + StringCchPrintfW(szMsg, ARRAYSIZE(szMsg), L"Failed to detect EFI environment (error code 0x%.8X)", dwLastError); throw ErrorException(szMsg, SRC_POS); } } |