1
0
mirror of https://github.com/veracrypt/VeraCrypt.git synced 2025-11-12 11:28:26 -06:00

Normalize all line terminators

This commit is contained in:
David Foerster
2016-05-10 20:20:14 +02:00
parent 98b04198c6
commit fc37cc4a02
297 changed files with 202290 additions and 202290 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -1,17 +1,17 @@
/*
Legal Notice: Some portions of the source code contained in this file were
derived from the source code of TrueCrypt 7.1a, which is
Copyright (c) 2003-2012 TrueCrypt Developers Association and which is
governed by the TrueCrypt License 3.0, also from the source code of
Encryption for the Masses 2.02a, which is Copyright (c) 1998-2000 Paul Le Roux
and which is governed by the 'License Agreement for Encryption for the Masses'
/*
Legal Notice: Some portions of the source code contained in this file were
derived from the source code of TrueCrypt 7.1a, which is
Copyright (c) 2003-2012 TrueCrypt Developers Association and which is
governed by the TrueCrypt License 3.0, also from the source code of
Encryption for the Masses 2.02a, which is Copyright (c) 1998-2000 Paul Le Roux
and which is governed by the 'License Agreement for Encryption for the Masses'
and also from the source code of extcv, which is Copyright (c) 2009-2010 Kih-Oskh
or Copyright (c) 2012-2013 Josef Schneider <josef@netpage.dk>
Modifications and additions to the original source code (contained in this file)
and all other portions of this file are Copyright (c) 2013-2016 IDRIX
and are governed by the Apache License 2.0 the full text of which is
contained in the file License.txt included in VeraCrypt binary and source
or Copyright (c) 2012-2013 Josef Schneider <josef@netpage.dk>
Modifications and additions to the original source code (contained in this file)
and all other portions of this file are Copyright (c) 2013-2016 IDRIX
and are governed by the Apache License 2.0 the full text of which is
contained in the file License.txt included in VeraCrypt binary and source
code distribution packages. */
#include "Tcdefs.h"
@@ -38,8 +38,8 @@
#include "ExpandVolume.h"
#include "Resource.h"
#ifndef SRC_POS
#define SRC_POS (__FUNCTION__ ":" TC_TO_STRING(__LINE__))
#ifndef SRC_POS
#define SRC_POS (__FUNCTION__ ":" TC_TO_STRING(__LINE__))
#endif
#define DEBUG_EXPAND_VOLUME
@@ -595,9 +595,9 @@ static int ExpandVolume (HWND hwndDlg, wchar_t *lpszVolume, Password *pVolumePas
if (Randinit ())
{
if (CryptoAPILastError == ERROR_SUCCESS)
nStatus = ERR_RAND_INIT_FAILED;
else
if (CryptoAPILastError == ERROR_SUCCESS)
nStatus = ERR_RAND_INIT_FAILED;
else
nStatus = ERR_CAPI_INIT_FAILED;
goto error;
}
@@ -868,9 +868,9 @@ static int ExpandVolume (HWND hwndDlg, wchar_t *lpszVolume, Password *pVolumePas
LARGE_INTEGER offset;
WipeAlgorithmId wipeAlgorithm = TC_WIPE_35_GUTMANN;
if ( !RandgetBytes (hwndDlg, wipeRandChars, TC_WIPE_RAND_CHAR_COUNT, TRUE)
|| !RandgetBytes (hwndDlg, wipeRandCharsUpdate, TC_WIPE_RAND_CHAR_COUNT, TRUE)
)
if ( !RandgetBytes (hwndDlg, wipeRandChars, TC_WIPE_RAND_CHAR_COUNT, TRUE)
|| !RandgetBytes (hwndDlg, wipeRandCharsUpdate, TC_WIPE_RAND_CHAR_COUNT, TRUE)
)
{
nStatus = ERR_OS_ERROR;
goto error;

View File

@@ -1,298 +1,298 @@
// Microsoft Visual C++ generated resource script.
//
#include "resource.h"
#define APSTUDIO_READONLY_SYMBOLS
/////////////////////////////////////////////////////////////////////////////
//
// Generated from the TEXTINCLUDE 2 resource.
//
#include "afxres.h"
#include "..\\common\\resource.h"
/////////////////////////////////////////////////////////////////////////////
#undef APSTUDIO_READONLY_SYMBOLS
/////////////////////////////////////////////////////////////////////////////
// English (U.S.) resources
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
#ifdef _WIN32
LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
#pragma code_page(1252)
#endif //_WIN32
/////////////////////////////////////////////////////////////////////////////
//
// Dialog
//
IDD_SIZE_DIALOG DIALOGEX 0, 0, 376, 271
STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "VeraCrypt Expander"
FONT 8, "MS Shell Dlg", 400, 0, 0x1
BEGIN
EDITTEXT IDC_SIZEBOX,30,102,109,14,ES_RIGHT | ES_AUTOHSCROLL | ES_NUMBER
CONTROL "&KB",IDC_KB,"Button",BS_AUTORADIOBUTTON | WS_GROUP | WS_TABSTOP,169,105,38,10
CONTROL "&MB",IDC_MB,"Button",BS_AUTORADIOBUTTON,209,105,38,10
CONTROL "&GB",IDC_GB,"Button",BS_AUTORADIOBUTTON,248,105,38,10
CONTROL "&TB",IDC_TB,"Button",BS_AUTORADIOBUTTON,288,105,38,10
CONTROL "Fill new space with random data",IDC_INIT_NEWSPACE,
"Button",BS_AUTOCHECKBOX | WS_TABSTOP,30,127,118,10
DEFPUSHBUTTON "Continue",IDOK,15,238,84,18
PUSHBUTTON "Cancel",IDCANCEL,277,238,84,18
LTEXT "Help Text",IDC_BOX_HELP,15,165,346,58,0,WS_EX_CLIENTEDGE
GROUPBOX "Enter new volume size",IDC_STATIC,15,83,346,63
RTEXT "Current size: ",IDT_CURRENT_SIZE,27,42,46,8
CONTROL "",IDC_EXPAND_VOLUME_OLDSIZE,"Static",SS_LEFTNOWORDWRAP | WS_GROUP,80,42,275,8,WS_EX_TRANSPARENT
RTEXT "New size: ",IDT_NEW_SIZE,28,54,45,8
LTEXT "",IDC_EXPAND_VOLUME_NEWSIZE,80,54,275,8,0,WS_EX_TRANSPARENT
RTEXT "Volume: ",IDT_VOL_NAME,31,18,42,8
GROUPBOX "",IDC_STATIC,15,9,346,59
CONTROL "",IDC_EXPAND_VOLUME_NAME,"Static",SS_SIMPLE | WS_GROUP,80,18,275,8,WS_EX_TRANSPARENT
RTEXT "File system: ",IDT_FILE_SYS,31,30,42,8
CONTROL "",IDC_EXPAND_FILE_SYSTEM,"Static",SS_SIMPLE | WS_GROUP,80,30,275,8,WS_EX_TRANSPARENT
END
IDD_MOUNT_DLG DIALOGEX 0, 0, 376, 271
STYLE DS_SETFONT | DS_SETFOREGROUND | DS_3DLOOK | DS_FIXEDSYS | DS_CENTER | WS_MINIMIZEBOX | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "VeraCrypt Expander"
MENU IDR_MENU
CLASS "VeraCryptCustomDlg"
FONT 8, "MS Shell Dlg", 0, 0, 0x0
BEGIN
COMBOBOX IDC_VOLUME,56,192,212,74,CBS_DROPDOWN | CBS_AUTOHSCROLL | WS_VSCROLL | WS_TABSTOP
PUSHBUTTON "Select &File...",IDC_SELECT_FILE,276,192,84,14
PUSHBUTTON "Select D&evice...",IDC_SELECT_DEVICE,276,211,84,14
DEFPUSHBUTTON "Mount",IDOK,8,243,84,18,WS_GROUP
PUSHBUTTON "E&xit",IDC_EXIT,284,243,84,18,WS_GROUP
CONTROL 112,IDC_LOGO,"Static",SS_BITMAP | SS_NOTIFY | WS_BORDER,16,192,27,31
GROUPBOX "Volume",IDT_VOLUME,8,179,360,53
CONTROL "",IDC_STATIC,"Static",SS_ETCHEDFRAME,1,0,373,147
GROUPBOX "",IDC_STATIC,282,238,88,24
GROUPBOX "",IDC_STATIC,6,238,88,24
GROUPBOX "",IDC_STATIC,1,147,373,123,BS_CENTER
LTEXT "1. Select the VeraCrypt volume to be expanded\n2. Click the 'Mount' button",IDC_STATIC,15,156,293,21
LTEXT "Static",IDC_INFOEXPAND,8,6,361,134,SS_NOPREFIX | SS_SUNKEN,WS_EX_STATICEDGE
END
IDD_PASSWORD_DLG DIALOGEX 0, 0, 322, 107
STYLE DS_SETFONT | DS_MODALFRAME | DS_3DLOOK | DS_FIXEDSYS | DS_CENTER | WS_POPUP | WS_VISIBLE | WS_CAPTION
CAPTION "Enter VeraCrypt Volume Password"
FONT 8, "MS Shell Dlg", 0, 0, 0x0
BEGIN
EDITTEXT IDC_PASSWORD,69,8,166,14,ES_PASSWORD | ES_AUTOHSCROLL
COMBOBOX IDC_PKCS5_PRF_ID,69,26,86,90,CBS_DROPDOWNLIST | WS_TABSTOP
CONTROL "TrueCrypt Mode",IDC_TRUECRYPT_MODE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,159,28,76,10
EDITTEXT IDC_PIM,69,43,42,14,ES_RIGHT | ES_PASSWORD | ES_AUTOHSCROLL | ES_NUMBER | NOT WS_VISIBLE
CONTROL "Use P&IM",IDC_PIM_ENABLE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,70,49,97,10
CONTROL "Cache passwords and keyfil&es in memory",IDC_CACHE,
"Button",BS_AUTOCHECKBOX | WS_TABSTOP,70,62,153,10
CONTROL "&Display password",IDC_SHOW_PASSWORD,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,70,75,83,10
CONTROL "U&se keyfiles",IDC_KEYFILES_ENABLE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,70,88,83,11
PUSHBUTTON "&Keyfiles...",IDC_KEY_FILES,171,86,64,14
PUSHBUTTON "Mount Opti&ons...",IDC_MOUNT_OPTIONS,243,86,64,14
DEFPUSHBUTTON "OK",IDOK,243,8,64,14
PUSHBUTTON "Cancel",IDCANCEL,243,25,64,14
RTEXT "Password:",IDT_PASSWORD,0,10,65,13
RTEXT "PKCS-5 PRF:",IDT_PKCS5_PRF,0,27,65,13
RTEXT "Volume PIM:",IDT_PIM,0,46,65,13,NOT WS_VISIBLE
LTEXT "(Empty or 0 for default iterations)",IDC_PIM_HELP,115,46,189,8,NOT WS_VISIBLE
END
IDD_EXPAND_PROGRESS_DLG DIALOGEX 0, 0, 376, 283
STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "VeraCrypt Expander"
FONT 8, "MS Shell Dlg", 0, 0, 0x0
BEGIN
RTEXT "Current size: ",IDT_CURRENT_SIZE,27,40,46,8
CONTROL "",IDC_EXPAND_VOLUME_OLDSIZE,"Static",SS_LEFTNOWORDWRAP | WS_GROUP,80,40,275,8,WS_EX_TRANSPARENT
RTEXT "New size: ",IDT_NEW_SIZE,28,52,45,8
LTEXT "",IDC_EXPAND_VOLUME_NEWSIZE,80,52,275,8,0,WS_EX_TRANSPARENT
CONTROL "",IDC_PROGRESS_BAR,"msctls_progress32",PBS_SMOOTH | WS_BORDER,22,96,332,12
RTEXT "",IDC_TIMEREMAIN,275,114,42,11,SS_CENTERIMAGE,WS_EX_TRANSPARENT | WS_EX_RIGHT | WS_EX_STATICEDGE
RTEXT "",IDC_WRITESPEED,178,114,42,11,SS_CENTERIMAGE,WS_EX_TRANSPARENT | WS_EX_RIGHT | WS_EX_STATICEDGE
LTEXT "",IDC_BYTESWRITTEN,77,114,39,11,SS_CENTERIMAGE,WS_EX_TRANSPARENT | WS_EX_RIGHT | WS_EX_STATICEDGE
RTEXT "Done",IDT_DONE,53,115,22,8
RTEXT "Speed",IDT_SPEED,142,115,34,8
RTEXT "Left",IDT_LEFT,248,115,25,8
GROUPBOX "",IDC_STATIC,15,84,346,49
RTEXT "Volume: ",IDT_VOL_NAME,31,16,42,8
GROUPBOX "",IDC_STATIC,15,7,346,72
CONTROL "",IDC_EXPAND_VOLUME_NAME,"Static",SS_SIMPLE | WS_GROUP,80,16,275,8,WS_EX_TRANSPARENT
DEFPUSHBUTTON "Continue",IDOK,15,247,84,18
PUSHBUTTON "Cancel",IDCANCEL,277,247,84,18
EDITTEXT IDC_BOX_STATUS,15,176,346,66,ES_MULTILINE | ES_AUTOVSCROLL | ES_READONLY | ES_WANTRETURN | WS_VSCROLL
CONTROL "",IDC_EXPAND_VOLUME_INITSPACE,"Static",SS_SIMPLE | WS_GROUP,80,64,275,8,WS_EX_TRANSPARENT
RTEXT "Fill new space: ",IDT_INIT_SPACE,20,64,53,8
RTEXT "File system: ",IDT_FILE_SYS,31,28,42,8
CONTROL "",IDC_EXPAND_FILE_SYSTEM,"Static",SS_SIMPLE | WS_GROUP,80,28,275,8,WS_EX_TRANSPARENT
RTEXT "Random Pool: ",IDT_RANDOM_POOL2,20,144,53,8
CONTROL "",IDC_RANDOM_BYTES,"Static",SS_SIMPLE | WS_GROUP,80,144,149,8,WS_EX_TRANSPARENT
CONTROL "Display pool content",IDC_DISPLAY_POOL_CONTENTS,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,236,142,125,12
GROUPBOX "Randomness Collected From Mouse Movements",IDT_ENTROPY_BAR,20,156,214,18
CONTROL "",IDC_ENTROPY_BAR,"msctls_progress32",WS_BORDER,31,165,193,6
END
/////////////////////////////////////////////////////////////////////////////
//
// DESIGNINFO
//
#ifdef APSTUDIO_INVOKED
GUIDELINES DESIGNINFO
BEGIN
IDD_SIZE_DIALOG, DIALOG
BEGIN
LEFTMARGIN, 15
RIGHTMARGIN, 361
VERTGUIDE, 30
TOPMARGIN, 14
BOTTOMMARGIN, 256
END
IDD_MOUNT_DLG, DIALOG
BEGIN
RIGHTMARGIN, 369
VERTGUIDE, 8
BOTTOMMARGIN, 269
END
IDD_PASSWORD_DLG, DIALOG
BEGIN
BOTTOMMARGIN, 102
END
IDD_EXPAND_PROGRESS_DLG, DIALOG
BEGIN
RIGHTMARGIN, 361
VERTGUIDE, 15
VERTGUIDE, 73
VERTGUIDE, 80
VERTGUIDE, 355
TOPMARGIN, 9
BOTTOMMARGIN, 268
HORZGUIDE, 176
END
END
#endif // APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// HEADER
//
IDR_MOUNT_RSRC_HEADER HEADER "resource.h"
/////////////////////////////////////////////////////////////////////////////
//
// Version
//
VS_VERSION_INFO VERSIONINFO
FILEVERSION 1,17,22,0
PRODUCTVERSION 1,17,22,0
FILEFLAGSMASK 0x17L
#ifdef _DEBUG
FILEFLAGS 0x1L
#else
FILEFLAGS 0x0L
#endif
FILEOS 0x4L
FILETYPE 0x1L
FILESUBTYPE 0x0L
BEGIN
BLOCK "StringFileInfo"
BEGIN
BLOCK "040904b0"
BEGIN
VALUE "CompanyName", "IDRIX"
VALUE "FileDescription", "VeraCrypt Expander"
VALUE "FileVersion", "1.17"
VALUE "LegalTrademarks", "VeraCrypt"
VALUE "OriginalFilename", "VeraCryptExpander.exe"
VALUE "ProductName", "VeraCrypt"
VALUE "ProductVersion", "1.17"
END
END
BLOCK "VarFileInfo"
BEGIN
VALUE "Translation", 0x409, 1200
END
END
#ifdef APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// TEXTINCLUDE
//
1 TEXTINCLUDE
BEGIN
"resource.h\0"
END
2 TEXTINCLUDE
BEGIN
"#include ""afxres.h""\r\n"
"#include ""..\\\\common\\\\resource.h""\r\n"
"\0"
END
3 TEXTINCLUDE
BEGIN
"#include ""..\\\\common\\\\common.rc""\r\n"
"\0"
END
#endif // APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// Bitmap
//
IDB_LOGO_96DPI BITMAP "Logo_96dpi.bmp"
IDB_LOGO_288DPI BITMAP "Logo_288dpi.bmp"
/////////////////////////////////////////////////////////////////////////////
//
// Menu
//
IDR_MENU MENUEX
BEGIN
MENUITEM "About", IDM_ABOUT,MFT_STRING,MFS_ENABLED
MENUITEM "Homepage", IDM_HOMEPAGE,MFT_STRING | MFT_RIGHTJUSTIFY,MFS_ENABLED
END
/////////////////////////////////////////////////////////////////////////////
//
// String Table
//
STRINGTABLE
BEGIN
IDS_UACSTRING "VeraCrypt Expander"
END
#endif // English (U.S.) resources
/////////////////////////////////////////////////////////////////////////////
#ifndef APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// Generated from the TEXTINCLUDE 3 resource.
//
#include "..\\common\\common.rc"
/////////////////////////////////////////////////////////////////////////////
#endif // not APSTUDIO_INVOKED
// Microsoft Visual C++ generated resource script.
//
#include "resource.h"
#define APSTUDIO_READONLY_SYMBOLS
/////////////////////////////////////////////////////////////////////////////
//
// Generated from the TEXTINCLUDE 2 resource.
//
#include "afxres.h"
#include "..\\common\\resource.h"
/////////////////////////////////////////////////////////////////////////////
#undef APSTUDIO_READONLY_SYMBOLS
/////////////////////////////////////////////////////////////////////////////
// English (U.S.) resources
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
#ifdef _WIN32
LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
#pragma code_page(1252)
#endif //_WIN32
/////////////////////////////////////////////////////////////////////////////
//
// Dialog
//
IDD_SIZE_DIALOG DIALOGEX 0, 0, 376, 271
STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "VeraCrypt Expander"
FONT 8, "MS Shell Dlg", 400, 0, 0x1
BEGIN
EDITTEXT IDC_SIZEBOX,30,102,109,14,ES_RIGHT | ES_AUTOHSCROLL | ES_NUMBER
CONTROL "&KB",IDC_KB,"Button",BS_AUTORADIOBUTTON | WS_GROUP | WS_TABSTOP,169,105,38,10
CONTROL "&MB",IDC_MB,"Button",BS_AUTORADIOBUTTON,209,105,38,10
CONTROL "&GB",IDC_GB,"Button",BS_AUTORADIOBUTTON,248,105,38,10
CONTROL "&TB",IDC_TB,"Button",BS_AUTORADIOBUTTON,288,105,38,10
CONTROL "Fill new space with random data",IDC_INIT_NEWSPACE,
"Button",BS_AUTOCHECKBOX | WS_TABSTOP,30,127,118,10
DEFPUSHBUTTON "Continue",IDOK,15,238,84,18
PUSHBUTTON "Cancel",IDCANCEL,277,238,84,18
LTEXT "Help Text",IDC_BOX_HELP,15,165,346,58,0,WS_EX_CLIENTEDGE
GROUPBOX "Enter new volume size",IDC_STATIC,15,83,346,63
RTEXT "Current size: ",IDT_CURRENT_SIZE,27,42,46,8
CONTROL "",IDC_EXPAND_VOLUME_OLDSIZE,"Static",SS_LEFTNOWORDWRAP | WS_GROUP,80,42,275,8,WS_EX_TRANSPARENT
RTEXT "New size: ",IDT_NEW_SIZE,28,54,45,8
LTEXT "",IDC_EXPAND_VOLUME_NEWSIZE,80,54,275,8,0,WS_EX_TRANSPARENT
RTEXT "Volume: ",IDT_VOL_NAME,31,18,42,8
GROUPBOX "",IDC_STATIC,15,9,346,59
CONTROL "",IDC_EXPAND_VOLUME_NAME,"Static",SS_SIMPLE | WS_GROUP,80,18,275,8,WS_EX_TRANSPARENT
RTEXT "File system: ",IDT_FILE_SYS,31,30,42,8
CONTROL "",IDC_EXPAND_FILE_SYSTEM,"Static",SS_SIMPLE | WS_GROUP,80,30,275,8,WS_EX_TRANSPARENT
END
IDD_MOUNT_DLG DIALOGEX 0, 0, 376, 271
STYLE DS_SETFONT | DS_SETFOREGROUND | DS_3DLOOK | DS_FIXEDSYS | DS_CENTER | WS_MINIMIZEBOX | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "VeraCrypt Expander"
MENU IDR_MENU
CLASS "VeraCryptCustomDlg"
FONT 8, "MS Shell Dlg", 0, 0, 0x0
BEGIN
COMBOBOX IDC_VOLUME,56,192,212,74,CBS_DROPDOWN | CBS_AUTOHSCROLL | WS_VSCROLL | WS_TABSTOP
PUSHBUTTON "Select &File...",IDC_SELECT_FILE,276,192,84,14
PUSHBUTTON "Select D&evice...",IDC_SELECT_DEVICE,276,211,84,14
DEFPUSHBUTTON "Mount",IDOK,8,243,84,18,WS_GROUP
PUSHBUTTON "E&xit",IDC_EXIT,284,243,84,18,WS_GROUP
CONTROL 112,IDC_LOGO,"Static",SS_BITMAP | SS_NOTIFY | WS_BORDER,16,192,27,31
GROUPBOX "Volume",IDT_VOLUME,8,179,360,53
CONTROL "",IDC_STATIC,"Static",SS_ETCHEDFRAME,1,0,373,147
GROUPBOX "",IDC_STATIC,282,238,88,24
GROUPBOX "",IDC_STATIC,6,238,88,24
GROUPBOX "",IDC_STATIC,1,147,373,123,BS_CENTER
LTEXT "1. Select the VeraCrypt volume to be expanded\n2. Click the 'Mount' button",IDC_STATIC,15,156,293,21
LTEXT "Static",IDC_INFOEXPAND,8,6,361,134,SS_NOPREFIX | SS_SUNKEN,WS_EX_STATICEDGE
END
IDD_PASSWORD_DLG DIALOGEX 0, 0, 322, 107
STYLE DS_SETFONT | DS_MODALFRAME | DS_3DLOOK | DS_FIXEDSYS | DS_CENTER | WS_POPUP | WS_VISIBLE | WS_CAPTION
CAPTION "Enter VeraCrypt Volume Password"
FONT 8, "MS Shell Dlg", 0, 0, 0x0
BEGIN
EDITTEXT IDC_PASSWORD,69,8,166,14,ES_PASSWORD | ES_AUTOHSCROLL
COMBOBOX IDC_PKCS5_PRF_ID,69,26,86,90,CBS_DROPDOWNLIST | WS_TABSTOP
CONTROL "TrueCrypt Mode",IDC_TRUECRYPT_MODE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,159,28,76,10
EDITTEXT IDC_PIM,69,43,42,14,ES_RIGHT | ES_PASSWORD | ES_AUTOHSCROLL | ES_NUMBER | NOT WS_VISIBLE
CONTROL "Use P&IM",IDC_PIM_ENABLE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,70,49,97,10
CONTROL "Cache passwords and keyfil&es in memory",IDC_CACHE,
"Button",BS_AUTOCHECKBOX | WS_TABSTOP,70,62,153,10
CONTROL "&Display password",IDC_SHOW_PASSWORD,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,70,75,83,10
CONTROL "U&se keyfiles",IDC_KEYFILES_ENABLE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,70,88,83,11
PUSHBUTTON "&Keyfiles...",IDC_KEY_FILES,171,86,64,14
PUSHBUTTON "Mount Opti&ons...",IDC_MOUNT_OPTIONS,243,86,64,14
DEFPUSHBUTTON "OK",IDOK,243,8,64,14
PUSHBUTTON "Cancel",IDCANCEL,243,25,64,14
RTEXT "Password:",IDT_PASSWORD,0,10,65,13
RTEXT "PKCS-5 PRF:",IDT_PKCS5_PRF,0,27,65,13
RTEXT "Volume PIM:",IDT_PIM,0,46,65,13,NOT WS_VISIBLE
LTEXT "(Empty or 0 for default iterations)",IDC_PIM_HELP,115,46,189,8,NOT WS_VISIBLE
END
IDD_EXPAND_PROGRESS_DLG DIALOGEX 0, 0, 376, 283
STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "VeraCrypt Expander"
FONT 8, "MS Shell Dlg", 0, 0, 0x0
BEGIN
RTEXT "Current size: ",IDT_CURRENT_SIZE,27,40,46,8
CONTROL "",IDC_EXPAND_VOLUME_OLDSIZE,"Static",SS_LEFTNOWORDWRAP | WS_GROUP,80,40,275,8,WS_EX_TRANSPARENT
RTEXT "New size: ",IDT_NEW_SIZE,28,52,45,8
LTEXT "",IDC_EXPAND_VOLUME_NEWSIZE,80,52,275,8,0,WS_EX_TRANSPARENT
CONTROL "",IDC_PROGRESS_BAR,"msctls_progress32",PBS_SMOOTH | WS_BORDER,22,96,332,12
RTEXT "",IDC_TIMEREMAIN,275,114,42,11,SS_CENTERIMAGE,WS_EX_TRANSPARENT | WS_EX_RIGHT | WS_EX_STATICEDGE
RTEXT "",IDC_WRITESPEED,178,114,42,11,SS_CENTERIMAGE,WS_EX_TRANSPARENT | WS_EX_RIGHT | WS_EX_STATICEDGE
LTEXT "",IDC_BYTESWRITTEN,77,114,39,11,SS_CENTERIMAGE,WS_EX_TRANSPARENT | WS_EX_RIGHT | WS_EX_STATICEDGE
RTEXT "Done",IDT_DONE,53,115,22,8
RTEXT "Speed",IDT_SPEED,142,115,34,8
RTEXT "Left",IDT_LEFT,248,115,25,8
GROUPBOX "",IDC_STATIC,15,84,346,49
RTEXT "Volume: ",IDT_VOL_NAME,31,16,42,8
GROUPBOX "",IDC_STATIC,15,7,346,72
CONTROL "",IDC_EXPAND_VOLUME_NAME,"Static",SS_SIMPLE | WS_GROUP,80,16,275,8,WS_EX_TRANSPARENT
DEFPUSHBUTTON "Continue",IDOK,15,247,84,18
PUSHBUTTON "Cancel",IDCANCEL,277,247,84,18
EDITTEXT IDC_BOX_STATUS,15,176,346,66,ES_MULTILINE | ES_AUTOVSCROLL | ES_READONLY | ES_WANTRETURN | WS_VSCROLL
CONTROL "",IDC_EXPAND_VOLUME_INITSPACE,"Static",SS_SIMPLE | WS_GROUP,80,64,275,8,WS_EX_TRANSPARENT
RTEXT "Fill new space: ",IDT_INIT_SPACE,20,64,53,8
RTEXT "File system: ",IDT_FILE_SYS,31,28,42,8
CONTROL "",IDC_EXPAND_FILE_SYSTEM,"Static",SS_SIMPLE | WS_GROUP,80,28,275,8,WS_EX_TRANSPARENT
RTEXT "Random Pool: ",IDT_RANDOM_POOL2,20,144,53,8
CONTROL "",IDC_RANDOM_BYTES,"Static",SS_SIMPLE | WS_GROUP,80,144,149,8,WS_EX_TRANSPARENT
CONTROL "Display pool content",IDC_DISPLAY_POOL_CONTENTS,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,236,142,125,12
GROUPBOX "Randomness Collected From Mouse Movements",IDT_ENTROPY_BAR,20,156,214,18
CONTROL "",IDC_ENTROPY_BAR,"msctls_progress32",WS_BORDER,31,165,193,6
END
/////////////////////////////////////////////////////////////////////////////
//
// DESIGNINFO
//
#ifdef APSTUDIO_INVOKED
GUIDELINES DESIGNINFO
BEGIN
IDD_SIZE_DIALOG, DIALOG
BEGIN
LEFTMARGIN, 15
RIGHTMARGIN, 361
VERTGUIDE, 30
TOPMARGIN, 14
BOTTOMMARGIN, 256
END
IDD_MOUNT_DLG, DIALOG
BEGIN
RIGHTMARGIN, 369
VERTGUIDE, 8
BOTTOMMARGIN, 269
END
IDD_PASSWORD_DLG, DIALOG
BEGIN
BOTTOMMARGIN, 102
END
IDD_EXPAND_PROGRESS_DLG, DIALOG
BEGIN
RIGHTMARGIN, 361
VERTGUIDE, 15
VERTGUIDE, 73
VERTGUIDE, 80
VERTGUIDE, 355
TOPMARGIN, 9
BOTTOMMARGIN, 268
HORZGUIDE, 176
END
END
#endif // APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// HEADER
//
IDR_MOUNT_RSRC_HEADER HEADER "resource.h"
/////////////////////////////////////////////////////////////////////////////
//
// Version
//
VS_VERSION_INFO VERSIONINFO
FILEVERSION 1,17,22,0
PRODUCTVERSION 1,17,22,0
FILEFLAGSMASK 0x17L
#ifdef _DEBUG
FILEFLAGS 0x1L
#else
FILEFLAGS 0x0L
#endif
FILEOS 0x4L
FILETYPE 0x1L
FILESUBTYPE 0x0L
BEGIN
BLOCK "StringFileInfo"
BEGIN
BLOCK "040904b0"
BEGIN
VALUE "CompanyName", "IDRIX"
VALUE "FileDescription", "VeraCrypt Expander"
VALUE "FileVersion", "1.17"
VALUE "LegalTrademarks", "VeraCrypt"
VALUE "OriginalFilename", "VeraCryptExpander.exe"
VALUE "ProductName", "VeraCrypt"
VALUE "ProductVersion", "1.17"
END
END
BLOCK "VarFileInfo"
BEGIN
VALUE "Translation", 0x409, 1200
END
END
#ifdef APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// TEXTINCLUDE
//
1 TEXTINCLUDE
BEGIN
"resource.h\0"
END
2 TEXTINCLUDE
BEGIN
"#include ""afxres.h""\r\n"
"#include ""..\\\\common\\\\resource.h""\r\n"
"\0"
END
3 TEXTINCLUDE
BEGIN
"#include ""..\\\\common\\\\common.rc""\r\n"
"\0"
END
#endif // APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// Bitmap
//
IDB_LOGO_96DPI BITMAP "Logo_96dpi.bmp"
IDB_LOGO_288DPI BITMAP "Logo_288dpi.bmp"
/////////////////////////////////////////////////////////////////////////////
//
// Menu
//
IDR_MENU MENUEX
BEGIN
MENUITEM "About", IDM_ABOUT,MFT_STRING,MFS_ENABLED
MENUITEM "Homepage", IDM_HOMEPAGE,MFT_STRING | MFT_RIGHTJUSTIFY,MFS_ENABLED
END
/////////////////////////////////////////////////////////////////////////////
//
// String Table
//
STRINGTABLE
BEGIN
IDS_UACSTRING "VeraCrypt Expander"
END
#endif // English (U.S.) resources
/////////////////////////////////////////////////////////////////////////////
#ifndef APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// Generated from the TEXTINCLUDE 3 resource.
//
#include "..\\common\\common.rc"
/////////////////////////////////////////////////////////////////////////////
#endif // not APSTUDIO_INVOKED

File diff suppressed because it is too large Load Diff

View File

@@ -1,17 +1,17 @@
/*
Legal Notice: Some portions of the source code contained in this file were
derived from the source code of TrueCrypt 7.1a, which is
Copyright (c) 2003-2012 TrueCrypt Developers Association and which is
governed by the TrueCrypt License 3.0, also from the source code of
Encryption for the Masses 2.02a, which is Copyright (c) 1998-2000 Paul Le Roux
and which is governed by the 'License Agreement for Encryption for the Masses'
/*
Legal Notice: Some portions of the source code contained in this file were
derived from the source code of TrueCrypt 7.1a, which is
Copyright (c) 2003-2012 TrueCrypt Developers Association and which is
governed by the TrueCrypt License 3.0, also from the source code of
Encryption for the Masses 2.02a, which is Copyright (c) 1998-2000 Paul Le Roux
and which is governed by the 'License Agreement for Encryption for the Masses'
and also from the source code of extcv, which is Copyright (c) 2009-2010 Kih-Oskh
or Copyright (c) 2012-2013 Josef Schneider <josef@netpage.dk>
Modifications and additions to the original source code (contained in this file)
and all other portions of this file are Copyright (c) 2013-2016 IDRIX
and are governed by the Apache License 2.0 the full text of which is
contained in the file License.txt included in VeraCrypt binary and source
or Copyright (c) 2012-2013 Josef Schneider <josef@netpage.dk>
Modifications and additions to the original source code (contained in this file)
and all other portions of this file are Copyright (c) 2013-2016 IDRIX
and are governed by the Apache License 2.0 the full text of which is
contained in the file License.txt included in VeraCrypt binary and source
code distribution packages. */
#include <stdlib.h>
@@ -32,8 +32,8 @@
#include "InitDataArea.h"
#ifndef SRC_POS
#define SRC_POS (__FUNCTION__ ":" TC_TO_STRING(__LINE__))
#ifndef SRC_POS
#define SRC_POS (__FUNCTION__ ":" TC_TO_STRING(__LINE__))
#endif
int FormatWriteBufferSize = 1024 * 1024;

View File

@@ -1,15 +1,15 @@
/*
Derived from source code of TrueCrypt 7.1a, which is
Copyright (c) 2008-2012 TrueCrypt Developers Association and which is governed
by the TrueCrypt License 3.0, and also derived from source code of extcv which
is Copyright (c) 2009-2010 by Kih-Oskh or Copyright (c) 2012-2013 Josef Schneider
<josef@netpage.dk>
Modifications and additions to the original source code (contained in this file)
and all other portions of this file are Copyright (c) 2013-2016 IDRIX
and are governed by the Apache License 2.0 the full text of which is
contained in the file License.txt included in VeraCrypt binary and source
code distribution packages.
/*
Derived from source code of TrueCrypt 7.1a, which is
Copyright (c) 2008-2012 TrueCrypt Developers Association and which is governed
by the TrueCrypt License 3.0, and also derived from source code of extcv which
is Copyright (c) 2009-2010 by Kih-Oskh or Copyright (c) 2012-2013 Josef Schneider
<josef@netpage.dk>
Modifications and additions to the original source code (contained in this file)
and all other portions of this file are Copyright (c) 2013-2016 IDRIX
and are governed by the Apache License 2.0 the full text of which is
contained in the file License.txt included in VeraCrypt binary and source
code distribution packages.
*/
#ifndef TC_HEADER_InitDataArea

View File

@@ -1,17 +1,17 @@
/*
Legal Notice: Some portions of the source code contained in this file were
derived from the source code of TrueCrypt 7.1a, which is
Copyright (c) 2003-2012 TrueCrypt Developers Association and which is
governed by the TrueCrypt License 3.0, also from the source code of
Encryption for the Masses 2.02a, which is Copyright (c) 1998-2000 Paul Le Roux
and which is governed by the 'License Agreement for Encryption for the Masses'
/*
Legal Notice: Some portions of the source code contained in this file were
derived from the source code of TrueCrypt 7.1a, which is
Copyright (c) 2003-2012 TrueCrypt Developers Association and which is
governed by the TrueCrypt License 3.0, also from the source code of
Encryption for the Masses 2.02a, which is Copyright (c) 1998-2000 Paul Le Roux
and which is governed by the 'License Agreement for Encryption for the Masses'
and also from the source code of extcv, which is Copyright (c) 2009-2010 Kih-Oskh
or Copyright (c) 2012-2013 Josef Schneider <josef@netpage.dk>
Modifications and additions to the original source code (contained in this file)
and all other portions of this file are Copyright (c) 2013-2016 IDRIX
and are governed by the Apache License 2.0 the full text of which is
contained in the file License.txt included in VeraCrypt binary and source
or Copyright (c) 2012-2013 Josef Schneider <josef@netpage.dk>
Modifications and additions to the original source code (contained in this file)
and all other portions of this file are Copyright (c) 2013-2016 IDRIX
and are governed by the Apache License 2.0 the full text of which is
contained in the file License.txt included in VeraCrypt binary and source
code distribution packages. */
#include "Tcdefs.h"
@@ -383,32 +383,32 @@ static char *PasswordDialogTitleStringId;
/* Except in response to the WM_INITDIALOG message, the dialog box procedure
should return nonzero if it processes the message, and zero if it does
not. - see DialogProc */
BOOL CALLBACK ExtcvPasswordDlgProc (HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam)
{
WORD lw = LOWORD (wParam);
static Password *szXPwd;
static int *pkcs5;
static int *pim;
static BOOL* truecryptMode;
switch (msg)
{
case WM_INITDIALOG:
{
int i, nIndex;
szXPwd = ((PasswordDlgParam *) lParam) -> password;
pkcs5 = ((PasswordDlgParam *) lParam) -> pkcs5;
pim = ((PasswordDlgParam *) lParam) -> pim;
truecryptMode = ((PasswordDlgParam *) lParam) -> truecryptMode;
LocalizeDialog (hwndDlg, "IDD_PASSWORD_DLG");
DragAcceptFiles (hwndDlg, TRUE);
if (PasswordDialogTitleStringId)
{
SetWindowTextW (hwndDlg, GetString (PasswordDialogTitleStringId));
}
else if (wcslen (PasswordDlgVolume) > 0)
{
BOOL CALLBACK ExtcvPasswordDlgProc (HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam)
{
WORD lw = LOWORD (wParam);
static Password *szXPwd;
static int *pkcs5;
static int *pim;
static BOOL* truecryptMode;
switch (msg)
{
case WM_INITDIALOG:
{
int i, nIndex;
szXPwd = ((PasswordDlgParam *) lParam) -> password;
pkcs5 = ((PasswordDlgParam *) lParam) -> pkcs5;
pim = ((PasswordDlgParam *) lParam) -> pim;
truecryptMode = ((PasswordDlgParam *) lParam) -> truecryptMode;
LocalizeDialog (hwndDlg, "IDD_PASSWORD_DLG");
DragAcceptFiles (hwndDlg, TRUE);
if (PasswordDialogTitleStringId)
{
SetWindowTextW (hwndDlg, GetString (PasswordDialogTitleStringId));
}
else if (wcslen (PasswordDlgVolume) > 0)
{
wchar_t s[1024];
const int maxVisibleLen = 40;
@@ -420,359 +420,359 @@ BOOL CALLBACK ExtcvPasswordDlgProc (HWND hwndDlg, UINT msg, WPARAM wParam, LPARA
else
StringCbPrintfW (s, sizeof(s), GetString ("ENTER_PASSWORD_FOR"), PasswordDlgVolume);
SetWindowTextW (hwndDlg, s);
}
/* Populate the PRF algorithms list */
HWND hComboBox = GetDlgItem (hwndDlg, IDC_PKCS5_PRF_ID);
SendMessage (hComboBox, CB_RESETCONTENT, 0, 0);
nIndex = 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));
SendMessage (hComboBox, CB_SETITEMDATA, nIndex, (LPARAM) i);
}
/* make autodetection the default */
SendMessage (hComboBox, CB_SETCURSEL, 0, 0);
SendMessage (GetDlgItem (hwndDlg, IDC_PASSWORD), EM_LIMITTEXT, MAX_PASSWORD, 0);
SendMessage (GetDlgItem (hwndDlg, IDC_CACHE), BM_SETCHECK, bCacheInDriver ? BST_CHECKED:BST_UNCHECKED, 0);
SendMessage (GetDlgItem (hwndDlg, IDC_PIM), EM_LIMITTEXT, MAX_PIM, 0);
SetPim (hwndDlg, IDC_PIM, *pim);
/* make PIM field visible if a PIM value has been explicitely specified */
if (*pim > 0)
{
ShowWindow (GetDlgItem (hwndDlg, IDC_PIM_ENABLE), SW_HIDE);
ShowWindow (GetDlgItem( hwndDlg, IDT_PIM), SW_SHOW);
ShowWindow (GetDlgItem( hwndDlg, IDC_PIM), SW_SHOW);
ShowWindow (GetDlgItem( hwndDlg, IDC_PIM_HELP), SW_SHOW);
}
SetCheckBox (hwndDlg, IDC_KEYFILES_ENABLE, KeyFilesEnable);
mountOptions.PartitionInInactiveSysEncScope = bPrebootPasswordDlgMode;
if (bPrebootPasswordDlgMode)
{
SendMessage (hwndDlg, TC_APPMSG_PREBOOT_PASSWORD_MODE, 0, 0);
}
if (PasswordDialogDisableMountOptions)
{
EnableWindow (GetDlgItem (hwndDlg, IDC_CACHE), FALSE);
EnableWindow (GetDlgItem (hwndDlg, IDC_MOUNT_OPTIONS), FALSE);
}
/* No support for mounting TrueCrypt volumes */
SetCheckBox (hwndDlg, IDC_TRUECRYPT_MODE, FALSE);
EnableWindow (GetDlgItem (hwndDlg, IDC_TRUECRYPT_MODE), FALSE);
if (!SetForegroundWindow (hwndDlg) && (FavoriteMountOnArrivalInProgress))
{
SetWindowPos (hwndDlg, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE);
FLASHWINFO flash;
flash.cbSize = sizeof (flash);
flash.dwFlags = FLASHW_ALL | FLASHW_TIMERNOFG;
flash.dwTimeout = 0;
flash.hwnd = hwndDlg;
flash.uCount = 0;
FlashWindowEx (&flash);
SetWindowPos (hwndDlg, HWND_NOTOPMOST, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE);
}
}
return 0;
case TC_APPMSG_PREBOOT_PASSWORD_MODE:
{
/* No support for mounting TrueCrypt system partition */
SetCheckBox (hwndDlg, IDC_TRUECRYPT_MODE, FALSE);
EnableWindow (GetDlgItem (hwndDlg, IDC_TRUECRYPT_MODE), FALSE);
/* Repopulate the PRF algorithms list with algorithms that support system encryption */
HWND hComboBox = GetDlgItem (hwndDlg, IDC_PKCS5_PRF_ID);
SendMessage (hComboBox, CB_RESETCONTENT, 0, 0);
int i, nIndex = 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++)
{
if (HashForSystemEncryption(i))
{
nIndex = SendMessage (hComboBox, CB_ADDSTRING, 0, (LPARAM) get_pkcs5_prf_name(i));
SendMessage (hComboBox, CB_SETITEMDATA, nIndex, (LPARAM) i);
}
}
/* make autodetection the default */
SendMessage (hComboBox, CB_SETCURSEL, 0, 0);
ToBootPwdField (hwndDlg, IDC_PASSWORD);
// Attempt to wipe the password stored in the input field buffer
wchar_t tmp[MAX_PASSWORD+1];
wmemset (tmp, L'X', MAX_PASSWORD);
tmp [MAX_PASSWORD] = 0;
SetWindowText (GetDlgItem (hwndDlg, IDC_PASSWORD), tmp);
SetWindowText (GetDlgItem (hwndDlg, IDC_PASSWORD), L"");
StringCbPrintfW (OrigKeyboardLayout, sizeof(OrigKeyboardLayout),L"%08X", (DWORD) GetKeyboardLayout (NULL) & 0xFFFF);
DWORD keybLayout = (DWORD) LoadKeyboardLayout (L"00000409", KLF_ACTIVATE);
if (keybLayout != 0x00000409 && keybLayout != 0x04090409)
{
Error ("CANT_CHANGE_KEYB_LAYOUT_FOR_SYS_ENCRYPTION", hwndDlg);
EndDialog (hwndDlg, IDCANCEL);
return 1;
}
if (SetTimer (hwndDlg, TIMER_ID_KEYB_LAYOUT_GUARD, TIMER_INTERVAL_KEYB_LAYOUT_GUARD, NULL) == 0)
{
Error ("CANNOT_SET_TIMER", hwndDlg);
EndDialog (hwndDlg, IDCANCEL);
return 1;
}
if (GetCheckBox (hwndDlg, IDC_SHOW_PASSWORD))
{
// simulate hiding password
SetCheckBox (hwndDlg, IDC_SHOW_PASSWORD, FALSE);
HandleShowPasswordFieldAction (hwndDlg, IDC_SHOW_PASSWORD, IDC_PASSWORD, IDC_PIM);
}
SetCheckBox (hwndDlg, IDC_KEYFILES_ENABLE, FALSE);
EnableWindow (GetDlgItem (hwndDlg, IDC_KEYFILES_ENABLE), FALSE);
EnableWindow (GetDlgItem (hwndDlg, IDC_KEY_FILES), FALSE);
SetPim (hwndDlg, IDC_PIM, *pim);
bPrebootPasswordDlgMode = TRUE;
}
return 1;
case WM_TIMER:
switch (wParam)
{
case TIMER_ID_KEYB_LAYOUT_GUARD:
if (bPrebootPasswordDlgMode)
{
DWORD keybLayout = (DWORD) GetKeyboardLayout (NULL);
if (keybLayout != 0x00000409 && keybLayout != 0x04090409)
{
// Keyboard layout is not standard US
// Attempt to wipe the password stored in the input field buffer
wchar_t tmp[MAX_PASSWORD+1];
wmemset (tmp, L'X', MAX_PASSWORD);
tmp [MAX_PASSWORD] = 0;
SetWindowText (GetDlgItem (hwndDlg, IDC_PASSWORD), tmp);
SetWindowText (GetDlgItem (hwndDlg, IDC_PASSWORD), L"");
keybLayout = (DWORD) LoadKeyboardLayout (L"00000409", KLF_ACTIVATE);
if (keybLayout != 0x00000409 && keybLayout != 0x04090409)
{
KillTimer (hwndDlg, TIMER_ID_KEYB_LAYOUT_GUARD);
Error ("CANT_CHANGE_KEYB_LAYOUT_FOR_SYS_ENCRYPTION", hwndDlg);
EndDialog (hwndDlg, IDCANCEL);
return 1;
}
wchar_t szTmp [4096];
StringCbCopyW (szTmp, sizeof(szTmp), GetString ("KEYB_LAYOUT_CHANGE_PREVENTED"));
StringCbCatW (szTmp, sizeof(szTmp), L"\n\n");
StringCbCatW (szTmp, sizeof(szTmp), GetString ("KEYB_LAYOUT_SYS_ENC_EXPLANATION"));
MessageBoxW (MainDlg, szTmp, lpszTitle, MB_ICONWARNING | MB_SETFOREGROUND | MB_TOPMOST);
}
}
return 1;
}
return 0;
case WM_COMMAND:
if (lw == IDC_MOUNT_OPTIONS)
{
DialogBoxParamW (hInst,
MAKEINTRESOURCEW (IDD_MOUNT_OPTIONS), hwndDlg,
(DLGPROC) MountOptionsDlgProc, (LPARAM) &mountOptions);
if (!bPrebootPasswordDlgMode && mountOptions.PartitionInInactiveSysEncScope)
SendMessage (hwndDlg, TC_APPMSG_PREBOOT_PASSWORD_MODE, 0, 0);
return 1;
}
if (lw == IDC_PIM_ENABLE)
{
ShowWindow (GetDlgItem (hwndDlg, IDC_PIM_ENABLE), SW_HIDE);
ShowWindow (GetDlgItem( hwndDlg, IDT_PIM), SW_SHOW);
ShowWindow (GetDlgItem( hwndDlg, IDC_PIM), SW_SHOW);
ShowWindow (GetDlgItem( hwndDlg, IDC_PIM_HELP), SW_SHOW);
SetFocus (GetDlgItem (hwndDlg, IDC_PIM));
return 1;
}
if (lw == IDC_SHOW_PASSWORD)
{
HandleShowPasswordFieldAction (hwndDlg, IDC_SHOW_PASSWORD, IDC_PASSWORD, IDC_PIM);
return 1;
}
if (lw == IDC_KEY_FILES)
{
KeyFilesDlgParam param;
param.EnableKeyFiles = KeyFilesEnable;
param.FirstKeyFile = FirstKeyFile;
if (IDOK == DialogBoxParamW (hInst,
MAKEINTRESOURCEW (IDD_KEYFILES), hwndDlg,
(DLGPROC) KeyFilesDlgProc, (LPARAM) &param))
{
KeyFilesEnable = param.EnableKeyFiles;
FirstKeyFile = param.FirstKeyFile;
SetCheckBox (hwndDlg, IDC_KEYFILES_ENABLE, KeyFilesEnable);
}
return 1;
}
if (lw == IDC_KEYFILES_ENABLE)
{
KeyFilesEnable = GetCheckBox (hwndDlg, IDC_KEYFILES_ENABLE);
return 1;
}
if (lw == IDCANCEL || lw == IDOK)
{
wchar_t tmp[MAX_PASSWORD+1];
if (lw == IDOK)
{
if (mountOptions.ProtectHiddenVolume && hidVolProtKeyFilesParam.EnableKeyFiles)
KeyFilesApply (hwndDlg, &mountOptions.ProtectedHidVolPassword, hidVolProtKeyFilesParam.FirstKeyFile, PasswordDlgVolume);
if (GetPassword (hwndDlg, IDC_PASSWORD, (LPSTR) szXPwd->Text, MAX_PASSWORD + 1, TRUE))
szXPwd->Length = strlen ((char *) szXPwd->Text);
else
return 1;
bCacheInDriver = IsButtonChecked (GetDlgItem (hwndDlg, IDC_CACHE));
*pkcs5 = (int) SendMessage (GetDlgItem (hwndDlg, IDC_PKCS5_PRF_ID), CB_GETITEMDATA, SendMessage (GetDlgItem (hwndDlg, IDC_PKCS5_PRF_ID), CB_GETCURSEL, 0, 0), 0);
*truecryptMode = GetCheckBox (hwndDlg, IDC_TRUECRYPT_MODE);
*pim = GetPim (hwndDlg, IDC_PIM);
/* SHA-256 is not supported by TrueCrypt */
if ( (*truecryptMode)
&& ((*pkcs5 == SHA256) || (mountOptions.ProtectHiddenVolume && mountOptions.ProtectedHidVolPkcs5Prf == SHA256))
)
{
Error ("ALGO_NOT_SUPPORTED_FOR_TRUECRYPT_MODE", hwndDlg);
return 1;
}
if ( (*truecryptMode)
&& (*pim != 0)
)
{
Error ("PIM_NOT_SUPPORTED_FOR_TRUECRYPT_MODE", hwndDlg);
return 1;
}
}
// Attempt to wipe password stored in the input field buffer
wmemset (tmp, L'X', MAX_PASSWORD);
tmp[MAX_PASSWORD] = 0;
SetWindowText (GetDlgItem (hwndDlg, IDC_PASSWORD), tmp);
SetWindowText (GetDlgItem (hwndDlg, IDC_PASSWORD_PROT_HIDVOL), tmp);
if (hidVolProtKeyFilesParam.FirstKeyFile != NULL)
{
KeyFileRemoveAll (&hidVolProtKeyFilesParam.FirstKeyFile);
hidVolProtKeyFilesParam.EnableKeyFiles = FALSE;
}
if (bPrebootPasswordDlgMode)
{
KillTimer (hwndDlg, TIMER_ID_KEYB_LAYOUT_GUARD);
// Restore the original keyboard layout
if (LoadKeyboardLayout (OrigKeyboardLayout, KLF_ACTIVATE | KLF_SUBSTITUTE_OK) == NULL)
Warning ("CANNOT_RESTORE_KEYBOARD_LAYOUT", hwndDlg);
}
EndDialog (hwndDlg, lw);
return 1;
}
return 0;
case WM_CONTEXTMENU:
{
RECT buttonRect;
GetWindowRect (GetDlgItem (hwndDlg, IDC_KEY_FILES), &buttonRect);
if (LOWORD (lParam) >= buttonRect.left && LOWORD (lParam) <= buttonRect.right
&& HIWORD (lParam) >= buttonRect.top && HIWORD (lParam) <= buttonRect.bottom)
{
// The "Keyfiles" button has been right-clicked
KeyFilesDlgParam param;
param.EnableKeyFiles = KeyFilesEnable;
param.FirstKeyFile = FirstKeyFile;
POINT popupPos;
popupPos.x = buttonRect.left + 2;
popupPos.y = buttonRect.top + 2;
if (KeyfilesPopupMenu (hwndDlg, popupPos, &param))
{
KeyFilesEnable = param.EnableKeyFiles;
FirstKeyFile = param.FirstKeyFile;
SetCheckBox (hwndDlg, IDC_KEYFILES_ENABLE, KeyFilesEnable);
}
}
}
break;
case WM_DROPFILES:
{
HDROP hdrop = (HDROP) wParam;
int i = 0, count = DragQueryFile (hdrop, 0xFFFFFFFF, NULL, 0);
while (count-- > 0)
{
KeyFile *kf = (KeyFile *) malloc (sizeof (KeyFile));
if (kf)
{
DragQueryFile (hdrop, i++, kf->FileName, ARRAYSIZE (kf->FileName));
FirstKeyFile = KeyFileAdd (FirstKeyFile, kf);
KeyFilesEnable = TRUE;
}
}
SetCheckBox (hwndDlg, IDC_KEYFILES_ENABLE, KeyFilesEnable);
DragFinish (hdrop);
}
return 1;
}
return 0;
SetWindowTextW (hwndDlg, s);
}
/* Populate the PRF algorithms list */
HWND hComboBox = GetDlgItem (hwndDlg, IDC_PKCS5_PRF_ID);
SendMessage (hComboBox, CB_RESETCONTENT, 0, 0);
nIndex = 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));
SendMessage (hComboBox, CB_SETITEMDATA, nIndex, (LPARAM) i);
}
/* make autodetection the default */
SendMessage (hComboBox, CB_SETCURSEL, 0, 0);
SendMessage (GetDlgItem (hwndDlg, IDC_PASSWORD), EM_LIMITTEXT, MAX_PASSWORD, 0);
SendMessage (GetDlgItem (hwndDlg, IDC_CACHE), BM_SETCHECK, bCacheInDriver ? BST_CHECKED:BST_UNCHECKED, 0);
SendMessage (GetDlgItem (hwndDlg, IDC_PIM), EM_LIMITTEXT, MAX_PIM, 0);
SetPim (hwndDlg, IDC_PIM, *pim);
/* make PIM field visible if a PIM value has been explicitely specified */
if (*pim > 0)
{
ShowWindow (GetDlgItem (hwndDlg, IDC_PIM_ENABLE), SW_HIDE);
ShowWindow (GetDlgItem( hwndDlg, IDT_PIM), SW_SHOW);
ShowWindow (GetDlgItem( hwndDlg, IDC_PIM), SW_SHOW);
ShowWindow (GetDlgItem( hwndDlg, IDC_PIM_HELP), SW_SHOW);
}
SetCheckBox (hwndDlg, IDC_KEYFILES_ENABLE, KeyFilesEnable);
mountOptions.PartitionInInactiveSysEncScope = bPrebootPasswordDlgMode;
if (bPrebootPasswordDlgMode)
{
SendMessage (hwndDlg, TC_APPMSG_PREBOOT_PASSWORD_MODE, 0, 0);
}
if (PasswordDialogDisableMountOptions)
{
EnableWindow (GetDlgItem (hwndDlg, IDC_CACHE), FALSE);
EnableWindow (GetDlgItem (hwndDlg, IDC_MOUNT_OPTIONS), FALSE);
}
/* No support for mounting TrueCrypt volumes */
SetCheckBox (hwndDlg, IDC_TRUECRYPT_MODE, FALSE);
EnableWindow (GetDlgItem (hwndDlg, IDC_TRUECRYPT_MODE), FALSE);
if (!SetForegroundWindow (hwndDlg) && (FavoriteMountOnArrivalInProgress))
{
SetWindowPos (hwndDlg, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE);
FLASHWINFO flash;
flash.cbSize = sizeof (flash);
flash.dwFlags = FLASHW_ALL | FLASHW_TIMERNOFG;
flash.dwTimeout = 0;
flash.hwnd = hwndDlg;
flash.uCount = 0;
FlashWindowEx (&flash);
SetWindowPos (hwndDlg, HWND_NOTOPMOST, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE);
}
}
return 0;
case TC_APPMSG_PREBOOT_PASSWORD_MODE:
{
/* No support for mounting TrueCrypt system partition */
SetCheckBox (hwndDlg, IDC_TRUECRYPT_MODE, FALSE);
EnableWindow (GetDlgItem (hwndDlg, IDC_TRUECRYPT_MODE), FALSE);
/* Repopulate the PRF algorithms list with algorithms that support system encryption */
HWND hComboBox = GetDlgItem (hwndDlg, IDC_PKCS5_PRF_ID);
SendMessage (hComboBox, CB_RESETCONTENT, 0, 0);
int i, nIndex = 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++)
{
if (HashForSystemEncryption(i))
{
nIndex = SendMessage (hComboBox, CB_ADDSTRING, 0, (LPARAM) get_pkcs5_prf_name(i));
SendMessage (hComboBox, CB_SETITEMDATA, nIndex, (LPARAM) i);
}
}
/* make autodetection the default */
SendMessage (hComboBox, CB_SETCURSEL, 0, 0);
ToBootPwdField (hwndDlg, IDC_PASSWORD);
// Attempt to wipe the password stored in the input field buffer
wchar_t tmp[MAX_PASSWORD+1];
wmemset (tmp, L'X', MAX_PASSWORD);
tmp [MAX_PASSWORD] = 0;
SetWindowText (GetDlgItem (hwndDlg, IDC_PASSWORD), tmp);
SetWindowText (GetDlgItem (hwndDlg, IDC_PASSWORD), L"");
StringCbPrintfW (OrigKeyboardLayout, sizeof(OrigKeyboardLayout),L"%08X", (DWORD) GetKeyboardLayout (NULL) & 0xFFFF);
DWORD keybLayout = (DWORD) LoadKeyboardLayout (L"00000409", KLF_ACTIVATE);
if (keybLayout != 0x00000409 && keybLayout != 0x04090409)
{
Error ("CANT_CHANGE_KEYB_LAYOUT_FOR_SYS_ENCRYPTION", hwndDlg);
EndDialog (hwndDlg, IDCANCEL);
return 1;
}
if (SetTimer (hwndDlg, TIMER_ID_KEYB_LAYOUT_GUARD, TIMER_INTERVAL_KEYB_LAYOUT_GUARD, NULL) == 0)
{
Error ("CANNOT_SET_TIMER", hwndDlg);
EndDialog (hwndDlg, IDCANCEL);
return 1;
}
if (GetCheckBox (hwndDlg, IDC_SHOW_PASSWORD))
{
// simulate hiding password
SetCheckBox (hwndDlg, IDC_SHOW_PASSWORD, FALSE);
HandleShowPasswordFieldAction (hwndDlg, IDC_SHOW_PASSWORD, IDC_PASSWORD, IDC_PIM);
}
SetCheckBox (hwndDlg, IDC_KEYFILES_ENABLE, FALSE);
EnableWindow (GetDlgItem (hwndDlg, IDC_KEYFILES_ENABLE), FALSE);
EnableWindow (GetDlgItem (hwndDlg, IDC_KEY_FILES), FALSE);
SetPim (hwndDlg, IDC_PIM, *pim);
bPrebootPasswordDlgMode = TRUE;
}
return 1;
case WM_TIMER:
switch (wParam)
{
case TIMER_ID_KEYB_LAYOUT_GUARD:
if (bPrebootPasswordDlgMode)
{
DWORD keybLayout = (DWORD) GetKeyboardLayout (NULL);
if (keybLayout != 0x00000409 && keybLayout != 0x04090409)
{
// Keyboard layout is not standard US
// Attempt to wipe the password stored in the input field buffer
wchar_t tmp[MAX_PASSWORD+1];
wmemset (tmp, L'X', MAX_PASSWORD);
tmp [MAX_PASSWORD] = 0;
SetWindowText (GetDlgItem (hwndDlg, IDC_PASSWORD), tmp);
SetWindowText (GetDlgItem (hwndDlg, IDC_PASSWORD), L"");
keybLayout = (DWORD) LoadKeyboardLayout (L"00000409", KLF_ACTIVATE);
if (keybLayout != 0x00000409 && keybLayout != 0x04090409)
{
KillTimer (hwndDlg, TIMER_ID_KEYB_LAYOUT_GUARD);
Error ("CANT_CHANGE_KEYB_LAYOUT_FOR_SYS_ENCRYPTION", hwndDlg);
EndDialog (hwndDlg, IDCANCEL);
return 1;
}
wchar_t szTmp [4096];
StringCbCopyW (szTmp, sizeof(szTmp), GetString ("KEYB_LAYOUT_CHANGE_PREVENTED"));
StringCbCatW (szTmp, sizeof(szTmp), L"\n\n");
StringCbCatW (szTmp, sizeof(szTmp), GetString ("KEYB_LAYOUT_SYS_ENC_EXPLANATION"));
MessageBoxW (MainDlg, szTmp, lpszTitle, MB_ICONWARNING | MB_SETFOREGROUND | MB_TOPMOST);
}
}
return 1;
}
return 0;
case WM_COMMAND:
if (lw == IDC_MOUNT_OPTIONS)
{
DialogBoxParamW (hInst,
MAKEINTRESOURCEW (IDD_MOUNT_OPTIONS), hwndDlg,
(DLGPROC) MountOptionsDlgProc, (LPARAM) &mountOptions);
if (!bPrebootPasswordDlgMode && mountOptions.PartitionInInactiveSysEncScope)
SendMessage (hwndDlg, TC_APPMSG_PREBOOT_PASSWORD_MODE, 0, 0);
return 1;
}
if (lw == IDC_PIM_ENABLE)
{
ShowWindow (GetDlgItem (hwndDlg, IDC_PIM_ENABLE), SW_HIDE);
ShowWindow (GetDlgItem( hwndDlg, IDT_PIM), SW_SHOW);
ShowWindow (GetDlgItem( hwndDlg, IDC_PIM), SW_SHOW);
ShowWindow (GetDlgItem( hwndDlg, IDC_PIM_HELP), SW_SHOW);
SetFocus (GetDlgItem (hwndDlg, IDC_PIM));
return 1;
}
if (lw == IDC_SHOW_PASSWORD)
{
HandleShowPasswordFieldAction (hwndDlg, IDC_SHOW_PASSWORD, IDC_PASSWORD, IDC_PIM);
return 1;
}
if (lw == IDC_KEY_FILES)
{
KeyFilesDlgParam param;
param.EnableKeyFiles = KeyFilesEnable;
param.FirstKeyFile = FirstKeyFile;
if (IDOK == DialogBoxParamW (hInst,
MAKEINTRESOURCEW (IDD_KEYFILES), hwndDlg,
(DLGPROC) KeyFilesDlgProc, (LPARAM) &param))
{
KeyFilesEnable = param.EnableKeyFiles;
FirstKeyFile = param.FirstKeyFile;
SetCheckBox (hwndDlg, IDC_KEYFILES_ENABLE, KeyFilesEnable);
}
return 1;
}
if (lw == IDC_KEYFILES_ENABLE)
{
KeyFilesEnable = GetCheckBox (hwndDlg, IDC_KEYFILES_ENABLE);
return 1;
}
if (lw == IDCANCEL || lw == IDOK)
{
wchar_t tmp[MAX_PASSWORD+1];
if (lw == IDOK)
{
if (mountOptions.ProtectHiddenVolume && hidVolProtKeyFilesParam.EnableKeyFiles)
KeyFilesApply (hwndDlg, &mountOptions.ProtectedHidVolPassword, hidVolProtKeyFilesParam.FirstKeyFile, PasswordDlgVolume);
if (GetPassword (hwndDlg, IDC_PASSWORD, (LPSTR) szXPwd->Text, MAX_PASSWORD + 1, TRUE))
szXPwd->Length = strlen ((char *) szXPwd->Text);
else
return 1;
bCacheInDriver = IsButtonChecked (GetDlgItem (hwndDlg, IDC_CACHE));
*pkcs5 = (int) SendMessage (GetDlgItem (hwndDlg, IDC_PKCS5_PRF_ID), CB_GETITEMDATA, SendMessage (GetDlgItem (hwndDlg, IDC_PKCS5_PRF_ID), CB_GETCURSEL, 0, 0), 0);
*truecryptMode = GetCheckBox (hwndDlg, IDC_TRUECRYPT_MODE);
*pim = GetPim (hwndDlg, IDC_PIM);
/* SHA-256 is not supported by TrueCrypt */
if ( (*truecryptMode)
&& ((*pkcs5 == SHA256) || (mountOptions.ProtectHiddenVolume && mountOptions.ProtectedHidVolPkcs5Prf == SHA256))
)
{
Error ("ALGO_NOT_SUPPORTED_FOR_TRUECRYPT_MODE", hwndDlg);
return 1;
}
if ( (*truecryptMode)
&& (*pim != 0)
)
{
Error ("PIM_NOT_SUPPORTED_FOR_TRUECRYPT_MODE", hwndDlg);
return 1;
}
}
// Attempt to wipe password stored in the input field buffer
wmemset (tmp, L'X', MAX_PASSWORD);
tmp[MAX_PASSWORD] = 0;
SetWindowText (GetDlgItem (hwndDlg, IDC_PASSWORD), tmp);
SetWindowText (GetDlgItem (hwndDlg, IDC_PASSWORD_PROT_HIDVOL), tmp);
if (hidVolProtKeyFilesParam.FirstKeyFile != NULL)
{
KeyFileRemoveAll (&hidVolProtKeyFilesParam.FirstKeyFile);
hidVolProtKeyFilesParam.EnableKeyFiles = FALSE;
}
if (bPrebootPasswordDlgMode)
{
KillTimer (hwndDlg, TIMER_ID_KEYB_LAYOUT_GUARD);
// Restore the original keyboard layout
if (LoadKeyboardLayout (OrigKeyboardLayout, KLF_ACTIVATE | KLF_SUBSTITUTE_OK) == NULL)
Warning ("CANNOT_RESTORE_KEYBOARD_LAYOUT", hwndDlg);
}
EndDialog (hwndDlg, lw);
return 1;
}
return 0;
case WM_CONTEXTMENU:
{
RECT buttonRect;
GetWindowRect (GetDlgItem (hwndDlg, IDC_KEY_FILES), &buttonRect);
if (LOWORD (lParam) >= buttonRect.left && LOWORD (lParam) <= buttonRect.right
&& HIWORD (lParam) >= buttonRect.top && HIWORD (lParam) <= buttonRect.bottom)
{
// The "Keyfiles" button has been right-clicked
KeyFilesDlgParam param;
param.EnableKeyFiles = KeyFilesEnable;
param.FirstKeyFile = FirstKeyFile;
POINT popupPos;
popupPos.x = buttonRect.left + 2;
popupPos.y = buttonRect.top + 2;
if (KeyfilesPopupMenu (hwndDlg, popupPos, &param))
{
KeyFilesEnable = param.EnableKeyFiles;
FirstKeyFile = param.FirstKeyFile;
SetCheckBox (hwndDlg, IDC_KEYFILES_ENABLE, KeyFilesEnable);
}
}
}
break;
case WM_DROPFILES:
{
HDROP hdrop = (HDROP) wParam;
int i = 0, count = DragQueryFile (hdrop, 0xFFFFFFFF, NULL, 0);
while (count-- > 0)
{
KeyFile *kf = (KeyFile *) malloc (sizeof (KeyFile));
if (kf)
{
DragQueryFile (hdrop, i++, kf->FileName, ARRAYSIZE (kf->FileName));
FirstKeyFile = KeyFileAdd (FirstKeyFile, kf);
KeyFilesEnable = TRUE;
}
}
SetCheckBox (hwndDlg, IDC_KEYFILES_ENABLE, KeyFilesEnable);
DragFinish (hdrop);
}
return 1;
}
return 0;
}
void SaveSettings (HWND hwndDlg)
@@ -792,36 +792,36 @@ int RestoreVolumeHeader (HWND hwndDlg, char *lpszVolume)
return 0;
}
int ExtcvAskVolumePassword (HWND hwndDlg, const wchar_t* fileName, Password *password, int *pkcs5, int *pim, BOOL* truecryptMode, char *titleStringId, BOOL enableMountOptions)
{
int result;
PasswordDlgParam dlgParam;
PasswordDialogTitleStringId = titleStringId;
PasswordDialogDisableMountOptions = !enableMountOptions;
dlgParam.password = password;
dlgParam.pkcs5 = pkcs5;
dlgParam.pim = pim;
dlgParam.truecryptMode = truecryptMode;
StringCbCopyW (PasswordDlgVolume, sizeof(PasswordDlgVolume), fileName);
result = DialogBoxParamW (hInst,
MAKEINTRESOURCEW (IDD_PASSWORD_DLG), hwndDlg,
(DLGPROC) ExtcvPasswordDlgProc, (LPARAM) &dlgParam);
if (result != IDOK)
{
password->Length = 0;
*pkcs5 = 0;
*pim = 0;
*truecryptMode = FALSE;
burn (&mountOptions.ProtectedHidVolPassword, sizeof (mountOptions.ProtectedHidVolPassword));
burn (&mountOptions.ProtectedHidVolPkcs5Prf, sizeof (mountOptions.ProtectedHidVolPkcs5Prf));
}
return result == IDOK;
int ExtcvAskVolumePassword (HWND hwndDlg, const wchar_t* fileName, Password *password, int *pkcs5, int *pim, BOOL* truecryptMode, char *titleStringId, BOOL enableMountOptions)
{
int result;
PasswordDlgParam dlgParam;
PasswordDialogTitleStringId = titleStringId;
PasswordDialogDisableMountOptions = !enableMountOptions;
dlgParam.password = password;
dlgParam.pkcs5 = pkcs5;
dlgParam.pim = pim;
dlgParam.truecryptMode = truecryptMode;
StringCbCopyW (PasswordDlgVolume, sizeof(PasswordDlgVolume), fileName);
result = DialogBoxParamW (hInst,
MAKEINTRESOURCEW (IDD_PASSWORD_DLG), hwndDlg,
(DLGPROC) ExtcvPasswordDlgProc, (LPARAM) &dlgParam);
if (result != IDOK)
{
password->Length = 0;
*pkcs5 = 0;
*pim = 0;
*truecryptMode = FALSE;
burn (&mountOptions.ProtectedHidVolPassword, sizeof (mountOptions.ProtectedHidVolPassword));
burn (&mountOptions.ProtectedHidVolPkcs5Prf, sizeof (mountOptions.ProtectedHidVolPkcs5Prf));
}
return result == IDOK;
}
// GUI actions
@@ -839,7 +839,7 @@ static BOOL SelectContainer (HWND hwndDlg)
static BOOL SelectPartition (HWND hwndDlg)
{
RawDevicesDlgParam param;
RawDevicesDlgParam param;
param.pszFileName = szFileName;
int nResult = DialogBoxParamW (hInst, MAKEINTRESOURCEW (IDD_RAWDEVICES_DLG), hwndDlg,
(DLGPROC) RawDevicesDlgProc, (LPARAM) & param);

View File

@@ -1,147 +1,147 @@
//{{NO_DEPENDENCIES}}
// Microsoft Visual C++ generated include file.
// Used by ExpandVolume.rc
//
#define IDD_MOUNT_DLG 101
#define IDD_PASSWORD_DLG 104
#define IDR_MENU 106
#define IDD_EXPAND_PROGRESS_DLG 106
#define IDR_MOUNT_RSRC_HEADER 109
#define IDS_UACSTRING 110
#define IDB_LOGO_288DPI 111
#define IDB_LOGO_96DPI 112
#define IDD_SIZE_DIALOG 117
#define IDC_BOX_HELP 1003
#define IDC_CACHE 1005
#define IDC_NO_HISTORY 1006
#define IDC_DRIVELIST 1007
#define IDC_SPACE_LEFT 1009
#define IDC_KB 1011
#define IDC_MB 1013
#define IDC_PROGRESS_BAR 1014
#define IDC_GB 1015
#define IDC_TB 1016
#define IDC_EXPAND_VOLUME_OLDSIZE 1017
#define IDC_EXPAND_VOLUME_NEWSIZE 1019
#define IDC_EXPAND_VOLUME_NAME 1020
#define IDC_EXPAND_VOLUME_INITSPACE 1021
#define IDC_EXPAND_FILE_SYSTEM 1022
#define IDC_RANDOM_BYTES 1023
#define IDC_BYTESWRITTEN 1024
#define IDC_WRITESPEED 1025
#define IDC_MOUNT_OPTIONS 1026
#define IDC_TIMEREMAIN 1027
#define IDC_KEY_FILES 1030
#define IDC_VOLUME 1033
#define IDC_PASSWORD 1034
#define IDC_SELECT_DEVICE 1036
#define IDC_CREATE_VOLUME 1037
#define IDC_VOLUME_TOOLS 1038
#define IDC_SIZEBOX 1038
#define IDC_WIPE_CACHE 1039
#define IDC_MOUNTALL 1040
#define IDC_SELECT_FILE 1042
#define IDC_VOLUME_PROPERTIES 1044
#define IDT_RANDOM_POOL 1047
#define IDT_VOL_NAME 1047
#define IDT_HEADER_KEY 1048
#define IDT_CURRENT_SIZE 1048
#define IDT_VOLUME 1049
#define IDT_MASTER_KEY 1049
#define IDT_NEW_SIZE 1049
#define IDT_PASSWORD 1050
#define IDT_DONE 1050
#define IDT_SPEED 1051
#define IDT_LEFT 1052
#define IDT_INIT_SPACE 1053
#define IDT_FILE_SYS 1054
#define IDT_INIT_SPACE2 1055
#define IDT_RANDOM_POOL2 1055
#define IDC_EXIT 1060
#define IDC_UNMOUNTALL 1063
#define IDC_SHOW_PASSWORD 1094
#define IDC_LOGO 1095
#define IDC_SIZEDLG_TITLE 1111
#define IDC_INIT_NEWSPACE 1112
#define IDC_INFOEXPAND 1113
#define IDC_BOX_STATUS 1114
#define IDC_TRUECRYPT_MODE 1140
#define IDC_PREF_TEMP_CACHE_ON_MULTIPLE_MOUNT 1141
#define IDT_OLD_PIM 1142
#define IDC_OLD_PIM 1143
#define IDC_OLD_PIM_HELP 1144
#define ID_HOMEPAGE 1145
#define IDM_HELP 40001
#define IDM_ABOUT 40002
#define IDM_UNMOUNT_VOLUME 40003
#define IDM_CLEAR_HISTORY 40004
#define IDM_FORUMS 40005
#define IDM_BENCHMARK 40006
#define IDM_TRAVELER 40007
#define IDM_MOUNT_VOLUME_OPTIONS 40008
#define IDM_FAQ 40009
#define IDM_REFRESH_DRIVE_LETTERS 40010
#define IDM_DEFAULT_KEYFILES 40011
#define IDM_WEBSITE 40012
#define IDM_MOUNTALL 40013
#define IDM_UNMOUNTALL 40014
#define IDM_MOUNT_VOLUME 40015
#define IDM_CHANGE_PASSWORD 40016
#define IDM_VOLUME_WIZARD 40017
#define IDM_CREATE_VOLUME 40018
#define IDM_WIPE_CACHE 40019
#define IDM_PREFERENCES 40020
#define IDM_LICENSE 40021
#define IDM_SELECT_FILE 40022
#define IDM_SELECT_DEVICE 40023
#define IDM_VOLUME_PROPERTIES 40024
#define IDM_LANGUAGE 40025
#define IDM_MOUNT_FAVORITE_VOLUMES 40026
#define IDM_SAVE_FAVORITE_VOLUMES 40027
#define IDM_BACKUP_VOL_HEADER 40028
#define IDM_RESTORE_VOL_HEADER 40029
#define IDM_HOTKEY_SETTINGS 40030
#define IDM_TC_DOWNLOADS 40031
#define IDM_NEWS 40032
#define IDM_BUGREPORT 40033
#define IDM_CONTACT 40034
#define IDM_VERSION_HISTORY 40035
#define IDM_HOMEPAGE 40036
#define IDM_TEST_VECTORS 40037
#define IDM_ADD_REMOVE_VOL_KEYFILES 40038
#define IDM_REMOVE_ALL_KEYFILES_FROM_VOL 40039
#define IDM_GENERATE_KEYFILE 40040
#define IDM_CHANGE_HEADER_KEY_DERIV_ALGO 40041
#define IDM_KEYFILE_GENERATOR 40042
#define IDM_SET_DEFAULT_KEYFILES 40043
#define IDM_ONLINE_TUTORIAL 40044
#define IDM_ONLINE_HELP 40045
#define IDM_DONATIONS 40046
#define IDM_CHANGE_SYS_HEADER_KEY_DERIV_ALGO 40047
#define IDM_CHANGE_SYS_PASSWORD 40048
#define IDM_CREATE_RESCUE_DISK 40049
#define IDM_PERMANENTLY_DECRYPT_SYS 40050
#define IDM_VERIFY_RESCUE_DISK 40051
#define IDM_SYSTEM_ENCRYPTION_STATUS 40052
#define IDM_ENCRYPT_SYSTEM_DEVICE 40053
#define IDM_SYSENC_RESUME 40054
#define IDM_MOUNT_SYSENC_PART_WITHOUT_PBA 40055
#define IDM_CREATE_HIDDEN_OS 40056
#define IDM_TOKEN_PREFERENCES 40057
#define IDM_CLOSE_ALL_TOKEN_SESSIONS 40058
#define IDM_SYS_ENC_SETTINGS 40059
#define IDM_SYSENC_SETTINGS 40060
#define IDM_RESUME_INTERRUPTED_PROC 40061
#define IDM_MANAGE_TOKEN_KEYFILES 40062
// Next default values for new objects
//
#ifdef APSTUDIO_INVOKED
#ifndef APSTUDIO_READONLY_SYMBOLS
#define _APS_NO_MFC 1
#define _APS_NEXT_RESOURCE_VALUE 120
#define _APS_NEXT_COMMAND_VALUE 40064
#define _APS_NEXT_CONTROL_VALUE 1146
#define _APS_NEXT_SYMED_VALUE 101
#endif
#endif
//{{NO_DEPENDENCIES}}
// Microsoft Visual C++ generated include file.
// Used by ExpandVolume.rc
//
#define IDD_MOUNT_DLG 101
#define IDD_PASSWORD_DLG 104
#define IDR_MENU 106
#define IDD_EXPAND_PROGRESS_DLG 106
#define IDR_MOUNT_RSRC_HEADER 109
#define IDS_UACSTRING 110
#define IDB_LOGO_288DPI 111
#define IDB_LOGO_96DPI 112
#define IDD_SIZE_DIALOG 117
#define IDC_BOX_HELP 1003
#define IDC_CACHE 1005
#define IDC_NO_HISTORY 1006
#define IDC_DRIVELIST 1007
#define IDC_SPACE_LEFT 1009
#define IDC_KB 1011
#define IDC_MB 1013
#define IDC_PROGRESS_BAR 1014
#define IDC_GB 1015
#define IDC_TB 1016
#define IDC_EXPAND_VOLUME_OLDSIZE 1017
#define IDC_EXPAND_VOLUME_NEWSIZE 1019
#define IDC_EXPAND_VOLUME_NAME 1020
#define IDC_EXPAND_VOLUME_INITSPACE 1021
#define IDC_EXPAND_FILE_SYSTEM 1022
#define IDC_RANDOM_BYTES 1023
#define IDC_BYTESWRITTEN 1024
#define IDC_WRITESPEED 1025
#define IDC_MOUNT_OPTIONS 1026
#define IDC_TIMEREMAIN 1027
#define IDC_KEY_FILES 1030
#define IDC_VOLUME 1033
#define IDC_PASSWORD 1034
#define IDC_SELECT_DEVICE 1036
#define IDC_CREATE_VOLUME 1037
#define IDC_VOLUME_TOOLS 1038
#define IDC_SIZEBOX 1038
#define IDC_WIPE_CACHE 1039
#define IDC_MOUNTALL 1040
#define IDC_SELECT_FILE 1042
#define IDC_VOLUME_PROPERTIES 1044
#define IDT_RANDOM_POOL 1047
#define IDT_VOL_NAME 1047
#define IDT_HEADER_KEY 1048
#define IDT_CURRENT_SIZE 1048
#define IDT_VOLUME 1049
#define IDT_MASTER_KEY 1049
#define IDT_NEW_SIZE 1049
#define IDT_PASSWORD 1050
#define IDT_DONE 1050
#define IDT_SPEED 1051
#define IDT_LEFT 1052
#define IDT_INIT_SPACE 1053
#define IDT_FILE_SYS 1054
#define IDT_INIT_SPACE2 1055
#define IDT_RANDOM_POOL2 1055
#define IDC_EXIT 1060
#define IDC_UNMOUNTALL 1063
#define IDC_SHOW_PASSWORD 1094
#define IDC_LOGO 1095
#define IDC_SIZEDLG_TITLE 1111
#define IDC_INIT_NEWSPACE 1112
#define IDC_INFOEXPAND 1113
#define IDC_BOX_STATUS 1114
#define IDC_TRUECRYPT_MODE 1140
#define IDC_PREF_TEMP_CACHE_ON_MULTIPLE_MOUNT 1141
#define IDT_OLD_PIM 1142
#define IDC_OLD_PIM 1143
#define IDC_OLD_PIM_HELP 1144
#define ID_HOMEPAGE 1145
#define IDM_HELP 40001
#define IDM_ABOUT 40002
#define IDM_UNMOUNT_VOLUME 40003
#define IDM_CLEAR_HISTORY 40004
#define IDM_FORUMS 40005
#define IDM_BENCHMARK 40006
#define IDM_TRAVELER 40007
#define IDM_MOUNT_VOLUME_OPTIONS 40008
#define IDM_FAQ 40009
#define IDM_REFRESH_DRIVE_LETTERS 40010
#define IDM_DEFAULT_KEYFILES 40011
#define IDM_WEBSITE 40012
#define IDM_MOUNTALL 40013
#define IDM_UNMOUNTALL 40014
#define IDM_MOUNT_VOLUME 40015
#define IDM_CHANGE_PASSWORD 40016
#define IDM_VOLUME_WIZARD 40017
#define IDM_CREATE_VOLUME 40018
#define IDM_WIPE_CACHE 40019
#define IDM_PREFERENCES 40020
#define IDM_LICENSE 40021
#define IDM_SELECT_FILE 40022
#define IDM_SELECT_DEVICE 40023
#define IDM_VOLUME_PROPERTIES 40024
#define IDM_LANGUAGE 40025
#define IDM_MOUNT_FAVORITE_VOLUMES 40026
#define IDM_SAVE_FAVORITE_VOLUMES 40027
#define IDM_BACKUP_VOL_HEADER 40028
#define IDM_RESTORE_VOL_HEADER 40029
#define IDM_HOTKEY_SETTINGS 40030
#define IDM_TC_DOWNLOADS 40031
#define IDM_NEWS 40032
#define IDM_BUGREPORT 40033
#define IDM_CONTACT 40034
#define IDM_VERSION_HISTORY 40035
#define IDM_HOMEPAGE 40036
#define IDM_TEST_VECTORS 40037
#define IDM_ADD_REMOVE_VOL_KEYFILES 40038
#define IDM_REMOVE_ALL_KEYFILES_FROM_VOL 40039
#define IDM_GENERATE_KEYFILE 40040
#define IDM_CHANGE_HEADER_KEY_DERIV_ALGO 40041
#define IDM_KEYFILE_GENERATOR 40042
#define IDM_SET_DEFAULT_KEYFILES 40043
#define IDM_ONLINE_TUTORIAL 40044
#define IDM_ONLINE_HELP 40045
#define IDM_DONATIONS 40046
#define IDM_CHANGE_SYS_HEADER_KEY_DERIV_ALGO 40047
#define IDM_CHANGE_SYS_PASSWORD 40048
#define IDM_CREATE_RESCUE_DISK 40049
#define IDM_PERMANENTLY_DECRYPT_SYS 40050
#define IDM_VERIFY_RESCUE_DISK 40051
#define IDM_SYSTEM_ENCRYPTION_STATUS 40052
#define IDM_ENCRYPT_SYSTEM_DEVICE 40053
#define IDM_SYSENC_RESUME 40054
#define IDM_MOUNT_SYSENC_PART_WITHOUT_PBA 40055
#define IDM_CREATE_HIDDEN_OS 40056
#define IDM_TOKEN_PREFERENCES 40057
#define IDM_CLOSE_ALL_TOKEN_SESSIONS 40058
#define IDM_SYS_ENC_SETTINGS 40059
#define IDM_SYSENC_SETTINGS 40060
#define IDM_RESUME_INTERRUPTED_PROC 40061
#define IDM_MANAGE_TOKEN_KEYFILES 40062
// Next default values for new objects
//
#ifdef APSTUDIO_INVOKED
#ifndef APSTUDIO_READONLY_SYMBOLS
#define _APS_NO_MFC 1
#define _APS_NEXT_RESOURCE_VALUE 120
#define _APS_NEXT_COMMAND_VALUE 40064
#define _APS_NEXT_CONTROL_VALUE 1146
#define _APS_NEXT_SYMED_VALUE 101
#endif
#endif