VeraCrypt
aboutsummaryrefslogtreecommitdiff
path: root/src/Format
diff options
context:
space:
mode:
Diffstat (limited to 'src/Format')
-rw-r--r--src/Format/InPlace.c4
-rw-r--r--src/Format/Tcformat.c52
2 files changed, 28 insertions, 28 deletions
diff --git a/src/Format/InPlace.c b/src/Format/InPlace.c
index 408f6252..cf96b813 100644
--- a/src/Format/InPlace.c
+++ b/src/Format/InPlace.c
@@ -2002,9 +2002,9 @@ BOOL SaveNonSysInPlaceEncSettings (int delta, WipeAlgorithmId newWipeAlgorithm,
if (newWipeAlgorithm != TC_WIPE_NONE)
{
StringCbPrintfA (str, sizeof(str), "%d", (int) newWipeAlgorithm);
- SaveBufferToFile (str, GetConfigPath (TC_APPD_FILENAME_NONSYS_INPLACE_ENC_WIPE), strlen(str), FALSE);
+ SaveBufferToFile (str, GetConfigPath (TC_APPD_FILENAME_NONSYS_INPLACE_ENC_WIPE), (DWORD) strlen(str), FALSE);
}
else if (FileExists (GetConfigPath (TC_APPD_FILENAME_NONSYS_INPLACE_ENC_WIPE)))
{
remove (GetConfigPath (TC_APPD_FILENAME_NONSYS_INPLACE_ENC_WIPE));
@@ -2012,9 +2012,9 @@ BOOL SaveNonSysInPlaceEncSettings (int delta, WipeAlgorithmId newWipeAlgorithm,
}
StringCbPrintfA (str, sizeof(str), "%d", count);
- return SaveBufferToFile (str, GetConfigPath (TC_APPD_FILENAME_NONSYS_INPLACE_ENC), strlen(str), FALSE);
+ return SaveBufferToFile (str, GetConfigPath (TC_APPD_FILENAME_NONSYS_INPLACE_ENC), (DWORD) strlen(str), FALSE);
}
// Repairs damaged sectors (i.e. those with read errors) by zeroing them.
diff --git a/src/Format/Tcformat.c b/src/Format/Tcformat.c
index a0d9b293..bc59a433 100644
--- a/src/Format/Tcformat.c
+++ b/src/Format/Tcformat.c
@@ -1294,9 +1294,9 @@ __int64 GetSystemPartitionSize (void)
}
void ComboSelChangeEA (HWND hwndDlg)
{
- LPARAM nIndex = SendMessage (GetDlgItem (hwndDlg, IDC_COMBO_BOX), CB_GETCURSEL, 0, 0);
+ int nIndex = (int) SendMessage (GetDlgItem (hwndDlg, IDC_COMBO_BOX), CB_GETCURSEL, 0, 0);
if (nIndex == CB_ERR)
{
SetWindowText (GetDlgItem (hwndDlg, IDC_BOX_HELP), "");
@@ -1308,9 +1308,9 @@ void ComboSelChangeEA (HWND hwndDlg)
wchar_t hyperLink[256] = { 0 };
int cipherIDs[5];
int i, cnt = 0;
- nIndex = SendMessage (GetDlgItem (hwndDlg, IDC_COMBO_BOX), CB_GETITEMDATA, nIndex, 0);
+ nIndex = (int) SendMessage (GetDlgItem (hwndDlg, IDC_COMBO_BOX), CB_GETITEMDATA, nIndex, 0);
EAGetName (name, nIndex, 0);
if (strcmp (name, "AES") == 0)
{
@@ -1382,14 +1382,14 @@ static void VerifySizeAndUpdate (HWND hwndDlg, BOOL bUpdate)
{
BOOL bEnable = TRUE;
char szTmp[50];
__int64 lTmp;
- size_t i;
+ int i;
static unsigned __int64 nLastVolumeSize = 0;
GetWindowText (GetDlgItem (hwndDlg, IDC_SIZEBOX), szTmp, sizeof (szTmp));
- for (i = 0; i < strlen (szTmp); i++)
+ for (i = 0; i < (int) strlen (szTmp); i++)
{
if (szTmp[i] >= '0' && szTmp[i] <= '9')
continue;
else
@@ -3110,9 +3110,9 @@ void DisplaySizingErrorText (HWND hwndTextBox)
}
void EnableDisableFileNext (HWND hComboBox, HWND hMainButton)
{
- LPARAM nIndex = SendMessage (hComboBox, CB_GETCURSEL, 0, 0);
+ int nIndex = (int) SendMessage (hComboBox, CB_GETCURSEL, 0, 0);
if (bHistory && nIndex == CB_ERR)
{
EnableWindow (hMainButton, FALSE);
SetFocus (hComboBox);
@@ -4045,14 +4045,14 @@ BOOL CALLBACK PageDialogProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPa
int nIndex, i;
HWND hComboBox = GetDlgItem (hwndDlg, IDC_PKCS5_PRF_ID);
SendMessage (hComboBox, CB_RESETCONTENT, 0, 0);
- nIndex = SendMessageW (hComboBox, CB_ADDSTRING, 0, (LPARAM) GetString ("AUTODETECTION"));
+ nIndex = (int) SendMessageW (hComboBox, CB_ADDSTRING, 0, (LPARAM) GetString ("AUTODETECTION"));
SendMessage (hComboBox, CB_SETITEMDATA, nIndex, (LPARAM) 0);
for (i = FIRST_PRF_ID; i <= LAST_PRF_ID; i++)
{
- nIndex = SendMessage (hComboBox, CB_ADDSTRING, 0, (LPARAM) get_pkcs5_prf_name(i));
+ nIndex = (int) SendMessage (hComboBox, CB_ADDSTRING, 0, (LPARAM) get_pkcs5_prf_name(i));
SendMessage (hComboBox, CB_SETITEMDATA, nIndex, (LPARAM) i);
}
/* make autodetection the default */
@@ -4162,9 +4162,9 @@ BOOL CALLBACK PageDialogProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPa
GetDlgItem (hwndDlg, IDC_VERIFY),
NULL,
NULL,
KeyFilesEnable && FirstKeyFile!=NULL && !SysEncInEffect());
- volumePassword.Length = strlen ((char *) volumePassword.Text);
+ volumePassword.Length = (unsigned __int32) strlen ((char *) volumePassword.Text);
}
break;
case FILESYS_PAGE:
@@ -5176,9 +5176,9 @@ BOOL CALLBACK PageDialogProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPa
LPARAM nIndex;
int c;
nIndex = SendMessage (GetDlgItem (hCurPage, IDC_COMBO_BOX), CB_GETCURSEL, 0, 0);
- nVolumeEA = SendMessage (GetDlgItem (hCurPage, IDC_COMBO_BOX), CB_GETITEMDATA, nIndex, 0);
+ nVolumeEA = (int) SendMessage (GetDlgItem (hCurPage, IDC_COMBO_BOX), CB_GETITEMDATA, nIndex, 0);
for (c = EAGetLastCipher (nVolumeEA); c != 0; c = EAGetPreviousCipher (nVolumeEA, c))
{
DialogBoxParamW (hInst, MAKEINTRESOURCEW (IDD_CIPHER_TEST_DLG),
@@ -5206,10 +5206,10 @@ BOOL CALLBACK PageDialogProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPa
if (lw == IDC_LINK_MORE_INFO_ABOUT_CIPHER && nCurPageNo == CIPHER_PAGE)
{
char name[100];
- int nIndex = SendMessage (GetDlgItem (hCurPage, IDC_COMBO_BOX), CB_GETCURSEL, 0, 0);
- nIndex = SendMessage (GetDlgItem (hCurPage, IDC_COMBO_BOX), CB_GETITEMDATA, nIndex, 0);
+ int nIndex = (int) SendMessage (GetDlgItem (hCurPage, IDC_COMBO_BOX), CB_GETCURSEL, 0, 0);
+ nIndex = (int) SendMessage (GetDlgItem (hCurPage, IDC_COMBO_BOX), CB_GETITEMDATA, nIndex, 0);
EAGetName (name, nIndex, 0);
if (strcmp (name, "AES") == 0)
Applink ("aes", FALSE, "");
@@ -5271,9 +5271,9 @@ BOOL CALLBACK PageDialogProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPa
GetDlgItem (hwndDlg, IDC_VERIFY),
NULL,
NULL,
KeyFilesEnable && FirstKeyFile!=NULL && !SysEncInEffect());
- volumePassword.Length = strlen ((char *) volumePassword.Text);
+ volumePassword.Length = (unsigned __int32) strlen ((char *) volumePassword.Text);
return 1;
}
@@ -5355,9 +5355,9 @@ BOOL CALLBACK PageDialogProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPa
{
if (hw == EN_CHANGE)
{
GetWindowText (GetDlgItem (hCurPage, IDC_PASSWORD_DIRECT), (char *) volumePassword.Text, sizeof (volumePassword.Text));
- volumePassword.Length = strlen ((char *) volumePassword.Text);
+ volumePassword.Length = (unsigned __int32) strlen ((char *) volumePassword.Text);
return 1;
}
if (lw == IDC_SHOW_PASSWORD_SINGLE)
@@ -5426,9 +5426,9 @@ BOOL CALLBACK PageDialogProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPa
{
// Select device
RawDevicesDlgParam param;
param.pszFileName = szFileName;
- int nResult = DialogBoxParamW (hInst,
+ INT_PTR nResult = DialogBoxParamW (hInst,
MAKEINTRESOURCEW (IDD_RAWDEVICES_DLG), GetParent (hwndDlg),
(DLGPROC) RawDevicesDlgProc, (LPARAM) & param);
// Check administrator privileges
@@ -5492,9 +5492,9 @@ BOOL CALLBACK PageDialogProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPa
case IDC_COMBO_BOX_HASH_ALGO:
if (SysEncInEffect ())
{
HWND hHashAlgoItem = GetDlgItem (hwndDlg, IDC_COMBO_BOX_HASH_ALGO);
- LRESULT selectedAlgo = SendMessage (hHashAlgoItem, CB_GETITEMDATA, SendMessage (hHashAlgoItem, CB_GETCURSEL, 0, 0), 0);
+ int selectedAlgo = (int) SendMessage (hHashAlgoItem, CB_GETITEMDATA, SendMessage (hHashAlgoItem, CB_GETCURSEL, 0, 0), 0);
if (!HashForSystemEncryption(selectedAlgo))
{
hash_algo = DEFAULT_HASH_ALGORITHM_BOOT;
RandSetHashFunction (DEFAULT_HASH_ALGORITHM_BOOT);
@@ -5524,9 +5524,9 @@ BOOL CALLBACK PageDialogProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPa
}
if (lw == IDC_FILESYS && hw == CBN_SELCHANGE)
{
- fileSystem = SendMessage (GetDlgItem (hCurPage, IDC_FILESYS), CB_GETITEMDATA,
+ fileSystem = (int) SendMessage (GetDlgItem (hCurPage, IDC_FILESYS), CB_GETITEMDATA,
SendMessage (GetDlgItem (hCurPage, IDC_FILESYS), CB_GETCURSEL, 0, 0) , 0);
return 1;
}
@@ -6859,9 +6859,9 @@ BOOL CALLBACK MainDialogProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPa
else if (nCurPageNo == CIPHER_PAGE)
{
LPARAM nIndex;
nIndex = SendMessage (GetDlgItem (hCurPage, IDC_COMBO_BOX), CB_GETCURSEL, 0, 0);
- nVolumeEA = SendMessage (GetDlgItem (hCurPage, IDC_COMBO_BOX), CB_GETITEMDATA, nIndex, 0);
+ nVolumeEA = (int) SendMessage (GetDlgItem (hCurPage, IDC_COMBO_BOX), CB_GETITEMDATA, nIndex, 0);
if (SysEncInEffect ()
&& EAGetCipherCount (nVolumeEA) > 1) // Cascade?
{
@@ -6872,9 +6872,9 @@ BOOL CALLBACK MainDialogProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPa
Info ("NOTE_CASCADE_FOR_SYS_ENCRYPTION", hwndDlg);
}
nIndex = SendMessage (GetDlgItem (hCurPage, IDC_COMBO_BOX_HASH_ALGO), CB_GETCURSEL, 0, 0);
- hash_algo = SendMessage (GetDlgItem (hCurPage, IDC_COMBO_BOX_HASH_ALGO), CB_GETITEMDATA, nIndex, 0);
+ hash_algo = (int) SendMessage (GetDlgItem (hCurPage, IDC_COMBO_BOX_HASH_ALGO), CB_GETITEMDATA, nIndex, 0);
RandSetHashFunction (hash_algo);
if (SysEncInEffect () || bInPlaceEncNonSys)
@@ -6938,9 +6938,9 @@ BOOL CALLBACK MainDialogProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPa
volumePassword.Text,
szVerify,
KeyFilesEnable && FirstKeyFile!=NULL && !SysEncInEffect());
- volumePassword.Length = strlen ((char *) volumePassword.Text);
+ volumePassword.Length = (unsigned __int32) strlen ((char *) volumePassword.Text);
if (volumePassword.Length > 0)
{
// Password character encoding
@@ -7008,9 +7008,9 @@ BOOL CALLBACK MainDialogProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPa
{
WaitCursor ();
GetWindowText (GetDlgItem (hCurPage, IDC_PASSWORD_DIRECT), (char *) volumePassword.Text, sizeof (volumePassword.Text));
- volumePassword.Length = strlen ((char *) volumePassword.Text);
+ volumePassword.Length = (unsigned __int32) strlen ((char *) volumePassword.Text);
hash_algo = (int) SendMessage (GetDlgItem (hCurPage, IDC_PKCS5_PRF_ID), CB_GETITEMDATA, SendMessage (GetDlgItem (hCurPage, IDC_PKCS5_PRF_ID), CB_GETCURSEL, 0, 0), 0);
// Store the password in case we need to restore it after keyfile is applied to it
@@ -7670,12 +7670,12 @@ retryCDDriveCheck:
bVolTransformThreadCancel = FALSE;
bVolTransformThreadToRun = TRUE;
- fileSystem = SendMessage (GetDlgItem (hCurPage, IDC_FILESYS), CB_GETITEMDATA,
+ fileSystem = (int) SendMessage (GetDlgItem (hCurPage, IDC_FILESYS), CB_GETITEMDATA,
SendMessage (GetDlgItem (hCurPage, IDC_FILESYS), CB_GETCURSEL, 0, 0) , 0);
- clusterSize = SendMessage (GetDlgItem (hCurPage, IDC_CLUSTERSIZE), CB_GETITEMDATA,
+ clusterSize = (int) SendMessage (GetDlgItem (hCurPage, IDC_CLUSTERSIZE), CB_GETITEMDATA,
SendMessage (GetDlgItem (hCurPage, IDC_CLUSTERSIZE), CB_GETCURSEL, 0, 0) , 0);
quickFormat = IsButtonChecked (GetDlgItem (hCurPage, IDC_QUICKFORMAT));
@@ -8048,12 +8048,12 @@ ovf_end:
else if (nCurPageNo == CIPHER_PAGE)
{
LPARAM nIndex;
nIndex = SendMessage (GetDlgItem (hCurPage, IDC_COMBO_BOX), CB_GETCURSEL, 0, 0);
- nVolumeEA = SendMessage (GetDlgItem (hCurPage, IDC_COMBO_BOX), CB_GETITEMDATA, nIndex, 0);
+ nVolumeEA = (int) SendMessage (GetDlgItem (hCurPage, IDC_COMBO_BOX), CB_GETITEMDATA, nIndex, 0);
nIndex = SendMessage (GetDlgItem (hCurPage, IDC_COMBO_BOX_HASH_ALGO), CB_GETCURSEL, 0, 0);
- hash_algo = SendMessage (GetDlgItem (hCurPage, IDC_COMBO_BOX_HASH_ALGO), CB_GETITEMDATA, nIndex, 0);
+ hash_algo = (int) SendMessage (GetDlgItem (hCurPage, IDC_COMBO_BOX_HASH_ALGO), CB_GETITEMDATA, nIndex, 0);
RandSetHashFunction (hash_algo);
if (WizardMode == WIZARD_MODE_SYS_DEVICE)
@@ -8093,9 +8093,9 @@ ovf_end:
volumePassword.Text,
szVerify,
KeyFilesEnable && FirstKeyFile!=NULL && !SysEncInEffect ());
- volumePassword.Length = strlen ((char *) volumePassword.Text);
+ volumePassword.Length = (unsigned __int32) strlen ((char *) volumePassword.Text);
nNewPageNo = SIZE_PAGE + 1; // Skip the hidden volume host password page
if (SysEncInEffect ())
@@ -8123,9 +8123,9 @@ ovf_end:
// Store the password in case we need to restore it after keyfile is applied to it
GetWindowText (GetDlgItem (hCurPage, IDC_PASSWORD_DIRECT), szRawPassword, sizeof (szRawPassword));
GetWindowText (GetDlgItem (hCurPage, IDC_PASSWORD_DIRECT), (char *) volumePassword.Text, sizeof (volumePassword.Text));
- volumePassword.Length = strlen ((char *) volumePassword.Text);
+ volumePassword.Length = (unsigned __int32) strlen ((char *) volumePassword.Text);
if (!bInPlaceEncNonSys)
nNewPageNo = VOLUME_LOCATION_PAGE + 1;
}