diff options
author | Mounir IDRASSI <mounir.idrassi@idrix.fr> | 2014-12-03 00:11:38 +0100 |
---|---|---|
committer | Mounir IDRASSI <mounir.idrassi@idrix.fr> | 2014-12-04 13:47:31 +0100 |
commit | a5df5d981a79c5da3913f48e89e4bdbaaec7dc37 (patch) | |
tree | c8c8cbcffc2b7b799e9ee41094d07df70e9aacfd | |
parent | dfff9273891e5a91753def02eb73ebf095b21727 (diff) | |
download | VeraCrypt-a5df5d981a79c5da3913f48e89e4bdbaaec7dc37.tar.gz VeraCrypt-a5df5d981a79c5da3913f48e89e4bdbaaec7dc37.zip |
Windows: correct issue in displaying PDF of User Guide.
-rw-r--r-- | src/Common/Dlgcode.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/Common/Dlgcode.c b/src/Common/Dlgcode.c index e0af53fd..e6686c2c 100644 --- a/src/Common/Dlgcode.c +++ b/src/Common/Dlgcode.c @@ -2483,88 +2483,88 @@ void InitApp (HINSTANCE hInstance, char *lpszCommandLine) // This error is fatal e.g. because legal notices could not be displayed
handleWin32Error (NULL);
AbortProcess ("INIT_RICHEDIT");
}
// DPI and GUI aspect ratio
DialogBoxParamW (hInst, MAKEINTRESOURCEW (IDD_AUXILIARY_DLG), NULL,
(DLGPROC) AuxiliaryDlgProc, (LPARAM) 1);
InitHelpFileName ();
#ifndef SETUP
if (!EncryptionThreadPoolStart (ReadEncryptionThreadPoolFreeCpuCountLimit()))
{
handleWin32Error (NULL);
exit (1);
}
#endif
}
void InitHelpFileName (void)
{
char *lpszTmp;
GetModuleFileName (NULL, szHelpFile, sizeof (szHelpFile));
lpszTmp = strrchr (szHelpFile, '\\');
if (lpszTmp)
{
char szTemp[TC_MAX_PATH];
++lpszTmp;
*lpszTmp = 0; // add null terminating character to prepare for append operations
// Primary file name
if (strcmp (GetPreferredLangId(), "en") == 0
- || GetPreferredLangId() == NULL)
+ || strlen(GetPreferredLangId()) == 0)
{
StringCbCatA (szHelpFile, sizeof(szHelpFile), "VeraCrypt User Guide.pdf");
}
else
{
StringCbPrintfA (szTemp, sizeof(szTemp), "VeraCrypt User Guide.%s.pdf", GetPreferredLangId());
StringCbCatA (szHelpFile, sizeof(szHelpFile), szTemp);
}
// Secondary file name (used when localized documentation is not found).
GetModuleFileName (NULL, szHelpFile2, sizeof (szHelpFile2));
lpszTmp = strrchr (szHelpFile2, '\\');
if (lpszTmp)
{
++lpszTmp;
*lpszTmp = 0;
- StringCbCopyA (szHelpFile2, sizeof(szHelpFile2), "VeraCrypt User Guide.pdf");
+ StringCbCatA (szHelpFile2, sizeof(szHelpFile2), "VeraCrypt User Guide.pdf");
}
}
}
BOOL OpenDevice (const char *lpszPath, OPEN_TEST_STRUCT *driver, BOOL detectFilesystem)
{
DWORD dwResult;
BOOL bResult;
StringCbCopyA ((char *) &driver->wszFileName[0], sizeof(driver->wszFileName), lpszPath);
ToUNICODE ((char *) &driver->wszFileName[0], sizeof(driver->wszFileName));
driver->bDetectTCBootLoader = FALSE;
driver->DetectFilesystem = detectFilesystem;
bResult = DeviceIoControl (hDriver, TC_IOCTL_OPEN_TEST,
driver, sizeof (OPEN_TEST_STRUCT),
driver, sizeof (OPEN_TEST_STRUCT),
&dwResult, NULL);
if (bResult == FALSE)
{
dwResult = GetLastError ();
if (dwResult == ERROR_SHARING_VIOLATION || dwResult == ERROR_NOT_READY)
{
driver->TCBootLoaderDetected = FALSE;
driver->FilesystemDetected = FALSE;
return TRUE;
}
else
return FALSE;
}
return TRUE;
|