mirror of
https://github.com/veracrypt/VeraCrypt.git
synced 2025-11-11 02:58:02 -06:00
Windows: Full UNICODE rewrite and implement support for UNICODE passwords.
This commit is contained in:
@@ -311,11 +311,7 @@ typedef struct
|
||||
|
||||
#pragma pack (pop)
|
||||
|
||||
#ifdef TC_WINDOWS_DRIVER
|
||||
#define DRIVER_STR WIDE
|
||||
#else
|
||||
#define DRIVER_STR
|
||||
#endif
|
||||
|
||||
#define TC_UNIQUE_ID_PREFIX "VeraCryptVolume"
|
||||
#define TC_MOUNT_PREFIX L"\\Device\\VeraCryptVolume"
|
||||
|
||||
@@ -128,16 +128,9 @@ BOOL BaseCom::IsPagingFileActive (BOOL checkNonWindowsPartitionsOnly)
|
||||
|
||||
DWORD BaseCom::ReadWriteFile (BOOL write, BOOL device, BSTR filePath, BSTR *bufferBstr, unsigned __int64 offset, unsigned __int32 size, DWORD *sizeDone)
|
||||
{
|
||||
USES_CONVERSION;
|
||||
CW2A szFilePathA(filePath);
|
||||
if (!szFilePathA.m_psz)
|
||||
{
|
||||
return ERROR_NOT_ENOUGH_MEMORY;
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
auto_ptr <File> file (device ? new Device (string (szFilePathA.m_psz), !write) : new File (string (szFilePathA.m_psz), !write));
|
||||
auto_ptr <File> file (device ? new Device (filePath, !write) : new File (filePath, !write));
|
||||
file->CheckOpened (SRC_POS);
|
||||
file->SeekAt (offset);
|
||||
|
||||
@@ -246,7 +239,7 @@ DWORD BaseCom::SetDriverServiceStartType (DWORD startType)
|
||||
|
||||
DWORD BaseCom::WriteLocalMachineRegistryDwordValue (BSTR keyPath, BSTR valueName, DWORD value)
|
||||
{
|
||||
if (!::WriteLocalMachineRegistryDwordW (keyPath, valueName, value))
|
||||
if (!::WriteLocalMachineRegistryDword (keyPath, valueName, value))
|
||||
return GetLastError();
|
||||
|
||||
return ERROR_SUCCESS;
|
||||
|
||||
@@ -76,17 +76,17 @@ namespace VeraCrypt
|
||||
}
|
||||
}
|
||||
|
||||
static void CopyFile (const string &sourceFile, const string &destinationFile)
|
||||
static void CopyFile (const wstring &sourceFile, const wstring &destinationFile)
|
||||
{
|
||||
Elevate();
|
||||
DWORD result;
|
||||
CComBSTR sourceFileBstr, destinationFileBstr;
|
||||
BSTR bstr = A2WBSTR(sourceFile.c_str());
|
||||
BSTR bstr = W2BSTR(sourceFile.c_str());
|
||||
if (bstr)
|
||||
{
|
||||
sourceFileBstr.Attach (bstr);
|
||||
|
||||
bstr = A2WBSTR(destinationFile.c_str());
|
||||
bstr = W2BSTR(destinationFile.c_str());
|
||||
if (bstr)
|
||||
{
|
||||
destinationFileBstr.Attach (bstr);
|
||||
@@ -109,12 +109,12 @@ namespace VeraCrypt
|
||||
}
|
||||
}
|
||||
|
||||
static void DeleteFile (const string &file)
|
||||
static void DeleteFile (const wstring &file)
|
||||
{
|
||||
Elevate();
|
||||
CComBSTR fileBstr;
|
||||
DWORD result;
|
||||
BSTR bstr = A2WBSTR(file.c_str());
|
||||
BSTR bstr = W2BSTR(file.c_str());
|
||||
if (bstr)
|
||||
{
|
||||
fileBstr.Attach (bstr);
|
||||
@@ -132,7 +132,7 @@ namespace VeraCrypt
|
||||
}
|
||||
}
|
||||
|
||||
static void ReadWriteFile (BOOL write, BOOL device, const string &filePath, byte *buffer, uint64 offset, uint32 size, DWORD *sizeDone)
|
||||
static void ReadWriteFile (BOOL write, BOOL device, const wstring &filePath, byte *buffer, uint64 offset, uint32 size, DWORD *sizeDone)
|
||||
{
|
||||
Elevate();
|
||||
|
||||
@@ -140,7 +140,7 @@ namespace VeraCrypt
|
||||
CComBSTR bufferBstr, fileBstr;
|
||||
if (bufferBstr.AppendBytes ((const char *) buffer, size) != S_OK)
|
||||
throw ParameterIncorrect (SRC_POS);
|
||||
BSTR bstr = A2WBSTR(filePath.c_str());
|
||||
BSTR bstr = W2BSTR(filePath.c_str());
|
||||
if (bstr)
|
||||
{
|
||||
fileBstr.Attach (bstr);
|
||||
@@ -168,17 +168,17 @@ namespace VeraCrypt
|
||||
return ElevatedComInstance->IsPagingFileActive (checkNonWindowsPartitionsOnly);
|
||||
}
|
||||
|
||||
static void WriteLocalMachineRegistryDwordValue (char *keyPath, char *valueName, DWORD value)
|
||||
static void WriteLocalMachineRegistryDwordValue (wchar_t *keyPath, wchar_t *valueName, DWORD value)
|
||||
{
|
||||
Elevate();
|
||||
DWORD result;
|
||||
CComBSTR keyPathBstr, valueNameBstr;
|
||||
BSTR bstr = A2WBSTR(keyPath);
|
||||
BSTR bstr = W2BSTR(keyPath);
|
||||
if (bstr)
|
||||
{
|
||||
keyPathBstr.Attach (bstr);
|
||||
|
||||
bstr = A2WBSTR(valueName);
|
||||
bstr = W2BSTR(valueName);
|
||||
if (bstr)
|
||||
{
|
||||
valueNameBstr.Attach (bstr);
|
||||
@@ -289,7 +289,7 @@ namespace VeraCrypt
|
||||
public:
|
||||
static void AddReference () { }
|
||||
static void CallDriver (DWORD ioctl, void *input, DWORD inputSize, void *output, DWORD outputSize) { throw ParameterIncorrect (SRC_POS); }
|
||||
static void ReadWriteFile (BOOL write, BOOL device, const string &filePath, byte *buffer, uint64 offset, uint32 size, DWORD *sizeDone) { throw ParameterIncorrect (SRC_POS); }
|
||||
static void ReadWriteFile (BOOL write, BOOL device, const wstring &filePath, byte *buffer, uint64 offset, uint32 size, DWORD *sizeDone) { throw ParameterIncorrect (SRC_POS); }
|
||||
static void RegisterFilterDriver (bool registerDriver, BootEncryption::FilterType filterType) { throw ParameterIncorrect (SRC_POS); }
|
||||
static void Release () { }
|
||||
static void SetDriverServiceStartType (DWORD startType) { throw ParameterIncorrect (SRC_POS); }
|
||||
@@ -298,7 +298,7 @@ namespace VeraCrypt
|
||||
#endif // SETUP
|
||||
|
||||
|
||||
File::File (string path, bool readOnly, bool create) : Elevated (false), FileOpen (false), LastError(0)
|
||||
File::File (wstring path, bool readOnly, bool create) : Elevated (false), FileOpen (false), LastError(0)
|
||||
{
|
||||
Handle = CreateFile (path.c_str(),
|
||||
readOnly ? GENERIC_READ : GENERIC_READ | GENERIC_WRITE,
|
||||
@@ -417,18 +417,18 @@ namespace VeraCrypt
|
||||
}
|
||||
}
|
||||
|
||||
void Show (HWND parent, const string &str)
|
||||
void Show (HWND parent, const wstring &str)
|
||||
{
|
||||
MessageBox (parent, str.c_str(), NULL, 0);
|
||||
}
|
||||
|
||||
|
||||
Device::Device (string path, bool readOnly)
|
||||
Device::Device (wstring path, bool readOnly)
|
||||
{
|
||||
FileOpen = false;
|
||||
Elevated = false;
|
||||
|
||||
Handle = CreateFile ((string ("\\\\.\\") + path).c_str(),
|
||||
Handle = CreateFile ((wstring (L"\\\\.\\") + path).c_str(),
|
||||
readOnly ? GENERIC_READ : GENERIC_READ | GENERIC_WRITE,
|
||||
FILE_SHARE_READ | FILE_SHARE_WRITE, NULL, OPEN_EXISTING,
|
||||
FILE_FLAG_RANDOM_ACCESS | FILE_FLAG_WRITE_THROUGH, NULL);
|
||||
@@ -616,7 +616,7 @@ namespace VeraCrypt
|
||||
DWORD BootEncryption::GetDriverServiceStartType ()
|
||||
{
|
||||
DWORD startType;
|
||||
throw_sys_if (!ReadLocalMachineRegistryDword ("SYSTEM\\CurrentControlSet\\Services\\veracrypt", "Start", &startType));
|
||||
throw_sys_if (!ReadLocalMachineRegistryDword (L"SYSTEM\\CurrentControlSet\\Services\\veracrypt", L"Start", &startType));
|
||||
return startType;
|
||||
}
|
||||
|
||||
@@ -645,42 +645,42 @@ namespace VeraCrypt
|
||||
|
||||
finally_do_arg (SC_HANDLE, serviceManager, { CloseServiceHandle (finally_arg); });
|
||||
|
||||
SC_HANDLE service = OpenService (serviceManager, "veracrypt", SERVICE_CHANGE_CONFIG);
|
||||
SC_HANDLE service = OpenService (serviceManager, L"veracrypt", SERVICE_CHANGE_CONFIG);
|
||||
throw_sys_if (!service);
|
||||
|
||||
finally_do_arg (SC_HANDLE, service, { CloseServiceHandle (finally_arg); });
|
||||
|
||||
// Windows versions preceding Vista can be installed on FAT filesystem which does not
|
||||
// support long filenames during boot. Convert the driver path to short form if required.
|
||||
string driverPath;
|
||||
wstring driverPath;
|
||||
if (startOnBoot && !IsOSAtLeast (WIN_VISTA))
|
||||
{
|
||||
char pathBuf[MAX_PATH];
|
||||
char filesystem[128];
|
||||
wchar_t pathBuf[MAX_PATH];
|
||||
wchar_t filesystem[128];
|
||||
|
||||
string path (GetWindowsDirectory());
|
||||
path += "\\drivers\\veracrypt.sys";
|
||||
wstring path (GetWindowsDirectory());
|
||||
path += L"\\drivers\\veracrypt.sys";
|
||||
|
||||
if (GetVolumePathName (path.c_str(), pathBuf, sizeof (pathBuf))
|
||||
&& GetVolumeInformation (pathBuf, NULL, 0, NULL, NULL, NULL, filesystem, sizeof(filesystem))
|
||||
&& memcmp (filesystem, "FAT", 3) == 0)
|
||||
if (GetVolumePathName (path.c_str(), pathBuf, ARRAYSIZE (pathBuf))
|
||||
&& GetVolumeInformation (pathBuf, NULL, 0, NULL, NULL, NULL, filesystem, ARRAYSIZE(filesystem))
|
||||
&& wmemcmp (filesystem, L"FAT", 3) == 0)
|
||||
{
|
||||
throw_sys_if (GetShortPathName (path.c_str(), pathBuf, sizeof (pathBuf)) == 0);
|
||||
throw_sys_if (GetShortPathName (path.c_str(), pathBuf, ARRAYSIZE (pathBuf)) == 0);
|
||||
|
||||
// Convert absolute path to relative to the Windows directory
|
||||
driverPath = pathBuf;
|
||||
driverPath = driverPath.substr (driverPath.rfind ("\\", driverPath.rfind ("\\", driverPath.rfind ("\\") - 1) - 1) + 1);
|
||||
driverPath = driverPath.substr (driverPath.rfind (L"\\", driverPath.rfind (L"\\", driverPath.rfind (L"\\") - 1) - 1) + 1);
|
||||
}
|
||||
}
|
||||
|
||||
throw_sys_if (!ChangeServiceConfig (service, SERVICE_NO_CHANGE, SERVICE_NO_CHANGE,
|
||||
startOnBoot ? SERVICE_ERROR_SEVERE : SERVICE_ERROR_NORMAL,
|
||||
driverPath.empty() ? NULL : driverPath.c_str(),
|
||||
startOnBoot ? "Filter" : NULL,
|
||||
startOnBoot ? L"Filter" : NULL,
|
||||
NULL, NULL, NULL, NULL, NULL));
|
||||
|
||||
// ChangeServiceConfig() rejects SERVICE_BOOT_START with ERROR_INVALID_PARAMETER
|
||||
throw_sys_if (!WriteLocalMachineRegistryDword ("SYSTEM\\CurrentControlSet\\Services\\veracrypt", "Start", startType));
|
||||
throw_sys_if (!WriteLocalMachineRegistryDword (L"SYSTEM\\CurrentControlSet\\Services\\veracrypt", L"Start", startType));
|
||||
}
|
||||
|
||||
|
||||
@@ -692,7 +692,7 @@ namespace VeraCrypt
|
||||
GetSystemDriveConfiguration();
|
||||
|
||||
ProbeRealDriveSizeRequest request;
|
||||
StringCbPrintfW (request.DeviceName, sizeof (request.DeviceName), L"%hs", DriveConfig.DrivePartition.DevicePath.c_str());
|
||||
StringCbCopyW (request.DeviceName, sizeof (request.DeviceName), DriveConfig.DrivePartition.DevicePath.c_str());
|
||||
|
||||
CallDriver (TC_IOCTL_PROBE_REAL_DRIVE_SIZE, &request, sizeof (request), &request, sizeof (request));
|
||||
DriveConfig.DrivePartition.Info.PartitionLength = request.RealDriveSize;
|
||||
@@ -717,11 +717,11 @@ namespace VeraCrypt
|
||||
|
||||
for (int partNumber = 0; partNumber < 64; ++partNumber)
|
||||
{
|
||||
stringstream partPath;
|
||||
partPath << "\\Device\\Harddisk" << driveNumber << "\\Partition" << partNumber;
|
||||
wstringstream partPath;
|
||||
partPath << L"\\Device\\Harddisk" << driveNumber << L"\\Partition" << partNumber;
|
||||
|
||||
DISK_PARTITION_INFO_STRUCT diskPartInfo = {0};
|
||||
StringCbPrintfW (diskPartInfo.deviceName, sizeof (diskPartInfo.deviceName), L"%hs", partPath.str().c_str());
|
||||
StringCbCopyW (diskPartInfo.deviceName, sizeof (diskPartInfo.deviceName), partPath.str().c_str());
|
||||
|
||||
try
|
||||
{
|
||||
@@ -748,19 +748,17 @@ namespace VeraCrypt
|
||||
part.IsGPT = diskPartInfo.IsGPT;
|
||||
|
||||
// Mount point
|
||||
wstringstream ws;
|
||||
ws << partPath.str().c_str();
|
||||
int driveNumber = GetDiskDeviceDriveLetter ((wchar_t *) ws.str().c_str());
|
||||
int driveNumber = GetDiskDeviceDriveLetter ((wchar_t *) partPath.str().c_str());
|
||||
|
||||
if (driveNumber >= 0)
|
||||
{
|
||||
part.MountPoint += (char) (driveNumber + 'A');
|
||||
part.MountPoint += ":";
|
||||
part.MountPoint += (wchar_t) (driveNumber + L'A');
|
||||
part.MountPoint += L":";
|
||||
}
|
||||
|
||||
// Volume ID
|
||||
wchar_t volumePath[TC_MAX_PATH];
|
||||
if (ResolveSymbolicLink ((wchar_t *) ws.str().c_str(), volumePath, sizeof(volumePath)))
|
||||
if (ResolveSymbolicLink ((wchar_t *) partPath.str().c_str(), volumePath, sizeof(volumePath)))
|
||||
{
|
||||
wchar_t volumeName[TC_MAX_PATH];
|
||||
HANDLE fh = FindFirstVolumeW (volumeName, array_capacity (volumeName));
|
||||
@@ -794,32 +792,32 @@ namespace VeraCrypt
|
||||
|
||||
DISK_GEOMETRY BootEncryption::GetDriveGeometry (int driveNumber)
|
||||
{
|
||||
stringstream devName;
|
||||
devName << "\\Device\\Harddisk" << driveNumber << "\\Partition0";
|
||||
wstringstream devName;
|
||||
devName << L"\\Device\\Harddisk" << driveNumber << L"\\Partition0";
|
||||
|
||||
DISK_GEOMETRY geometry;
|
||||
throw_sys_if (!::GetDriveGeometry ((char *) devName.str().c_str(), &geometry));
|
||||
throw_sys_if (!::GetDriveGeometry (devName.str().c_str(), &geometry));
|
||||
return geometry;
|
||||
}
|
||||
|
||||
|
||||
string BootEncryption::GetWindowsDirectory ()
|
||||
wstring BootEncryption::GetWindowsDirectory ()
|
||||
{
|
||||
char buf[MAX_PATH];
|
||||
throw_sys_if (GetSystemDirectory (buf, sizeof (buf)) == 0);
|
||||
wchar_t buf[MAX_PATH];
|
||||
throw_sys_if (GetSystemDirectory (buf, ARRAYSIZE (buf)) == 0);
|
||||
|
||||
return string (buf);
|
||||
return wstring (buf);
|
||||
}
|
||||
|
||||
|
||||
string BootEncryption::GetTempPath ()
|
||||
wstring BootEncryption::GetTempPath ()
|
||||
{
|
||||
char tempPath[MAX_PATH];
|
||||
DWORD tempLen = ::GetTempPath (sizeof (tempPath), tempPath);
|
||||
if (tempLen == 0 || tempLen > sizeof (tempPath))
|
||||
wchar_t tempPath[MAX_PATH];
|
||||
DWORD tempLen = ::GetTempPath (ARRAYSIZE (tempPath), tempPath);
|
||||
if (tempLen == 0 || tempLen > ARRAYSIZE (tempPath))
|
||||
throw ParameterIncorrect (SRC_POS);
|
||||
|
||||
return string (tempPath);
|
||||
return wstring (tempPath);
|
||||
}
|
||||
|
||||
|
||||
@@ -838,7 +836,7 @@ namespace VeraCrypt
|
||||
}
|
||||
|
||||
// Note that this does not require admin rights (it just requires the driver to be running)
|
||||
bool BootEncryption::IsBootLoaderOnDrive (char *devicePath)
|
||||
bool BootEncryption::IsBootLoaderOnDrive (wchar_t *devicePath)
|
||||
{
|
||||
try
|
||||
{
|
||||
@@ -846,8 +844,7 @@ namespace VeraCrypt
|
||||
memset (&openTestStruct, 0, sizeof (openTestStruct));
|
||||
DWORD dwResult;
|
||||
|
||||
StringCbCopyA ((char *) &openTestStruct.wszFileName[0], sizeof(openTestStruct.wszFileName),devicePath);
|
||||
ToUNICODE ((char *) &openTestStruct.wszFileName[0], sizeof(openTestStruct.wszFileName));
|
||||
StringCbCopyW (&openTestStruct.wszFileName[0], sizeof(openTestStruct.wszFileName),devicePath);
|
||||
|
||||
openTestStruct.bDetectTCBootLoader = TRUE;
|
||||
|
||||
@@ -949,7 +946,7 @@ namespace VeraCrypt
|
||||
bool BootEncryption::SystemDriveIsDynamic ()
|
||||
{
|
||||
GetSystemDriveConfigurationRequest request;
|
||||
StringCbPrintfW (request.DevicePath, sizeof (request.DevicePath), L"%hs", GetSystemDriveConfiguration().DeviceKernelPath.c_str());
|
||||
StringCbCopyW (request.DevicePath, sizeof (request.DevicePath), GetSystemDriveConfiguration().DeviceKernelPath.c_str());
|
||||
|
||||
CallDriver (TC_IOCTL_GET_SYSTEM_DRIVE_CONFIG, &request, sizeof (request), &request, sizeof (request));
|
||||
return request.DriveIsDynamic ? true : false;
|
||||
@@ -963,7 +960,7 @@ namespace VeraCrypt
|
||||
|
||||
SystemDriveConfiguration config;
|
||||
|
||||
string winDir = GetWindowsDirectory();
|
||||
wstring winDir = GetWindowsDirectory();
|
||||
|
||||
// Scan all drives
|
||||
for (int driveNumber = 0; driveNumber < 32; ++driveNumber)
|
||||
@@ -977,7 +974,7 @@ namespace VeraCrypt
|
||||
foreach (const Partition &part, partitions)
|
||||
{
|
||||
if (!part.MountPoint.empty()
|
||||
&& (_access ((part.MountPoint + "\\bootmgr").c_str(), 0) == 0 || _access ((part.MountPoint + "\\ntldr").c_str(), 0) == 0))
|
||||
&& (_waccess ((part.MountPoint + L"\\bootmgr").c_str(), 0) == 0 || _waccess ((part.MountPoint + L"\\ntldr").c_str(), 0) == 0))
|
||||
{
|
||||
config.SystemLoaderPresent = true;
|
||||
}
|
||||
@@ -1006,12 +1003,12 @@ namespace VeraCrypt
|
||||
{
|
||||
config.DriveNumber = driveNumber;
|
||||
|
||||
stringstream ss;
|
||||
ss << "PhysicalDrive" << driveNumber;
|
||||
wstringstream ss;
|
||||
ss << L"PhysicalDrive" << driveNumber;
|
||||
config.DevicePath = ss.str();
|
||||
|
||||
stringstream kernelPath;
|
||||
kernelPath << "\\Device\\Harddisk" << driveNumber << "\\Partition0";
|
||||
wstringstream kernelPath;
|
||||
kernelPath << L"\\Device\\Harddisk" << driveNumber << L"\\Partition0";
|
||||
config.DeviceKernelPath = kernelPath.str();
|
||||
|
||||
config.DrivePartition = partitions.front();
|
||||
@@ -1187,7 +1184,7 @@ namespace VeraCrypt
|
||||
|
||||
// Boot sector
|
||||
DWORD size;
|
||||
byte *bootSecResourceImg = MapResource ("BIN", bootSectorId, &size);
|
||||
byte *bootSecResourceImg = MapResource (L"BIN", bootSectorId, &size);
|
||||
if (!bootSecResourceImg || size != TC_SECTOR_SIZE_BIOS)
|
||||
throw ParameterIncorrect (SRC_POS);
|
||||
|
||||
@@ -1215,14 +1212,14 @@ namespace VeraCrypt
|
||||
}
|
||||
|
||||
// Decompressor
|
||||
byte *decompressor = MapResource ("BIN", IDR_BOOT_LOADER_DECOMPRESSOR, &size);
|
||||
byte *decompressor = MapResource (L"BIN", IDR_BOOT_LOADER_DECOMPRESSOR, &size);
|
||||
if (!decompressor || size > TC_BOOT_LOADER_DECOMPRESSOR_SECTOR_COUNT * TC_SECTOR_SIZE_BIOS)
|
||||
throw ParameterIncorrect (SRC_POS);
|
||||
|
||||
memcpy (buffer + TC_SECTOR_SIZE_BIOS, decompressor, size);
|
||||
|
||||
// Compressed boot loader
|
||||
byte *bootLoader = MapResource ("BIN", bootLoaderId, &size);
|
||||
byte *bootLoader = MapResource (L"BIN", bootLoaderId, &size);
|
||||
if (!bootLoader || size > TC_MAX_BOOT_LOADER_SECTOR_COUNT * TC_SECTOR_SIZE_BIOS)
|
||||
throw ParameterIncorrect (SRC_POS);
|
||||
|
||||
@@ -1254,7 +1251,7 @@ namespace VeraCrypt
|
||||
throw ParameterIncorrect (SRC_POS);
|
||||
|
||||
GetSystemDriveConfigurationRequest request;
|
||||
StringCbPrintfW (request.DevicePath, sizeof (request.DevicePath), L"%hs", GetSystemDriveConfiguration().DeviceKernelPath.c_str());
|
||||
StringCbCopyW (request.DevicePath, sizeof (request.DevicePath), GetSystemDriveConfiguration().DeviceKernelPath.c_str());
|
||||
|
||||
try
|
||||
{
|
||||
@@ -1584,35 +1581,35 @@ namespace VeraCrypt
|
||||
}
|
||||
#endif
|
||||
|
||||
string BootEncryption::GetSystemLoaderBackupPath ()
|
||||
wstring BootEncryption::GetSystemLoaderBackupPath ()
|
||||
{
|
||||
char pathBuf[MAX_PATH];
|
||||
WCHAR pathBuf[MAX_PATH];
|
||||
|
||||
throw_sys_if (!SUCCEEDED (SHGetFolderPath (NULL, CSIDL_COMMON_APPDATA | CSIDL_FLAG_CREATE, NULL, 0, pathBuf)));
|
||||
|
||||
string path = string (pathBuf) + "\\" TC_APP_NAME;
|
||||
wstring path = wstring (pathBuf) + L"\\" _T(TC_APP_NAME);
|
||||
CreateDirectory (path.c_str(), NULL);
|
||||
|
||||
return path + '\\' + TC_SYS_BOOT_LOADER_BACKUP_NAME;
|
||||
return path + L'\\' + TC_SYS_BOOT_LOADER_BACKUP_NAME;
|
||||
}
|
||||
|
||||
|
||||
void BootEncryption::RenameDeprecatedSystemLoaderBackup ()
|
||||
{
|
||||
char pathBuf[MAX_PATH];
|
||||
WCHAR pathBuf[MAX_PATH];
|
||||
|
||||
if (SUCCEEDED (SHGetFolderPath (NULL, CSIDL_COMMON_APPDATA, NULL, 0, pathBuf)))
|
||||
{
|
||||
string path = string (pathBuf) + "\\" TC_APP_NAME + '\\' + TC_SYS_BOOT_LOADER_BACKUP_NAME_LEGACY;
|
||||
wstring path = wstring (pathBuf) + L"\\" _T(TC_APP_NAME) + L'\\' + TC_SYS_BOOT_LOADER_BACKUP_NAME_LEGACY;
|
||||
|
||||
if (FileExists (path.c_str()) && !FileExists (GetSystemLoaderBackupPath().c_str()))
|
||||
throw_sys_if (rename (path.c_str(), GetSystemLoaderBackupPath().c_str()) != 0);
|
||||
throw_sys_if (_wrename (path.c_str(), GetSystemLoaderBackupPath().c_str()) != 0);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
#ifndef SETUP
|
||||
void BootEncryption::CreateRescueIsoImage (bool initialSetup, const string &isoImagePath)
|
||||
void BootEncryption::CreateRescueIsoImage (bool initialSetup, const wstring &isoImagePath)
|
||||
{
|
||||
BootEncryptionStatus encStatus = GetStatus();
|
||||
if (encStatus.SetupInProgress)
|
||||
@@ -1764,12 +1761,12 @@ namespace VeraCrypt
|
||||
if (!RescueIsoImage)
|
||||
throw ParameterIncorrect (SRC_POS);
|
||||
|
||||
for (char drive = 'Z'; drive >= 'C'; --drive)
|
||||
for (WCHAR drive = L'Z'; drive >= L'C'; --drive)
|
||||
{
|
||||
try
|
||||
{
|
||||
char rootPath[4] = { drive, ':', '\\', 0};
|
||||
UINT driveType = GetDriveTypeA (rootPath);
|
||||
WCHAR rootPath[4] = { drive, L':', L'\\', 0};
|
||||
UINT driveType = GetDriveType (rootPath);
|
||||
// check that it is a CD/DVD drive or a removable media in case a bootable
|
||||
// USB key was created from the rescue disk ISO file
|
||||
if ((DRIVE_CDROM == driveType) || (DRIVE_REMOVABLE == driveType))
|
||||
@@ -1795,7 +1792,7 @@ namespace VeraCrypt
|
||||
return false;
|
||||
}
|
||||
|
||||
bool BootEncryption::VerifyRescueDiskIsoImage (const char* imageFile)
|
||||
bool BootEncryption::VerifyRescueDiskIsoImage (const wchar_t* imageFile)
|
||||
{
|
||||
if (!RescueIsoImage)
|
||||
throw ParameterIncorrect (SRC_POS);
|
||||
@@ -1967,7 +1964,7 @@ namespace VeraCrypt
|
||||
|
||||
filter = "veracrypt.sys";
|
||||
filterReg = "DumpFilters";
|
||||
SetLastError (RegOpenKeyEx (HKEY_LOCAL_MACHINE, "SYSTEM\\CurrentControlSet\\Control\\CrashControl", 0, KEY_READ | KEY_WRITE, ®Key));
|
||||
SetLastError (RegOpenKeyEx (HKEY_LOCAL_MACHINE, L"SYSTEM\\CurrentControlSet\\Control\\CrashControl", 0, KEY_READ | KEY_WRITE, ®Key));
|
||||
throw_sys_if (GetLastError() != ERROR_SUCCESS);
|
||||
|
||||
break;
|
||||
@@ -1989,18 +1986,18 @@ namespace VeraCrypt
|
||||
// SetupInstallFromInfSection() does not support prepending of values so we have to modify the registry directly
|
||||
StringCbCopyA ((char *) regKeyBuf, sizeof(regKeyBuf), filter.c_str());
|
||||
|
||||
if (RegQueryValueEx (regKey, filterReg.c_str(), NULL, NULL, regKeyBuf + strSize, &size) != ERROR_SUCCESS)
|
||||
if (RegQueryValueExA (regKey, filterReg.c_str(), NULL, NULL, regKeyBuf + strSize, &size) != ERROR_SUCCESS)
|
||||
size = 1;
|
||||
|
||||
SetLastError (RegSetValueEx (regKey, filterReg.c_str(), 0, REG_MULTI_SZ, regKeyBuf, (DWORD) strSize + size));
|
||||
SetLastError (RegSetValueExA (regKey, filterReg.c_str(), 0, REG_MULTI_SZ, regKeyBuf, (DWORD) strSize + size));
|
||||
throw_sys_if (GetLastError() != ERROR_SUCCESS);
|
||||
}
|
||||
else
|
||||
{
|
||||
string infFileName = GetTempPath() + "\\veracrypt_driver_setup.inf";
|
||||
wstring infFileName = GetTempPath() + L"\\veracrypt_driver_setup.inf";
|
||||
|
||||
File infFile (infFileName, false, true);
|
||||
finally_do_arg (string, infFileName, { DeleteFile (finally_arg.c_str()); });
|
||||
finally_do_arg (wstring, infFileName, { DeleteFile (finally_arg.c_str()); });
|
||||
|
||||
string infTxt = "[veracrypt]\r\n"
|
||||
+ string (registerFilter ? "Add" : "Del") + "Reg=veracrypt_reg\r\n\r\n"
|
||||
@@ -2014,7 +2011,7 @@ namespace VeraCrypt
|
||||
throw_sys_if (hInf == INVALID_HANDLE_VALUE);
|
||||
finally_do_arg (HINF, hInf, { SetupCloseInfFile (finally_arg); });
|
||||
|
||||
throw_sys_if (!SetupInstallFromInfSection (ParentWindow, hInf, "veracrypt", SPINST_REGISTRY, regKey, NULL, 0, NULL, NULL, NULL, NULL));
|
||||
throw_sys_if (!SetupInstallFromInfSection (ParentWindow, hInf, L"veracrypt", SPINST_REGISTRY, regKey, NULL, 0, NULL, NULL, NULL, NULL));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2052,8 +2049,8 @@ namespace VeraCrypt
|
||||
throw_sys_if (!scm);
|
||||
finally_do_arg (SC_HANDLE, scm, { CloseServiceHandle (finally_arg); });
|
||||
|
||||
string servicePath = GetServiceConfigPath (TC_APP_NAME ".exe", false);
|
||||
string serviceLegacyPath = GetServiceConfigPath (TC_APP_NAME ".exe", true);
|
||||
wstring servicePath = GetServiceConfigPath (_T(TC_APP_NAME) L".exe", false);
|
||||
wstring serviceLegacyPath = GetServiceConfigPath (_T(TC_APP_NAME) L".exe", true);
|
||||
|
||||
if (registerService)
|
||||
{
|
||||
@@ -2065,20 +2062,20 @@ namespace VeraCrypt
|
||||
|
||||
if (!noFileHandling)
|
||||
{
|
||||
char appPath[TC_MAX_PATH];
|
||||
throw_sys_if (!GetModuleFileName (NULL, appPath, sizeof (appPath)));
|
||||
wchar_t appPath[TC_MAX_PATH];
|
||||
throw_sys_if (!GetModuleFileName (NULL, appPath, ARRAYSIZE (appPath)));
|
||||
|
||||
throw_sys_if (!CopyFile (appPath, servicePath.c_str(), FALSE));
|
||||
}
|
||||
|
||||
SC_HANDLE service = CreateService (scm,
|
||||
TC_SYSTEM_FAVORITES_SERVICE_NAME,
|
||||
TC_APP_NAME " System Favorites",
|
||||
_T(TC_APP_NAME) L" System Favorites",
|
||||
SERVICE_ALL_ACCESS,
|
||||
SERVICE_WIN32_OWN_PROCESS,
|
||||
SERVICE_AUTO_START,
|
||||
SERVICE_ERROR_NORMAL,
|
||||
(string ("\"") + servicePath + "\" " TC_SYSTEM_FAVORITES_SERVICE_CMDLINE_OPTION).c_str(),
|
||||
(wstring (L"\"") + servicePath + L"\" " TC_SYSTEM_FAVORITES_SERVICE_CMDLINE_OPTION).c_str(),
|
||||
TC_SYSTEM_FAVORITES_SERVICE_LOAD_ORDER_GROUP,
|
||||
NULL,
|
||||
NULL,
|
||||
@@ -2088,15 +2085,15 @@ namespace VeraCrypt
|
||||
throw_sys_if (!service);
|
||||
|
||||
SERVICE_DESCRIPTION description;
|
||||
description.lpDescription = "Mounts VeraCrypt system favorite volumes.";
|
||||
description.lpDescription = L"Mounts VeraCrypt system favorite volumes.";
|
||||
ChangeServiceConfig2 (service, SERVICE_CONFIG_DESCRIPTION, &description);
|
||||
|
||||
CloseServiceHandle (service);
|
||||
|
||||
try
|
||||
{
|
||||
WriteLocalMachineRegistryString ("SYSTEM\\CurrentControlSet\\Control\\SafeBoot\\Minimal\\" TC_SYSTEM_FAVORITES_SERVICE_NAME, NULL, "Service", FALSE);
|
||||
WriteLocalMachineRegistryString ("SYSTEM\\CurrentControlSet\\Control\\SafeBoot\\Network\\" TC_SYSTEM_FAVORITES_SERVICE_NAME, NULL, "Service", FALSE);
|
||||
WriteLocalMachineRegistryString (L"SYSTEM\\CurrentControlSet\\Control\\SafeBoot\\Minimal\\" TC_SYSTEM_FAVORITES_SERVICE_NAME, NULL, L"Service", FALSE);
|
||||
WriteLocalMachineRegistryString (L"SYSTEM\\CurrentControlSet\\Control\\SafeBoot\\Network\\" TC_SYSTEM_FAVORITES_SERVICE_NAME, NULL, L"Service", FALSE);
|
||||
|
||||
SetDriverConfigurationFlag (TC_DRIVER_CONFIG_CACHE_BOOT_PASSWORD_FOR_SYS_FAVORITES, true);
|
||||
}
|
||||
@@ -2115,8 +2112,8 @@ namespace VeraCrypt
|
||||
{
|
||||
SetDriverConfigurationFlag (TC_DRIVER_CONFIG_CACHE_BOOT_PASSWORD_FOR_SYS_FAVORITES, false);
|
||||
|
||||
DeleteLocalMachineRegistryKey ("SYSTEM\\CurrentControlSet\\Control\\SafeBoot\\Minimal", TC_SYSTEM_FAVORITES_SERVICE_NAME);
|
||||
DeleteLocalMachineRegistryKey ("SYSTEM\\CurrentControlSet\\Control\\SafeBoot\\Network", TC_SYSTEM_FAVORITES_SERVICE_NAME);
|
||||
DeleteLocalMachineRegistryKey (L"SYSTEM\\CurrentControlSet\\Control\\SafeBoot\\Minimal", TC_SYSTEM_FAVORITES_SERVICE_NAME);
|
||||
DeleteLocalMachineRegistryKey (L"SYSTEM\\CurrentControlSet\\Control\\SafeBoot\\Network", TC_SYSTEM_FAVORITES_SERVICE_NAME);
|
||||
|
||||
SC_HANDLE service = OpenService (scm, TC_SYSTEM_FAVORITES_SERVICE_NAME, SERVICE_ALL_ACCESS);
|
||||
throw_sys_if (!service);
|
||||
@@ -2140,7 +2137,7 @@ namespace VeraCrypt
|
||||
|
||||
finally_do_arg (SC_HANDLE, scm, { CloseServiceHandle (finally_arg); });
|
||||
|
||||
string servicePath = GetServiceConfigPath (TC_APP_NAME ".exe", false);
|
||||
wstring servicePath = GetServiceConfigPath (_T(TC_APP_NAME) L".exe", false);
|
||||
|
||||
// check if service exists
|
||||
SC_HANDLE service = OpenService (scm, TC_SYSTEM_FAVORITES_SERVICE_NAME, SERVICE_ALL_ACCESS);
|
||||
@@ -2151,13 +2148,13 @@ namespace VeraCrypt
|
||||
SERVICE_WIN32_OWN_PROCESS,
|
||||
SERVICE_AUTO_START,
|
||||
SERVICE_ERROR_NORMAL,
|
||||
(string ("\"") + servicePath + "\" " TC_SYSTEM_FAVORITES_SERVICE_CMDLINE_OPTION).c_str(),
|
||||
(wstring (L"\"") + servicePath + L"\" " TC_SYSTEM_FAVORITES_SERVICE_CMDLINE_OPTION).c_str(),
|
||||
TC_SYSTEM_FAVORITES_SERVICE_LOAD_ORDER_GROUP,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
TC_APP_NAME " System Favorites"));
|
||||
_T(TC_APP_NAME) L" System Favorites"));
|
||||
|
||||
}
|
||||
else
|
||||
@@ -2175,9 +2172,9 @@ namespace VeraCrypt
|
||||
else
|
||||
configMap &= ~flag;
|
||||
#ifdef SETUP
|
||||
WriteLocalMachineRegistryDword ("SYSTEM\\CurrentControlSet\\Services\\veracrypt", TC_DRIVER_CONFIG_REG_VALUE_NAME, configMap);
|
||||
WriteLocalMachineRegistryDword (L"SYSTEM\\CurrentControlSet\\Services\\veracrypt", TC_DRIVER_CONFIG_REG_VALUE_NAME, configMap);
|
||||
#else
|
||||
WriteLocalMachineRegistryDwordValue ("SYSTEM\\CurrentControlSet\\Services\\veracrypt", TC_DRIVER_CONFIG_REG_VALUE_NAME, configMap);
|
||||
WriteLocalMachineRegistryDwordValue (L"SYSTEM\\CurrentControlSet\\Services\\veracrypt", TC_DRIVER_CONFIG_REG_VALUE_NAME, configMap);
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -2260,20 +2257,20 @@ namespace VeraCrypt
|
||||
|
||||
void BootEncryption::InitialSecurityChecksForHiddenOS ()
|
||||
{
|
||||
char windowsDrive = (char) toupper (GetWindowsDirectory()[0]);
|
||||
wchar_t windowsDrive = (wchar_t) towupper (GetWindowsDirectory()[0]);
|
||||
|
||||
// Paging files
|
||||
bool pagingFilesOk = !IsPagingFileActive (TRUE);
|
||||
|
||||
char pagingFileRegData[65536];
|
||||
wchar_t pagingFileRegData[65536];
|
||||
DWORD pagingFileRegDataSize = sizeof (pagingFileRegData);
|
||||
|
||||
if (ReadLocalMachineRegistryMultiString ("System\\CurrentControlSet\\Control\\Session Manager\\Memory Management", "PagingFiles", pagingFileRegData, &pagingFileRegDataSize)
|
||||
&& pagingFileRegDataSize > 4)
|
||||
if (ReadLocalMachineRegistryMultiString (L"System\\CurrentControlSet\\Control\\Session Manager\\Memory Management", L"PagingFiles", pagingFileRegData, &pagingFileRegDataSize)
|
||||
&& pagingFileRegDataSize > 8)
|
||||
{
|
||||
for (size_t i = 1; i < pagingFileRegDataSize - 2; ++i)
|
||||
for (size_t i = 1; i < pagingFileRegDataSize/2 - 2; ++i)
|
||||
{
|
||||
if (memcmp (pagingFileRegData + i, ":\\", 2) == 0 && toupper (pagingFileRegData[i - 1]) != windowsDrive)
|
||||
if (wmemcmp (pagingFileRegData + i, L":\\", 2) == 0 && towupper (pagingFileRegData[i - 1]) != windowsDrive)
|
||||
{
|
||||
pagingFilesOk = false;
|
||||
break;
|
||||
@@ -2299,15 +2296,15 @@ namespace VeraCrypt
|
||||
}
|
||||
|
||||
// User profile
|
||||
char *configPath = GetConfigPath ("dummy");
|
||||
if (configPath && toupper (configPath[0]) != windowsDrive)
|
||||
wchar_t *configPath = GetConfigPath (L"dummy");
|
||||
if (configPath && towupper (configPath[0]) != windowsDrive)
|
||||
{
|
||||
throw ErrorException (wstring (GetString ("USER_PROFILE_NOT_ON_SYS_PARTITION"))
|
||||
+ GetString ("LEAKS_OUTSIDE_SYSPART_UNIVERSAL_EXPLANATION"), SRC_POS);
|
||||
}
|
||||
|
||||
// Temporary files
|
||||
if (toupper (GetTempPath()[0]) != windowsDrive)
|
||||
if (towupper (GetTempPath()[0]) != windowsDrive)
|
||||
{
|
||||
throw ErrorException (wstring (GetString ("TEMP_NOT_ON_SYS_PARTITION"))
|
||||
+ GetString ("LEAKS_OUTSIDE_SYSPART_UNIVERSAL_EXPLANATION"), SRC_POS);
|
||||
@@ -2602,7 +2599,7 @@ namespace VeraCrypt
|
||||
}
|
||||
|
||||
|
||||
void BootEncryption::PrepareInstallation (bool systemPartitionOnly, Password &password, int ea, int mode, int pkcs5, int pim, const string &rescueIsoImagePath)
|
||||
void BootEncryption::PrepareInstallation (bool systemPartitionOnly, Password &password, int ea, int mode, int pkcs5, int pim, const wstring &rescueIsoImagePath)
|
||||
{
|
||||
BootEncryptionStatus encStatus = GetStatus();
|
||||
if (encStatus.DriveMounted)
|
||||
@@ -2671,14 +2668,14 @@ namespace VeraCrypt
|
||||
|
||||
void BootEncryption::RestrictPagingFilesToSystemPartition ()
|
||||
{
|
||||
char pagingFiles[128];
|
||||
StringCbCopyA (pagingFiles, sizeof(pagingFiles), "X:\\pagefile.sys 0 0");
|
||||
wchar_t pagingFiles[128] = {0};
|
||||
StringCbCopyW (pagingFiles, sizeof(pagingFiles), L"X:\\pagefile.sys 0 0");
|
||||
pagingFiles[0] = GetWindowsDirectory()[0];
|
||||
|
||||
throw_sys_if (!WriteLocalMachineRegistryMultiString ("System\\CurrentControlSet\\Control\\Session Manager\\Memory Management", "PagingFiles", pagingFiles, (DWORD) strlen (pagingFiles) + 2));
|
||||
throw_sys_if (!WriteLocalMachineRegistryMultiString (L"System\\CurrentControlSet\\Control\\Session Manager\\Memory Management", L"PagingFiles", pagingFiles, (DWORD) (wcslen (pagingFiles) + 2) * sizeof (wchar_t)));
|
||||
}
|
||||
|
||||
void BootEncryption::WriteLocalMachineRegistryDwordValue (char *keyPath, char *valueName, DWORD value)
|
||||
void BootEncryption::WriteLocalMachineRegistryDwordValue (wchar_t *keyPath, wchar_t *valueName, DWORD value)
|
||||
{
|
||||
if (!IsAdmin() && IsUacSupported())
|
||||
{
|
||||
@@ -2722,7 +2719,7 @@ namespace VeraCrypt
|
||||
CallDriver (TC_IOCTL_BOOT_ENCRYPTION_SETUP, &request, sizeof (request), NULL, 0);
|
||||
}
|
||||
|
||||
void BootEncryption::CopyFileAdmin (const string &sourceFile, const string &destinationFile)
|
||||
void BootEncryption::CopyFileAdmin (const wstring &sourceFile, const wstring &destinationFile)
|
||||
{
|
||||
if (!IsAdmin())
|
||||
{
|
||||
@@ -2738,7 +2735,7 @@ namespace VeraCrypt
|
||||
throw_sys_if (!::CopyFile (sourceFile.c_str(), destinationFile.c_str(), FALSE));
|
||||
}
|
||||
|
||||
void BootEncryption::DeleteFileAdmin (const string &file)
|
||||
void BootEncryption::DeleteFileAdmin (const wstring &file)
|
||||
{
|
||||
if (!IsAdmin() && IsUacSupported())
|
||||
Elevator::DeleteFile (file);
|
||||
@@ -2752,7 +2749,7 @@ namespace VeraCrypt
|
||||
{
|
||||
DWORD configMap;
|
||||
|
||||
if (!ReadLocalMachineRegistryDword ("SYSTEM\\CurrentControlSet\\Services\\veracrypt", TC_DRIVER_CONFIG_REG_VALUE_NAME, &configMap))
|
||||
if (!ReadLocalMachineRegistryDword (L"SYSTEM\\CurrentControlSet\\Services\\veracrypt", TC_DRIVER_CONFIG_REG_VALUE_NAME, &configMap))
|
||||
configMap = 0;
|
||||
|
||||
return configMap;
|
||||
|
||||
@@ -27,7 +27,7 @@ namespace VeraCrypt
|
||||
{
|
||||
public:
|
||||
File () : Elevated (false), FileOpen (false), FilePointerPosition(0), Handle(INVALID_HANDLE_VALUE), IsDevice(false), LastError(0) { }
|
||||
File (string path,bool readOnly = false, bool create = false);
|
||||
File (wstring path,bool readOnly = false, bool create = false);
|
||||
virtual ~File () { Close(); }
|
||||
|
||||
void CheckOpened (const char* srcPos) { if (!FileOpen) { SetLastError (LastError); throw SystemException (srcPos);} }
|
||||
@@ -42,7 +42,7 @@ namespace VeraCrypt
|
||||
uint64 FilePointerPosition;
|
||||
HANDLE Handle;
|
||||
bool IsDevice;
|
||||
string Path;
|
||||
wstring Path;
|
||||
DWORD LastError;
|
||||
};
|
||||
|
||||
@@ -50,7 +50,7 @@ namespace VeraCrypt
|
||||
class Device : public File
|
||||
{
|
||||
public:
|
||||
Device (string path,bool readOnly = false);
|
||||
Device (wstring path,bool readOnly = false);
|
||||
virtual ~Device () {}
|
||||
};
|
||||
|
||||
@@ -77,9 +77,9 @@ namespace VeraCrypt
|
||||
|
||||
struct Partition
|
||||
{
|
||||
string DevicePath;
|
||||
wstring DevicePath;
|
||||
PARTITION_INFORMATION Info;
|
||||
string MountPoint;
|
||||
wstring MountPoint;
|
||||
size_t Number;
|
||||
BOOL IsGPT;
|
||||
wstring VolumeNameId;
|
||||
@@ -119,8 +119,8 @@ namespace VeraCrypt
|
||||
|
||||
struct SystemDriveConfiguration
|
||||
{
|
||||
string DeviceKernelPath;
|
||||
string DevicePath;
|
||||
wstring DeviceKernelPath;
|
||||
wstring DevicePath;
|
||||
int DriveNumber;
|
||||
Partition DrivePartition;
|
||||
bool ExtraBootPartitionPresent;
|
||||
@@ -154,19 +154,19 @@ namespace VeraCrypt
|
||||
void CheckEncryptionSetupResult ();
|
||||
void CheckRequirements ();
|
||||
void CheckRequirementsHiddenOS ();
|
||||
void CopyFileAdmin (const string &sourceFile, const string &destinationFile);
|
||||
void CreateRescueIsoImage (bool initialSetup, const string &isoImagePath);
|
||||
void CopyFileAdmin (const wstring &sourceFile, const wstring &destinationFile);
|
||||
void CreateRescueIsoImage (bool initialSetup, const wstring &isoImagePath);
|
||||
void Deinstall (bool displayWaitDialog = false);
|
||||
void DeleteFileAdmin (const string &file);
|
||||
void DeleteFileAdmin (const wstring &file);
|
||||
DecoySystemWipeStatus GetDecoyOSWipeStatus ();
|
||||
DWORD GetDriverServiceStartType ();
|
||||
unsigned int GetHiddenOSCreationPhase ();
|
||||
uint16 GetInstalledBootLoaderVersion ();
|
||||
void GetInstalledBootLoaderFingerprint (byte fingerprint[WHIRLPOOL_DIGESTSIZE + SHA512_DIGESTSIZE]);
|
||||
Partition GetPartitionForHiddenOS ();
|
||||
bool IsBootLoaderOnDrive (char *devicePath);
|
||||
bool IsBootLoaderOnDrive (wchar_t *devicePath);
|
||||
BootEncryptionStatus GetStatus ();
|
||||
string GetTempPath ();
|
||||
wstring GetTempPath ();
|
||||
void GetVolumeProperties (VOLUME_PROPERTIES_STRUCT *properties);
|
||||
SystemDriveConfiguration GetSystemDriveConfiguration ();
|
||||
void Install (bool hiddenSystem);
|
||||
@@ -178,7 +178,7 @@ namespace VeraCrypt
|
||||
bool IsHiddenSystemRunning ();
|
||||
bool IsPagingFileActive (BOOL checkNonWindowsPartitionsOnly);
|
||||
void PrepareHiddenOSCreation (int ea, int mode, int pkcs5);
|
||||
void PrepareInstallation (bool systemPartitionOnly, Password &password, int ea, int mode, int pkcs5, int pim, const string &rescueIsoImagePath);
|
||||
void PrepareInstallation (bool systemPartitionOnly, Password &password, int ea, int mode, int pkcs5, int pim, const wstring &rescueIsoImagePath);
|
||||
void ProbeRealSystemDriveSize ();
|
||||
void ReadBootSectorConfig (byte *config, size_t bufLength, byte *userConfig = nullptr, string *customUserMessage = nullptr, uint16 *bootLoaderVersion = nullptr);
|
||||
uint32 ReadDriverConfigurationFlags ();
|
||||
@@ -203,12 +203,12 @@ namespace VeraCrypt
|
||||
bool SystemPartitionCoversWholeDrive ();
|
||||
bool SystemDriveIsDynamic ();
|
||||
bool VerifyRescueDisk ();
|
||||
bool VerifyRescueDiskIsoImage (const char* imageFile);
|
||||
bool VerifyRescueDiskIsoImage (const wchar_t* imageFile);
|
||||
void WipeHiddenOSCreationConfig ();
|
||||
void WriteBootDriveSector (uint64 offset, byte *data);
|
||||
void WriteBootSectorConfig (const byte newConfig[]);
|
||||
void WriteBootSectorUserConfig (byte userConfig, const string &customUserMessage);
|
||||
void WriteLocalMachineRegistryDwordValue (char *keyPath, char *valueName, DWORD value);
|
||||
void WriteLocalMachineRegistryDwordValue (wchar_t *keyPath, wchar_t *valueName, DWORD value);
|
||||
|
||||
protected:
|
||||
static const uint32 RescueIsoImageSize = 1835008; // Size of ISO9660 image with bootable emulated 1.44MB floppy disk image
|
||||
@@ -216,12 +216,12 @@ namespace VeraCrypt
|
||||
void BackupSystemLoader ();
|
||||
void CreateBootLoaderInMemory (byte *buffer, size_t bufferSize, bool rescueDisk, bool hiddenOSCreation = false);
|
||||
void CreateVolumeHeader (uint64 volumeSize, uint64 encryptedAreaStart, Password *password, int ea, int mode, int pkcs5, int pim);
|
||||
string GetSystemLoaderBackupPath ();
|
||||
wstring GetSystemLoaderBackupPath ();
|
||||
uint32 GetChecksum (byte *data, size_t size);
|
||||
DISK_GEOMETRY GetDriveGeometry (int driveNumber);
|
||||
PartitionList GetDrivePartitions (int driveNumber);
|
||||
wstring GetRemarksOnHiddenOS ();
|
||||
string GetWindowsDirectory ();
|
||||
wstring GetWindowsDirectory ();
|
||||
void RegisterFilter (bool registerFilter, FilterType filterType, const GUID *deviceClassGuid = nullptr);
|
||||
void RestoreSystemLoader ();
|
||||
void InstallVolumeHeader ();
|
||||
@@ -246,11 +246,11 @@ namespace VeraCrypt
|
||||
#define MIN_HIDDENOS_DECOY_PARTITION_SIZE_RATIO_NTFS 2.1
|
||||
#define MIN_HIDDENOS_DECOY_PARTITION_SIZE_RATIO_FAT 1.05
|
||||
|
||||
#define TC_SYS_BOOT_LOADER_BACKUP_NAME "Original System Loader"
|
||||
#define TC_SYS_BOOT_LOADER_BACKUP_NAME_LEGACY "Original System Loader.bak" // Deprecated to prevent removal by some "cleaners"
|
||||
#define TC_SYS_BOOT_LOADER_BACKUP_NAME L"Original System Loader"
|
||||
#define TC_SYS_BOOT_LOADER_BACKUP_NAME_LEGACY L"Original System Loader.bak" // Deprecated to prevent removal by some "cleaners"
|
||||
|
||||
#define TC_SYSTEM_FAVORITES_SERVICE_NAME TC_APP_NAME "SystemFavorites"
|
||||
#define TC_SYSTEM_FAVORITES_SERVICE_LOAD_ORDER_GROUP "Event Log"
|
||||
#define TC_SYSTEM_FAVORITES_SERVICE_CMDLINE_OPTION "/systemFavoritesService"
|
||||
#define TC_SYSTEM_FAVORITES_SERVICE_NAME _T(TC_APP_NAME) L"SystemFavorites"
|
||||
#define TC_SYSTEM_FAVORITES_SERVICE_LOAD_ORDER_GROUP L"Event Log"
|
||||
#define TC_SYSTEM_FAVORITES_SERVICE_CMDLINE_OPTION L"/systemFavoritesService"
|
||||
|
||||
#endif // TC_HEADER_Common_BootEncryption
|
||||
|
||||
@@ -40,8 +40,8 @@ BOOL CALLBACK CommandHelpDlgProc (HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM
|
||||
{
|
||||
case WM_INITDIALOG:
|
||||
{
|
||||
char * tmp = err_malloc(8192);
|
||||
char tmp2[MAX_PATH * 2];
|
||||
wchar_t * tmp = err_malloc(8192 * sizeof (wchar_t));
|
||||
wchar_t tmp2[MAX_PATH * 2];
|
||||
argumentspec *as;
|
||||
int i;
|
||||
|
||||
@@ -51,29 +51,29 @@ BOOL CALLBACK CommandHelpDlgProc (HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM
|
||||
|
||||
*tmp = 0;
|
||||
|
||||
StringCbCopyA (tmp, 8192, "VeraCrypt " VERSION_STRING);
|
||||
StringCchCopyW (tmp, 8192, L"VeraCrypt " _T(VERSION_STRING));
|
||||
#ifdef _WIN64
|
||||
StringCbCatA (tmp, 8192, " (64-bit)");
|
||||
StringCchCatW (tmp, 8192, L" (64-bit)");
|
||||
#else
|
||||
StringCbCatA (tmp, 8192, " (32-bit)");
|
||||
StringCchCatW (tmp, 8192, L" (32-bit)");
|
||||
#endif
|
||||
#if (defined(_DEBUG) || defined(DEBUG))
|
||||
StringCbCatA (tmp, 8192, " (debug)");
|
||||
StringCchCatW (tmp, 8192, L" (debug)");
|
||||
#endif
|
||||
|
||||
StringCbCatA (tmp, 8192, "\n\nCommand line options:\n\n");
|
||||
StringCchCatW (tmp, 8192, L"\n\nCommand line options:\n\n");
|
||||
for (i = 0; i < as->arg_cnt; i ++)
|
||||
{
|
||||
if (!as->args[i].Internal)
|
||||
{
|
||||
StringCchPrintf(tmp2, MAX_PATH * 2, "%s\t%s\n", as->args[i].short_name, as->args[i].long_name);
|
||||
StringCchCat(tmp, 8192, tmp2);
|
||||
StringCchPrintfW(tmp2, MAX_PATH * 2, L"%s\t%s\n", as->args[i].short_name, as->args[i].long_name);
|
||||
StringCchCatW(tmp, 8192, tmp2);
|
||||
}
|
||||
}
|
||||
|
||||
StringCbCatA (tmp, 8192, "\nExamples:\n\nMount a volume as X:\tveracrypt.exe /q /v volume.hc /l X\nDismount a volume X:\tveracrypt.exe /q /d X");
|
||||
StringCchCatW (tmp, 8192, L"\nExamples:\n\nMount a volume as X:\tveracrypt.exe /q /v volume.hc /l X\nDismount a volume X:\tveracrypt.exe /q /d X");
|
||||
|
||||
SetWindowText (GetDlgItem (hwndDlg, IDC_COMMANDHELP_TEXT), (char*) tmp);
|
||||
SetWindowTextW (GetDlgItem (hwndDlg, IDC_COMMANDHELP_TEXT), tmp);
|
||||
|
||||
TCfree(tmp);
|
||||
return 1;
|
||||
@@ -90,7 +90,7 @@ BOOL CALLBACK CommandHelpDlgProc (HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM
|
||||
return 0;
|
||||
}
|
||||
|
||||
int Win32CommandLine (char *lpszCommandLine, char ***lpszArgs)
|
||||
int Win32CommandLine (wchar_t ***lpszArgs)
|
||||
{
|
||||
int argumentCount;
|
||||
int i;
|
||||
@@ -109,30 +109,16 @@ int Win32CommandLine (char *lpszCommandLine, char ***lpszArgs)
|
||||
return 0;
|
||||
}
|
||||
|
||||
*lpszArgs = malloc (sizeof (char *) * argumentCount);
|
||||
*lpszArgs = malloc (sizeof (wchar_t *) * argumentCount);
|
||||
if (!*lpszArgs)
|
||||
AbortProcess ("OUTOFMEMORY");
|
||||
|
||||
for (i = 0; i < argumentCount; ++i)
|
||||
{
|
||||
size_t argLen = wcslen (arguments[i + 1]);
|
||||
|
||||
char *arg = malloc (argLen + 1);
|
||||
wchar_t *arg = _wcsdup (arguments[i + 1]);
|
||||
if (!arg)
|
||||
AbortProcess ("OUTOFMEMORY");
|
||||
|
||||
if (argLen > 0)
|
||||
{
|
||||
int len = WideCharToMultiByte (CP_ACP, 0, arguments[i + 1], -1, arg, (int) argLen + 1, NULL, NULL);
|
||||
if (len == 0)
|
||||
{
|
||||
handleWin32Error (NULL, SRC_POS);
|
||||
AbortProcessSilent();
|
||||
}
|
||||
}
|
||||
else
|
||||
arg[0] = 0;
|
||||
|
||||
(*lpszArgs)[i] = arg;
|
||||
}
|
||||
|
||||
@@ -140,21 +126,21 @@ int Win32CommandLine (char *lpszCommandLine, char ***lpszArgs)
|
||||
return argumentCount;
|
||||
}
|
||||
|
||||
int GetArgSepPosOffset (char *lpszArgument)
|
||||
int GetArgSepPosOffset (wchar_t *lpszArgument)
|
||||
{
|
||||
if (lpszArgument[0] == '/')
|
||||
if (lpszArgument[0] == L'/')
|
||||
return 1;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int GetArgumentID (argumentspec *as, char *lpszArgument)
|
||||
int GetArgumentID (argumentspec *as, wchar_t *lpszArgument)
|
||||
{
|
||||
int i;
|
||||
|
||||
for (i = 0; i < as->arg_cnt; i++)
|
||||
{
|
||||
if (_stricmp (as->args[i].long_name, lpszArgument) == 0)
|
||||
if (_wcsicmp (as->args[i].long_name, lpszArgument) == 0)
|
||||
{
|
||||
return as->args[i].Id;
|
||||
}
|
||||
@@ -165,7 +151,7 @@ int GetArgumentID (argumentspec *as, char *lpszArgument)
|
||||
if (as->args[i].short_name[0] == 0)
|
||||
continue;
|
||||
|
||||
if (_stricmp (as->args[i].short_name, lpszArgument) == 0)
|
||||
if (_wcsicmp (as->args[i].short_name, lpszArgument) == 0)
|
||||
{
|
||||
return as->args[i].Id;
|
||||
}
|
||||
@@ -175,8 +161,8 @@ int GetArgumentID (argumentspec *as, char *lpszArgument)
|
||||
return -1;
|
||||
}
|
||||
|
||||
int GetArgumentValue (char **lpszCommandLineArgs, int *nArgIdx,
|
||||
int nNoCommandLineArgs, char *lpszValue, int nValueSize)
|
||||
int GetArgumentValue (wchar_t **lpszCommandLineArgs, int *nArgIdx,
|
||||
int nNoCommandLineArgs, wchar_t *lpszValue, int nValueSize)
|
||||
{
|
||||
*lpszValue = 0;
|
||||
|
||||
@@ -187,7 +173,7 @@ int GetArgumentValue (char **lpszCommandLineArgs, int *nArgIdx,
|
||||
{
|
||||
/* Handles the case of space between parameter code
|
||||
and value */
|
||||
StringCbCopyA (lpszValue, nValueSize, lpszCommandLineArgs[*nArgIdx + 1]);
|
||||
StringCbCopyW (lpszValue, nValueSize, lpszCommandLineArgs[*nArgIdx + 1]);
|
||||
lpszValue[nValueSize - 1] = 0;
|
||||
(*nArgIdx)++;
|
||||
return HAS_ARGUMENT;
|
||||
|
||||
@@ -21,8 +21,8 @@ extern "C" {
|
||||
typedef struct argument_t
|
||||
{
|
||||
int Id;
|
||||
char long_name[32];
|
||||
char short_name[8];
|
||||
wchar_t long_name[32];
|
||||
wchar_t short_name[8];
|
||||
BOOL Internal;
|
||||
} argument;
|
||||
|
||||
@@ -33,10 +33,10 @@ typedef struct argumentspec_t
|
||||
} argumentspec;
|
||||
|
||||
BOOL CALLBACK CommandHelpDlgProc ( HWND hwndDlg , UINT msg , WPARAM wParam , LPARAM lParam );
|
||||
int Win32CommandLine ( char *lpszCommandLine , char ***lpszArgs );
|
||||
int GetArgSepPosOffset ( char *lpszArgument );
|
||||
int GetArgumentID ( argumentspec *as , char *lpszArgument );
|
||||
int GetArgumentValue ( char **lpszCommandLineArgs , int *nArgIdx , int nNoCommandLineArgs , char *lpszValue , int nValueSize );
|
||||
int Win32CommandLine ( wchar_t ***lpszArgs );
|
||||
int GetArgSepPosOffset ( wchar_t *lpszArgument );
|
||||
int GetArgumentID ( argumentspec *as , wchar_t *lpszArgument );
|
||||
int GetArgumentValue ( wchar_t **lpszCommandLineArgs , int *nArgIdx , int nNoCommandLineArgs , wchar_t *lpszValue , int nValueSize );
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
|
||||
#define SIZEOF_MRU_LIST 20
|
||||
|
||||
void AddComboItem (HWND hComboBox, char *lpszFileName, BOOL saveHistory)
|
||||
void AddComboItem (HWND hComboBox, const wchar_t *lpszFileName, BOOL saveHistory)
|
||||
{
|
||||
LPARAM nIndex;
|
||||
|
||||
@@ -53,19 +53,19 @@ void AddComboItem (HWND hComboBox, char *lpszFileName, BOOL saveHistory)
|
||||
|
||||
LPARAM MoveEditToCombo (HWND hComboBox, BOOL saveHistory)
|
||||
{
|
||||
char szTmp[TC_MAX_PATH] = {0};
|
||||
wchar_t szTmp[TC_MAX_PATH] = {0};
|
||||
|
||||
if (!saveHistory)
|
||||
{
|
||||
GetWindowText (hComboBox, szTmp, sizeof (szTmp));
|
||||
GetWindowText (hComboBox, szTmp, ARRAYSIZE (szTmp));
|
||||
SendMessage (hComboBox, CB_RESETCONTENT, 0, 0);
|
||||
SetWindowText (hComboBox, szTmp);
|
||||
return 0;
|
||||
}
|
||||
|
||||
GetWindowText (hComboBox, szTmp, sizeof (szTmp));
|
||||
GetWindowText (hComboBox, szTmp, ARRAYSIZE (szTmp));
|
||||
|
||||
if (strlen (szTmp) > 0)
|
||||
if (wcslen (szTmp) > 0)
|
||||
{
|
||||
LPARAM nIndex = SendMessage (hComboBox, CB_FINDSTRINGEXACT, (WPARAM) - 1,
|
||||
(LPARAM) & szTmp[0]);
|
||||
@@ -169,19 +169,22 @@ void LoadCombo (HWND hComboBox, BOOL bEnabled, BOOL bOnlyCheckModified, BOOL *pb
|
||||
i = 0;
|
||||
while (xml = XmlFindElement (xml, "volume"))
|
||||
{
|
||||
char szTmp[MAX_PATH] = { 0 };
|
||||
wchar_t szTmp[MAX_PATH] = { 0 };
|
||||
wchar_t wszVolume[MAX_PATH] = {0};
|
||||
|
||||
if (i < count)
|
||||
{
|
||||
if (SendMessage (hComboBox, CB_GETLBTEXTLEN, nComboIdx[i], 0) < sizeof (szTmp))
|
||||
if (SendMessage (hComboBox, CB_GETLBTEXTLEN, nComboIdx[i], 0) < ARRAYSIZE (szTmp))
|
||||
SendMessage (hComboBox, CB_GETLBTEXT, nComboIdx[i], (LPARAM) & szTmp[0]);
|
||||
}
|
||||
|
||||
XmlGetNodeText (xml, volume, sizeof (volume));
|
||||
if (0 == MultiByteToWideChar (CP_UTF8, 0, volume, -1, wszVolume, MAX_PATH))
|
||||
wszVolume [0] = 0;
|
||||
if (!bOnlyCheckModified)
|
||||
AddComboItem (hComboBox, volume, TRUE);
|
||||
AddComboItem (hComboBox, wszVolume, TRUE);
|
||||
|
||||
if (pbModified && strcmp (volume, szTmp))
|
||||
if (pbModified && wcscmp (wszVolume, szTmp))
|
||||
*pbModified = TRUE;
|
||||
|
||||
xml++;
|
||||
@@ -208,11 +211,11 @@ void DumpCombo (HWND hComboBox, int bClear)
|
||||
return;
|
||||
}
|
||||
|
||||
f = fopen (GetConfigPath (TC_APPD_FILENAME_HISTORY), "w");
|
||||
f = _wfopen (GetConfigPath (TC_APPD_FILENAME_HISTORY), L"w,ccs=UTF-8");
|
||||
if (f == NULL) return;
|
||||
|
||||
XmlWriteHeader (f);
|
||||
fputs ("\n\t<history>", f);
|
||||
fputws (L"\n\t<history>", f);
|
||||
|
||||
/* combo list part:- get mru items */
|
||||
for (i = 0; i < SIZEOF_MRU_LIST; i++)
|
||||
@@ -221,21 +224,21 @@ void DumpCombo (HWND hComboBox, int bClear)
|
||||
/* combo list part:- write out mru items */
|
||||
for (i = 0; i < SIZEOF_MRU_LIST; i++)
|
||||
{
|
||||
char szTmp[MAX_PATH] = { 0 };
|
||||
wchar_t szTmp[MAX_PATH] = { 0 };
|
||||
|
||||
if (SendMessage (hComboBox, CB_GETLBTEXTLEN, nComboIdx[i], 0) < sizeof (szTmp))
|
||||
if (SendMessage (hComboBox, CB_GETLBTEXTLEN, nComboIdx[i], 0) < ARRAYSIZE (szTmp))
|
||||
SendMessage (hComboBox, CB_GETLBTEXT, nComboIdx[i], (LPARAM) & szTmp[0]);
|
||||
|
||||
if (szTmp[0] != 0)
|
||||
{
|
||||
char q[MAX_PATH * 2] = { 0 };
|
||||
XmlQuoteText (szTmp, q, sizeof (q));
|
||||
wchar_t q[MAX_PATH * 2] = { 0 };
|
||||
XmlQuoteTextW (szTmp, q, sizeof (q));
|
||||
|
||||
fprintf (f, "\n\t\t<volume>%s</volume>", q);
|
||||
fwprintf (f, L"\n\t\t<volume>%s</volume>", q);
|
||||
}
|
||||
}
|
||||
|
||||
fputs ("\n\t</history>", f);
|
||||
fputws (L"\n\t</history>", f);
|
||||
XmlWriteFooter (f);
|
||||
fclose (f);
|
||||
}
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
void AddComboItem (HWND hComboBox, char *lpszFileName, BOOL saveHistory);
|
||||
void AddComboItem (HWND hComboBox, const wchar_t *lpszFileName, BOOL saveHistory);
|
||||
LPARAM MoveEditToCombo (HWND hComboBox, BOOL saveHistory);
|
||||
int GetOrderComboIdx ( HWND hComboBox , int *nIdxList , int nElems );
|
||||
LPARAM UpdateComboOrder ( HWND hComboBox );
|
||||
|
||||
@@ -44,9 +44,15 @@ static Cipher Ciphers[] =
|
||||
{
|
||||
// Block Size Key Size Key Schedule Size
|
||||
// ID Name (Bytes) (Bytes) (Bytes)
|
||||
#ifdef TC_WINDOWS_BOOT
|
||||
{ AES, "AES", 16, 32, AES_KS },
|
||||
{ SERPENT, "Serpent", 16, 32, 140*4 },
|
||||
{ TWOFISH, "Twofish", 16, 32, TWOFISH_KS },
|
||||
#else
|
||||
{ AES, L"AES", 16, 32, AES_KS },
|
||||
{ SERPENT, L"Serpent", 16, 32, 140*4 },
|
||||
{ TWOFISH, L"Twofish", 16, 32, TWOFISH_KS },
|
||||
#endif
|
||||
{ 0, 0, 0, 0, 0 }
|
||||
};
|
||||
|
||||
@@ -88,18 +94,17 @@ static EncryptionAlgorithm EncryptionAlgorithms[] =
|
||||
};
|
||||
|
||||
|
||||
|
||||
#ifndef TC_WINDOWS_BOOT
|
||||
// Hash algorithms
|
||||
static Hash Hashes[] =
|
||||
{ // ID Name Deprecated System Encryption
|
||||
#ifndef TC_WINDOWS_BOOT
|
||||
{ SHA512, "SHA-512", FALSE, FALSE },
|
||||
{ WHIRLPOOL, "Whirlpool", FALSE, FALSE },
|
||||
#endif
|
||||
{ SHA256, "SHA-256", FALSE, TRUE },
|
||||
{ RIPEMD160, "RIPEMD-160", TRUE, TRUE },
|
||||
{ SHA512, L"SHA-512", FALSE, FALSE },
|
||||
{ WHIRLPOOL, L"Whirlpool", FALSE, FALSE },
|
||||
{ SHA256, L"SHA-256", FALSE, TRUE },
|
||||
{ RIPEMD160, L"RIPEMD-160", TRUE, TRUE },
|
||||
{ 0, 0, 0 }
|
||||
};
|
||||
#endif
|
||||
|
||||
/* Return values: 0 = success, ERR_CIPHER_INIT_FAILURE (fatal), ERR_CIPHER_INIT_WEAK_KEY (non-fatal) */
|
||||
int CipherInit (int cipher, unsigned char *key, unsigned __int8 *ks)
|
||||
@@ -279,17 +284,12 @@ Cipher *CipherGet (int id)
|
||||
}
|
||||
|
||||
#ifndef TC_WINDOWS_BOOT
|
||||
const
|
||||
#endif
|
||||
char *CipherGetName (int cipherId)
|
||||
const wchar_t *CipherGetName (int cipherId)
|
||||
{
|
||||
#ifdef TC_WINDOWS_BOOT
|
||||
return CipherGet (cipherId) -> Name;
|
||||
#else
|
||||
Cipher* pCipher = CipherGet (cipherId);
|
||||
return pCipher? pCipher -> Name : "";
|
||||
#endif
|
||||
return pCipher? pCipher -> Name : L"";
|
||||
}
|
||||
#endif
|
||||
|
||||
int CipherGetBlockSize (int cipherId)
|
||||
{
|
||||
@@ -410,19 +410,19 @@ BOOL EAInitMode (PCRYPTO_INFO ci)
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static void EAGetDisplayName(char *buf, int ea, int i)
|
||||
static void EAGetDisplayName(wchar_t *buf, int ea, int i)
|
||||
{
|
||||
strcpy (buf, CipherGetName (i));
|
||||
wcscpy (buf, CipherGetName (i));
|
||||
if (i = EAGetPreviousCipher(ea, i))
|
||||
{
|
||||
strcat (buf, "(");
|
||||
EAGetDisplayName (&buf[strlen(buf)], ea, i);
|
||||
strcat (buf, ")");
|
||||
wcscat (buf, L"(");
|
||||
EAGetDisplayName (&buf[wcslen(buf)], ea, i);
|
||||
wcscat (buf, L")");
|
||||
}
|
||||
}
|
||||
|
||||
// Returns name of EA, cascaded cipher names are separated by hyphens
|
||||
char *EAGetName (char *buf, int ea, int guiDisplay)
|
||||
wchar_t *EAGetName (wchar_t *buf, int ea, int guiDisplay)
|
||||
{
|
||||
if (guiDisplay)
|
||||
{
|
||||
@@ -431,27 +431,27 @@ char *EAGetName (char *buf, int ea, int guiDisplay)
|
||||
else
|
||||
{
|
||||
int i = EAGetLastCipher(ea);
|
||||
strcpy (buf, (i != 0) ? CipherGetName (i) : "?");
|
||||
wcscpy (buf, (i != 0) ? CipherGetName (i) : L"?");
|
||||
|
||||
while (i = EAGetPreviousCipher(ea, i))
|
||||
{
|
||||
strcat (buf, "-");
|
||||
strcat (buf, CipherGetName (i));
|
||||
wcscat (buf, L"-");
|
||||
wcscat (buf, CipherGetName (i));
|
||||
}
|
||||
}
|
||||
return buf;
|
||||
}
|
||||
|
||||
|
||||
int EAGetByName (char *name)
|
||||
int EAGetByName (wchar_t *name)
|
||||
{
|
||||
int ea = EAGetFirst ();
|
||||
char n[128];
|
||||
wchar_t n[128];
|
||||
|
||||
do
|
||||
{
|
||||
EAGetName (n, ea, 1);
|
||||
if (_stricmp (n, name) == 0)
|
||||
if (_wcsicmp (n, name) == 0)
|
||||
return ea;
|
||||
}
|
||||
while (ea = EAGetNext (ea));
|
||||
@@ -499,16 +499,16 @@ int EAGetNextMode (int ea, int previousModeId)
|
||||
#ifndef TC_WINDOWS_BOOT
|
||||
|
||||
// Returns the name of the mode of operation of the whole EA
|
||||
char *EAGetModeName (int ea, int mode, BOOL capitalLetters)
|
||||
wchar_t *EAGetModeName (int ea, int mode, BOOL capitalLetters)
|
||||
{
|
||||
switch (mode)
|
||||
{
|
||||
case XTS:
|
||||
|
||||
return "XTS";
|
||||
return L"XTS";
|
||||
|
||||
}
|
||||
return "[unknown]";
|
||||
return L"[unknown]";
|
||||
}
|
||||
|
||||
#endif // TC_WINDOWS_BOOT
|
||||
@@ -635,7 +635,7 @@ BOOL EAIsModeSupported (int ea, int testedMode)
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
||||
#ifndef TC_WINDOWS_BOOT
|
||||
Hash *HashGet (int id)
|
||||
{
|
||||
int i;
|
||||
@@ -647,37 +647,29 @@ Hash *HashGet (int id)
|
||||
}
|
||||
|
||||
|
||||
int HashGetIdByName (char *name)
|
||||
int HashGetIdByName (wchar_t *name)
|
||||
{
|
||||
int i;
|
||||
for (i = 0; Hashes[i].Id != 0; i++)
|
||||
if (strcmp (Hashes[i].Name, name) == 0)
|
||||
if (wcscmp (Hashes[i].Name, name) == 0)
|
||||
return Hashes[i].Id;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
#ifndef TC_WINDOWS_BOOT
|
||||
const
|
||||
#endif
|
||||
char *HashGetName (int hashId)
|
||||
const wchar_t *HashGetName (int hashId)
|
||||
{
|
||||
#ifdef TC_WINDOWS_BOOT
|
||||
return HashGet(hashId) -> Name;
|
||||
#else
|
||||
Hash* pHash = HashGet(hashId);
|
||||
return pHash? pHash -> Name : "";
|
||||
#endif
|
||||
return pHash? pHash -> Name : L"";
|
||||
}
|
||||
|
||||
#ifndef TC_WINDOWS_BOOT
|
||||
void HashGetName2 (char *buf, int hashId)
|
||||
void HashGetName2 (wchar_t *buf, int hashId)
|
||||
{
|
||||
Hash* pHash = HashGet(hashId);
|
||||
if (pHash)
|
||||
strcpy(buf, pHash -> Name);
|
||||
wcscpy(buf, pHash -> Name);
|
||||
else
|
||||
buf[0] = '\0';
|
||||
buf[0] = L'\0';
|
||||
}
|
||||
|
||||
BOOL HashIsDeprecated (int hashId)
|
||||
|
||||
@@ -112,7 +112,11 @@ enum
|
||||
typedef struct
|
||||
{
|
||||
int Id; // Cipher ID
|
||||
#ifdef TC_WINDOWS_BOOT
|
||||
char *Name; // Name
|
||||
#else
|
||||
wchar_t *Name; // Name
|
||||
#endif
|
||||
int BlockSize; // Block size (bytes)
|
||||
int KeySize; // Key size (bytes)
|
||||
int KeyScheduleSize; // Scheduled key size (bytes)
|
||||
@@ -125,13 +129,15 @@ typedef struct
|
||||
int FormatEnabled;
|
||||
} EncryptionAlgorithm;
|
||||
|
||||
#ifndef TC_WINDOWS_BOOT
|
||||
typedef struct
|
||||
{
|
||||
int Id; // Hash ID
|
||||
char *Name; // Name
|
||||
wchar_t *Name; // Name
|
||||
BOOL Deprecated;
|
||||
BOOL SystemEncryption; // Available for system encryption
|
||||
} Hash;
|
||||
#endif
|
||||
|
||||
// Maxium length of scheduled key
|
||||
#if !defined (TC_WINDOWS_BOOT) || defined (TC_WINDOWS_BOOT_AES)
|
||||
@@ -276,9 +282,8 @@ int CipherGetKeyScheduleSize (int cipher);
|
||||
BOOL CipherSupportsIntraDataUnitParallelization (int cipher);
|
||||
|
||||
#ifndef TC_WINDOWS_BOOT
|
||||
const
|
||||
const wchar_t * CipherGetName (int cipher);
|
||||
#endif
|
||||
char * CipherGetName (int cipher);
|
||||
|
||||
int CipherInit (int cipher, unsigned char *key, unsigned char *ks);
|
||||
#ifndef TC_WINDOWS_BOOT_SINGLE_CIPHER_MODE
|
||||
@@ -297,12 +302,16 @@ void DecipherBlocks (int cipher, void *dataPtr, void *ks, size_t blockCount);
|
||||
int EAGetFirst ();
|
||||
int EAGetCount (void);
|
||||
int EAGetNext (int previousEA);
|
||||
char * EAGetName (char *buf, int ea, int guiDisplay);
|
||||
int EAGetByName (char *name);
|
||||
#ifndef TC_WINDOWS_BOOT
|
||||
wchar_t * EAGetName (wchar_t *buf, int ea, int guiDisplay);
|
||||
int EAGetByName (wchar_t *name);
|
||||
#endif
|
||||
int EAGetKeySize (int ea);
|
||||
int EAGetFirstMode (int ea);
|
||||
int EAGetNextMode (int ea, int previousModeId);
|
||||
char * EAGetModeName (int ea, int mode, BOOL capitalLetters);
|
||||
#ifndef TC_WINDOWS_BOOT
|
||||
wchar_t * EAGetModeName (int ea, int mode, BOOL capitalLetters);
|
||||
#endif
|
||||
int EAGetKeyScheduleSize (int ea);
|
||||
int EAGetLargestKey ();
|
||||
int EAGetLargestKeyForMode (int mode);
|
||||
@@ -317,13 +326,10 @@ BOOL EAIsModeSupported (int ea, int testedMode);
|
||||
|
||||
|
||||
#ifndef TC_WINDOWS_BOOT
|
||||
const
|
||||
#endif
|
||||
char *HashGetName (int hash_algo_id);
|
||||
const wchar_t *HashGetName (int hash_algo_id);
|
||||
|
||||
#ifndef TC_WINDOWS_BOOT
|
||||
Hash *HashGet (int id);
|
||||
void HashGetName2 (char *buf, int hashId);
|
||||
void HashGetName2 (wchar_t *buf, int hashId);
|
||||
BOOL HashIsDeprecated (int hashId);
|
||||
BOOL HashForSystemEncryption (int hashId);
|
||||
int GetMaxPkcs5OutSize (void);
|
||||
|
||||
1462
src/Common/Dlgcode.c
1462
src/Common/Dlgcode.c
File diff suppressed because it is too large
Load Diff
@@ -48,10 +48,10 @@ enum
|
||||
|
||||
#define TC_APPLICATION_ID L"IDRIX.VeraCrypt"
|
||||
|
||||
#define TC_MUTEX_NAME_SYSENC "Global\\VeraCrypt System Encryption Wizard"
|
||||
#define TC_MUTEX_NAME_NONSYS_INPLACE_ENC "Global\\VeraCrypt In-Place Encryption Wizard"
|
||||
#define TC_MUTEX_NAME_APP_SETUP "Global\\VeraCrypt Setup"
|
||||
#define TC_MUTEX_NAME_DRIVER_SETUP "Global\\VeraCrypt Driver Setup"
|
||||
#define TC_MUTEX_NAME_SYSENC L"Global\\VeraCrypt System Encryption Wizard"
|
||||
#define TC_MUTEX_NAME_NONSYS_INPLACE_ENC L"Global\\VeraCrypt In-Place Encryption Wizard"
|
||||
#define TC_MUTEX_NAME_APP_SETUP L"Global\\VeraCrypt Setup"
|
||||
#define TC_MUTEX_NAME_DRIVER_SETUP L"Global\\VeraCrypt Driver Setup"
|
||||
|
||||
#define IDC_ABOUT 0x7fff /* ID for AboutBox on system menu in wm_user range */
|
||||
|
||||
@@ -68,18 +68,18 @@ enum
|
||||
|
||||
#define MAX_MULTI_CHOICES 10 /* Maximum number of options for mutliple-choice dialog */
|
||||
|
||||
#define TC_APPD_FILENAME_CONFIGURATION "Configuration.xml"
|
||||
#define TC_APPD_FILENAME_SYSTEM_ENCRYPTION "System Encryption.xml"
|
||||
#define TC_APPD_FILENAME_DEFAULT_KEYFILES "Default Keyfiles.xml"
|
||||
#define TC_APPD_FILENAME_HISTORY "History.xml"
|
||||
#define TC_APPD_FILENAME_FAVORITE_VOLUMES "Favorite Volumes.xml"
|
||||
#define TC_APPD_FILENAME_SYSTEM_FAVORITE_VOLUMES TC_APP_NAME " System Favorite Volumes.xml"
|
||||
#define TC_APPD_FILENAME_NONSYS_INPLACE_ENC "In-Place Encryption"
|
||||
#define TC_APPD_FILENAME_NONSYS_INPLACE_ENC_WIPE "In-Place Encryption Wipe Algo"
|
||||
#define TC_APPD_FILENAME_POST_INSTALL_TASK_TUTORIAL "Post-Install Task - Tutorial"
|
||||
#define TC_APPD_FILENAME_POST_INSTALL_TASK_RELEASE_NOTES "Post-Install Task - Release Notes"
|
||||
#define TC_APPD_FILENAME_CONFIGURATION L"Configuration.xml"
|
||||
#define TC_APPD_FILENAME_SYSTEM_ENCRYPTION L"System Encryption.xml"
|
||||
#define TC_APPD_FILENAME_DEFAULT_KEYFILES L"Default Keyfiles.xml"
|
||||
#define TC_APPD_FILENAME_HISTORY L"History.xml"
|
||||
#define TC_APPD_FILENAME_FAVORITE_VOLUMES L"Favorite Volumes.xml"
|
||||
#define TC_APPD_FILENAME_SYSTEM_FAVORITE_VOLUMES _T(TC_APP_NAME) L" System Favorite Volumes.xml"
|
||||
#define TC_APPD_FILENAME_NONSYS_INPLACE_ENC L"In-Place Encryption"
|
||||
#define TC_APPD_FILENAME_NONSYS_INPLACE_ENC_WIPE L"In-Place Encryption Wipe Algo"
|
||||
#define TC_APPD_FILENAME_POST_INSTALL_TASK_TUTORIAL L"Post-Install Task - Tutorial"
|
||||
#define TC_APPD_FILENAME_POST_INSTALL_TASK_RELEASE_NOTES L"Post-Install Task - Release Notes"
|
||||
|
||||
#define VC_FILENAME_RENAMED_SUFFIX "_old"
|
||||
#define VC_FILENAME_RENAMED_SUFFIX L"_old"
|
||||
|
||||
#ifndef USER_DEFAULT_SCREEN_DPI
|
||||
#define USER_DEFAULT_SCREEN_DPI 96
|
||||
@@ -98,9 +98,9 @@ enum
|
||||
|
||||
extern char *LastDialogId;
|
||||
extern char *ConfigBuffer;
|
||||
extern char szHelpFile[TC_MAX_PATH];
|
||||
extern char szHelpFile2[TC_MAX_PATH];
|
||||
extern char SecurityTokenLibraryPath[TC_MAX_PATH];
|
||||
extern wchar_t szHelpFile[TC_MAX_PATH];
|
||||
extern wchar_t szHelpFile2[TC_MAX_PATH];
|
||||
extern wchar_t SecurityTokenLibraryPath[TC_MAX_PATH];
|
||||
extern HFONT hFixedDigitFont;
|
||||
extern HFONT hBoldFont;
|
||||
extern HFONT hTitleFont;
|
||||
@@ -132,8 +132,8 @@ extern WipeAlgorithmId nWipeMode;
|
||||
extern BOOL bSysPartitionSelected;
|
||||
extern BOOL bSysDriveSelected;
|
||||
|
||||
extern char SysPartitionDevicePath [TC_MAX_PATH];
|
||||
extern char SysDriveDevicePath [TC_MAX_PATH];
|
||||
extern wchar_t SysPartitionDevicePath [TC_MAX_PATH];
|
||||
extern wchar_t SysDriveDevicePath [TC_MAX_PATH];
|
||||
extern char bCachedSysDevicePathsValid;
|
||||
|
||||
extern BOOL bHyperLinkBeingTracked;
|
||||
@@ -226,15 +226,15 @@ typedef struct
|
||||
#define ICON_HAND MB_ICONHAND
|
||||
#define YES_NO MB_YESNO
|
||||
|
||||
#define ISO_BURNER_TOOL "isoburn.exe"
|
||||
#define PRINT_TOOL "notepad.exe"
|
||||
#define ISO_BURNER_TOOL L"isoburn.exe"
|
||||
#define PRINT_TOOL L"notepad.exe"
|
||||
|
||||
void cleanup ( void );
|
||||
void LowerCaseCopy ( char *lpszDest , const char *lpszSource );
|
||||
void UpperCaseCopy ( char *lpszDest , size_t cbDest, const char *lpszSource );
|
||||
void CreateFullVolumePath ( char *lpszDiskFile , size_t cbDiskFile, const char *lpszFileName , BOOL *bDevice );
|
||||
int FakeDosNameForDevice ( const char *lpszDiskFile , char *lpszDosDevice , size_t cbDosDevice, char *lpszCFDevice , size_t cbCFDevice, BOOL bNameOnly );
|
||||
int RemoveFakeDosName ( char *lpszDiskFile , char *lpszDosDevice );
|
||||
void LowerCaseCopy ( wchar_t *lpszDest , const wchar_t *lpszSource );
|
||||
void UpperCaseCopy ( wchar_t *lpszDest , size_t cbDest, const wchar_t *lpszSource );
|
||||
void CreateFullVolumePath ( wchar_t *lpszDiskFile , size_t cbDiskFile, const wchar_t *lpszFileName , BOOL *bDevice );
|
||||
int FakeDosNameForDevice ( const wchar_t *lpszDiskFile , wchar_t *lpszDosDevice , size_t cbDosDevice, wchar_t *lpszCFDevice , size_t cbCFDevice, BOOL bNameOnly );
|
||||
int RemoveFakeDosName ( wchar_t *lpszDiskFile , wchar_t *lpszDosDevice );
|
||||
void AbortProcessDirect ( wchar_t *abortMsg );
|
||||
void AbortProcess ( char *stringId );
|
||||
void AbortProcessSilent ( void );
|
||||
@@ -251,13 +251,11 @@ void DisplayStaticModelessWaitDlg (HWND parent);
|
||||
void CloseStaticModelessWaitDlg (void);
|
||||
BOOL IsButtonChecked ( HWND hButton );
|
||||
void CheckButton ( HWND hButton );
|
||||
void LeftPadString (char *szTmp, int len, int targetLen, char filler);
|
||||
void ToSBCS ( LPWSTR lpszText, size_t cbSize );
|
||||
void ToUNICODE ( char *lpszText , size_t cbSize);
|
||||
void LeftPadString (wchar_t *szTmp, int len, int targetLen, wchar_t filler);
|
||||
void InitDialog ( HWND hwndDlg );
|
||||
void ProcessPaintMessages (HWND hwnd, int maxMessagesToProcess);
|
||||
HDC CreateMemBitmap ( HINSTANCE hInstance , HWND hwnd , char *resource );
|
||||
HBITMAP RenderBitmap ( char *resource , HWND hwndDest , int x , int y , int nWidth , int nHeight , BOOL bDirectRender , BOOL bKeepAspectRatio);
|
||||
HDC CreateMemBitmap ( HINSTANCE hInstance , HWND hwnd , wchar_t *resource );
|
||||
HBITMAP RenderBitmap ( wchar_t *resource , HWND hwndDest , int x , int y , int nWidth , int nHeight , BOOL bDirectRender , BOOL bKeepAspectRatio);
|
||||
LRESULT CALLBACK RedTick ( HWND hwnd , UINT uMsg , WPARAM wParam , LPARAM lParam );
|
||||
BOOL RegisterRedTick ( HINSTANCE hInstance );
|
||||
BOOL UnregisterRedTick ( HINSTANCE hInstance );
|
||||
@@ -271,11 +269,11 @@ void AddComboPairW (HWND hComboBox, const wchar_t *lpszItem, int value);
|
||||
void SelectAlgo ( HWND hComboBox , int *nCipher );
|
||||
void PopulateWipeModeCombo (HWND hComboBox, BOOL bNA, BOOL bInPlaceEncryption, BOOL bHeaderWipe);
|
||||
wchar_t *GetWipeModeName (WipeAlgorithmId modeId);
|
||||
wchar_t *GetPathType (const char *path, BOOL bUpperCase, BOOL *bIsPartition);
|
||||
wchar_t *GetPathType (const wchar_t *path, BOOL bUpperCase, BOOL *bIsPartition);
|
||||
LRESULT CALLBACK CustomDlgProc ( HWND hwnd , UINT uMsg , WPARAM wParam , LPARAM lParam );
|
||||
BOOL TCCreateMutex (volatile HANDLE *hMutex, char *name);
|
||||
BOOL TCCreateMutex (volatile HANDLE *hMutex, wchar_t *name);
|
||||
void TCCloseMutex (volatile HANDLE *hMutex);
|
||||
BOOL MutexExistsOnSystem (char *name);
|
||||
BOOL MutexExistsOnSystem (wchar_t *name);
|
||||
BOOL CreateSysEncMutex (void);
|
||||
BOOL InstanceHasSysEncMutex (void);
|
||||
void CloseSysEncMutex (void);
|
||||
@@ -297,15 +295,15 @@ void RemoveNonSysInPlaceEncNotifications (void);
|
||||
void SavePostInstallTasksSettings (int command);
|
||||
void DoPostInstallTasks (HWND hwndDlg);
|
||||
void InitOSVersionInfo ();
|
||||
void InitApp ( HINSTANCE hInstance, char *lpszCommandLine );
|
||||
void InitApp ( HINSTANCE hInstance, wchar_t *lpszCommandLine );
|
||||
void FinalizeApp (void);
|
||||
void InitHelpFileName (void);
|
||||
BOOL OpenDevice (const char *lpszPath, OPEN_TEST_STRUCT *driver, BOOL detectFilesystem);
|
||||
BOOL OpenDevice (const wchar_t *lpszPath, OPEN_TEST_STRUCT *driver, BOOL detectFilesystem);
|
||||
void NotifyDriverOfPortableMode (void);
|
||||
int GetAvailableFixedDisks ( HWND hComboBox , char *lpszRootPath );
|
||||
int GetAvailableRemovables ( HWND hComboBox , char *lpszRootPath );
|
||||
int IsSystemDevicePath (const char *path, HWND hwndDlg, BOOL bReliableRequired);
|
||||
int IsNonSysPartitionOnSysDrive (const char *path);
|
||||
int IsSystemDevicePath (const wchar_t *path, HWND hwndDlg, BOOL bReliableRequired);
|
||||
int IsNonSysPartitionOnSysDrive (const wchar_t *path);
|
||||
BOOL CALLBACK RawDevicesDlgProc ( HWND hwndDlg , UINT msg , WPARAM wParam , LPARAM lParam );
|
||||
INT_PTR TextInfoDialogBox (int nID);
|
||||
BOOL CALLBACK TextInfoDialogBoxDlgProc (HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam);
|
||||
@@ -318,50 +316,49 @@ int DriverAttach ( void );
|
||||
BOOL CALLBACK CipherTestDialogProc ( HWND hwndDlg , UINT uMsg , WPARAM wParam , LPARAM lParam );
|
||||
void ResetCipherTest ( HWND hwndDlg , int idTestCipher );
|
||||
void ResetCurrentDirectory ();
|
||||
BOOL BrowseFiles (HWND hwndDlg, char *stringId, char *lpszFileName, BOOL keepHistory, BOOL saveMode, wchar_t *browseFilter);
|
||||
BOOL BrowseDirectories (HWND hWnd, char *lpszTitle, char *dirName);
|
||||
BOOL BrowseFiles (HWND hwndDlg, char *stringId, wchar_t *lpszFileName, BOOL keepHistory, BOOL saveMode, wchar_t *browseFilter);
|
||||
BOOL BrowseDirectories (HWND hWnd, char *lpszTitle, wchar_t *dirName);
|
||||
void handleError ( HWND hwndDlg , int code, const char* srcPos );
|
||||
BOOL CheckFileStreamWriteErrors (HWND hwndDlg, FILE *file, const char *fileName);
|
||||
BOOL CheckFileStreamWriteErrors (HWND hwndDlg, FILE *file, const wchar_t *fileName);
|
||||
void LocalizeDialog ( HWND hwnd, char *stringId );
|
||||
void OpenVolumeExplorerWindow (int driveNo);
|
||||
static BOOL CALLBACK CloseVolumeExplorerWindowsEnum( HWND hwnd, LPARAM driveNo);
|
||||
BOOL CloseVolumeExplorerWindows (HWND hwnd, int driveNo);
|
||||
BOOL UpdateDriveCustomLabel (int driveNo, wchar_t* effectiveLabel, BOOL bSetValue);
|
||||
BOOL CheckCapsLock (HWND hwnd, BOOL quiet);
|
||||
BOOL CheckFileExtension (char *fileName);
|
||||
void CorrectFileName (char* fileName);
|
||||
BOOL CheckFileExtension (wchar_t *fileName);
|
||||
void CorrectFileName (wchar_t* fileName);
|
||||
void IncreaseWrongPwdRetryCount (int count);
|
||||
void ResetWrongPwdRetryCount (void);
|
||||
BOOL WrongPwdRetryCountOverLimit (void);
|
||||
int GetFirstAvailableDrive ();
|
||||
int GetLastAvailableDrive ();
|
||||
BOOL IsDriveAvailable (int driveNo);
|
||||
BOOL IsDeviceMounted (char *deviceName);
|
||||
BOOL IsDeviceMounted (wchar_t *deviceName);
|
||||
int DriverUnmountVolume (HWND hwndDlg, int nDosDriveNo, BOOL forced);
|
||||
void BroadcastDeviceChange (WPARAM message, int nDosDriveNo, DWORD driveMap);
|
||||
int MountVolume (HWND hwndDlg, int driveNo, char *volumePath, Password *password, int pkcs5, int pim, BOOL truecryptMode, BOOL cachePassword, BOOL sharedAccess, const MountOptions* const mountOptions, BOOL quiet, BOOL bReportWrongPassword);
|
||||
int MountVolume (HWND hwndDlg, int driveNo, wchar_t *volumePath, Password *password, int pkcs5, int pim, BOOL truecryptMode, BOOL cachePassword, BOOL sharedAccess, const MountOptions* const mountOptions, BOOL quiet, BOOL bReportWrongPassword);
|
||||
BOOL UnmountVolume (HWND hwndDlg , int nDosDriveNo, BOOL forceUnmount);
|
||||
BOOL UnmountVolumeAfterFormatExCall (HWND hwndDlg, int nDosDriveNo);
|
||||
BOOL IsPasswordCacheEmpty (void);
|
||||
BOOL IsMountedVolume (const char *volname);
|
||||
int GetMountedVolumeDriveNo (char *volname);
|
||||
BOOL IsMountedVolume (const wchar_t *volname);
|
||||
int GetMountedVolumeDriveNo (wchar_t *volname);
|
||||
BOOL IsAdmin (void);
|
||||
BOOL IsBuiltInAdmin ();
|
||||
BOOL IsUacSupported ();
|
||||
BOOL ResolveSymbolicLink (const wchar_t *symLinkName, PWSTR targetName, size_t cbTargetName);
|
||||
int GetDiskDeviceDriveLetter (PWSTR deviceName);
|
||||
int FileSystemAppearsEmpty (const char *devicePath);
|
||||
__int64 GetStatsFreeSpaceOnPartition (const char *devicePath, float *percent, __int64 *occupiedBytes, BOOL silent);
|
||||
__int64 GetDeviceSize (const char *devicePath);
|
||||
HANDLE DismountDrive (char *devName, char *devicePath);
|
||||
int FileSystemAppearsEmpty (const wchar_t *devicePath);
|
||||
__int64 GetStatsFreeSpaceOnPartition (const wchar_t *devicePath, float *percent, __int64 *occupiedBytes, BOOL silent);
|
||||
__int64 GetDeviceSize (const wchar_t *devicePath);
|
||||
HANDLE DismountDrive (wchar_t *devName, wchar_t *devicePath);
|
||||
int64 FindString (const char *buf, const char *str, int64 bufLen, int64 strLen, int64 startOffset);
|
||||
BOOL FileExists (const char *filePathPtr);
|
||||
__int64 FindStringInFile (const char *filePath, const char *str, int strLen);
|
||||
BOOL TCCopyFile (char *sourceFileName, char *destinationFile);
|
||||
BOOL TCCopyFileW (wchar_t *sourceFileName, wchar_t *destinationFile);
|
||||
BOOL SaveBufferToFile (const char *inputBuffer, const char *destinationFile, DWORD inputLength, BOOL bAppend, BOOL bRenameIfFailed);
|
||||
BOOL FileExists (const wchar_t *filePathPtr);
|
||||
__int64 FindStringInFile (const wchar_t *filePath, const char *str, int strLen);
|
||||
BOOL TCCopyFile (wchar_t *sourceFileName, wchar_t *destinationFile);
|
||||
BOOL SaveBufferToFile (const char *inputBuffer, const wchar_t *destinationFile, DWORD inputLength, BOOL bAppend, BOOL bRenameIfFailed);
|
||||
BOOL TCFlushFile (FILE *f);
|
||||
BOOL PrintHardCopyTextUTF16 (wchar_t *text, char *title, size_t byteLen);
|
||||
BOOL PrintHardCopyTextUTF16 (wchar_t *text, wchar_t *title, size_t byteLen);
|
||||
void GetSpeedString (unsigned __int64 speed, wchar_t *str, size_t cbStr);
|
||||
BOOL IsNonInstallMode ();
|
||||
BOOL DriverUnload ();
|
||||
@@ -369,25 +366,23 @@ LRESULT SetCheckBox (HWND hwndDlg, int dlgItem, BOOL state);
|
||||
BOOL GetCheckBox (HWND hwndDlg, int dlgItem);
|
||||
void SetListScrollHPos (HWND hList, int topMostVisibleItem);
|
||||
void ManageStartupSeq (void);
|
||||
void ManageStartupSeqWiz (BOOL bRemove, const char *arg);
|
||||
void ManageStartupSeqWiz (BOOL bRemove, const wchar_t *arg);
|
||||
void CleanLastVisitedMRU (void);
|
||||
void ClearHistory (HWND hwndDlgItem);
|
||||
LRESULT ListItemAdd (HWND list, int index, char *string);
|
||||
LRESULT ListItemAddW (HWND list, int index, wchar_t *string);
|
||||
LRESULT ListSubItemSet (HWND list, int index, int subIndex, char *string);
|
||||
LRESULT ListSubItemSetW (HWND list, int index, int subIndex, wchar_t *string);
|
||||
LRESULT ListItemAdd (HWND list, int index, const wchar_t *string);
|
||||
LRESULT ListSubItemSet (HWND list, int index, int subIndex, const wchar_t *string);
|
||||
BOOL GetMountList (MOUNT_LIST_STRUCT *list);
|
||||
int GetDriverRefCount ();
|
||||
void GetSizeString (unsigned __int64 size, wchar_t *str, size_t cbStr);
|
||||
__int64 GetFileSize64 (const char *path);
|
||||
BOOL LoadInt16 (char *filePath, int *result, __int64 fileOffset);
|
||||
BOOL LoadInt32 (char *filePath, unsigned __int32 *result, __int64 fileOffset);
|
||||
char *LoadFile (const char *fileName, DWORD *size);
|
||||
char *LoadFileBlock (char *fileName, __int64 fileOffset, DWORD count);
|
||||
char *GetModPath (char *path, int maxSize);
|
||||
char *GetConfigPath (char *fileName);
|
||||
char *GetProgramConfigPath (char *fileName);
|
||||
char GetSystemDriveLetter (void);
|
||||
__int64 GetFileSize64 (const wchar_t *path);
|
||||
BOOL LoadInt16 (const wchar_t *filePath, int *result, __int64 fileOffset);
|
||||
BOOL LoadInt32 (const wchar_t *filePath, unsigned __int32 *result, __int64 fileOffset);
|
||||
char *LoadFile (const wchar_t *fileName, DWORD *size);
|
||||
char *LoadFileBlock (const wchar_t *fileName, __int64 fileOffset, DWORD count);
|
||||
wchar_t *GetModPath (wchar_t *path, int maxSize);
|
||||
wchar_t *GetConfigPath (wchar_t *fileName);
|
||||
wchar_t *GetProgramConfigPath (wchar_t *fileName);
|
||||
wchar_t GetSystemDriveLetter (void);
|
||||
void OpenPageHelp (HWND hwndDlg, int nPage);
|
||||
void TaskBarIconDisplayBalloonTooltip (HWND hwnd, wchar_t *headline, wchar_t *text, BOOL warning);
|
||||
void InfoBalloon (char *headingStringId, char *textStringId, HWND hwnd);
|
||||
@@ -425,6 +420,7 @@ int AskMultiChoice (void *strings[], BOOL bBold, HWND hwnd);
|
||||
BOOL ConfigWriteBegin ();
|
||||
BOOL ConfigWriteEnd (HWND hwnd);
|
||||
BOOL ConfigWriteString (char *configKey, char *configValue);
|
||||
BOOL ConfigWriteStringW (char *configKey, wchar_t *configValue);
|
||||
BOOL ConfigWriteInt (char *configKey, int configValue);
|
||||
int ConfigReadInt (char *configKey, int defaultValue);
|
||||
char *ConfigReadString (char *configKey, char *defaultValue, char *str, int maxLen);
|
||||
@@ -442,20 +438,20 @@ BOOL IsHiddenOSRunning (void);
|
||||
BOOL EnableWow64FsRedirection (BOOL enable);
|
||||
BOOL RestartComputer (void);
|
||||
void Applink (char *dest, BOOL bSendOS, char *extraOutput);
|
||||
char *RelativePath2Absolute (char *szFileName);
|
||||
wchar_t *RelativePath2Absolute (wchar_t *szFileName);
|
||||
void HandleDriveNotReadyError (HWND hwnd);
|
||||
BOOL CALLBACK CloseTCWindowsEnum( HWND hwnd, LPARAM lParam);
|
||||
BOOL CALLBACK FindTCWindowEnum (HWND hwnd, LPARAM lParam);
|
||||
BYTE *MapResource (char *resourceType, int resourceId, PDWORD size);
|
||||
BYTE *MapResource (wchar_t *resourceType, int resourceId, PDWORD size);
|
||||
void InconsistencyResolved (char *msg);
|
||||
void ReportUnexpectedState (char *techInfo);
|
||||
BOOL SelectMultipleFiles (HWND hwndDlg, const char *stringId, char *lpszFileName, size_t cbFileName, BOOL keepHistory);
|
||||
BOOL SelectMultipleFilesNext (char *lpszFileName, size_t cbFileName);
|
||||
BOOL SelectMultipleFiles (HWND hwndDlg, const char *stringId, wchar_t *lpszFileName, size_t cbFileName, BOOL keepHistory);
|
||||
BOOL SelectMultipleFilesNext (wchar_t *lpszFileName, size_t cbFileName);
|
||||
void OpenOnlineHelp ();
|
||||
BOOL GetPartitionInfo (const char *deviceName, PPARTITION_INFORMATION rpartInfo);
|
||||
BOOL GetDeviceInfo (const char *deviceName, DISK_PARTITION_INFO_STRUCT *info);
|
||||
BOOL GetDriveGeometry (const char *deviceName, PDISK_GEOMETRY diskGeometry);
|
||||
BOOL IsVolumeDeviceHosted (const char *lpszDiskFile);
|
||||
BOOL GetPartitionInfo (const wchar_t *deviceName, PPARTITION_INFORMATION rpartInfo);
|
||||
BOOL GetDeviceInfo (const wchar_t *deviceName, DISK_PARTITION_INFO_STRUCT *info);
|
||||
BOOL GetDriveGeometry (const wchar_t *deviceName, PDISK_GEOMETRY diskGeometry);
|
||||
BOOL IsVolumeDeviceHosted (const wchar_t *lpszDiskFile);
|
||||
int CompensateXDPI (int val);
|
||||
int CompensateYDPI (int val);
|
||||
int CompensateDPIFont (int val);
|
||||
@@ -470,7 +466,7 @@ void AccommodateTextField (HWND hwndDlg, UINT ctrlId, BOOL bFirstUpdate, HFONT h
|
||||
BOOL GetDriveLabel (int driveNo, wchar_t *label, int labelSize);
|
||||
BOOL GetSysDevicePaths (HWND hwndDlg);
|
||||
BOOL DoDriverInstall (HWND hwndDlg);
|
||||
int OpenVolume (OpenVolumeContext *context, const char *volumePath, Password *password, int pkcs5_prf, int pim, BOOL truecryptMode, BOOL write, BOOL preserveTimestamps, BOOL useBackupHeader);
|
||||
int OpenVolume (OpenVolumeContext *context, const wchar_t *volumePath, Password *password, int pkcs5_prf, int pim, BOOL truecryptMode, BOOL write, BOOL preserveTimestamps, BOOL useBackupHeader);
|
||||
void CloseVolume (OpenVolumeContext *context);
|
||||
int ReEncryptVolumeHeader (HWND hwndDlg, char *buffer, BOOL bBoot, CRYPTO_INFO *cryptoInfo, Password *password, int pim, BOOL wipeMode);
|
||||
BOOL IsPagingFileActive (BOOL checkNonWindowsPartitionsOnly);
|
||||
@@ -479,20 +475,22 @@ BOOL DisablePagingFile ();
|
||||
BOOL CALLBACK SecurityTokenPasswordDlgProc (HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam);
|
||||
BOOL CALLBACK SecurityTokenKeyfileDlgProc (HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam);
|
||||
BOOL InitSecurityTokenLibrary (HWND hwndDlg);
|
||||
BOOL FileHasReadOnlyAttribute (const char *path);
|
||||
BOOL IsFileOnReadOnlyFilesystem (const char *path);
|
||||
BOOL FileHasReadOnlyAttribute (const wchar_t *path);
|
||||
BOOL IsFileOnReadOnlyFilesystem (const wchar_t *path);
|
||||
void CheckFilesystem (HWND hwndDlg, int driveNo, BOOL fixErrors);
|
||||
BOOL BufferContainsString (const byte *buffer, size_t bufferSize, const char *str);
|
||||
int AskNonSysInPlaceEncryptionResume (HWND hwndDlg, BOOL* pbDecrypt);
|
||||
BOOL RemoveDeviceWriteProtection (HWND hwndDlg, char *devicePath);
|
||||
BOOL RemoveDeviceWriteProtection (HWND hwndDlg, wchar_t *devicePath);
|
||||
void EnableElevatedCursorChange (HWND parent);
|
||||
BOOL DisableFileCompression (HANDLE file);
|
||||
BOOL VolumePathExists (const char *volumePath);
|
||||
BOOL VolumePathExists (const wchar_t *volumePath);
|
||||
BOOL IsWindowsIsoBurnerAvailable ();
|
||||
BOOL LaunchWindowsIsoBurner (HWND hwnd, const char *isoPath);
|
||||
BOOL IsApplicationInstalled (const char *appName);
|
||||
BOOL LaunchWindowsIsoBurner (HWND hwnd, const wchar_t *isoPath);
|
||||
BOOL IsApplicationInstalled (const wchar_t *appName);
|
||||
int GetPim (HWND hwndDlg, UINT ctrlId);
|
||||
void SetPim (HWND hwndDlg, UINT ctrlId, int pim);
|
||||
BOOL GetPassword (HWND hwndDlg, UINT ctrlID, char* passValue, int bufSize, BOOL bShowError);
|
||||
void SetPassword (HWND hwndDlg, UINT ctrlID, char* passValue);
|
||||
void HandleShowPasswordFieldAction (HWND hwndDlg, UINT checkBoxId, UINT edit1Id, UINT edit2Id);
|
||||
|
||||
#ifdef __cplusplus
|
||||
@@ -527,9 +525,9 @@ struct HostDevice
|
||||
bool IsPartition;
|
||||
bool IsVirtualPartition;
|
||||
bool HasUnencryptedFilesystem;
|
||||
std::string MountPoint;
|
||||
std::wstring MountPoint;
|
||||
std::wstring Name;
|
||||
std::string Path;
|
||||
std::wstring Path;
|
||||
bool Removable;
|
||||
uint64 Size;
|
||||
uint32 SystemNumber;
|
||||
@@ -540,10 +538,10 @@ struct HostDevice
|
||||
struct RawDevicesDlgParam
|
||||
{
|
||||
std::vector <HostDevice> devices;
|
||||
char *pszFileName;
|
||||
wchar_t *pszFileName;
|
||||
};
|
||||
|
||||
BOOL BrowseFilesInDir (HWND hwndDlg, char *stringId, char *initialDir, char *lpszFileName, BOOL keepHistory, BOOL saveMode, wchar_t *browseFilter, const wchar_t *initialFileName = NULL, const wchar_t *defaultExtension = NULL);
|
||||
BOOL BrowseFilesInDir (HWND hwndDlg, char *stringId, wchar_t *initialDir, wchar_t *lpszFileName, BOOL keepHistory, BOOL saveMode, wchar_t *browseFilter, const wchar_t *initialFileName = NULL, const wchar_t *defaultExtension = NULL);
|
||||
std::wstring SingleStringToWide (const std::string &singleString);
|
||||
std::wstring Utf8StringToWide (const std::string &utf8String);
|
||||
std::string WideToSingleString (const std::wstring &wideString);
|
||||
@@ -551,14 +549,15 @@ std::string WideToUtf8String (const std::wstring &wideString);
|
||||
std::string StringToUpperCase (const std::string &str);
|
||||
std::vector <HostDevice> GetAvailableHostDevices (bool noDeviceProperties = false, bool singleList = false, bool noFloppy = true, bool detectUnencryptedFilesystems = false);
|
||||
std::string ToUpperCase (const std::string &str);
|
||||
std::wstring ToUpperCase (const std::wstring &str);
|
||||
std::wstring GetWrongPasswordErrorMessage (HWND hwndDlg);
|
||||
std::string GetWindowsEdition ();
|
||||
std::string FitPathInGfxWidth (HWND hwnd, HFONT hFont, LONG width, const std::string &path);
|
||||
std::string GetServiceConfigPath (const char *fileName, bool useLegacy);
|
||||
std::string VolumeGuidPathToDevicePath (std::string volumeGuidPath);
|
||||
std::string HarddiskVolumePathToPartitionPath (const std::string &harddiskVolumePath);
|
||||
std::string FindLatestFileOrDirectory (const std::string &directory, const char *namePattern, bool findDirectory, bool findFile);
|
||||
std::string GetUserFriendlyVersionString (int version);
|
||||
std::wstring GetWindowsEdition ();
|
||||
std::wstring FitPathInGfxWidth (HWND hwnd, HFONT hFont, LONG width, const std::wstring &path);
|
||||
std::wstring GetServiceConfigPath (const wchar_t *fileName, bool useLegacy);
|
||||
std::wstring VolumeGuidPathToDevicePath (std::wstring volumeGuidPath);
|
||||
std::wstring HarddiskVolumePathToPartitionPath (const std::wstring &harddiskVolumePath);
|
||||
std::wstring FindLatestFileOrDirectory (const std::wstring &directory, const wchar_t *namePattern, bool findDirectory, bool findFile);
|
||||
std::wstring GetUserFriendlyVersionString (int version);
|
||||
std::string IntToString (int val);
|
||||
std::wstring IntToWideString (int val);
|
||||
inline std::wstring AppendSrcPos (const wchar_t* msg, const char* srcPos)
|
||||
|
||||
@@ -64,7 +64,7 @@ namespace VeraCrypt
|
||||
void Show (HWND parent) const
|
||||
{
|
||||
string msgBody = "Parameter incorrect.\n\n\n(If you report a bug in connection with this, please include the following technical information in the bug report:\n" + string (SrcPos) + ")";
|
||||
MessageBox (parent, msgBody.c_str(), "VeraCrypt", MB_ICONERROR | MB_SETFOREGROUND);
|
||||
MessageBoxA (parent, msgBody.c_str(), "VeraCrypt", MB_ICONERROR | MB_SETFOREGROUND);
|
||||
}
|
||||
|
||||
const char *SrcPos;
|
||||
@@ -77,9 +77,9 @@ namespace VeraCrypt
|
||||
void Show (HWND parent) const
|
||||
{
|
||||
char szErrCode[16];
|
||||
StringCbPrintf (szErrCode, sizeof(szErrCode), "0x%.8X", LastError);
|
||||
StringCbPrintfA (szErrCode, sizeof(szErrCode), "0x%.8X", LastError);
|
||||
string msgBody = "The Random Generator initialization failed.\n\n\n(If you report a bug in connection with this, please include the following technical information in the bug report:\n" + string (SrcPos) + "\nLast Error = " + string (szErrCode) + ")";
|
||||
MessageBox (parent, msgBody.c_str(), "VeraCrypt", MB_ICONERROR | MB_SETFOREGROUND);
|
||||
MessageBoxA (parent, msgBody.c_str(), "VeraCrypt", MB_ICONERROR | MB_SETFOREGROUND);
|
||||
}
|
||||
|
||||
const char *SrcPos;
|
||||
@@ -93,9 +93,9 @@ namespace VeraCrypt
|
||||
void Show (HWND parent) const
|
||||
{
|
||||
char szErrCode[16];
|
||||
StringCbPrintf (szErrCode, sizeof(szErrCode), "0x%.8X", LastError);
|
||||
StringCbPrintfA (szErrCode, sizeof(szErrCode), "0x%.8X", LastError);
|
||||
string msgBody = "Windows Crypto API failed.\n\n\n(If you report a bug in connection with this, please include the following technical information in the bug report:\n" + string (SrcPos) + "\nLast Error = " + string (szErrCode) + ")";
|
||||
MessageBox (parent, msgBody.c_str(), "VeraCrypt", MB_ICONERROR | MB_SETFOREGROUND);
|
||||
MessageBoxA (parent, msgBody.c_str(), "VeraCrypt", MB_ICONERROR | MB_SETFOREGROUND);
|
||||
}
|
||||
|
||||
const char *SrcPos;
|
||||
|
||||
@@ -92,8 +92,8 @@ int TCFormatVolume (volatile FORMAT_VOL_PARAMETERS *volParams)
|
||||
FILETIME ftLastAccessTime;
|
||||
BOOL bTimeStampValid = FALSE;
|
||||
BOOL bInstantRetryOtherFilesys = FALSE;
|
||||
char dosDev[TC_MAX_PATH] = { 0 };
|
||||
char devName[MAX_PATH] = { 0 };
|
||||
WCHAR dosDev[TC_MAX_PATH] = { 0 };
|
||||
WCHAR devName[MAX_PATH] = { 0 };
|
||||
int driveLetter = -1;
|
||||
WCHAR deviceName[MAX_PATH];
|
||||
uint64 dataOffset, dataAreaSize;
|
||||
@@ -138,8 +138,7 @@ int TCFormatVolume (volatile FORMAT_VOL_PARAMETERS *volParams)
|
||||
|
||||
if (volParams->bDevice)
|
||||
{
|
||||
StringCbCopyA ((char *)deviceName, sizeof(deviceName), volParams->volumePath);
|
||||
ToUNICODE ((char *)deviceName, sizeof(deviceName));
|
||||
StringCbCopyW (deviceName, sizeof(deviceName), volParams->volumePath);
|
||||
|
||||
driveLetter = GetDiskDeviceDriveLetter (deviceName);
|
||||
}
|
||||
@@ -213,9 +212,9 @@ begin_format:
|
||||
// to which no drive letter has been assigned under the system. This problem can be worked
|
||||
// around by assigning a drive letter to the partition temporarily.
|
||||
|
||||
char szDriveLetter[] = { 'A', ':', 0 };
|
||||
char rootPath[] = { 'A', ':', '\\', 0 };
|
||||
char uniqVolName[MAX_PATH+1] = { 0 };
|
||||
wchar_t szDriveLetter[] = { L'A', L':', 0 };
|
||||
wchar_t rootPath[] = { L'A', L':', L'\\', 0 };
|
||||
wchar_t uniqVolName[MAX_PATH+1] = { 0 };
|
||||
int tmpDriveLetter = -1;
|
||||
BOOL bResult = FALSE;
|
||||
|
||||
@@ -223,8 +222,8 @@ begin_format:
|
||||
|
||||
if (tmpDriveLetter != -1)
|
||||
{
|
||||
rootPath[0] += (char) tmpDriveLetter;
|
||||
szDriveLetter[0] += (char) tmpDriveLetter;
|
||||
rootPath[0] += (wchar_t) tmpDriveLetter;
|
||||
szDriveLetter[0] += (wchar_t) tmpDriveLetter;
|
||||
|
||||
if (DefineDosDevice (DDD_RAW_TARGET_PATH, szDriveLetter, volParams->volumePath))
|
||||
{
|
||||
@@ -863,25 +862,25 @@ BOOLEAN __stdcall FormatExCallback (int command, DWORD subCommand, PVOID paramet
|
||||
|
||||
BOOL FormatNtfs (int driveNo, int clusterSize)
|
||||
{
|
||||
char dllPath[MAX_PATH] = {0};
|
||||
WCHAR dir[8] = { (WCHAR) driveNo + 'A', 0 };
|
||||
wchar_t dllPath[MAX_PATH] = {0};
|
||||
WCHAR dir[8] = { (WCHAR) driveNo + L'A', 0 };
|
||||
PFORMATEX FormatEx;
|
||||
HMODULE hModule;
|
||||
int i;
|
||||
|
||||
if (GetSystemDirectory (dllPath, MAX_PATH))
|
||||
{
|
||||
StringCbCatA(dllPath, sizeof(dllPath), "\\fmifs.dll");
|
||||
StringCbCatW(dllPath, sizeof(dllPath), L"\\fmifs.dll");
|
||||
}
|
||||
else
|
||||
StringCbCopyA(dllPath, sizeof(dllPath), "C:\\Windows\\System32\\fmifs.dll");
|
||||
StringCbCopyW(dllPath, sizeof(dllPath), L"C:\\Windows\\System32\\fmifs.dll");
|
||||
|
||||
hModule = LoadLibrary (dllPath);
|
||||
|
||||
if (hModule == NULL)
|
||||
return FALSE;
|
||||
|
||||
if (!(FormatEx = (PFORMATEX) GetProcAddress (GetModuleHandle ("fmifs.dll"), "FormatEx")))
|
||||
if (!(FormatEx = (PFORMATEX) GetProcAddress (GetModuleHandle (L"fmifs.dll"), "FormatEx")))
|
||||
{
|
||||
FreeLibrary (hModule);
|
||||
return FALSE;
|
||||
|
||||
@@ -28,7 +28,7 @@ typedef struct
|
||||
{
|
||||
BOOL bDevice;
|
||||
BOOL hiddenVol;
|
||||
char *volumePath;
|
||||
wchar_t *volumePath;
|
||||
unsigned __int64 size;
|
||||
unsigned __int64 hiddenVolHostSize;
|
||||
int ea;
|
||||
|
||||
@@ -112,7 +112,7 @@ KeyFile *KeyFileClone (KeyFile *keyFile)
|
||||
clone = (KeyFile *) malloc (sizeof (KeyFile));
|
||||
if (clone)
|
||||
{
|
||||
StringCbCopyA (clone->FileName, sizeof(clone->FileName), keyFile->FileName);
|
||||
StringCbCopyW (clone->FileName, sizeof(clone->FileName), keyFile->FileName);
|
||||
clone->Next = NULL;
|
||||
}
|
||||
return clone;
|
||||
@@ -170,7 +170,7 @@ static BOOL KeyFileProcess (unsigned __int8 *keyPool, KeyFile *keyFile)
|
||||
CloseHandle (finally_arg);
|
||||
});
|
||||
|
||||
f = fopen (keyFile->FileName, "rb");
|
||||
f = _wfopen (keyFile->FileName, L"rb");
|
||||
if (f == NULL) return FALSE;
|
||||
|
||||
while ((bytesRead = fread (buffer, 1, sizeof (buffer), f)) > 0)
|
||||
@@ -225,7 +225,7 @@ close:
|
||||
}
|
||||
|
||||
|
||||
BOOL KeyFilesApply (HWND hwndDlg, Password *password, KeyFile *firstKeyFile, const char* volumeFileName)
|
||||
BOOL KeyFilesApply (HWND hwndDlg, Password *password, KeyFile *firstKeyFile, const wchar_t* volumeFileName)
|
||||
{
|
||||
BOOL status = TRUE;
|
||||
KeyFile kfSubStruct;
|
||||
@@ -234,8 +234,8 @@ BOOL KeyFilesApply (HWND hwndDlg, Password *password, KeyFile *firstKeyFile, con
|
||||
static unsigned __int8 keyPool [KEYFILE_POOL_SIZE];
|
||||
size_t i;
|
||||
struct stat statStruct;
|
||||
char searchPath [TC_MAX_PATH*2];
|
||||
struct _finddata_t fBuf;
|
||||
wchar_t searchPath [TC_MAX_PATH*2];
|
||||
struct _wfinddata_t fBuf;
|
||||
intptr_t searchHandle;
|
||||
|
||||
HiddenFilesPresentInKeyfilePath = FALSE;
|
||||
@@ -250,11 +250,12 @@ BOOL KeyFilesApply (HWND hwndDlg, Password *password, KeyFile *firstKeyFile, con
|
||||
// Determine whether it's a security token path
|
||||
try
|
||||
{
|
||||
if (SecurityToken::IsKeyfilePathValid (SingleStringToWide (kf->FileName)))
|
||||
if (SecurityToken::IsKeyfilePathValid (kf->FileName))
|
||||
{
|
||||
// Apply security token keyfile
|
||||
vector <byte> keyfileData;
|
||||
SecurityToken::GetKeyfileData (SecurityTokenKeyfile (SingleStringToWide (kf->FileName)), keyfileData);
|
||||
SecurityTokenKeyfilePath secPath (kf->FileName);
|
||||
SecurityToken::GetKeyfileData (SecurityTokenKeyfile (secPath), keyfileData);
|
||||
|
||||
if (keyfileData.empty())
|
||||
{
|
||||
@@ -296,7 +297,7 @@ BOOL KeyFilesApply (HWND hwndDlg, Password *password, KeyFile *firstKeyFile, con
|
||||
}
|
||||
|
||||
// Determine whether it's a path or a file
|
||||
if (stat (kf->FileName, &statStruct) != 0)
|
||||
if (_wstat (kf->FileName, &statStruct) != 0)
|
||||
{
|
||||
handleWin32Error (hwndDlg, SRC_POS);
|
||||
Error ("ERR_PROCESS_KEYFILE", hwndDlg);
|
||||
@@ -309,8 +310,8 @@ BOOL KeyFilesApply (HWND hwndDlg, Password *password, KeyFile *firstKeyFile, con
|
||||
/* Find and process all keyfiles in the directory */
|
||||
int keyfileCount = 0;
|
||||
|
||||
StringCbPrintfA (searchPath, sizeof (searchPath), "%s\\*.*", kf->FileName);
|
||||
if ((searchHandle = _findfirst (searchPath, &fBuf)) == -1)
|
||||
StringCbPrintfW (searchPath, sizeof (searchPath), L"%s\\*.*", kf->FileName);
|
||||
if ((searchHandle = _wfindfirst (searchPath, &fBuf)) == -1)
|
||||
{
|
||||
handleWin32Error (hwndDlg, SRC_POS);
|
||||
Error ("ERR_PROCESS_KEYFILE_PATH", hwndDlg);
|
||||
@@ -322,13 +323,13 @@ BOOL KeyFilesApply (HWND hwndDlg, Password *password, KeyFile *firstKeyFile, con
|
||||
{
|
||||
WIN32_FILE_ATTRIBUTE_DATA fileAttributes;
|
||||
|
||||
StringCbPrintfA (kfSub->FileName, sizeof(kfSub->FileName), "%s%c%s", kf->FileName,
|
||||
'\\',
|
||||
StringCbPrintfW (kfSub->FileName, sizeof(kfSub->FileName), L"%s%c%s", kf->FileName,
|
||||
L'\\',
|
||||
fBuf.name
|
||||
);
|
||||
|
||||
// Determine whether it's a path or a file
|
||||
if (stat (kfSub->FileName, &statStruct) != 0)
|
||||
if (_wstat (kfSub->FileName, &statStruct) != 0)
|
||||
{
|
||||
handleWin32Error (hwndDlg, SRC_POS);
|
||||
Error ("ERR_PROCESS_KEYFILE", hwndDlg);
|
||||
@@ -342,7 +343,7 @@ BOOL KeyFilesApply (HWND hwndDlg, Password *password, KeyFile *firstKeyFile, con
|
||||
}
|
||||
|
||||
// Skip hidden files
|
||||
if (GetFileAttributesEx (kfSub->FileName, GetFileExInfoStandard, &fileAttributes)
|
||||
if (GetFileAttributesExW (kfSub->FileName, GetFileExInfoStandard, &fileAttributes)
|
||||
&& (fileAttributes.dwFileAttributes & FILE_ATTRIBUTE_HIDDEN) != 0)
|
||||
{
|
||||
HiddenFilesPresentInKeyfilePath = TRUE;
|
||||
@@ -350,7 +351,7 @@ BOOL KeyFilesApply (HWND hwndDlg, Password *password, KeyFile *firstKeyFile, con
|
||||
}
|
||||
|
||||
CorrectFileName (kfSub->FileName);
|
||||
if (volumeFileName && (_stricmp (volumeFileName, kfSub->FileName) == 0))
|
||||
if (volumeFileName && (_wcsicmp (volumeFileName, kfSub->FileName) == 0))
|
||||
{
|
||||
// skip if it is the current container file name
|
||||
continue;
|
||||
@@ -366,14 +367,14 @@ BOOL KeyFilesApply (HWND hwndDlg, Password *password, KeyFile *firstKeyFile, con
|
||||
status = FALSE;
|
||||
}
|
||||
|
||||
} while (_findnext (searchHandle, &fBuf) != -1);
|
||||
} while (_wfindnext (searchHandle, &fBuf) != -1);
|
||||
_findclose (searchHandle);
|
||||
|
||||
burn (&kfSubStruct, sizeof (kfSubStruct));
|
||||
|
||||
if (keyfileCount == 0)
|
||||
{
|
||||
ErrorDirect ((wstring (GetString ("ERR_KEYFILE_PATH_EMPTY")) + L"\n\n" + SingleStringToWide (kf->FileName)).c_str(), hwndDlg);
|
||||
ErrorDirect ((wstring (GetString ("ERR_KEYFILE_PATH_EMPTY")) + L"\n\n" + wstring (kf->FileName)).c_str(), hwndDlg);
|
||||
status = FALSE;
|
||||
}
|
||||
}
|
||||
@@ -499,7 +500,7 @@ BOOL CALLBACK KeyFilesDlgProc (HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPa
|
||||
do
|
||||
{
|
||||
CorrectFileName (kf->FileName);
|
||||
if (_stricmp (param->VolumeFileName, kf->FileName) == 0)
|
||||
if (_wcsicmp (param->VolumeFileName, kf->FileName) == 0)
|
||||
containerFileSkipped = true;
|
||||
else
|
||||
{
|
||||
@@ -547,7 +548,7 @@ BOOL CALLBACK KeyFilesDlgProc (HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPa
|
||||
KeyFile *kf = (KeyFile *) malloc (sizeof (KeyFile));
|
||||
if (kf)
|
||||
{
|
||||
strcpy_s (kf->FileName, sizeof (kf->FileName), WideToSingleString (keyPath).c_str());
|
||||
StringCbCopyW (kf->FileName, sizeof (kf->FileName), wstring(keyPath).c_str ());
|
||||
|
||||
param->FirstKeyFile = KeyFileAdd (param->FirstKeyFile, kf);
|
||||
LoadKeyList (hwndDlg, param->FirstKeyFile);
|
||||
@@ -741,7 +742,7 @@ BOOL KeyfilesPopupMenu (HWND hwndDlg, POINT popupPosition, KeyFilesDlgParam *par
|
||||
KeyFile *kf = (KeyFile *) malloc (sizeof (KeyFile));
|
||||
if (kf)
|
||||
{
|
||||
strcpy_s (kf->FileName, sizeof (kf->FileName), WideToSingleString (keyPath).c_str());
|
||||
StringCbCopyW (kf->FileName, sizeof (kf->FileName), wstring (keyPath).c_str());
|
||||
|
||||
param->FirstKeyFile = KeyFileAdd (param->FirstKeyFile, kf);
|
||||
param->EnableKeyFiles = TRUE;
|
||||
|
||||
@@ -24,13 +24,13 @@ extern "C" {
|
||||
|
||||
typedef struct KeyFileStruct
|
||||
{
|
||||
char FileName[MAX_PATH + 1];
|
||||
wchar_t FileName[MAX_PATH + 1];
|
||||
struct KeyFileStruct *Next;
|
||||
} KeyFile;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
char VolumeFileName[MAX_PATH + 1];
|
||||
wchar_t VolumeFileName[MAX_PATH + 1];
|
||||
BOOL EnableKeyFiles;
|
||||
KeyFile *FirstKeyFile;
|
||||
} KeyFilesDlgParam;
|
||||
@@ -39,7 +39,7 @@ KeyFile *KeyFileAdd (KeyFile *firstKeyFile, KeyFile *keyFile);
|
||||
void KeyFileRemoveAll (KeyFile **firstKeyFile);
|
||||
KeyFile *KeyFileClone (KeyFile *keyFile);
|
||||
KeyFile *KeyFileCloneAll (KeyFile *firstKeyFile);
|
||||
BOOL KeyFilesApply (HWND hwndDlg, Password *password, KeyFile *firstKeyFilem, const char* volumeFileName);
|
||||
BOOL KeyFilesApply (HWND hwndDlg, Password *password, KeyFile *firstKeyFilem, const wchar_t* volumeFileName);
|
||||
|
||||
BOOL CALLBACK KeyFilesDlgProc (HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam);
|
||||
BOOL KeyfilesPopupMenu (HWND hwndDlg, POINT popupPosition, KeyFilesDlgParam *dialogParam);
|
||||
|
||||
@@ -62,7 +62,7 @@ static char *MapFirstLanguageFile ()
|
||||
if (LanguageResource == NULL)
|
||||
{
|
||||
DWORD size;
|
||||
LanguageResource = MapResource ("Xml", IDR_LANGUAGE, &size);
|
||||
LanguageResource = MapResource (L"Xml", IDR_LANGUAGE, &size);
|
||||
if (LanguageResource)
|
||||
LanguageResourceSize = size;
|
||||
}
|
||||
@@ -287,7 +287,7 @@ BOOL LoadLanguageFile ()
|
||||
case 't': *out++ = '\t'; break;
|
||||
case 'n': *out++ = 13; *out++ = 10; break;
|
||||
default:
|
||||
MessageBox (0, key, "VeraCrypt: Unknown '\\' escape sequence in string", MB_ICONERROR);
|
||||
MessageBoxA (0, key, "VeraCrypt: Unknown '\\' escape sequence in string", MB_ICONERROR);
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
@@ -301,7 +301,7 @@ BOOL LoadLanguageFile ()
|
||||
len = MultiByteToWideChar (CP_UTF8, 0, attr, -1, wattr, sizeof (wattr) / sizeof(wattr[0]));
|
||||
if (len == 0)
|
||||
{
|
||||
MessageBox (0, key, "VeraCrypt: Error while decoding UTF-8 string", MB_ICONERROR);
|
||||
MessageBoxA (0, key, "VeraCrypt: Error while decoding UTF-8 string", MB_ICONERROR);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
@@ -343,7 +343,7 @@ BOOL LoadLanguageFile ()
|
||||
{
|
||||
if (HeaderResource[i] == NULL)
|
||||
{
|
||||
HeaderResource[i] = MapResource ("Header", headers[i], &size);
|
||||
HeaderResource[i] = MapResource (L"Header", headers[i], &size);
|
||||
if (HeaderResource[i])
|
||||
HeaderResourceSize[i] = size;
|
||||
}
|
||||
|
||||
@@ -416,13 +416,13 @@
|
||||
<string lang="en" key="CIPHER_TITLE">Encryption Options</string>
|
||||
<string lang="en" key="CLEAN_WINMRU_FAILED">WARNING: Failed to clear the path of the last selected volume/keyfile (remembered by file selector)!</string>
|
||||
<string lang="en" key="COMPRESSION_NOT_SUPPORTED">Error: The container has been compressed at the filesystem level. VeraCrypt does not support compressed containers (note that compression of encrypted data is ineffective and redundant).\n\nPlease disable compression for the container by following these steps:\n1) Right-click the container in Windows Explorer (not in VeraCrypt).\n2) Select 'Properties'.\n3) In the 'Properties' dialog box, click 'Advanced'.\n4) In the 'Advanced Attributes' dialog box, disable the option 'Compress contents to save disk space' and click 'OK'.\n5) In the 'Properties' dialog box, click 'OK'.</string>
|
||||
<string lang="en" key="CREATE_FAILED">Failed to create volume %hs</string>
|
||||
<string lang="en" key="DEVICE_FREE_BYTES">Size of %hs is %.2f bytes</string>
|
||||
<string lang="en" key="DEVICE_FREE_KB">Size of %hs is %.2f KB</string>
|
||||
<string lang="en" key="DEVICE_FREE_MB">Size of %hs is %.2f MB</string>
|
||||
<string lang="en" key="DEVICE_FREE_GB">Size of %hs is %.2f GB</string>
|
||||
<string lang="en" key="DEVICE_FREE_TB">Size of %hs is %.2f TB</string>
|
||||
<string lang="en" key="DEVICE_FREE_PB">Size of %hs is %.2f PB</string>
|
||||
<string lang="en" key="CREATE_FAILED">Failed to create volume %s</string>
|
||||
<string lang="en" key="DEVICE_FREE_BYTES">Size of %s is %.2f bytes</string>
|
||||
<string lang="en" key="DEVICE_FREE_KB">Size of %s is %.2f KB</string>
|
||||
<string lang="en" key="DEVICE_FREE_MB">Size of %s is %.2f MB</string>
|
||||
<string lang="en" key="DEVICE_FREE_GB">Size of %s is %.2f GB</string>
|
||||
<string lang="en" key="DEVICE_FREE_TB">Size of %s is %.2f TB</string>
|
||||
<string lang="en" key="DEVICE_FREE_PB">Size of %s is %.2f PB</string>
|
||||
<string lang="en" key="DEVICE_IN_USE_FORMAT">WARNING: The device/partition is in use by the operating system or applications. Formatting the device/partition might cause data corruption and system instability.\n\nContinue?</string>
|
||||
<string lang="en" key="DEVICE_IN_USE_INPLACE_ENC">Warning: The partition is in use by the operating system or applications. You should close any applications that might be using the partition (including antivirus software).\n\nContinue?</string>
|
||||
<string lang="en" key="FORMAT_CANT_DISMOUNT_FILESYS">Error: The device/partition contains a file system that could not be dismounted. The file system may be in use by the operating system. Formatting the device/partition would very likely cause data corruption and system instability.\n\nTo solve this issue, we recommend that you first delete the partition and then recreate it without formatting. To do so, follow these steps:\n1) Right-click the 'Computer' (or 'My Computer') icon in the 'Start Menu' and select 'Manage'. The 'Computer Management' window should appear.\n2) In the 'Computer Management' window, select 'Storage' > 'Disk Management'.\n3) Right-click the partition you want to encrypt and select either 'Delete Partition', or 'Delete Volume', or 'Delete Logical Drive'.\n4) Click 'Yes'. If Windows asks you to restart the computer, do so. Then repeat the steps 1 and 2 and continue from the step 5.\n5) Right-click the unallocated/free space area and select either 'New Partition', or 'New Simple Volume', or 'New Logical Drive'.\n6) The 'New Partition Wizard' or 'New Simple Volume Wizard' window should appear now; follow its instructions. On the wizard page entitled 'Format Partition', select either 'Do not format this partition' or 'Do not format this volume'. In the same wizard, click 'Next' and then 'Finish'.\n7) Note that the device path you have selected in VeraCrypt may be wrong now. Therefore, exit the VeraCrypt Volume Creation Wizard (if it is still running) and then start it again.\n8) Try encrypting the device/partition again.\n\nIf VeraCrypt repeatedly fails to encrypt the device/partition, you may want to consider creating a file container instead.</string>
|
||||
@@ -441,12 +441,12 @@
|
||||
<string lang="en" key="INPLACE_ENC_INVALID_PATH">Error: VeraCrypt can in-place encrypt only a partition, a dynamic volume, or an entire system drive. Please make sure the specified path is valid.</string>
|
||||
<string lang="en" key="CANNOT_RESIZE_FILESYS">Error: Cannot shrink the filesystem (the filesystem needs to be shrunk to make space for the volume header and backup header).\n\nPossible causes and solutions:\n\n- Not enough free space on the volume. Please make sure no other application is writing to the filesystem.\n\n- Corrupted file system. Try to check it and fix any errors (right-click the corresponding drive letter in the 'Computer' list, then select Properties > Tools > 'Check Now', make sure the option 'Automatically fix file system errors' is enabled and click Start).\n\nIf the above steps do not help, please follow the below steps.</string>
|
||||
<string lang="en" key="NOT_ENOUGH_FREE_FILESYS_SPACE_FOR_SHRINK">Error: There is not enough free space on the volume and so the filesystem cannot be shrunk (the filesystem needs to be shrunk to make space for the volume header and backup header).\n\nPlease delete any redundant files and empty the Recycle Bin so as to free at least 256 KB of space and then try again. Note that due to a Windows issue, the amount of free space reported by the Windows Explorer may be incorrect until the operating system is restarted. If restarting the system does not help, the file system may be corrupted. Try to check it and fix any errors (right-click the corresponding drive letter in the 'Computer' list, then select Properties > Tools > 'Check Now', make sure the option 'Automatically fix file system errors' is enabled and click Start).\n\nIf the above steps do not help, please follow the below steps.</string>
|
||||
<string lang="en" key="DISK_FREE_BYTES">Free space on drive %hs is %.2f bytes.</string>
|
||||
<string lang="en" key="DISK_FREE_KB">Free space on drive %hs is %.2f KB</string>
|
||||
<string lang="en" key="DISK_FREE_MB">Free space on drive %hs is %.2f MB</string>
|
||||
<string lang="en" key="DISK_FREE_GB">Free space on drive %hs is %.2f GB</string>
|
||||
<string lang="en" key="DISK_FREE_TB">Free space on drive %hs is %.2f TB</string>
|
||||
<string lang="en" key="DISK_FREE_PB">Free space on drive %hs is %.2f PB</string>
|
||||
<string lang="en" key="DISK_FREE_BYTES">Free space on drive %s is %.2f bytes.</string>
|
||||
<string lang="en" key="DISK_FREE_KB">Free space on drive %s is %.2f KB</string>
|
||||
<string lang="en" key="DISK_FREE_MB">Free space on drive %s is %.2f MB</string>
|
||||
<string lang="en" key="DISK_FREE_GB">Free space on drive %s is %.2f GB</string>
|
||||
<string lang="en" key="DISK_FREE_TB">Free space on drive %s is %.2f TB</string>
|
||||
<string lang="en" key="DISK_FREE_PB">Free space on drive %s is %.2f PB</string>
|
||||
<string lang="en" key="DRIVELETTERS">Could not get available drive letters.</string>
|
||||
<string lang="en" key="DRIVER_NOT_FOUND">Error: VeraCrypt driver not found.\n\nPlease copy the files 'veracrypt.sys' and 'veracrypt-x64.sys' to the directory where the main VeraCrypt application (VeraCrypt.exe) is located.</string>
|
||||
<string lang="en" key="DRIVER_VERSION">Error: An incompatible version of the VeraCrypt driver is currently running.\n\nIf you are trying to run VeraCrypt in portable mode (i.e. without installing it) and a different version of VeraCrypt is already installed, you must uninstall it first (or upgrade it using the VeraCrypt installer). To uninstall it, follow these steps: On Windows Vista or later, select 'Start Menu' > Computer > 'Uninstall or change a program' > VeraCrypt > Uninstall; on Windows XP, select 'Start Menu' > Settings > 'Control Panel' > 'Add Or Remove Programs' > VeraCrypt > Remove.\n\nSimilarly, if you are trying to run VeraCrypt in portable mode (i.e. without installing it) and a different version of VeraCrypt is already running in portable mode, you must restart the system first and then run only this new version.</string>
|
||||
@@ -598,12 +598,12 @@
|
||||
<string lang="en" key="SELECT_PKCS11_MODULE">Select PKCS #11 Library</string>
|
||||
<string lang="en" key="OUTOFMEMORY">Out of Memory</string>
|
||||
<string lang="en" key="FORMAT_DEVICE_FOR_ADVANCED_ONLY">IMPORTANT: We strongly recommend that inexperienced users create a VeraCrypt file container on the selected device/partition, instead of attempting to encrypt the entire device/partition.\n\nWhen you create a VeraCrypt file container (as opposed to encrypting a device or partition) there is, for example, no risk of destroying a large number of files. Note that a VeraCrypt file container (even though it contains a virtual encrypted disk) is actually just like any normal file. For more information, see the chapter Beginner's Tutorial in the VeraCrypt User Guide.\n\nAre you sure you want to encrypt the entire device/partition?</string>
|
||||
<string lang="en" key="OVERWRITEPROMPT">WARNING: The file '%hs' already exists!\n\nIMPORTANT: VERACRYPT WILL NOT ENCRYPT THE FILE, BUT IT WILL DELETE IT. Are you sure you want to delete the file and replace it with a new VeraCrypt container?</string>
|
||||
<string lang="en" key="OVERWRITEPROMPT_DEVICE">CAUTION: ALL FILES CURRENTLY STORED ON THE SELECTED %s '%hs'%s WILL BE ERASED AND LOST (THEY WILL NOT BE ENCRYPTED)!\n\nAre you sure you want to proceed with format?</string>
|
||||
<string lang="en" key="NONSYS_INPLACE_ENC_CONFIRM">WARNING: You will not be able to mount the volume or access any files stored on it until it has been fully encrypted.\n\nAre you sure you want to start encrypting the selected %s '%hs'%s?</string>
|
||||
<string lang="en" key="NONSYS_INPLACE_DEC_CONFIRM">WARNING: You will not be able to mount the volume or access any files stored on it until it has been fully decrypted.\n\nAre you sure you want to start decrypting the selected %s '%hs'%s?</string>
|
||||
<string lang="en" key="OVERWRITEPROMPT">WARNING: The file '%s' already exists!\n\nIMPORTANT: VERACRYPT WILL NOT ENCRYPT THE FILE, BUT IT WILL DELETE IT. Are you sure you want to delete the file and replace it with a new VeraCrypt container?</string>
|
||||
<string lang="en" key="OVERWRITEPROMPT_DEVICE">CAUTION: ALL FILES CURRENTLY STORED ON THE SELECTED %s '%s'%s WILL BE ERASED AND LOST (THEY WILL NOT BE ENCRYPTED)!\n\nAre you sure you want to proceed with format?</string>
|
||||
<string lang="en" key="NONSYS_INPLACE_ENC_CONFIRM">WARNING: You will not be able to mount the volume or access any files stored on it until it has been fully encrypted.\n\nAre you sure you want to start encrypting the selected %s '%s'%s?</string>
|
||||
<string lang="en" key="NONSYS_INPLACE_DEC_CONFIRM">WARNING: You will not be able to mount the volume or access any files stored on it until it has been fully decrypted.\n\nAre you sure you want to start decrypting the selected %s '%s'%s?</string>
|
||||
<string lang="en" key="NONSYS_INPLACE_ENC_CONFIRM_BACKUP">WARNING: Please note that if power supply is suddenly interrupted while encrypting/decrypting existing data in place, or when the operating system crashes due to a software error or hardware malfunction while VeraCrypt is encrypting/decrypting existing data in place, portions of the data will be corrupted or lost. Therefore, before you start encrypting/decrypting, please make sure that you have backup copies of the files you want to encrypt/decrypt.\n\nDo you have such a backup?</string>
|
||||
<string lang="en" key="OVERWRITEPROMPT_DEVICE_HIDDEN_OS_PARTITION">CAUTION: ANY FILES CURRENTLY STORED ON THE PARTITION '%hs'%s (I.E. ON THE FIRST PARTITION BEHIND THE SYSTEM PARTITION) WILL BE ERASED AND LOST (THEY WILL NOT BE ENCRYPTED)!\n\nAre you sure you want to proceed with format?</string>
|
||||
<string lang="en" key="OVERWRITEPROMPT_DEVICE_HIDDEN_OS_PARTITION">CAUTION: ANY FILES CURRENTLY STORED ON THE PARTITION '%s'%s (I.E. ON THE FIRST PARTITION BEHIND THE SYSTEM PARTITION) WILL BE ERASED AND LOST (THEY WILL NOT BE ENCRYPTED)!\n\nAre you sure you want to proceed with format?</string>
|
||||
<string lang="en" key="OVERWRITEPROMPT_DEVICE_SECOND_WARNING_LOTS_OF_DATA">WARNING: THE SELECTED PARTITION CONTAINS A LARGE AMOUNT OF DATA! Any files stored on the partition will be erased and lost (they will NOT be encrypted)!</string>
|
||||
<string lang="en" key="ERASE_FILES_BY_CREATING_VOLUME">Erase any files stored on the partition by creating a VeraCrypt volume within it</string>
|
||||
<string lang="en" key="PASSWORD">Password</string>
|
||||
@@ -641,6 +641,8 @@
|
||||
<string lang="en" key="PASSWORD_WRONG_AUTOMOUNT">Auto-mount failed due to one or more of the following:\n - Incorrect password.\n - Incorrect Volume PIM number.\n - Incorrect PRF (hash).\n - No valid volume found.</string>
|
||||
<string lang="en" key="PASSWORD_OR_KEYFILE_WRONG_AUTOMOUNT">Auto-mount failed due to one or more of the following:\n - Incorrect keyfile(s).\n - Incorrect password.\n - Incorrect Volume PIM number.\n - Incorrect PRF (hash).\n - No valid volume found.</string>
|
||||
<string lang="en" key="PASSWORD_WRONG_CAPSLOCK_ON">\n\nWarning: Caps Lock is on. This may cause you to enter your password incorrectly.</string>
|
||||
<string lang="en" key="PASSWORD_UTF8_TOO_LONG">The entered password is too long: its UTF-8 representation exceeds 64 bytes.</string>
|
||||
<string lang="en" key="PASSWORD_UTF8_INVALID">The entered password contains Unicode characters that couldn't be converted to UTF-8 representation.</string>
|
||||
<string lang="en" key="PIM_CHANGE_WARNING">Remember Number to Mount Volume</string>
|
||||
<string lang="en" key="PIM_HIDVOL_HOST_TITLE">Outer Volume PIM</string>
|
||||
<string lang="en" key="PIM_HIDVOL_TITLE">Hidden Volume PIM</string>
|
||||
@@ -663,7 +665,7 @@
|
||||
<string lang="en" key="CANT_DECRYPT_PARTITION_ON_ENTIRELY_ENCRYPTED_SYS_DRIVE_UNSURE">Warning: As the drive contains the VeraCrypt Boot Loader, it may be an entirely encrypted system drive. If it is, please note that VeraCrypt cannot decrypt an individual partition on an entirely encrypted system drive (you can decrypt only the entire system drive). If that is the case, you will be able to continue now but you will receive the 'Incorrect password' error message later.</string>
|
||||
<string lang="en" key="PREV">< &Back</string>
|
||||
<string lang="en" key="RAWDEVICES">Unable to list raw devices installed on your system!</string>
|
||||
<string lang="en" key="READONLYPROMPT">The volume '%hs' exists, and is read-only. Are you sure you want to replace it?</string>
|
||||
<string lang="en" key="READONLYPROMPT">The volume '%s' exists, and is read-only. Are you sure you want to replace it?</string>
|
||||
<string lang="en" key="SELECT_DEST_DIR">Select destination directory</string>
|
||||
<string lang="en" key="SELECT_KEYFILE">Select Keyfile</string>
|
||||
<string lang="en" key="SELECT_KEYFILE_PATH">Select a keyfile search path. WARNING: Note that only the path will be remembered, not the filenames!</string>
|
||||
@@ -687,13 +689,13 @@
|
||||
<string lang="en" key="TEST_CIPHERTEXT_SIZE">The test ciphertext you have supplied is too long or short.</string>
|
||||
<string lang="en" key="TEST_KEY_SIZE">The test key you have supplied is too long or short.</string>
|
||||
<string lang="en" key="TEST_PLAINTEXT_SIZE">The test plaintext you have supplied is too long or short.</string>
|
||||
<string lang="en" key="TWO_LAYER_CASCADE_HELP">Two ciphers in a cascade operating in XTS mode. Each block is first encrypted with %hs (%d-bit key) and then with %hs (%d-bit key). Each cipher uses its own key. All keys are mutually independent.</string>
|
||||
<string lang="en" key="THREE_LAYER_CASCADE_HELP">Three ciphers in a cascade operating in XTS mode. Each block is first encrypted with %hs (%d-bit key), then with %hs (%d-bit key), and finally with %hs (%d-bit key). Each cipher uses its own key. All keys are mutually independent.</string>
|
||||
<string lang="en" key="TWO_LAYER_CASCADE_HELP">Two ciphers in a cascade operating in XTS mode. Each block is first encrypted with %s (%d-bit key) and then with %s (%d-bit key). Each cipher uses its own key. All keys are mutually independent.</string>
|
||||
<string lang="en" key="THREE_LAYER_CASCADE_HELP">Three ciphers in a cascade operating in XTS mode. Each block is first encrypted with %s (%d-bit key), then with %s (%d-bit key), and finally with %s (%d-bit key). Each cipher uses its own key. All keys are mutually independent.</string>
|
||||
<string lang="en" key="AUTORUN_MAY_NOT_ALWAYS_WORK">Note that, depending on the operating system configuration, these auto-run and auto-mount features may work only when the traveler disk files are created on a non-writable CD/DVD-like medium. Also note that this is not a bug in VeraCrypt (it is a limitation of Windows).</string>
|
||||
<string lang="en" key="TRAVELER_DISK_CREATED">VeraCrypt traveler disk has been successfully created.\n\nNote that you need administrator privileges to run VeraCrypt in portable mode. Also note that, after examining the registry file, it may be possible to tell that VeraCrypt was run on a Windows system even if it is run in portable mode.</string>
|
||||
<string lang="en" key="TC_TRAVELER_DISK">VeraCrypt Traveler Disk</string>
|
||||
<string lang="en" key="TWOFISH_HELP">Designed by Bruce Schneier, John Kelsey, Doug Whiting, David Wagner, Chris Hall, and Niels Ferguson. Published in 1998. 256-bit key, 128-bit block. Mode of operation is XTS. Twofish was one of the AES finalists.</string>
|
||||
<string lang="en" key="MORE_INFO_ABOUT">More information on %hs</string>
|
||||
<string lang="en" key="MORE_INFO_ABOUT">More information on %s</string>
|
||||
<string lang="en" key="UNKNOWN">Unknown</string>
|
||||
<string lang="en" key="ERR_UNKNOWN">An unspecified or unknown error occurred (%d).</string>
|
||||
<string lang="en" key="UNMOUNTALL_LOCK_FAILED">Some volumes contain files or folders being used by applications or system.\n\nForce dismount?</string>
|
||||
@@ -858,7 +860,7 @@
|
||||
<string lang="en" key="INSTALL_FAILED">Installation failed.</string>
|
||||
<string lang="en" key="UNINSTALL_FAILED">Uninstallation failed.</string>
|
||||
<string lang="en" key="DIST_PACKAGE_CORRUPTED">This distribution package is damaged. Please try downloading it again (preferably from the official VeraCrypt website at https://veracrypt.codeplex.com).</string>
|
||||
<string lang="en" key="CANNOT_WRITE_FILE_X">Cannot write file %hs</string>
|
||||
<string lang="en" key="CANNOT_WRITE_FILE_X">Cannot write file %s</string>
|
||||
<string lang="en" key="EXTRACTING_VERB">Extracting</string>
|
||||
<string lang="en" key="CANNOT_READ_FROM_PACKAGE">Cannot read data from the package.</string>
|
||||
<string lang="en" key="CANT_VERIFY_PACKAGE_INTEGRITY">Cannot verify the integrity of this distribution package.</string>
|
||||
@@ -868,7 +870,7 @@
|
||||
<string lang="en" key="SETUP_UPDATE_OK">VeraCrypt has been successfully updated.</string>
|
||||
<string lang="en" key="UPGRADE_OK_REBOOT_REQUIRED">VeraCrypt has been successfully upgraded. However, before you can start using it, the computer must be restarted.\n\nDo you want to restart it now?</string>
|
||||
<string lang="en" key="SYS_ENC_UPGRADE_FAILED">Failed to upgrade VeraCrypt!\n\nIMPORTANT: Before you shut down or restart the system, we strongly recommend that you use System Restore (Windows Start menu > All programs > Accessories > System Tools > System Restore) to restore your system to the restore point named 'VeraCrypt installation'. If System Restore is not available, you should try installing the original or the new version of VeraCrypt again before you shut down or restart the system.</string>
|
||||
<string lang="en" key="UNINSTALL_OK">VeraCrypt has been successfully uninstalled.\n\nClick 'Finish' to remove the VeraCrypt installer and the folder %hs. Note that the folder will not be removed if it contains any files that were not installed by the VeraCrypt installer or created by VeraCrypt.</string>
|
||||
<string lang="en" key="UNINSTALL_OK">VeraCrypt has been successfully uninstalled.\n\nClick 'Finish' to remove the VeraCrypt installer and the folder %s. Note that the folder will not be removed if it contains any files that were not installed by the VeraCrypt installer or created by VeraCrypt.</string>
|
||||
<string lang="en" key="REMOVING_REG">Removing VeraCrypt registry entries</string>
|
||||
<string lang="en" key="ADDING_REG">Adding registry entry</string>
|
||||
<string lang="en" key="REMOVING_APPDATA">Removing application-specific data</string>
|
||||
@@ -879,10 +881,10 @@
|
||||
<string lang="en" key="CREATING_SYS_RESTORE">Creating System Restore point</string>
|
||||
<string lang="en" key="FAILED_SYS_RESTORE">Failed to create System Restore point!</string>
|
||||
<string lang="en" key="INSTALLER_UPDATING_BOOT_LOADER">Updating boot loader</string>
|
||||
<string lang="en" key="INSTALL_OF_FAILED">Failed to install '%hs'. %hs\nDo you want to continue installing?</string>
|
||||
<string lang="en" key="UNINSTALL_OF_FAILED">Failed to uninstall '%hs'. %hs\nDo you want to continue uninstalling?</string>
|
||||
<string lang="en" key="INSTALL_OF_FAILED">Failed to install '%s'. %s\nDo you want to continue installing?</string>
|
||||
<string lang="en" key="UNINSTALL_OF_FAILED">Failed to uninstall '%s'. %s\nDo you want to continue uninstalling?</string>
|
||||
<string lang="en" key="INSTALL_COMPLETED">Installation completed.</string>
|
||||
<string lang="en" key="CANT_CREATE_FOLDER">The folder '%hs' could not be created</string>
|
||||
<string lang="en" key="CANT_CREATE_FOLDER">The folder '%s' could not be created</string>
|
||||
<string lang="en" key="CLOSE_TC_FIRST">The VeraCrypt device driver cannot be unloaded.\n\nPlease close all open VeraCrypt windows first. If it does not help, please restart Windows and then try again.</string>
|
||||
<string lang="en" key="DISMOUNT_ALL_FIRST">All VeraCrypt volumes must be dismounted before installing or uninstalling VeraCrypt.</string>
|
||||
<string lang="en" key="UNINSTALL_OLD_VERSION_FIRST">An obsolete version of VeraCrypt is currently installed on this system. It needs to be uninstalled before you can install this new version of VeraCrypt.\n\nAs soon as you close this message box, the uninstaller of the old version will be launched. Note that no volume will be decrypted when you uninstall VeraCrypt. After you uninstall the old version of VeraCrypt, run the installer of the new version of VeraCrypt again.</string>
|
||||
@@ -935,7 +937,7 @@
|
||||
<string lang="en" key="FAVORITE_LABEL_DEVICE_PATH_ERR">The device displayed below is neither a partition nor a dynamic volume. Therefore, no label can be assigned to it.</string>
|
||||
<string lang="en" key="FAVORITE_LABEL_PARTITION_TYPE_ERR">Please set the type of the partition displayed below to a type recognized by Windows (use the SETID command of the Windows 'diskpart' tool). Then remove the partition from favorites and add it again. This will enable VeraCrypt to assign a label to the partition.</string>
|
||||
<string lang="en" key="SYSTEM_FAVORITE_NETWORK_PATH_ERR">Due to a Windows limitation, a container stored in a remote filesystem shared over a network cannot be mounted as a system favorite volume (however, it can be mounted as a non-system favorite volume when a user logs on).</string>
|
||||
<string lang="en" key="ENTER_PASSWORD_FOR">Enter password for %hs</string>
|
||||
<string lang="en" key="ENTER_PASSWORD_FOR">Enter password for %s</string>
|
||||
<string lang="en" key="ENTER_PASSWORD_FOR_LABEL">Enter password for '%s'</string>
|
||||
<string lang="en" key="ENTER_NORMAL_VOL_PASSWORD">Enter password for the normal/outer volume</string>
|
||||
<string lang="en" key="ENTER_HIDDEN_VOL_PASSWORD">Enter password for the hidden volume</string>
|
||||
@@ -950,8 +952,8 @@
|
||||
<string lang="en" key="VOL_HEADER_BACKED_UP">Volume header backup has been successfully created.\n\nIMPORTANT: Restoring the volume header using this backup will also restore the current volume password. Moreover, if keyfile(s) are/is necessary to mount the volume, the same keyfile(s) will be necessary to mount the volume again when the volume header is restored.\n\nWARNING: This volume header backup may be used to restore the header ONLY of this particular volume. If you use this header backup to restore a header of a different volume, you will be able to mount the volume, but you will NOT be able to decrypt any data stored in the volume (because you will change its master key).</string>
|
||||
<string lang="en" key="VOL_HEADER_RESTORED">The volume header has been successfully restored.\n\nIMPORTANT: Please note that an old password may have been restored as well. Moreover, if keyfile(s) were/was necessary to mount the volume when the backup was created, the same keyfile(s) are now necessary to mount the volume again.</string>
|
||||
<string lang="en" key="EXTERNAL_VOL_HEADER_BAK_FIRST_INFO">For security reasons, you will have to enter the correct password (and/or supply the correct keyfiles) for the volume.\n\nNote: If the volume contains a hidden volume, you will have to enter the correct password (and/or supply the correct keyfiles) for the outer volume first. Afterwards, if you choose to back up the header of the hidden volume, you will have to enter the correct password (and/or supply the correct keyfiles) for the hidden volume.</string>
|
||||
<string lang="en" key="CONFIRM_VOL_HEADER_BAK">Are you sure you want to create volume header backup for %hs?\n\nAfter you click Yes, you will prompted for a filename for the header backup.\n\nNote: Both the standard and the hidden volume headers will be re-encrypted using a new salt and stored in the backup file. If there is no hidden volume within this volume, the area reserved for the hidden volume header in the backup file will be filled with random data (to preserve plausible deniability). When restoring a volume header from the backup file, you will need to enter the correct password (and/or to supply the correct keyfiles) that was/were valid when the volume header backup was created. The password (and/or keyfiles) will also automatically determine the type of the volume header to restore, i.e. standard or hidden (note that VeraCrypt determines the type through the process of trial and error).</string>
|
||||
<string lang="en" key="CONFIRM_VOL_HEADER_RESTORE">Are you sure you want to restore volume header of %hs?\n\nWARNING: Restoring a volume header also restores the volume password that was valid when the backup was created. Moreover, if keyfile(s) were/was necessary to mount the volume when the backup was created, the same keyfile(s) will be necessary to mount the volume again after the volume header is restored.\n\nAfter you click Yes, you will select the header backup file.</string>
|
||||
<string lang="en" key="CONFIRM_VOL_HEADER_BAK">Are you sure you want to create volume header backup for %s?\n\nAfter you click Yes, you will prompted for a filename for the header backup.\n\nNote: Both the standard and the hidden volume headers will be re-encrypted using a new salt and stored in the backup file. If there is no hidden volume within this volume, the area reserved for the hidden volume header in the backup file will be filled with random data (to preserve plausible deniability). When restoring a volume header from the backup file, you will need to enter the correct password (and/or to supply the correct keyfiles) that was/were valid when the volume header backup was created. The password (and/or keyfiles) will also automatically determine the type of the volume header to restore, i.e. standard or hidden (note that VeraCrypt determines the type through the process of trial and error).</string>
|
||||
<string lang="en" key="CONFIRM_VOL_HEADER_RESTORE">Are you sure you want to restore volume header of %s?\n\nWARNING: Restoring a volume header also restores the volume password that was valid when the backup was created. Moreover, if keyfile(s) were/was necessary to mount the volume when the backup was created, the same keyfile(s) will be necessary to mount the volume again after the volume header is restored.\n\nAfter you click Yes, you will select the header backup file.</string>
|
||||
<string lang="en" key="DOES_VOLUME_CONTAIN_HIDDEN">Does the volume contain a hidden volume?</string>
|
||||
<string lang="en" key="VOLUME_CONTAINS_HIDDEN">The volume contains a hidden volume</string>
|
||||
<string lang="en" key="VOLUME_DOES_NOT_CONTAIN_HIDDEN">The volume does not contain a hidden volume</string>
|
||||
@@ -963,8 +965,8 @@
|
||||
<string lang="en" key="BACKUP_HEADER_NOT_FOR_SYS_DEVICE">You are attempting to back up the header of the system partition/drive. This is not allowed. Backup/restore operations pertaining to the system partition/drive can be performed only using the VeraCrypt Rescue Disk.\n\nDo you want to create a VeraCrypt Rescue Disk?</string>
|
||||
<string lang="en" key="RESTORE_HEADER_NOT_FOR_SYS_DEVICE">You are attempting to restore the header of a virtual VeraCrypt volume but you selected the system partition/drive. This is not allowed. Backup/restore operations pertaining to the system partition/drive can be performed only using the VeraCrypt Rescue Disk.\n\nDo you want to create a VeraCrypt Rescue Disk?</string>
|
||||
<string lang="en" key="RESCUE_DISK_NON_WIZARD_CREATION_SELECT_PATH">After you click OK, you will select a filename for the new VeraCrypt Rescue Disk ISO image and the location where you wish to place it.</string>
|
||||
<string lang="en" key="RESCUE_DISK_NON_WIZARD_CREATION_BURN">The Rescue Disk image has been created and stored in this file:\n%hs\n\nNow you need to burn the Rescue Disk image to a CD or DVD.\n\nIMPORTANT: Note that the file must be written to the CD/DVD as an ISO disk image (not as an individual file). For information on how to do so, please refer to the documentation of your CD/DVD recording software.\n\nAfter you burn the Rescue Disk, select 'System' > 'Verify Rescue Disk' to verify that it has been correctly burned.</string>
|
||||
<string lang="en" key="RESCUE_DISK_NON_WIZARD_CREATION_WIN_ISOBURN">The Rescue Disk image has been created and stored in this file:\n%hs\n\nNow you need to burn the Rescue Disk image to a CD or DVD.\n\nDo you want to launch the Microsoft Windows Disc Image Burner now?\n\nNote: After you burn the Rescue Disk, select 'System' > 'Verify Rescue Disk' to verify that it has been correctly burned.</string>
|
||||
<string lang="en" key="RESCUE_DISK_NON_WIZARD_CREATION_BURN">The Rescue Disk image has been created and stored in this file:\n%s\n\nNow you need to burn the Rescue Disk image to a CD or DVD.\n\nIMPORTANT: Note that the file must be written to the CD/DVD as an ISO disk image (not as an individual file). For information on how to do so, please refer to the documentation of your CD/DVD recording software.\n\nAfter you burn the Rescue Disk, select 'System' > 'Verify Rescue Disk' to verify that it has been correctly burned.</string>
|
||||
<string lang="en" key="RESCUE_DISK_NON_WIZARD_CREATION_WIN_ISOBURN">The Rescue Disk image has been created and stored in this file:\n%s\n\nNow you need to burn the Rescue Disk image to a CD or DVD.\n\nDo you want to launch the Microsoft Windows Disc Image Burner now?\n\nNote: After you burn the Rescue Disk, select 'System' > 'Verify Rescue Disk' to verify that it has been correctly burned.</string>
|
||||
<string lang="en" key="RESCUE_DISK_NON_WIZARD_CHECK_INSERT">Please insert your VeraCrypt Rescue Disk into your CD/DVD drive and click OK to verify it.</string>
|
||||
<string lang="en" key="RESCUE_DISK_NON_WIZARD_CHECK_PASSED">The VeraCrypt Rescue Disk has been successfully verified.</string>
|
||||
<string lang="en" key="RESCUE_DISK_NON_WIZARD_CHECK_FAILED">Cannot verify that the Rescue Disk has been correctly burned.\n\nIf you have burned the Rescue Disk, please eject and reinsert the CD/DVD; then try again. If this does not help, please try other CD/DVD recording software and/or medium.\n\nIf you attempted to verify a VeraCrypt Rescue Disk created for a different master key, password, salt, etc., please note that such Rescue Disk will always fail this verification. To create a new Rescue Disk fully compatible with your current configuration, select 'System' > 'Create Rescue Disk'.</string>
|
||||
@@ -1059,8 +1061,8 @@
|
||||
<string lang="en" key="NO_SYS_ENC_PROCESS_TO_RESUME">There is no interrupted process of encryption/decryption of the system partition/drive to resume.\n\nNote: If you want to resume an interrupted process of encryption/decryption of a non-system partition/volume, select 'Volumes' > 'Resume Interrupted Process'.</string>
|
||||
<string lang="en" key="HIDVOL_PROT_BKG_TASK_WARNING">WARNING: VeraCrypt Background Task is disabled. After you exit VeraCrypt, you will not be notified if damage to hidden volume is prevented.\n\nNote: You may shut down the Background Task anytime by right-clicking the VeraCrypt tray icon and selecting 'Exit'.\n\nEnable VeraCrypt Background Task?</string>
|
||||
<string lang="en" key="LANG_PACK_VERSION">Language pack version: %s</string>
|
||||
<string lang="en" key="CHECKING_FS">Checking the file system on the VeraCrypt volume mounted as %hs...</string>
|
||||
<string lang="en" key="REPAIRING_FS">Attempting to repair the file system on the VeraCrypt volume mounted as %hs...</string>
|
||||
<string lang="en" key="CHECKING_FS">Checking the file system on the VeraCrypt volume mounted as %s...</string>
|
||||
<string lang="en" key="REPAIRING_FS">Attempting to repair the file system on the VeraCrypt volume mounted as %s...</string>
|
||||
<string lang="en" key="WARN_64_BIT_BLOCK_CIPHER">Warning: This volume is encrypted with a legacy encryption algorithm.\n\nAll 64-bit-block encryption algorithms (e.g., Blowfish, CAST-128, or Triple DES) are deprecated. It will be possible to mount this volume using future versions of VeraCrypt. However, there will be no further enhancements to the implementations of these legacy encryption algorithms. We recommend that you create a new VeraCrypt volume encrypted with a 128-bit-block encryption algorithm (e.g., AES, Serpent, Twofish, etc.) and that you move all files from this volume to the new volume.</string>
|
||||
<string lang="en" key="SYS_AUTOMOUNT_DISABLED">Your system is not configured to auto-mount new volumes. It may be impossible to mount device-hosted VeraCrypt volumes. Auto-mounting can be enabled by executing the following command and restarting the system.\n\nmountvol.exe /E</string>
|
||||
<string lang="en" key="SYS_ASSIGN_DRIVE_LETTER">Please assign a drive letter to the partition/device before proceeding ('Control Panel' > 'System and Maintenance' > 'Administrative Tools' - 'Create and format hard disk partitions').\n\nNote that this is a requirement of the operating system.</string>
|
||||
@@ -1116,8 +1118,8 @@
|
||||
<string lang="en" key="KEYB_LAYOUT_SYS_ENC_EXPLANATION">Note: The password will need to be typed in the pre-boot environment (before Windows starts) where non-US Windows keyboard layouts are not available. Therefore, the password must always be typed using the standard US keyboard layout. However, it is important to note that you do NOT need a real US keyboard. VeraCrypt automatically ensures that you can safely type the password (right now and in the pre-boot environment) even if you do NOT have a real US keyboard.</string>
|
||||
<string lang="en" key="RESCUE_DISK_INFO">Before you can encrypt the partition/drive, you must create a VeraCrypt Rescue Disk (VRD), which serves the following purposes:\n\n- If the VeraCrypt Boot Loader, master key, or other critical data gets damaged, the VRD allows you to restore it (note, however, that you will still have to enter the correct password then).\n\n- If Windows gets damaged and cannot start, the VRD allows you to permanently decrypt the partition/drive before Windows starts.\n\n- The VRD will contain a backup of the present content of the first drive track (which typically contains a system loader or boot manager) and will allow you to restore it if necessary.\n\nThe VeraCrypt Rescue Disk ISO image will be created in the location specified below.</string>
|
||||
<string lang="en" key="RESCUE_DISK_WIN_ISOBURN_PRELAUNCH_NOTE">After you click OK, Microsoft Windows Disc Image Burner will be launched. Please use it to burn the VeraCrypt Rescue Disk ISO image to a CD or DVD.\n\nAfter you do so, return to the VeraCrypt Volume Creation Wizard and follow its instructions.</string>
|
||||
<string lang="en" key="RESCUE_DISK_BURN_INFO">The Rescue Disk image has been created and stored in this file:\n%hs\n\nNow you need to burn it to a CD or DVD.\n\n%lsAfter you burn the Rescue Disk, click Next to verify that it has been correctly burned.</string>
|
||||
<string lang="en" key="RESCUE_DISK_BURN_INFO_NO_CHECK">The Rescue Disk image has been created and stored in this file:\n%hs\n\nNow you should either burn the image to a CD/DVD or move it to a safe location for later use.\n\n%lsClick Next to continue.</string>
|
||||
<string lang="en" key="RESCUE_DISK_BURN_INFO">The Rescue Disk image has been created and stored in this file:\n%s\n\nNow you need to burn it to a CD or DVD.\n\n%lsAfter you burn the Rescue Disk, click Next to verify that it has been correctly burned.</string>
|
||||
<string lang="en" key="RESCUE_DISK_BURN_INFO_NO_CHECK">The Rescue Disk image has been created and stored in this file:\n%s\n\nNow you should either burn the image to a CD/DVD or move it to a safe location for later use.\n\n%lsClick Next to continue.</string>
|
||||
<string lang="en" key="RESCUE_DISK_BURN_INFO_NONWIN_ISO_BURNER">IMPORTANT: Note that the file must be written to the CD/DVD as an ISO disk image (not as an individual file). For information on how to do so, please refer to the documentation of your CD/DVD recording software. If you do not have any CD/DVD recording software that can write the ISO disk image to a CD/DVD, click the link below to download such free software.\n\n</string>
|
||||
<string lang="en" key="LAUNCH_WIN_ISOBURN">Launch Microsoft Windows Disc Image Burner</string>
|
||||
<string lang="en" key="RESCUE_DISK_BURN_NO_CHECK_WARN">WARNING: If you already created a VeraCrypt Rescue Disk in the past, it cannot be reused for this system partition/drive because it was created for a different master key! Every time you encrypt a system partition/drive, you must create a new VeraCrypt Rescue Disk for it even if you use the same password.</string>
|
||||
|
||||
@@ -33,17 +33,25 @@ void VerifyPasswordAndUpdate (HWND hwndDlg, HWND hButton, HWND hPassword,
|
||||
char *szVerify,
|
||||
BOOL keyFilesEnabled)
|
||||
{
|
||||
char szTmp1[MAX_PASSWORD + 1];
|
||||
char szTmp2[MAX_PASSWORD + 1];
|
||||
wchar_t szTmp1[MAX_PASSWORD + 1];
|
||||
wchar_t szTmp2[MAX_PASSWORD + 1];
|
||||
char szTmp1Utf8[MAX_PASSWORD + 1];
|
||||
char szTmp2Utf8[MAX_PASSWORD + 1];
|
||||
int k = GetWindowTextLength (hPassword);
|
||||
BOOL bEnable = FALSE;
|
||||
int utf8Len1, utf8Len2;
|
||||
|
||||
UNREFERENCED_PARAMETER (hwndDlg); /* Remove warning */
|
||||
|
||||
GetWindowText (hPassword, szTmp1, sizeof (szTmp1));
|
||||
GetWindowText (hVerify, szTmp2, sizeof (szTmp2));
|
||||
|
||||
if (strcmp (szTmp1, szTmp2) != 0)
|
||||
utf8Len1 = WideCharToMultiByte (CP_UTF8, 0, szTmp1, -1, szTmp1Utf8, MAX_PASSWORD + 1, NULL, NULL);
|
||||
utf8Len2 = WideCharToMultiByte (CP_UTF8, 0, szTmp2, -1, szTmp2Utf8, MAX_PASSWORD + 1, NULL, NULL);
|
||||
|
||||
if (wcscmp (szTmp1, szTmp2) != 0)
|
||||
bEnable = FALSE;
|
||||
else if (utf8Len1 <= 0)
|
||||
bEnable = FALSE;
|
||||
else
|
||||
{
|
||||
@@ -54,13 +62,25 @@ void VerifyPasswordAndUpdate (HWND hwndDlg, HWND hButton, HWND hPassword,
|
||||
}
|
||||
|
||||
if (szPassword != NULL)
|
||||
memcpy (szPassword, szTmp1, sizeof (szTmp1));
|
||||
{
|
||||
if (utf8Len1 > 0)
|
||||
memcpy (szPassword, szTmp1Utf8, sizeof (szTmp1Utf8));
|
||||
else
|
||||
szPassword [0] = 0;
|
||||
}
|
||||
|
||||
if (szVerify != NULL)
|
||||
memcpy (szVerify, szTmp2, sizeof (szTmp2));
|
||||
{
|
||||
if (utf8Len2 > 0)
|
||||
memcpy (szVerify, szTmp2Utf8, sizeof (szTmp2Utf8));
|
||||
else
|
||||
szVerify [0] = 0;
|
||||
}
|
||||
|
||||
burn (szTmp1, sizeof (szTmp1));
|
||||
burn (szTmp2, sizeof (szTmp2));
|
||||
burn (szTmp1Utf8, sizeof (szTmp1Utf8));
|
||||
burn (szTmp2Utf8, sizeof (szTmp2Utf8));
|
||||
|
||||
EnableWindow (hButton, bEnable);
|
||||
}
|
||||
@@ -146,11 +166,11 @@ BOOL CheckPasswordLength (HWND hwndDlg, unsigned __int32 passwordLength, int pim
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
int ChangePwd (const char *lpszVolume, Password *oldPassword, int old_pkcs5, int old_pim, BOOL truecryptMode, Password *newPassword, int pkcs5, int pim, int wipePassCount, HWND hwndDlg)
|
||||
int ChangePwd (const wchar_t *lpszVolume, Password *oldPassword, int old_pkcs5, int old_pim, BOOL truecryptMode, Password *newPassword, int pkcs5, int pim, int wipePassCount, HWND hwndDlg)
|
||||
{
|
||||
int nDosLinkCreated = 1, nStatus = ERR_OS_ERROR;
|
||||
char szDiskFile[TC_MAX_PATH], szCFDevice[TC_MAX_PATH];
|
||||
char szDosDevice[TC_MAX_PATH];
|
||||
wchar_t szDiskFile[TC_MAX_PATH], szCFDevice[TC_MAX_PATH];
|
||||
wchar_t szDosDevice[TC_MAX_PATH];
|
||||
char buffer[TC_VOLUME_HEADER_EFFECTIVE_SIZE];
|
||||
PCRYPTO_INFO cryptoInfo = NULL, ci = NULL;
|
||||
void *dev = INVALID_HANDLE_VALUE;
|
||||
@@ -190,7 +210,7 @@ int ChangePwd (const char *lpszVolume, Password *oldPassword, int old_pkcs5, int
|
||||
|
||||
if (bDevice == FALSE)
|
||||
{
|
||||
strcpy (szCFDevice, szDiskFile);
|
||||
wcscpy (szCFDevice, szDiskFile);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -40,7 +40,7 @@ typedef struct
|
||||
void VerifyPasswordAndUpdate ( HWND hwndDlg , HWND hButton , HWND hPassword , HWND hVerify , unsigned char *szPassword , char *szVerify, BOOL keyFilesEnabled );
|
||||
BOOL CheckPasswordLength (HWND hwndDlg, unsigned __int32 passwordLength, int pim, BOOL bForBoot, BOOL bSkipPasswordWarning, BOOL bSkipPimWarning);
|
||||
BOOL CheckPasswordCharEncoding (HWND hPassword, Password *ptrPw);
|
||||
int ChangePwd (const char *lpszVolume, Password *oldPassword, int old_pkcs5, int old_pim, BOOL truecryptMode, Password *newPassword, int pkcs5, int pim, int wipePassCount, HWND hwndDlg);
|
||||
int ChangePwd (const wchar_t *lpszVolume, Password *oldPassword, int old_pkcs5, int old_pim, BOOL truecryptMode, Password *newPassword, int pkcs5, int pim, int wipePassCount, HWND hwndDlg);
|
||||
|
||||
#endif // defined(_WIN32) && !defined(TC_WINDOWS_DRIVER)
|
||||
|
||||
|
||||
@@ -736,24 +736,24 @@ void derive_key_whirlpool (char *pwd, int pwd_len, char *salt, int salt_len, uin
|
||||
}
|
||||
|
||||
|
||||
char *get_pkcs5_prf_name (int pkcs5_prf_id)
|
||||
wchar_t *get_pkcs5_prf_name (int pkcs5_prf_id)
|
||||
{
|
||||
switch (pkcs5_prf_id)
|
||||
{
|
||||
case SHA512:
|
||||
return "HMAC-SHA-512";
|
||||
return L"HMAC-SHA-512";
|
||||
|
||||
case SHA256:
|
||||
return "HMAC-SHA-256";
|
||||
return L"HMAC-SHA-256";
|
||||
|
||||
case RIPEMD160:
|
||||
return "HMAC-RIPEMD-160";
|
||||
return L"HMAC-RIPEMD-160";
|
||||
|
||||
case WHIRLPOOL:
|
||||
return "HMAC-Whirlpool";
|
||||
return L"HMAC-Whirlpool";
|
||||
|
||||
default:
|
||||
return "(Unknown)";
|
||||
return L"(Unknown)";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -20,24 +20,26 @@
|
||||
extern "C"
|
||||
{
|
||||
#endif
|
||||
/* output written to input_digest which must be at lease 20 bytes long */
|
||||
void hmac_ripemd160 (char *key, int keylen, char *input_digest, int len);
|
||||
void derive_key_ripemd160 (char *pwd, int pwd_len, char *salt, int salt_len, uint32 iterations, char *dk, int dklen);
|
||||
|
||||
/* output written to d which must be at lease 32 bytes long */
|
||||
void hmac_sha256 (char *k, int lk, char *d, int ld);
|
||||
void derive_key_sha256 (char *pwd, int pwd_len, char *salt, int salt_len, uint32 iterations, char *dk, int dklen);
|
||||
|
||||
#ifndef TC_WINDOWS_BOOT
|
||||
/* output written to d which must be at lease 64 bytes long */
|
||||
void hmac_sha512 (char *k, int lk, char *d, int ld);
|
||||
void derive_key_sha512 (char *pwd, int pwd_len, char *salt, int salt_len, uint32 iterations, char *dk, int dklen);
|
||||
|
||||
/* output written to input_digest which must be at lease 20 bytes long */
|
||||
void hmac_ripemd160 (char *key, int keylen, char *input_digest, int len);
|
||||
void derive_key_ripemd160 (char *pwd, int pwd_len, char *salt, int salt_len, uint32 iterations, char *dk, int dklen);
|
||||
|
||||
/* output written to d which must be at lease 64 bytes long */
|
||||
void hmac_whirlpool (char *k, int lk, char *d, int ld);
|
||||
void derive_key_whirlpool (char *pwd, int pwd_len, char *salt, int salt_len, uint32 iterations, char *dk, int dklen);
|
||||
|
||||
int get_pkcs5_iteration_count (int pkcs5_prf_id, int pim, BOOL truecryptMode, BOOL bBoot);
|
||||
char *get_pkcs5_prf_name (int pkcs5_prf_id);
|
||||
wchar_t *get_pkcs5_prf_name (int pkcs5_prf_id);
|
||||
#endif
|
||||
|
||||
#if defined(__cplusplus)
|
||||
}
|
||||
|
||||
@@ -631,17 +631,17 @@ BOOL SlowPoll (void)
|
||||
HKEY hKey;
|
||||
|
||||
if (RegOpenKeyEx (HKEY_LOCAL_MACHINE,
|
||||
"SYSTEM\\CurrentControlSet\\Control\\ProductOptions",
|
||||
L"SYSTEM\\CurrentControlSet\\Control\\ProductOptions",
|
||||
0, KEY_READ, &hKey) == ERROR_SUCCESS)
|
||||
{
|
||||
unsigned char szValue[32];
|
||||
wchar_t szValue[32];
|
||||
dwSize = sizeof (szValue);
|
||||
|
||||
isWorkstation = TRUE;
|
||||
status = RegQueryValueEx (hKey, "ProductType", 0, NULL,
|
||||
szValue, &dwSize);
|
||||
status = RegQueryValueEx (hKey, L"ProductType", 0, NULL,
|
||||
(LPBYTE) szValue, &dwSize);
|
||||
|
||||
if (status == ERROR_SUCCESS && _stricmp ((char *) szValue, "WinNT"))
|
||||
if (status == ERROR_SUCCESS && _wcsicmp (szValue, L"WinNT"))
|
||||
/* Note: There are (at least) three cases for
|
||||
ProductType: WinNT = NT Workstation,
|
||||
ServerNT = NT Server, LanmanNT = NT Server
|
||||
@@ -656,13 +656,13 @@ BOOL SlowPoll (void)
|
||||
{
|
||||
/* Obtain a handle to the module containing the Lan Manager
|
||||
functions */
|
||||
char dllPath[MAX_PATH];
|
||||
wchar_t dllPath[MAX_PATH];
|
||||
if (GetSystemDirectory (dllPath, MAX_PATH))
|
||||
{
|
||||
StringCbCatA(dllPath, sizeof(dllPath), "\\NETAPI32.DLL");
|
||||
StringCbCatW(dllPath, sizeof(dllPath), L"\\NETAPI32.DLL");
|
||||
}
|
||||
else
|
||||
StringCbCopyA(dllPath, sizeof(dllPath), "C:\\Windows\\System32\\NETAPI32.DLL");
|
||||
StringCbCopyW(dllPath, sizeof(dllPath), L"C:\\Windows\\System32\\NETAPI32.DLL");
|
||||
|
||||
hNetAPI32 = LoadLibrary (dllPath);
|
||||
if (hNetAPI32 != NULL)
|
||||
@@ -710,10 +710,10 @@ BOOL SlowPoll (void)
|
||||
for (nDrive = 0;; nDrive++)
|
||||
{
|
||||
DISK_PERFORMANCE diskPerformance;
|
||||
char szDevice[24];
|
||||
wchar_t szDevice[24];
|
||||
|
||||
/* Check whether we can access this device */
|
||||
StringCbPrintfA (szDevice, sizeof(szDevice), "\\\\.\\PhysicalDrive%d", nDrive);
|
||||
StringCbPrintfW (szDevice, sizeof(szDevice), L"\\\\.\\PhysicalDrive%d", nDrive);
|
||||
hDevice = CreateFile (szDevice, 0, FILE_SHARE_READ | FILE_SHARE_WRITE,
|
||||
NULL, OPEN_EXISTING, 0, NULL);
|
||||
if (hDevice == INVALID_HANDLE_VALUE)
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
#include "Registry.h"
|
||||
#include <Strsafe.h>
|
||||
|
||||
BOOL ReadLocalMachineRegistryDword (char *subKey, char *name, DWORD *value)
|
||||
BOOL ReadLocalMachineRegistryDword (wchar_t *subKey, wchar_t *name, DWORD *value)
|
||||
{
|
||||
HKEY hkey = 0;
|
||||
DWORD size = sizeof (*value);
|
||||
@@ -33,7 +33,7 @@ BOOL ReadLocalMachineRegistryDword (char *subKey, char *name, DWORD *value)
|
||||
return type == REG_DWORD;
|
||||
}
|
||||
|
||||
BOOL ReadLocalMachineRegistryMultiString (char *subKey, char *name, char *value, DWORD *size)
|
||||
BOOL ReadLocalMachineRegistryMultiString (wchar_t *subKey, wchar_t *name, wchar_t *value, DWORD *size)
|
||||
{
|
||||
HKEY hkey = 0;
|
||||
DWORD type;
|
||||
@@ -51,7 +51,7 @@ BOOL ReadLocalMachineRegistryMultiString (char *subKey, char *name, char *value,
|
||||
return type == REG_MULTI_SZ;
|
||||
}
|
||||
|
||||
BOOL ReadLocalMachineRegistryString (const char *subKey, char *name, char *str, DWORD *size)
|
||||
BOOL ReadLocalMachineRegistryString (const wchar_t *subKey, wchar_t *name, wchar_t *str, DWORD *size)
|
||||
{
|
||||
HKEY hkey = 0;
|
||||
DWORD type;
|
||||
@@ -69,7 +69,7 @@ BOOL ReadLocalMachineRegistryString (const char *subKey, char *name, char *str,
|
||||
return type == REG_SZ;
|
||||
}
|
||||
|
||||
BOOL ReadLocalMachineRegistryStringNonReflected (const char *subKey, char *name, char *str, DWORD *size, BOOL b32bitApp)
|
||||
BOOL ReadLocalMachineRegistryStringNonReflected (const wchar_t *subKey, wchar_t *name, wchar_t *str, DWORD *size, BOOL b32bitApp)
|
||||
{
|
||||
HKEY hkey = 0;
|
||||
DWORD type;
|
||||
@@ -87,7 +87,7 @@ BOOL ReadLocalMachineRegistryStringNonReflected (const char *subKey, char *name,
|
||||
return type == REG_SZ;
|
||||
}
|
||||
|
||||
int ReadRegistryInt (char *subKey, char *name, int defaultValue)
|
||||
int ReadRegistryInt (wchar_t *subKey, wchar_t *name, int defaultValue)
|
||||
{
|
||||
HKEY hkey = 0;
|
||||
DWORD value, size = sizeof (DWORD);
|
||||
@@ -103,27 +103,27 @@ int ReadRegistryInt (char *subKey, char *name, int defaultValue)
|
||||
return value;
|
||||
}
|
||||
|
||||
char *ReadRegistryString (char *subKey, char *name, char *defaultValue, char *str, int maxLen)
|
||||
wchar_t *ReadRegistryString (wchar_t *subKey, wchar_t *name, wchar_t *defaultValue, wchar_t *str, int maxLen)
|
||||
{
|
||||
HKEY hkey = 0;
|
||||
char value[MAX_PATH*4];
|
||||
wchar_t value[MAX_PATH*4];
|
||||
DWORD size = sizeof (value);
|
||||
|
||||
str[maxLen-1] = 0;
|
||||
StringCbCopyA (str, maxLen, defaultValue);
|
||||
str[maxLen/2-1] = 0;
|
||||
StringCbCopyW (str, maxLen, defaultValue);
|
||||
|
||||
ZeroMemory (value, sizeof value);
|
||||
if (RegOpenKeyEx (HKEY_CURRENT_USER, subKey,
|
||||
0, KEY_READ, &hkey) == ERROR_SUCCESS)
|
||||
if (RegQueryValueEx (hkey, name, 0, 0, (LPBYTE) value, &size) == ERROR_SUCCESS)
|
||||
StringCbCopyA (str, maxLen,value);
|
||||
StringCbCopyW (str, maxLen,value);
|
||||
|
||||
if (hkey)
|
||||
RegCloseKey (hkey);
|
||||
return str;
|
||||
}
|
||||
|
||||
DWORD ReadRegistryBytes (char *path, char *name, char *value, int maxLen)
|
||||
DWORD ReadRegistryBytes (wchar_t *path, wchar_t *name, char *value, int maxLen)
|
||||
{
|
||||
HKEY hkey = 0;
|
||||
DWORD size = maxLen;
|
||||
@@ -138,7 +138,7 @@ DWORD ReadRegistryBytes (char *path, char *name, char *value, int maxLen)
|
||||
return success ? size : 0;
|
||||
}
|
||||
|
||||
void WriteRegistryInt (char *subKey, char *name, int value)
|
||||
void WriteRegistryInt (wchar_t *subKey, wchar_t *name, int value)
|
||||
{
|
||||
HKEY hkey = 0;
|
||||
DWORD disp;
|
||||
@@ -151,7 +151,7 @@ void WriteRegistryInt (char *subKey, char *name, int value)
|
||||
RegCloseKey (hkey);
|
||||
}
|
||||
|
||||
BOOL WriteLocalMachineRegistryDword (char *subKey, char *name, DWORD value)
|
||||
BOOL WriteLocalMachineRegistryDword (wchar_t *subKey, wchar_t *name, DWORD value)
|
||||
{
|
||||
HKEY hkey = 0;
|
||||
DWORD disp;
|
||||
@@ -175,31 +175,7 @@ BOOL WriteLocalMachineRegistryDword (char *subKey, char *name, DWORD value)
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
BOOL WriteLocalMachineRegistryDwordW (WCHAR *subKey, WCHAR *name, DWORD value)
|
||||
{
|
||||
HKEY hkey = 0;
|
||||
DWORD disp;
|
||||
LONG status;
|
||||
|
||||
if ((status = RegCreateKeyExW (HKEY_LOCAL_MACHINE, subKey,
|
||||
0, NULL, REG_OPTION_NON_VOLATILE, KEY_WRITE, NULL, &hkey, &disp)) != ERROR_SUCCESS)
|
||||
{
|
||||
SetLastError (status);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
if ((status = RegSetValueExW (hkey, name, 0, REG_DWORD, (BYTE *) &value, sizeof value)) != ERROR_SUCCESS)
|
||||
{
|
||||
RegCloseKey (hkey);
|
||||
SetLastError (status);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
RegCloseKey (hkey);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
BOOL WriteLocalMachineRegistryMultiString (char *subKey, char *name, char *multiString, DWORD size)
|
||||
BOOL WriteLocalMachineRegistryMultiString (wchar_t *subKey, wchar_t *name, wchar_t *multiString, DWORD size)
|
||||
{
|
||||
HKEY hkey = 0;
|
||||
DWORD disp;
|
||||
@@ -223,7 +199,7 @@ BOOL WriteLocalMachineRegistryMultiString (char *subKey, char *name, char *multi
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
BOOL WriteLocalMachineRegistryString (char *subKey, char *name, char *str, BOOL expandable)
|
||||
BOOL WriteLocalMachineRegistryString (wchar_t *subKey, wchar_t *name, wchar_t *str, BOOL expandable)
|
||||
{
|
||||
HKEY hkey = 0;
|
||||
DWORD disp;
|
||||
@@ -236,7 +212,7 @@ BOOL WriteLocalMachineRegistryString (char *subKey, char *name, char *str, BOOL
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
if ((status = RegSetValueEx (hkey, name, 0, expandable ? REG_EXPAND_SZ : REG_SZ, (BYTE *) str, (DWORD) strlen (str) + 1)) != ERROR_SUCCESS)
|
||||
if ((status = RegSetValueEx (hkey, name, 0, expandable ? REG_EXPAND_SZ : REG_SZ, (BYTE *) str, (DWORD) (wcslen (str) + 1) * sizeof (wchar_t))) != ERROR_SUCCESS)
|
||||
{
|
||||
RegCloseKey (hkey);
|
||||
SetLastError (status);
|
||||
@@ -247,7 +223,7 @@ BOOL WriteLocalMachineRegistryString (char *subKey, char *name, char *str, BOOL
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
void WriteRegistryString (char *subKey, char *name, char *str)
|
||||
void WriteRegistryString (wchar_t *subKey, wchar_t *name, wchar_t *str)
|
||||
{
|
||||
HKEY hkey = 0;
|
||||
DWORD disp;
|
||||
@@ -256,11 +232,11 @@ void WriteRegistryString (char *subKey, char *name, char *str)
|
||||
0, NULL, REG_OPTION_NON_VOLATILE, KEY_WRITE, NULL, &hkey, &disp) != ERROR_SUCCESS)
|
||||
return;
|
||||
|
||||
RegSetValueEx (hkey, name, 0, REG_SZ, (BYTE *) str, (DWORD) strlen (str) + 1);
|
||||
RegSetValueEx (hkey, name, 0, REG_SZ, (BYTE *) str, (DWORD) (wcslen (str) + 1) * sizeof (wchar_t));
|
||||
RegCloseKey (hkey);
|
||||
}
|
||||
|
||||
BOOL WriteRegistryBytes (char *path, char *name, char *str, DWORD size)
|
||||
BOOL WriteRegistryBytes (wchar_t *path, wchar_t *name, char *str, DWORD size)
|
||||
{
|
||||
HKEY hkey = 0;
|
||||
DWORD disp;
|
||||
@@ -275,7 +251,7 @@ BOOL WriteRegistryBytes (char *path, char *name, char *str, DWORD size)
|
||||
return res == ERROR_SUCCESS;
|
||||
}
|
||||
|
||||
BOOL DeleteLocalMachineRegistryKey (char *parentKey, char *subKeyToDelete)
|
||||
BOOL DeleteLocalMachineRegistryKey (wchar_t *parentKey, wchar_t *subKeyToDelete)
|
||||
{
|
||||
LONG status;
|
||||
HKEY hkey = 0;
|
||||
@@ -297,7 +273,7 @@ BOOL DeleteLocalMachineRegistryKey (char *parentKey, char *subKeyToDelete)
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
void DeleteRegistryValue (char *subKey, char *name)
|
||||
void DeleteRegistryValue (wchar_t *subKey, wchar_t *name)
|
||||
{
|
||||
HKEY hkey = 0;
|
||||
|
||||
@@ -309,16 +285,16 @@ void DeleteRegistryValue (char *subKey, char *name)
|
||||
}
|
||||
|
||||
|
||||
void GetStartupRegKeyName (char *regk, size_t cbRegk)
|
||||
void GetStartupRegKeyName (wchar_t *regk, size_t cbRegk)
|
||||
{
|
||||
// The string is split in order to prevent some antivirus packages from falsely reporting
|
||||
// VeraCrypt.exe to contain a possible Trojan horse because of this string (heuristic scan).
|
||||
StringCbPrintfA (regk, cbRegk,"%s%s", "Software\\Microsoft\\Windows\\Curren", "tVersion\\Run");
|
||||
StringCbPrintfW (regk, cbRegk,L"%s%s", L"Software\\Microsoft\\Windows\\Curren", L"tVersion\\Run");
|
||||
}
|
||||
|
||||
void GetRestorePointRegKeyName (char *regk, size_t cbRegk)
|
||||
void GetRestorePointRegKeyName (wchar_t *regk, size_t cbRegk)
|
||||
{
|
||||
// The string is split in order to prevent some antivirus packages from falsely reporting
|
||||
// VeraCrypt.exe to contain a possible Trojan horse because of this string (heuristic scan).
|
||||
StringCbPrintfA (regk, cbRegk,"%s%s%s%s", "Software\\Microsoft\\Windows", " NT\\Curren", "tVersion\\Sy", "stemRestore");
|
||||
StringCbPrintfW (regk, cbRegk,L"%s%s%s%s", L"Software\\Microsoft\\Windows", L" NT\\Curren", L"tVersion\\Sy", L"stemRestore");
|
||||
}
|
||||
@@ -14,24 +14,23 @@
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
BOOL ReadLocalMachineRegistryDword (char *subKey, char *name, DWORD *value);
|
||||
BOOL ReadLocalMachineRegistryMultiString (char *subKey, char *name, char *value, DWORD *size);
|
||||
BOOL ReadLocalMachineRegistryString (const char *subKey, char *name, char *value, DWORD *size);
|
||||
BOOL ReadLocalMachineRegistryStringNonReflected (const char *subKey, char *name, char *str, DWORD *size, BOOL b32bitApp);
|
||||
int ReadRegistryInt (char *subKey, char *name, int defaultValue);
|
||||
char *ReadRegistryString (char *subKey, char *name, char *defaultValue, char *str, int maxLen);
|
||||
DWORD ReadRegistryBytes (char *path, char *name, char *value, int maxLen);
|
||||
void WriteRegistryInt (char *subKey, char *name, int value);
|
||||
BOOL WriteLocalMachineRegistryDword (char *subKey, char *name, DWORD value);
|
||||
BOOL WriteLocalMachineRegistryDwordW (WCHAR *subKey, WCHAR *name, DWORD value);
|
||||
BOOL WriteLocalMachineRegistryMultiString (char *subKey, char *name, char *multiString, DWORD size);
|
||||
BOOL WriteLocalMachineRegistryString (char *subKey, char *name, char *str, BOOL expandable);
|
||||
void WriteRegistryString (char *subKey, char *name, char *str);
|
||||
BOOL WriteRegistryBytes (char *path, char *name, char *str, DWORD size);
|
||||
BOOL DeleteLocalMachineRegistryKey (char *parentKey, char *subKeyToDelete);
|
||||
void DeleteRegistryValue (char *subKey, char *name);
|
||||
void GetStartupRegKeyName (char *regk, size_t cbRegk);
|
||||
void GetRestorePointRegKeyName (char *regk, size_t cbRegk);
|
||||
BOOL ReadLocalMachineRegistryDword (wchar_t *subKey, wchar_t *name, DWORD *value);
|
||||
BOOL ReadLocalMachineRegistryMultiString (wchar_t *subKey, wchar_t *name, wchar_t *value, DWORD *size);
|
||||
BOOL ReadLocalMachineRegistryString (const wchar_t *subKey, wchar_t *name, wchar_t *value, DWORD *size);
|
||||
BOOL ReadLocalMachineRegistryStringNonReflected (const wchar_t *subKey, wchar_t *name, wchar_t *str, DWORD *size, BOOL b32bitApp);
|
||||
int ReadRegistryInt (wchar_t *subKey, wchar_t *name, int defaultValue);
|
||||
wchar_t *ReadRegistryString (wchar_t *subKey, wchar_t *name, wchar_t *defaultValue, wchar_t *str, int maxLen);
|
||||
DWORD ReadRegistryBytes (wchar_t *path, wchar_t *name, char *value, int maxLen);
|
||||
void WriteRegistryInt (wchar_t *subKey, wchar_t *name, int value);
|
||||
BOOL WriteLocalMachineRegistryDword (wchar_t *subKey, wchar_t *name, DWORD value);
|
||||
BOOL WriteLocalMachineRegistryMultiString (wchar_t *subKey, wchar_t *name, wchar_t *multiString, DWORD size);
|
||||
BOOL WriteLocalMachineRegistryString (wchar_t *subKey, wchar_t *name, wchar_t *str, BOOL expandable);
|
||||
void WriteRegistryString (wchar_t *subKey, wchar_t *name, wchar_t *str);
|
||||
BOOL WriteRegistryBytes (wchar_t *path, wchar_t *name, char *str, DWORD size);
|
||||
BOOL DeleteLocalMachineRegistryKey (wchar_t *parentKey, wchar_t *subKeyToDelete);
|
||||
void DeleteRegistryValue (wchar_t *subKey, wchar_t *name);
|
||||
void GetStartupRegKeyName (wchar_t *regk, size_t cbRegk);
|
||||
void GetRestorePointRegKeyName (wchar_t *regk, size_t cbRegk);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
||||
@@ -47,7 +47,7 @@ namespace VeraCrypt
|
||||
SlotId = slotId;
|
||||
|
||||
size_t keyIdPos = pathStr.find (L"/" TC_SECURITY_TOKEN_KEYFILE_URL_FILE L"/");
|
||||
if (keyIdPos == string::npos)
|
||||
if (keyIdPos == wstring::npos)
|
||||
throw InvalidSecurityTokenKeyfilePath();
|
||||
|
||||
Id = pathStr.substr (keyIdPos + wstring (L"/" TC_SECURITY_TOKEN_KEYFILE_URL_FILE L"/").size());
|
||||
@@ -510,13 +510,17 @@ namespace VeraCrypt
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef TC_WINDOWS
|
||||
void SecurityToken::InitLibrary (const wstring &pkcs11LibraryPath, auto_ptr <GetPinFunctor> pinCallback, auto_ptr <SendExceptionFunctor> warningCallback)
|
||||
#else
|
||||
void SecurityToken::InitLibrary (const string &pkcs11LibraryPath, auto_ptr <GetPinFunctor> pinCallback, auto_ptr <SendExceptionFunctor> warningCallback)
|
||||
#endif
|
||||
{
|
||||
if (Initialized)
|
||||
CloseLibrary();
|
||||
|
||||
#ifdef TC_WINDOWS
|
||||
Pkcs11LibraryHandle = LoadLibraryA (pkcs11LibraryPath.c_str());
|
||||
Pkcs11LibraryHandle = LoadLibraryW (pkcs11LibraryPath.c_str());
|
||||
#else
|
||||
Pkcs11LibraryHandle = dlopen (pkcs11LibraryPath.c_str(), RTLD_NOW | RTLD_LOCAL);
|
||||
#endif
|
||||
|
||||
@@ -189,7 +189,11 @@ namespace VeraCrypt
|
||||
static void GetKeyfileData (const SecurityTokenKeyfile &keyfile, vector <byte> &keyfileData);
|
||||
static list <SecurityTokenInfo> GetAvailableTokens ();
|
||||
static SecurityTokenInfo GetTokenInfo (CK_SLOT_ID slotId);
|
||||
#ifdef TC_WINDOWS
|
||||
static void InitLibrary (const wstring &pkcs11LibraryPath, auto_ptr <GetPinFunctor> pinCallback, auto_ptr <SendExceptionFunctor> warningCallback);
|
||||
#else
|
||||
static void InitLibrary (const string &pkcs11LibraryPath, auto_ptr <GetPinFunctor> pinCallback, auto_ptr <SendExceptionFunctor> warningCallback);
|
||||
#endif
|
||||
static bool IsInitialized () { return Initialized; }
|
||||
static bool IsKeyfilePathValid (const wstring &securityTokenKeyfilePath);
|
||||
|
||||
|
||||
@@ -175,6 +175,7 @@ typedef int BOOL;
|
||||
#include <process.h> /* Process control */
|
||||
#include <winioctl.h>
|
||||
#include <stdio.h> /* For sprintf */
|
||||
#include <tchar.h>
|
||||
|
||||
#endif /* _WIN32 */
|
||||
|
||||
@@ -254,7 +255,7 @@ void EraseMemory (void *memory, int size);
|
||||
#define TC_MAX_PATH 260 /* Includes the null terminator */
|
||||
#endif
|
||||
|
||||
#define TC_STR_RELEASED_BY "Released by IDRIX on " TC_STR_RELEASE_DATE
|
||||
#define TC_STR_RELEASED_BY L"Released by IDRIX on " TC_STR_RELEASE_DATE
|
||||
|
||||
#define MAX_URL_LENGTH 2084 /* Internet Explorer limit. Includes the terminating null character. */
|
||||
|
||||
|
||||
@@ -265,7 +265,7 @@ BOOL XTSAesTest (PCRYPTO_INFO ci)
|
||||
|
||||
for (i = 0; i < XTS_TEST_COUNT; i++)
|
||||
{
|
||||
ci->ea = EAGetByName ("AES");
|
||||
ci->ea = EAGetByName (L"AES");
|
||||
if (ci->ea == 0)
|
||||
return FALSE;
|
||||
|
||||
@@ -476,7 +476,7 @@ BOOL TestSectorBufEncryption (PCRYPTO_INFO ci)
|
||||
{
|
||||
unsigned char buf [ENCRYPTION_DATA_UNIT_SIZE * 4];
|
||||
unsigned int i;
|
||||
char name[64];
|
||||
wchar_t name[64];
|
||||
unsigned __int32 crc;
|
||||
UINT64_STRUCT unitNo;
|
||||
uint32 nbrUnits;
|
||||
@@ -538,7 +538,7 @@ BOOL TestSectorBufEncryption (PCRYPTO_INFO ci)
|
||||
|
||||
crc = GetCrc32 (buf, sizeof (buf));
|
||||
|
||||
if (strcmp (name, "AES") == 0)
|
||||
if (wcscmp (name, L"AES") == 0)
|
||||
{
|
||||
// Verify the ciphertext of the "moving" data unit using the IEEE test vector #14
|
||||
if (memcmp (XTS_vectors[XTS_TEST_COUNT-1].ciphertext,
|
||||
@@ -573,7 +573,7 @@ BOOL TestSectorBufEncryption (PCRYPTO_INFO ci)
|
||||
break;
|
||||
}
|
||||
}
|
||||
else if (strcmp (name, "Serpent") == 0)
|
||||
else if (wcscmp (name, L"Serpent") == 0)
|
||||
{
|
||||
switch (testCase)
|
||||
{
|
||||
@@ -599,7 +599,7 @@ BOOL TestSectorBufEncryption (PCRYPTO_INFO ci)
|
||||
break;
|
||||
}
|
||||
}
|
||||
else if (strcmp (name, "Twofish") == 0)
|
||||
else if (wcscmp (name, L"Twofish") == 0)
|
||||
{
|
||||
switch (testCase)
|
||||
{
|
||||
@@ -625,7 +625,7 @@ BOOL TestSectorBufEncryption (PCRYPTO_INFO ci)
|
||||
break;
|
||||
}
|
||||
}
|
||||
else if (strcmp (name, "AES-Twofish") == 0)
|
||||
else if (wcscmp (name, L"AES-Twofish") == 0)
|
||||
{
|
||||
switch (testCase)
|
||||
{
|
||||
@@ -651,7 +651,7 @@ BOOL TestSectorBufEncryption (PCRYPTO_INFO ci)
|
||||
break;
|
||||
}
|
||||
}
|
||||
else if (strcmp (name, "AES-Twofish-Serpent") == 0)
|
||||
else if (wcscmp (name, L"AES-Twofish-Serpent") == 0)
|
||||
{
|
||||
switch (testCase)
|
||||
{
|
||||
@@ -677,7 +677,7 @@ BOOL TestSectorBufEncryption (PCRYPTO_INFO ci)
|
||||
break;
|
||||
}
|
||||
}
|
||||
else if (strcmp (name, "Serpent-AES") == 0)
|
||||
else if (wcscmp (name, L"Serpent-AES") == 0)
|
||||
{
|
||||
switch (testCase)
|
||||
{
|
||||
@@ -703,7 +703,7 @@ BOOL TestSectorBufEncryption (PCRYPTO_INFO ci)
|
||||
break;
|
||||
}
|
||||
}
|
||||
else if (strcmp (name, "Serpent-Twofish-AES") == 0)
|
||||
else if (wcscmp (name, L"Serpent-Twofish-AES") == 0)
|
||||
{
|
||||
switch (testCase)
|
||||
{
|
||||
@@ -729,7 +729,7 @@ BOOL TestSectorBufEncryption (PCRYPTO_INFO ci)
|
||||
break;
|
||||
}
|
||||
}
|
||||
else if (strcmp (name, "Twofish-Serpent") == 0)
|
||||
else if (wcscmp (name, L"Twofish-Serpent") == 0)
|
||||
{
|
||||
switch (testCase)
|
||||
{
|
||||
@@ -801,49 +801,49 @@ BOOL TestSectorBufEncryption (PCRYPTO_INFO ci)
|
||||
|
||||
crc = GetCrc32 (buf, sizeof (buf));
|
||||
|
||||
if (strcmp (name, "AES") == 0)
|
||||
if (wcscmp (name, L"AES") == 0)
|
||||
{
|
||||
if (crc != 0x33b91fab)
|
||||
return FALSE;
|
||||
nTestsPerformed++;
|
||||
}
|
||||
else if (strcmp (name, "Serpent") == 0)
|
||||
else if (wcscmp (name, L"Serpent") == 0)
|
||||
{
|
||||
if (crc != 0x3494d480)
|
||||
return FALSE;
|
||||
nTestsPerformed++;
|
||||
}
|
||||
else if (strcmp (name, "Twofish") == 0)
|
||||
else if (wcscmp (name, L"Twofish") == 0)
|
||||
{
|
||||
if (crc != 0xc4d65b46)
|
||||
return FALSE;
|
||||
nTestsPerformed++;
|
||||
}
|
||||
else if (strcmp (name, "AES-Twofish") == 0)
|
||||
else if (wcscmp (name, L"AES-Twofish") == 0)
|
||||
{
|
||||
if (crc != 0x14ce7385)
|
||||
return FALSE;
|
||||
nTestsPerformed++;
|
||||
}
|
||||
else if (strcmp (name, "AES-Twofish-Serpent") == 0)
|
||||
else if (wcscmp (name, L"AES-Twofish-Serpent") == 0)
|
||||
{
|
||||
if (crc != 0x0ec81bf7)
|
||||
return FALSE;
|
||||
nTestsPerformed++;
|
||||
}
|
||||
else if (strcmp (name, "Serpent-AES") == 0)
|
||||
else if (wcscmp (name, L"Serpent-AES") == 0)
|
||||
{
|
||||
if (crc != 0x42f919ad)
|
||||
return FALSE;
|
||||
nTestsPerformed++;
|
||||
}
|
||||
else if (strcmp (name, "Serpent-Twofish-AES") == 0)
|
||||
else if (wcscmp (name, L"Serpent-Twofish-AES") == 0)
|
||||
{
|
||||
if (crc != 0x208d5c58)
|
||||
return FALSE;
|
||||
nTestsPerformed++;
|
||||
}
|
||||
else if (strcmp (name, "Twofish-Serpent") == 0)
|
||||
else if (wcscmp (name, L"Twofish-Serpent") == 0)
|
||||
{
|
||||
if (crc != 0xbe78cec1)
|
||||
return FALSE;
|
||||
|
||||
@@ -210,26 +210,59 @@ char *XmlQuoteText (const char *textSrc, char *textDst, int textDstMaxSize)
|
||||
return textDst;
|
||||
}
|
||||
|
||||
|
||||
int XmlWriteHeader (FILE *file)
|
||||
wchar_t *XmlQuoteTextW (const wchar_t *textSrc, wchar_t *textDst, int textDstMaxSize)
|
||||
{
|
||||
return fputs ("<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<VeraCrypt>", file);
|
||||
wchar_t *textDstLast = textDst + textDstMaxSize - 1;
|
||||
|
||||
if (textDstMaxSize == 0)
|
||||
return NULL;
|
||||
|
||||
while (*textSrc != 0 && textDst <= textDstLast)
|
||||
{
|
||||
wchar_t c = *textSrc++;
|
||||
switch (c)
|
||||
{
|
||||
case L'&':
|
||||
if (textDst + 6 > textDstLast)
|
||||
return NULL;
|
||||
wcscpy (textDst, L"&");
|
||||
textDst += 5;
|
||||
continue;
|
||||
|
||||
case L'>':
|
||||
if (textDst + 5 > textDstLast)
|
||||
return NULL;
|
||||
wcscpy (textDst, L">");
|
||||
textDst += 4;
|
||||
continue;
|
||||
|
||||
case L'<':
|
||||
if (textDst + 5 > textDstLast)
|
||||
return NULL;
|
||||
wcscpy (textDst, L"<");
|
||||
textDst += 4;
|
||||
continue;
|
||||
|
||||
default:
|
||||
*textDst++ = c;
|
||||
}
|
||||
}
|
||||
|
||||
if (textDst > textDstLast)
|
||||
return NULL;
|
||||
|
||||
*textDst = 0;
|
||||
return textDst;
|
||||
}
|
||||
|
||||
|
||||
int XmlWriteHeaderW (FILE *file)
|
||||
int XmlWriteHeader (FILE *file)
|
||||
{
|
||||
return fputws (L"<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<VeraCrypt>", file);
|
||||
}
|
||||
|
||||
|
||||
int XmlWriteFooter (FILE *file)
|
||||
{
|
||||
return fputs ("\n</VeraCrypt>", file);
|
||||
}
|
||||
|
||||
|
||||
int XmlWriteFooterW (FILE *file)
|
||||
{
|
||||
return fputws (L"\n</VeraCrypt>", file);
|
||||
}
|
||||
|
||||
@@ -19,11 +19,10 @@ char *XmlFindElement (char *xmlNode, char *nodeName);
|
||||
char *XmlGetAttributeText (char *xmlNode, char *xmlAttrName, char *xmlAttrValue, int xmlAttrValueSize);
|
||||
char *XmlGetNodeText (char *xmlNode, char *xmlText, int xmlTextSize);
|
||||
int XmlWriteHeader (FILE *file);
|
||||
int XmlWriteHeaderW (FILE *file);
|
||||
int XmlWriteFooter (FILE *file);
|
||||
int XmlWriteFooterW (FILE *file);
|
||||
char *XmlFindElementByAttributeValue (char *xml, char *nodeName, char *attrName, char *attrValue);
|
||||
char *XmlQuoteText (const char *textSrc, char *textDst, int textDstMaxSize);
|
||||
wchar_t *XmlQuoteTextW (const wchar_t *textSrc, wchar_t *textDst, int textDstMaxSize);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
IntermediateDirectory="Debug"
|
||||
ConfigurationType="4"
|
||||
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
|
||||
CharacterSet="2"
|
||||
CharacterSet="1"
|
||||
>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"
|
||||
@@ -85,13 +85,80 @@
|
||||
Name="VCPostBuildEventTool"
|
||||
/>
|
||||
</Configuration>
|
||||
<Configuration
|
||||
Name="Debug|x64"
|
||||
OutputDirectory="$(PlatformName)\$(ConfigurationName)"
|
||||
IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
|
||||
ConfigurationType="4"
|
||||
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
|
||||
CharacterSet="1"
|
||||
>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"
|
||||
TargetEnvironment="3"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories=""$(ProjectDir)\..";"$(ProjectDir)\..\Common""
|
||||
PreprocessorDefinitions="WIN32;DEBUG;_DEBUG;_LIB;_CRT_SECURE_NO_DEPRECATE;_CRT_NON_CONFORMING_SWPRINTFS"
|
||||
MinimalRebuild="true"
|
||||
BasicRuntimeChecks="0"
|
||||
RuntimeLibrary="1"
|
||||
BufferSecurityCheck="false"
|
||||
UsePrecompiledHeader="0"
|
||||
WarningLevel="4"
|
||||
DebugInformationFormat="3"
|
||||
DisableSpecificWarnings="4100;4127;4201"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManagedResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCLibrarianTool"
|
||||
OutputFile="$(OutDir)/Crypto.lib"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCALinkTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXDCMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCBscMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCFxCopTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"
|
||||
/>
|
||||
</Configuration>
|
||||
<Configuration
|
||||
Name="Release|Win32"
|
||||
OutputDirectory="Release"
|
||||
IntermediateDirectory="Release"
|
||||
ConfigurationType="4"
|
||||
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
|
||||
CharacterSet="2"
|
||||
CharacterSet="1"
|
||||
>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"
|
||||
@@ -153,80 +220,13 @@
|
||||
Name="VCPostBuildEventTool"
|
||||
/>
|
||||
</Configuration>
|
||||
<Configuration
|
||||
Name="Debug|x64"
|
||||
OutputDirectory="$(PlatformName)\$(ConfigurationName)"
|
||||
IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
|
||||
ConfigurationType="4"
|
||||
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
|
||||
CharacterSet="2"
|
||||
>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"
|
||||
TargetEnvironment="3"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories=""$(ProjectDir)\..";"$(ProjectDir)\..\Common""
|
||||
PreprocessorDefinitions="WIN32;DEBUG;_DEBUG;_LIB;_CRT_SECURE_NO_DEPRECATE;_CRT_NON_CONFORMING_SWPRINTFS"
|
||||
MinimalRebuild="true"
|
||||
BasicRuntimeChecks="0"
|
||||
RuntimeLibrary="1"
|
||||
BufferSecurityCheck="false"
|
||||
UsePrecompiledHeader="0"
|
||||
WarningLevel="4"
|
||||
DebugInformationFormat="3"
|
||||
DisableSpecificWarnings="4100;4127;4201"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManagedResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCLibrarianTool"
|
||||
OutputFile="$(OutDir)/Crypto.lib"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCALinkTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXDCMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCBscMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCFxCopTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"
|
||||
/>
|
||||
</Configuration>
|
||||
<Configuration
|
||||
Name="Release|x64"
|
||||
OutputDirectory="$(PlatformName)\$(ConfigurationName)"
|
||||
IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
|
||||
ConfigurationType="4"
|
||||
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
|
||||
CharacterSet="2"
|
||||
CharacterSet="1"
|
||||
>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"
|
||||
@@ -310,15 +310,6 @@
|
||||
Outputs="$(TargetDir)\$(InputName).obj"
|
||||
/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Release|Win32"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
CommandLine="echo $(InputFileName) & nasm.exe -Xvc -f win32 -Ox --prefix _ -o "$(TargetDir)\$(InputName).obj" -l "$(TargetDir)\$(InputName).lst" "$(InputPath)"
"
|
||||
Outputs="$(TargetDir)\$(InputName).obj"
|
||||
/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Debug|x64"
|
||||
>
|
||||
@@ -328,6 +319,15 @@
|
||||
Outputs="$(TargetDir)\$(InputName).obj"
|
||||
/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Release|Win32"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
CommandLine="echo $(InputFileName) & nasm.exe -Xvc -f win32 -Ox --prefix _ -o "$(TargetDir)\$(InputName).obj" -l "$(TargetDir)\$(InputName).lst" "$(InputPath)"
"
|
||||
Outputs="$(TargetDir)\$(InputName).obj"
|
||||
/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Release|x64"
|
||||
>
|
||||
@@ -349,6 +349,15 @@
|
||||
Name="VCCustomBuildTool"
|
||||
/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Debug|x64"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
CommandLine="echo $(InputFileName) & nasm.exe -Xvc -f win64 -Ox -o "$(TargetDir)\$(InputName).obj" -l "$(TargetDir)\$(InputName).lst" "$(InputPath)"
"
|
||||
Outputs="$(TargetDir)\$(InputName).obj"
|
||||
/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Release|Win32"
|
||||
ExcludedFromBuild="true"
|
||||
@@ -357,21 +366,12 @@
|
||||
Name="VCCustomBuildTool"
|
||||
/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Debug|x64"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
CommandLine="echo $(InputFileName) & nasm.exe -Xvc -f win64 -Ox -o "$(TargetDir)\$(InputName).obj" -l "$(TargetDir)\$(InputName).lst" "$(InputPath)""
|
||||
Outputs="$(TargetDir)\$(InputName).obj"
|
||||
/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Release|x64"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
CommandLine="echo $(InputFileName) & nasm.exe -Xvc -f win64 -Ox -o "$(TargetDir)\$(InputName).obj" -l "$(TargetDir)\$(InputName).lst" "$(InputPath)""
|
||||
CommandLine="echo $(InputFileName) & nasm.exe -Xvc -f win64 -Ox -o "$(TargetDir)\$(InputName).obj" -l "$(TargetDir)\$(InputName).lst" "$(InputPath)"
"
|
||||
Outputs="$(TargetDir)\$(InputName).obj"
|
||||
/>
|
||||
</FileConfiguration>
|
||||
@@ -388,15 +388,6 @@
|
||||
Outputs="$(TargetDir)\$(InputName).obj"
|
||||
/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Release|Win32"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
CommandLine="echo $(InputFileName) & nasm.exe -Xvc -f win32 -Ox --prefix _ -o "$(TargetDir)\$(InputName).obj" -l "$(TargetDir)\$(InputName).lst" "$(InputPath)"
"
|
||||
Outputs="$(TargetDir)\$(InputName).obj"
|
||||
/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Debug|x64"
|
||||
ExcludedFromBuild="true"
|
||||
@@ -407,6 +398,15 @@
|
||||
Outputs="$(TargetDir)\$(InputName).obj"
|
||||
/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Release|Win32"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
CommandLine="echo $(InputFileName) & nasm.exe -Xvc -f win32 -Ox --prefix _ -o "$(TargetDir)\$(InputName).obj" -l "$(TargetDir)\$(InputName).lst" "$(InputPath)"
"
|
||||
Outputs="$(TargetDir)\$(InputName).obj"
|
||||
/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Release|x64"
|
||||
ExcludedFromBuild="true"
|
||||
|
||||
@@ -13,6 +13,7 @@
|
||||
#include "TCdefs.h"
|
||||
#include <ntddk.h>
|
||||
#include <ntddvol.h>
|
||||
#include <Ntstrsafe.h>
|
||||
#include "Cache.h"
|
||||
#include "Crc.h"
|
||||
#include "Crypto.h"
|
||||
@@ -1812,9 +1813,14 @@ void GetBootEncryptionAlgorithmName (PIRP irp, PIO_STACK_LOCATION irpSp)
|
||||
{
|
||||
if (BootDriveFilterExtension && BootDriveFilterExtension->DriveMounted)
|
||||
{
|
||||
wchar_t BootEncryptionAlgorithmNameW[256];
|
||||
wchar_t BootPrfAlgorithmNameW[256];
|
||||
GetBootEncryptionAlgorithmNameRequest *request = (GetBootEncryptionAlgorithmNameRequest *) irp->AssociatedIrp.SystemBuffer;
|
||||
EAGetName (request->BootEncryptionAlgorithmName, BootDriveFilterExtension->Queue.CryptoInfo->ea, 0);
|
||||
HashGetName2 (request->BootPrfAlgorithmName, BootDriveFilterExtension->Queue.CryptoInfo->pkcs5);
|
||||
EAGetName (BootEncryptionAlgorithmNameW, BootDriveFilterExtension->Queue.CryptoInfo->ea, 0);
|
||||
HashGetName2 (BootPrfAlgorithmNameW, BootDriveFilterExtension->Queue.CryptoInfo->pkcs5);
|
||||
|
||||
RtlStringCbPrintfA (request->BootEncryptionAlgorithmName, sizeof (request->BootEncryptionAlgorithmName), "%S", BootEncryptionAlgorithmNameW);
|
||||
RtlStringCbPrintfA (request->BootPrfAlgorithmName, sizeof (request->BootPrfAlgorithmName), "%S", BootPrfAlgorithmNameW);
|
||||
|
||||
irp->IoStatus.Information = sizeof (GetBootEncryptionAlgorithmNameRequest);
|
||||
irp->IoStatus.Status = STATUS_SUCCESS;
|
||||
|
||||
@@ -50,7 +50,7 @@
|
||||
#define TIMER_INTERVAL_RANDVIEW 50
|
||||
|
||||
// see definition of enum EV_FileSystem
|
||||
const char * szFileSystemStr[3] = {"RAW","FAT","NTFS"};
|
||||
const wchar_t * szFileSystemStr[3] = {L"RAW",L"FAT",L"NTFS"};
|
||||
|
||||
// prototypes for internal functions
|
||||
BOOL CALLBACK ExpandVolSizeDlgProc (HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam);
|
||||
@@ -59,15 +59,15 @@ BOOL CALLBACK ExpandVolProgressDlgProc (HWND hwndDlg, UINT msg, WPARAM wParam, L
|
||||
namespace VeraCryptExpander
|
||||
{
|
||||
/* defined in WinMain.c, referenced by ExpandVolumeWizard() */
|
||||
int ExtcvAskVolumePassword (HWND hwndDlg, const char* fileName, Password *password, int *pkcs5, int *pim, BOOL* truecryptMode, char *titleStringId, BOOL enableMountOptions);
|
||||
int ExtcvAskVolumePassword (HWND hwndDlg, const wchar_t* fileName, Password *password, int *pkcs5, int *pim, BOOL* truecryptMode, char *titleStringId, BOOL enableMountOptions);
|
||||
}
|
||||
|
||||
|
||||
int GetSpaceString(char *dest, size_t maxlen, uint64 size, BOOL bDevice)
|
||||
int GetSpaceString(wchar_t *dest, size_t cbDest, uint64 size, BOOL bDevice)
|
||||
{
|
||||
const char * szFmtBytes = "%.0lf %s";
|
||||
const char * szFmtOther = "%.2lf %s";
|
||||
const char * SuffixStr[] = {"Byte", "kB", "MB", "GB", "TB"};
|
||||
const wchar_t * szFmtBytes = L"%.0lf %s";
|
||||
const wchar_t * szFmtOther = L"%.2lf %s";
|
||||
const wchar_t * SuffixStr[] = {L"Byte", L"KB", L"MB", L"GB", L"TB"};
|
||||
const uint64 Muliplier[] = {1, BYTES_PER_KB, BYTES_PER_MB, BYTES_PER_GB, BYTES_PER_TB};
|
||||
const int nMaxSuffix = sizeof(Muliplier)/sizeof(uint64) - 1;
|
||||
int i;
|
||||
@@ -77,15 +77,15 @@ int GetSpaceString(char *dest, size_t maxlen, uint64 size, BOOL bDevice)
|
||||
--i;
|
||||
|
||||
if (bDevice) {
|
||||
char szTemp[512];
|
||||
wchar_t szTemp[512];
|
||||
|
||||
if (sprintf_s(szTemp, sizeof(szTemp),i?szFmtOther:szFmtBytes, size/(double)Muliplier[i], SuffixStr[i]) < 0 )
|
||||
if (StringCbPrintfW(szTemp, sizeof(szTemp),i?szFmtOther:szFmtBytes, size/(double)Muliplier[i], SuffixStr[i]) < 0 )
|
||||
return -1;
|
||||
|
||||
return sprintf_s(dest, maxlen, "%I64u sectors (%s)", size/SECTOR_SIZE_MSG , szTemp);
|
||||
return StringCbPrintfW(dest, cbDest, L"%I64u sectors (%s)", size/SECTOR_SIZE_MSG , szTemp);
|
||||
}
|
||||
|
||||
return sprintf_s(dest, maxlen,i?szFmtOther:szFmtBytes, size/(double)Muliplier[i], SuffixStr[i]);
|
||||
return StringCbPrintfW(dest, cbDest,i?szFmtOther:szFmtBytes, size/(double)Muliplier[i], SuffixStr[i]);
|
||||
}
|
||||
|
||||
void SetCurrentVolSize(HWND hwndDlg, uint64 size)
|
||||
@@ -94,14 +94,14 @@ void SetCurrentVolSize(HWND hwndDlg, uint64 size)
|
||||
const int IdRadioBtn[] = {IDC_KB, IDC_MB, IDC_GB, IDC_TB};
|
||||
const int nMaxSuffix = sizeof(Muliplier)/sizeof(uint64) - 1;
|
||||
int i;
|
||||
char szTemp[256];
|
||||
wchar_t szTemp[256];
|
||||
|
||||
for (i=1; i<=nMaxSuffix && size>Muliplier[i]; i++) ;
|
||||
|
||||
--i;
|
||||
|
||||
SendDlgItemMessage (hwndDlg, IdRadioBtn[i], BM_SETCHECK, BST_CHECKED, 0);
|
||||
StringCbPrintfA(szTemp,sizeof(szTemp),"%I64u",size/Muliplier[i]);
|
||||
StringCbPrintfW(szTemp,sizeof(szTemp),L"%I64u",size/Muliplier[i]);
|
||||
SetWindowText (GetDlgItem (hwndDlg, IDC_SIZEBOX), szTemp);
|
||||
}
|
||||
|
||||
@@ -127,7 +127,7 @@ BOOL CALLBACK ExpandVolSizeDlgProc (HWND hwndDlg, UINT msg, WPARAM wParam, LPARA
|
||||
{
|
||||
case WM_INITDIALOG:
|
||||
{
|
||||
char szTemp[4096];
|
||||
wchar_t szTemp[4096];
|
||||
|
||||
pVolExpandParam = (EXPAND_VOL_THREAD_PARAMS*)lParam;
|
||||
|
||||
@@ -159,11 +159,11 @@ BOOL CALLBACK ExpandVolSizeDlgProc (HWND hwndDlg, UINT msg, WPARAM wParam, LPARA
|
||||
}
|
||||
else
|
||||
{
|
||||
char szHostFreeStr[256];
|
||||
wchar_t szHostFreeStr[256];
|
||||
|
||||
SetWindowText (GetDlgItem (hwndDlg, IDT_NEW_SIZE), "");
|
||||
SetWindowText (GetDlgItem (hwndDlg, IDT_NEW_SIZE), L"");
|
||||
GetSpaceString(szHostFreeStr,sizeof(szHostFreeStr),pVolExpandParam->hostSizeFree,FALSE);
|
||||
StringCbPrintfA (szTemp,sizeof(szTemp),"%s available on host drive", szHostFreeStr);
|
||||
StringCbPrintfW (szTemp,sizeof(szTemp),L"%s available on host drive", szHostFreeStr);
|
||||
}
|
||||
|
||||
SetWindowText (GetDlgItem (hwndDlg, IDC_EXPAND_VOLUME_NEWSIZE), szTemp);
|
||||
@@ -171,13 +171,13 @@ BOOL CALLBACK ExpandVolSizeDlgProc (HWND hwndDlg, UINT msg, WPARAM wParam, LPARA
|
||||
// set help text
|
||||
if (pVolExpandParam->bIsDevice)
|
||||
{
|
||||
StringCbPrintfA (szTemp,sizeof(szTemp),"This is a device-based VeraCrypt volume.\n\nThe new volume size will be choosen automatically as the size of the host device.");
|
||||
StringCbPrintfW (szTemp,sizeof(szTemp),L"This is a device-based VeraCrypt volume.\n\nThe new volume size will be choosen automatically as the size of the host device.");
|
||||
if (pVolExpandParam->bIsLegacy)
|
||||
StringCbCatA(szTemp,sizeof(szTemp)," Note: filling the new space with random data is not supported for legacy volumes.");
|
||||
StringCbCatW(szTemp,sizeof(szTemp),L" Note: filling the new space with random data is not supported for legacy volumes.");
|
||||
}
|
||||
else
|
||||
{
|
||||
StringCbPrintfA (szTemp, sizeof(szTemp),"Please specify the new size of the VeraCrypt volume (must be at least %I64u KB larger than the current size).",TC_MINVAL_FS_EXPAND/1024);
|
||||
StringCbPrintfW (szTemp, sizeof(szTemp),L"Please specify the new size of the VeraCrypt volume (must be at least %I64u KB larger than the current size).",TC_MINVAL_FS_EXPAND/1024);
|
||||
}
|
||||
SetWindowText (GetDlgItem (hwndDlg, IDC_BOX_HELP), szTemp);
|
||||
|
||||
@@ -194,13 +194,13 @@ BOOL CALLBACK ExpandVolSizeDlgProc (HWND hwndDlg, UINT msg, WPARAM wParam, LPARA
|
||||
|
||||
if (lw == IDOK)
|
||||
{
|
||||
char szTemp[4096];
|
||||
wchar_t szTemp[4096];
|
||||
|
||||
pVolExpandParam->bInitFreeSpace = IsButtonChecked (GetDlgItem (hwndDlg, IDC_INIT_NEWSPACE));
|
||||
if (!pVolExpandParam->bIsDevice) // for devices new size is set by calling function
|
||||
{
|
||||
GetWindowText (GetDlgItem (hwndDlg, IDC_SIZEBOX), szTemp, sizeof (szTemp));
|
||||
pVolExpandParam->newSize = _atoi64(szTemp) * GetSizeBoxMultiplier(hwndDlg);
|
||||
GetWindowText (GetDlgItem (hwndDlg, IDC_SIZEBOX), szTemp, ARRAYSIZE (szTemp));
|
||||
pVolExpandParam->newSize = _wtoi64(szTemp) * GetSizeBoxMultiplier(hwndDlg);
|
||||
}
|
||||
|
||||
EndDialog (hwndDlg, lw);
|
||||
@@ -247,7 +247,7 @@ BOOL CALLBACK ExpandVolProgressDlgProc (HWND hwndDlg, UINT msg, WPARAM wParam, L
|
||||
{
|
||||
case WM_INITDIALOG:
|
||||
{
|
||||
char szOldHostSize[512], szNewHostSize[512];
|
||||
wchar_t szOldHostSize[512], szNewHostSize[512];
|
||||
|
||||
pProgressDlgParam = (EXPAND_VOL_THREAD_PARAMS*)lParam;
|
||||
bVolTransformStarted = FALSE;
|
||||
@@ -263,7 +263,7 @@ BOOL CALLBACK ExpandVolProgressDlgProc (HWND hwndDlg, UINT msg, WPARAM wParam, L
|
||||
SetWindowText (GetDlgItem (hwndDlg, IDC_EXPAND_VOLUME_NEWSIZE), szNewHostSize);
|
||||
SetWindowText (GetDlgItem (hwndDlg, IDC_EXPAND_VOLUME_NAME), pProgressDlgParam->szVolumeName);
|
||||
SetWindowText (GetDlgItem (hwndDlg, IDC_EXPAND_FILE_SYSTEM), szFileSystemStr[pProgressDlgParam->FileSystem]);
|
||||
SetWindowText (GetDlgItem (hwndDlg, IDC_EXPAND_VOLUME_INITSPACE), pProgressDlgParam->bInitFreeSpace?"Yes":"No");
|
||||
SetWindowText (GetDlgItem (hwndDlg, IDC_EXPAND_VOLUME_INITSPACE), pProgressDlgParam->bInitFreeSpace?L"Yes":L"No");
|
||||
|
||||
SendMessage (GetDlgItem (hwndDlg, IDC_BOX_STATUS), WM_SETFONT, (WPARAM) hBoldFont, (LPARAM) TRUE);
|
||||
|
||||
@@ -275,11 +275,11 @@ BOOL CALLBACK ExpandVolProgressDlgProc (HWND hwndDlg, UINT msg, WPARAM wParam, L
|
||||
showRandPool = FALSE;
|
||||
EnableWindow (GetDlgItem (hwndDlg, IDC_DISPLAY_POOL_CONTENTS), FALSE);
|
||||
EnableWindow (GetDlgItem (hwndDlg, IDC_RANDOM_BYTES), FALSE);
|
||||
SetDlgItemText(hwndDlg, IDC_BOX_STATUS, "Click 'Continue' to expand the volume.");
|
||||
SetDlgItemText(hwndDlg, IDC_BOX_STATUS, L"Click 'Continue' to expand the volume.");
|
||||
}
|
||||
else
|
||||
{
|
||||
SetDlgItemText(hwndDlg, IDC_BOX_STATUS, "IMPORTANT: Move your mouse as randomly as possible within this window. The longer you move it, the better. This significantly increases the cryptographic strength of the encryption keys. Then click 'Continue' to expand the volume.");
|
||||
SetDlgItemText(hwndDlg, IDC_BOX_STATUS, L"IMPORTANT: Move your mouse as randomly as possible within this window. The longer you move it, the better. This significantly increases the cryptographic strength of the encryption keys. Then click 'Continue' to expand the volume.");
|
||||
}
|
||||
|
||||
SendMessage (GetDlgItem (hwndDlg, IDC_DISPLAY_POOL_CONTENTS), BM_SETCHECK, showRandPool ? BST_CHECKED : BST_UNCHECKED, 0);
|
||||
@@ -303,7 +303,7 @@ BOOL CALLBACK ExpandVolProgressDlgProc (HWND hwndDlg, UINT msg, WPARAM wParam, L
|
||||
AddProgressDlgStatus (hwndDlg, "Finished. Volume successfully expanded.");
|
||||
}
|
||||
|
||||
SetWindowText (GetDlgItem (hwndDlg, IDOK), "Exit");
|
||||
SetWindowText (GetDlgItem (hwndDlg, IDOK), L"Exit");
|
||||
EnableWindow (GetDlgItem (hwndDlg, IDOK), TRUE);
|
||||
EnableWindow (GetDlgItem (hwndDlg, IDCANCEL), FALSE);
|
||||
}
|
||||
@@ -316,14 +316,14 @@ BOOL CALLBACK ExpandVolProgressDlgProc (HWND hwndDlg, UINT msg, WPARAM wParam, L
|
||||
case TIMER_ID_RANDVIEW:
|
||||
{
|
||||
unsigned char tmp[16] = {0};
|
||||
char szRndPool[64] = {0};
|
||||
wchar_t szRndPool[64] = {0};
|
||||
|
||||
if (!showRandPool)
|
||||
return 1;
|
||||
|
||||
RandpeekBytes (hwndDlg, tmp, sizeof (tmp));
|
||||
|
||||
StringCbPrintfA (szRndPool, sizeof(szRndPool), "%08X%08X%08X%08X",
|
||||
StringCbPrintfW (szRndPool, sizeof(szRndPool), L"%08X%08X%08X%08X",
|
||||
*((DWORD*) (tmp + 12)), *((DWORD*) (tmp + 8)), *((DWORD*) (tmp + 4)), *((DWORD*) (tmp)));
|
||||
|
||||
SetWindowText (GetDlgItem (hwndDlg, IDC_RANDOM_BYTES), szRndPool);
|
||||
@@ -391,7 +391,7 @@ BOOL CALLBACK ExpandVolProgressDlgProc (HWND hwndDlg, UINT msg, WPARAM wParam, L
|
||||
typedef struct
|
||||
{
|
||||
OpenVolumeContext *context;
|
||||
const char *volumePath;
|
||||
const wchar_t *volumePath;
|
||||
Password *password;
|
||||
int pkcs5_prf;
|
||||
int pim;
|
||||
@@ -428,7 +428,7 @@ void CALLBACK OpenVolumeWaitThreadProc(void* pArg, HWND hwndDlg)
|
||||
none
|
||||
|
||||
*/
|
||||
void ExpandVolumeWizard (HWND hwndDlg, char *lpszVolume)
|
||||
void ExpandVolumeWizard (HWND hwndDlg, wchar_t *lpszVolume)
|
||||
{
|
||||
int nStatus = ERR_OS_ERROR;
|
||||
wchar_t szTmp[4096];
|
||||
@@ -439,7 +439,7 @@ void ExpandVolumeWizard (HWND hwndDlg, char *lpszVolume)
|
||||
DWORD dwError;
|
||||
int driveNo;
|
||||
enum EV_FileSystem volFSType;
|
||||
char rootPath[] = "A:\\";
|
||||
wchar_t rootPath[] = L"A:\\";
|
||||
|
||||
switch (IsSystemDevicePath (lpszVolume, hwndDlg, TRUE))
|
||||
{
|
||||
|
||||
@@ -56,8 +56,8 @@ int nPbar; /* Control ID of progress bar (used by FormatNoFs) */
|
||||
volatile BOOL bVolTransformThreadCancel = FALSE; /* TRUE if the user cancels/pauses volume expansion */
|
||||
|
||||
// internal functions
|
||||
static int UpdateVolumeHeaderHostSize (char *lpszVolume, Password *pVolumePassword, HWND hwndDlg, uint64 newHostSize, uint64 *pDataSize, BOOL initFreeSpace);
|
||||
static int FsctlExtendVolume(char * szVolume, LONGLONG nTotalSectors );
|
||||
static int UpdateVolumeHeaderHostSize (wchar_t *lpszVolume, Password *pVolumePassword, HWND hwndDlg, uint64 newHostSize, uint64 *pDataSize, BOOL initFreeSpace);
|
||||
static int FsctlExtendVolume(wchar_t * szVolume, LONGLONG nTotalSectors );
|
||||
|
||||
|
||||
/*
|
||||
@@ -84,7 +84,7 @@ static int FsctlExtendVolume(char * szVolume, LONGLONG nTotalSectors );
|
||||
int with Truecrypt error code (ERR_SUCCESS on success)
|
||||
|
||||
*/
|
||||
int MountVolTemp (HWND hwndDlg, char *volumePath, int *driveNo, Password *password, int pkcs5, int pim)
|
||||
int MountVolTemp (HWND hwndDlg, wchar_t *volumePath, int *driveNo, Password *password, int pkcs5, int pim)
|
||||
{
|
||||
MountOptions mountOptions;
|
||||
ZeroMemory (&mountOptions, sizeof (mountOptions));
|
||||
@@ -133,7 +133,7 @@ int MountVolTemp (HWND hwndDlg, char *volumePath, int *driveNo, Password *passwo
|
||||
Remarks: only supported by NTFS and RAW file systems
|
||||
|
||||
*/
|
||||
static int FsctlExtendVolume(char * szVolume, LONGLONG nTotalSectors )
|
||||
static int FsctlExtendVolume(wchar_t * szVolume, LONGLONG nTotalSectors )
|
||||
{
|
||||
HANDLE hDevice; // handle to the volume to be extended
|
||||
BOOL bResult; // results flag
|
||||
@@ -176,21 +176,21 @@ error:
|
||||
}
|
||||
|
||||
|
||||
BOOL GetFileSystemType(const char *szFileName, enum EV_FileSystem *pFS)
|
||||
BOOL GetFileSystemType(const wchar_t *szFileName, enum EV_FileSystem *pFS)
|
||||
{
|
||||
char szFS[256];
|
||||
char root[MAX_PATH];
|
||||
wchar_t szFS[256];
|
||||
wchar_t root[MAX_PATH];
|
||||
|
||||
*pFS = EV_FS_TYPE_RAW;
|
||||
|
||||
if (!GetVolumePathName (szFileName, root, sizeof (root)))
|
||||
if (!GetVolumePathName (szFileName, root, ARRAYSIZE (root)))
|
||||
return FALSE;
|
||||
|
||||
if ( GetVolumeInformation (root, NULL, 0, NULL, NULL, NULL, szFS, sizeof(szFS)) )
|
||||
if ( GetVolumeInformation (root, NULL, 0, NULL, NULL, NULL, szFS, ARRAYSIZE(szFS)) )
|
||||
{
|
||||
if (!strncmp (szFS, "NTFS", 4))
|
||||
if (!wcsncmp (szFS, L"NTFS", 4))
|
||||
*pFS = EV_FS_TYPE_NTFS;
|
||||
else if (!strncmp (szFS, "FAT", 3)) // FAT16, FAT32
|
||||
else if (!wcsncmp (szFS, L"FAT", 3)) // FAT16, FAT32
|
||||
*pFS = EV_FS_TYPE_FAT;
|
||||
else
|
||||
*pFS = EV_FS_TYPE_RAW;
|
||||
@@ -227,10 +227,10 @@ BOOL GetFileSystemType(const char *szFileName, enum EV_FileSystem *pFS)
|
||||
int with TrueCrypt error code (ERR_SUCCESS on success)
|
||||
|
||||
*/
|
||||
int QueryVolumeInfo (HWND hwndDlg, const char *lpszVolume, uint64 * pHostSizeFree, uint64 * pSizeLimitFS )
|
||||
int QueryVolumeInfo (HWND hwndDlg, const wchar_t *lpszVolume, uint64 * pHostSizeFree, uint64 * pSizeLimitFS )
|
||||
{
|
||||
int nStatus = ERR_OS_ERROR;
|
||||
char szDiskFile[TC_MAX_PATH], root[MAX_PATH];
|
||||
wchar_t szDiskFile[TC_MAX_PATH], root[MAX_PATH];
|
||||
BOOL bDevice;
|
||||
enum EV_FileSystem fs;
|
||||
|
||||
@@ -244,7 +244,7 @@ int QueryVolumeInfo (HWND hwndDlg, const char *lpszVolume, uint64 * pHostSizeFre
|
||||
return ERR_SUCCESS;
|
||||
}
|
||||
|
||||
if (!GetVolumePathName (szDiskFile, root, sizeof (root)))
|
||||
if (!GetVolumePathName (szDiskFile, root, ARRAYSIZE (root)))
|
||||
{
|
||||
nStatus = ERR_OS_ERROR;
|
||||
goto error;
|
||||
@@ -286,26 +286,26 @@ error:
|
||||
return nStatus;
|
||||
}
|
||||
|
||||
BOOL GetNtfsNumberOfSectors(char * rootPath, uint64 * pNumberOfSectors, DWORD *pBytesPerSector)
|
||||
BOOL GetNtfsNumberOfSectors(wchar_t * rootPath, uint64 * pNumberOfSectors, DWORD *pBytesPerSector)
|
||||
{
|
||||
HANDLE hDevice;
|
||||
BOOL bResult;
|
||||
DWORD nbytes, dwError;
|
||||
size_t len;
|
||||
NTFS_VOLUME_DATA_BUFFER ntfsvdb;
|
||||
char szVolumeGUID[128];
|
||||
wchar_t szVolumeGUID[128];
|
||||
|
||||
// get volume name
|
||||
if (!GetVolumeNameForVolumeMountPoint(rootPath,szVolumeGUID,sizeof(szVolumeGUID)))
|
||||
if (!GetVolumeNameForVolumeMountPoint(rootPath,szVolumeGUID,ARRAYSIZE(szVolumeGUID)))
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
// strip trailing backslash from volume GUID (otherwise it means root dir)
|
||||
len = strlen(szVolumeGUID);
|
||||
len = wcslen(szVolumeGUID);
|
||||
if (len>0)
|
||||
--len;
|
||||
if (szVolumeGUID[len]=='\\')
|
||||
if (szVolumeGUID[len]==L'\\')
|
||||
szVolumeGUID[len]=0;
|
||||
|
||||
hDevice = CreateFile(szVolumeGUID,
|
||||
@@ -371,11 +371,11 @@ uint64 GetVolumeSizeByDataAreaSize (uint64 dataAreaSize, BOOL legacyVolume)
|
||||
}
|
||||
|
||||
|
||||
int ExtendFileSystem (HWND hwndDlg , char *lpszVolume, Password *pVolumePassword, int VolumePkcs5, int VolumePim, uint64 newDataAreaSize)
|
||||
int ExtendFileSystem (HWND hwndDlg , wchar_t *lpszVolume, Password *pVolumePassword, int VolumePkcs5, int VolumePim, uint64 newDataAreaSize)
|
||||
{
|
||||
char szVolumeGUID[128];
|
||||
wchar_t szVolumeGUID[128];
|
||||
int driveNo = -1;
|
||||
char rootPath[] = "A:\\";
|
||||
wchar_t rootPath[] = L"A:\\";
|
||||
enum EV_FileSystem fs;
|
||||
DWORD dwError;
|
||||
int nStatus = ERR_SUCCESS;
|
||||
@@ -415,7 +415,7 @@ int ExtendFileSystem (HWND hwndDlg , char *lpszVolume, Password *pVolumePassword
|
||||
}
|
||||
|
||||
// Get volume GUID
|
||||
if (!GetVolumeNameForVolumeMountPoint(rootPath,szVolumeGUID,sizeof(szVolumeGUID)))
|
||||
if (!GetVolumeNameForVolumeMountPoint(rootPath,szVolumeGUID,ARRAYSIZE(szVolumeGUID)))
|
||||
{
|
||||
nStatus = ERR_OS_ERROR;
|
||||
goto error;
|
||||
@@ -423,9 +423,9 @@ int ExtendFileSystem (HWND hwndDlg , char *lpszVolume, Password *pVolumePassword
|
||||
else
|
||||
{
|
||||
// strip trailing backslash from volume GUID (otherwise it means root dir)
|
||||
size_t len = strlen(szVolumeGUID);
|
||||
size_t len = wcslen(szVolumeGUID);
|
||||
if (len>0) --len;
|
||||
if (szVolumeGUID[len]=='\\') szVolumeGUID[len]=0;
|
||||
if (szVolumeGUID[len]==L'\\') szVolumeGUID[len]=0;
|
||||
}
|
||||
|
||||
// Get Sector Size
|
||||
@@ -486,11 +486,11 @@ error:
|
||||
Remarks: a lot of code is from TrueCrypt 'Common\Password.c' :: ChangePwd()
|
||||
|
||||
*/
|
||||
static int ExpandVolume (HWND hwndDlg, char *lpszVolume, Password *pVolumePassword, int VolumePkcs5, int VolumePim, uint64 newHostSize, BOOL initFreeSpace)
|
||||
static int ExpandVolume (HWND hwndDlg, wchar_t *lpszVolume, Password *pVolumePassword, int VolumePkcs5, int VolumePim, uint64 newHostSize, BOOL initFreeSpace)
|
||||
{
|
||||
int nDosLinkCreated = 1, nStatus = ERR_OS_ERROR;
|
||||
char szDiskFile[TC_MAX_PATH], szCFDevice[TC_MAX_PATH];
|
||||
char szDosDevice[TC_MAX_PATH];
|
||||
wchar_t szDiskFile[TC_MAX_PATH], szCFDevice[TC_MAX_PATH];
|
||||
wchar_t szDosDevice[TC_MAX_PATH];
|
||||
char buffer[TC_VOLUME_HEADER_EFFECTIVE_SIZE];
|
||||
PCRYPTO_INFO cryptoInfo = NULL, ci = NULL;
|
||||
void *dev = INVALID_HANDLE_VALUE;
|
||||
@@ -515,7 +515,7 @@ static int ExpandVolume (HWND hwndDlg, char *lpszVolume, Password *pVolumePasswo
|
||||
|
||||
if (bDevice == FALSE)
|
||||
{
|
||||
strcpy (szCFDevice, szDiskFile);
|
||||
wcscpy (szCFDevice, szDiskFile);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -969,7 +969,7 @@ void __cdecl volTransformThreadFunction (void *pExpandDlgParam)
|
||||
EXPAND_VOL_THREAD_PARAMS *pParam=(EXPAND_VOL_THREAD_PARAMS *)pExpandDlgParam;
|
||||
HWND hwndDlg = (HWND) pParam->hwndDlg;
|
||||
|
||||
nStatus = ExpandVolume (hwndDlg, (char*)pParam->szVolumeName, pParam->pVolumePassword,
|
||||
nStatus = ExpandVolume (hwndDlg, (wchar_t*)pParam->szVolumeName, pParam->pVolumePassword,
|
||||
pParam->VolumePkcs5, pParam->VolumePim, pParam->newSize, pParam->bInitFreeSpace );
|
||||
|
||||
if (nStatus!=ERR_SUCCESS && nStatus!=ERR_USER_ABORT)
|
||||
|
||||
@@ -27,14 +27,14 @@ enum EV_FileSystem
|
||||
EV_FS_TYPE_NTFS = 2,
|
||||
};
|
||||
|
||||
extern const char * szFileSystemStr[3];
|
||||
extern const wchar_t * szFileSystemStr[3];
|
||||
|
||||
typedef struct
|
||||
{
|
||||
uint64 oldSize;
|
||||
uint64 newSize;
|
||||
uint64 hostSizeFree;
|
||||
const char *szVolumeName;
|
||||
const wchar_t *szVolumeName;
|
||||
enum EV_FileSystem FileSystem;
|
||||
BOOL bIsDevice;
|
||||
BOOL bIsLegacy;
|
||||
@@ -56,10 +56,10 @@ extern volatile BOOL bVolTransformThreadCancel; /* TRUE if the user cancels/paus
|
||||
/* defined in ExpandVolume.c */
|
||||
uint64 GetVolumeDataAreaSize (uint64 volumeSize, BOOL legacyVolume);
|
||||
uint64 GetVolumeSizeByDataAreaSize (uint64 dataSize, BOOL legacyVolume);
|
||||
int QueryVolumeInfo (HWND hwndDlg, const char *lpszVolume, uint64 * pHostSizeFree, uint64 * pSizeLimitFS );
|
||||
int MountVolTemp (HWND hwndDlg, char *volumePath, int *driveNo, Password *password, int pkcs5, int pim);
|
||||
BOOL GetFileSystemType(const char *szFileName, enum EV_FileSystem *pFS);
|
||||
BOOL GetNtfsNumberOfSectors(char *rootPath, uint64 *pNumberOfSectors, DWORD *pBytesPerSector);
|
||||
int QueryVolumeInfo (HWND hwndDlg, const wchar_t *lpszVolume, uint64 * pHostSizeFree, uint64 * pSizeLimitFS );
|
||||
int MountVolTemp (HWND hwndDlg, wchar_t *volumePath, int *driveNo, Password *password, int pkcs5, int pim);
|
||||
BOOL GetFileSystemType(const wchar_t *szFileName, enum EV_FileSystem *pFS);
|
||||
BOOL GetNtfsNumberOfSectors(wchar_t *rootPath, uint64 *pNumberOfSectors, DWORD *pBytesPerSector);
|
||||
void __cdecl volTransformThreadFunction (void *hwndDlgArg);
|
||||
|
||||
/* defined in DlgExpandVolume.cpp */
|
||||
@@ -71,7 +71,7 @@ void SetProgressDlgStatus(HWND hwndDlg, const char* szText);
|
||||
#endif
|
||||
|
||||
/* defined in DlgExpandVolume.cpp */
|
||||
void ExpandVolumeWizard (HWND hwndDlg, char *lpszVolume);
|
||||
void ExpandVolumeWizard (HWND hwndDlg, wchar_t *lpszVolume);
|
||||
|
||||
|
||||
#endif /* TC_HEADER_ExpandVolume */
|
||||
@@ -25,7 +25,7 @@
|
||||
IntermediateDirectory="Debug"
|
||||
ConfigurationType="1"
|
||||
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
|
||||
CharacterSet="2"
|
||||
CharacterSet="1"
|
||||
>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"
|
||||
@@ -111,103 +111,13 @@
|
||||
CommandLine="md "..\Debug\Setup Files" 2>NUL:
copy Debug\VeraCryptExpander.exe "..\Debug\Setup Files" >NUL:
"
|
||||
/>
|
||||
</Configuration>
|
||||
<Configuration
|
||||
Name="Release|Win32"
|
||||
OutputDirectory="Release"
|
||||
IntermediateDirectory="Release"
|
||||
ConfigurationType="1"
|
||||
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
|
||||
CharacterSet="2"
|
||||
>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"
|
||||
AdditionalIncludeDirectories=""
|
||||
TypeLibraryName="$(SolutionDir)/Mount/$(ProjectName).tlb"
|
||||
OutputDirectory=""
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
AdditionalOptions="/w34189"
|
||||
Optimization="2"
|
||||
AdditionalIncludeDirectories="..\Common;..\Crypto;..\;..\pkcs11"
|
||||
PreprocessorDefinitions="VCEXPANDER;TCMOUNT;WIN32;NDEBUG;_WINDOWS;_CRT_SECURE_NO_DEPRECATE;_CRT_NON_CONFORMING_SWPRINTFS"
|
||||
RuntimeLibrary="0"
|
||||
BufferSecurityCheck="true"
|
||||
UsePrecompiledHeader="0"
|
||||
AssemblerOutput="2"
|
||||
AssemblerListingLocation="$(IntDir)/"
|
||||
WarningLevel="3"
|
||||
DebugInformationFormat="0"
|
||||
DisableSpecificWarnings="4311"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManagedResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
AdditionalDependencies="comctl32.lib setupapi.lib version.lib ..\Crypto\Release\crypto.lib"
|
||||
OutputFile="$(OutDir)/VeraCryptExpander.exe"
|
||||
LinkIncremental="1"
|
||||
GenerateManifest="false"
|
||||
IgnoreAllDefaultLibraries="false"
|
||||
GenerateDebugInformation="false"
|
||||
GenerateMapFile="true"
|
||||
SubSystem="2"
|
||||
OptimizeReferences="2"
|
||||
EnableCOMDATFolding="2"
|
||||
RandomizedBaseAddress="1"
|
||||
DataExecutionPrevention="2"
|
||||
TargetMachine="1"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCALinkTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManifestTool"
|
||||
AdditionalManifestFiles="VeraCryptExpander.manifest"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXDCMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCBscMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCFxCopTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCAppVerifierTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"
|
||||
CommandLine="copy Release\VeraCryptExpander.exe "..\Release\Setup Files\""
|
||||
/>
|
||||
</Configuration>
|
||||
<Configuration
|
||||
Name="Debug|x64"
|
||||
OutputDirectory="$(PlatformName)\$(ConfigurationName)"
|
||||
IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
|
||||
ConfigurationType="1"
|
||||
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
|
||||
CharacterSet="2"
|
||||
CharacterSet="1"
|
||||
>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"
|
||||
@@ -294,13 +204,103 @@
|
||||
CommandLine="md "..\Debug\Setup Files" 2>NUL:
copy $(TargetPath) "..\Debug\Setup Files\VeraCryptExpander-x64.exe" >NUL:
"
|
||||
/>
|
||||
</Configuration>
|
||||
<Configuration
|
||||
Name="Release|Win32"
|
||||
OutputDirectory="Release"
|
||||
IntermediateDirectory="Release"
|
||||
ConfigurationType="1"
|
||||
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
|
||||
CharacterSet="1"
|
||||
>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"
|
||||
AdditionalIncludeDirectories=""
|
||||
TypeLibraryName="$(SolutionDir)/Mount/$(ProjectName).tlb"
|
||||
OutputDirectory=""
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
AdditionalOptions="/w34189"
|
||||
Optimization="2"
|
||||
AdditionalIncludeDirectories="..\Common;..\Crypto;..\;..\pkcs11"
|
||||
PreprocessorDefinitions="VCEXPANDER;TCMOUNT;WIN32;NDEBUG;_WINDOWS;_CRT_SECURE_NO_DEPRECATE;_CRT_NON_CONFORMING_SWPRINTFS"
|
||||
RuntimeLibrary="0"
|
||||
BufferSecurityCheck="true"
|
||||
UsePrecompiledHeader="0"
|
||||
AssemblerOutput="2"
|
||||
AssemblerListingLocation="$(IntDir)/"
|
||||
WarningLevel="3"
|
||||
DebugInformationFormat="0"
|
||||
DisableSpecificWarnings="4311"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManagedResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
AdditionalDependencies="comctl32.lib setupapi.lib version.lib ..\Crypto\Release\crypto.lib"
|
||||
OutputFile="$(OutDir)/VeraCryptExpander.exe"
|
||||
LinkIncremental="1"
|
||||
GenerateManifest="false"
|
||||
IgnoreAllDefaultLibraries="false"
|
||||
GenerateDebugInformation="false"
|
||||
GenerateMapFile="true"
|
||||
SubSystem="2"
|
||||
OptimizeReferences="2"
|
||||
EnableCOMDATFolding="2"
|
||||
RandomizedBaseAddress="1"
|
||||
DataExecutionPrevention="2"
|
||||
TargetMachine="1"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCALinkTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManifestTool"
|
||||
AdditionalManifestFiles="VeraCryptExpander.manifest"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXDCMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCBscMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCFxCopTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCAppVerifierTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"
|
||||
CommandLine="copy Release\VeraCryptExpander.exe "..\Release\Setup Files\""
|
||||
/>
|
||||
</Configuration>
|
||||
<Configuration
|
||||
Name="Release|x64"
|
||||
OutputDirectory="$(PlatformName)\$(ConfigurationName)"
|
||||
IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
|
||||
ConfigurationType="1"
|
||||
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
|
||||
CharacterSet="2"
|
||||
CharacterSet="1"
|
||||
>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"
|
||||
@@ -422,7 +422,7 @@
|
||||
/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Release|Win32"
|
||||
Name="Debug|x64"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
@@ -430,7 +430,7 @@
|
||||
/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Debug|x64"
|
||||
Name="Release|Win32"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
@@ -485,7 +485,7 @@
|
||||
/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Release|Win32"
|
||||
Name="Debug|x64"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
@@ -493,7 +493,7 @@
|
||||
/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Debug|x64"
|
||||
Name="Release|Win32"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
@@ -521,7 +521,7 @@
|
||||
/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Release|Win32"
|
||||
Name="Debug|x64"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
@@ -529,7 +529,7 @@
|
||||
/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Debug|x64"
|
||||
Name="Release|Win32"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
@@ -569,7 +569,7 @@
|
||||
/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Release|Win32"
|
||||
Name="Debug|x64"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
@@ -577,7 +577,7 @@
|
||||
/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Debug|x64"
|
||||
Name="Release|Win32"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
@@ -674,7 +674,7 @@
|
||||
/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Release|Win32"
|
||||
Name="Debug|x64"
|
||||
>
|
||||
<Tool
|
||||
Name="VCMIDLTool"
|
||||
@@ -683,7 +683,7 @@
|
||||
/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Debug|x64"
|
||||
Name="Release|Win32"
|
||||
>
|
||||
<Tool
|
||||
Name="VCMIDLTool"
|
||||
@@ -713,7 +713,7 @@
|
||||
/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Release|Win32"
|
||||
Name="Debug|x64"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
@@ -721,7 +721,7 @@
|
||||
/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Debug|x64"
|
||||
Name="Release|Win32"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
@@ -937,7 +937,7 @@
|
||||
/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Release|Win32"
|
||||
Name="Debug|x64"
|
||||
ExcludedFromBuild="true"
|
||||
>
|
||||
<Tool
|
||||
@@ -945,7 +945,7 @@
|
||||
/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Debug|x64"
|
||||
Name="Release|Win32"
|
||||
ExcludedFromBuild="true"
|
||||
>
|
||||
<Tool
|
||||
|
||||
@@ -53,8 +53,8 @@
|
||||
|
||||
using namespace VeraCrypt;
|
||||
|
||||
const char szExpandVolumeInfo[] =
|
||||
":: VeraCrypt Expander ::\n\nExpand a VeraCrypt volume on the fly without reformatting\n\n\n\
|
||||
const wchar_t szExpandVolumeInfo[] =
|
||||
L":: VeraCrypt Expander ::\n\nExpand a VeraCrypt volume on the fly without reformatting\n\n\n\
|
||||
All kind of volumes (container files, disks and partitions) formatted with \
|
||||
NTFS are supported. The only condition is that there must be enough free \
|
||||
space on the host drive or host device of the VeraCrypt volume.\n\n\
|
||||
@@ -83,9 +83,9 @@ namespace VeraCryptExpander
|
||||
|
||||
BOOL bExplore = FALSE; /* Display explorer window after mount */
|
||||
BOOL bBeep = FALSE; /* Donot beep after mount */
|
||||
char szFileName[TC_MAX_PATH+1]; /* Volume to mount */
|
||||
char szDriveLetter[3]; /* Drive Letter to mount */
|
||||
char commandLineDrive = 0;
|
||||
wchar_t szFileName[TC_MAX_PATH+1]; /* Volume to mount */
|
||||
wchar_t szDriveLetter[3]; /* Drive Letter to mount */
|
||||
wchar_t commandLineDrive = 0;
|
||||
BOOL bCacheInDriver = FALSE; /* Cache any passwords we see */
|
||||
BOOL bCacheInDriverDefault = FALSE;
|
||||
BOOL bHistoryCmdLine = FALSE; /* History control is always disabled */
|
||||
@@ -130,7 +130,7 @@ MountOptions defaultMountOptions;
|
||||
KeyFile *FirstCmdKeyFile;
|
||||
|
||||
HBITMAP hbmLogoBitmapRescaled = NULL;
|
||||
char OrigKeyboardLayout [8+1] = "00000409";
|
||||
wchar_t OrigKeyboardLayout [8+1] = L"00000409";
|
||||
BOOL bKeyboardLayoutChanged = FALSE; /* TRUE if the keyboard layout was changed to the standard US keyboard layout (from any other layout). */
|
||||
BOOL bKeybLayoutAltKeyWarningShown = FALSE; /* TRUE if the user has been informed that it is not possible to type characters by pressing keys while the right Alt key is held down. */
|
||||
|
||||
@@ -173,7 +173,7 @@ void EndMainDlg (HWND hwndDlg)
|
||||
{
|
||||
if (!bHistory)
|
||||
{
|
||||
SetWindowText (GetDlgItem (hwndDlg, IDC_VOLUME), "");
|
||||
SetWindowText (GetDlgItem (hwndDlg, IDC_VOLUME), L"");
|
||||
}
|
||||
|
||||
EndDialog (hwndDlg, 0);
|
||||
@@ -292,15 +292,21 @@ void LoadSettings (HWND hwndDlg)
|
||||
|
||||
CloseSecurityTokenSessionsAfterMount = ConfigReadInt ("CloseSecurityTokenSessionsAfterMount", 0);
|
||||
|
||||
ConfigReadString ("SecurityTokenLibrary", "", SecurityTokenLibraryPath, sizeof (SecurityTokenLibraryPath) - 1);
|
||||
if (SecurityTokenLibraryPath[0])
|
||||
InitSecurityTokenLibrary(hwndDlg);
|
||||
{
|
||||
char szTmp[TC_MAX_PATH] = {0};
|
||||
WideCharToMultiByte (CP_UTF8, 0, SecurityTokenLibraryPath, -1, szTmp, sizeof (szTmp), NULL, NULL);
|
||||
ConfigReadString ("SecurityTokenLibrary", "", szTmp, sizeof (szTmp) - 1);
|
||||
MultiByteToWideChar (CP_UTF8, 0, szTmp, -1, SecurityTokenLibraryPath, ARRAYSIZE (SecurityTokenLibraryPath));
|
||||
|
||||
if (SecurityTokenLibraryPath[0])
|
||||
InitSecurityTokenLibrary(hwndDlg);
|
||||
}
|
||||
|
||||
/* we don't load the history */
|
||||
}
|
||||
|
||||
|
||||
BOOL SelectItem (HWND hTree, char nLetter)
|
||||
BOOL SelectItem (HWND hTree, wchar_t nLetter)
|
||||
{
|
||||
int i;
|
||||
LVITEM item;
|
||||
@@ -367,7 +373,7 @@ GetItemLong (HWND hTree, int itemNo)
|
||||
return item.lParam;
|
||||
}
|
||||
|
||||
static char PasswordDlgVolume[MAX_PATH + 1] = {0};
|
||||
static wchar_t PasswordDlgVolume[MAX_PATH + 1] = {0};
|
||||
static BOOL PasswordDialogDisableMountOptions;
|
||||
static char *PasswordDialogTitleStringId;
|
||||
|
||||
@@ -398,15 +404,15 @@ BOOL CALLBACK ExtcvPasswordDlgProc (HWND hwndDlg, UINT msg, WPARAM wParam, LPARA
|
||||
{
|
||||
SetWindowTextW (hwndDlg, GetString (PasswordDialogTitleStringId));
|
||||
}
|
||||
else if (strlen (PasswordDlgVolume) > 0)
|
||||
else if (wcslen (PasswordDlgVolume) > 0)
|
||||
{
|
||||
wchar_t s[1024];
|
||||
const int maxVisibleLen = 40;
|
||||
|
||||
if (strlen (PasswordDlgVolume) > maxVisibleLen)
|
||||
if (wcslen (PasswordDlgVolume) > maxVisibleLen)
|
||||
{
|
||||
string volStr = PasswordDlgVolume;
|
||||
StringCbPrintfW (s, sizeof(s), GetString ("ENTER_PASSWORD_FOR"), ("..." + volStr.substr (volStr.size() - maxVisibleLen - 1)).c_str());
|
||||
wstring volStr = PasswordDlgVolume;
|
||||
StringCbPrintfW (s, sizeof(s), GetString ("ENTER_PASSWORD_FOR"), (L"..." + volStr.substr (volStr.size() - maxVisibleLen - 1)).c_str());
|
||||
}
|
||||
else
|
||||
StringCbPrintfW (s, sizeof(s), GetString ("ENTER_PASSWORD_FOR"), PasswordDlgVolume);
|
||||
@@ -510,15 +516,15 @@ BOOL CALLBACK ExtcvPasswordDlgProc (HWND hwndDlg, UINT msg, WPARAM wParam, LPARA
|
||||
ToBootPwdField (hwndDlg, IDC_PASSWORD);
|
||||
|
||||
// Attempt to wipe the password stored in the input field buffer
|
||||
char tmp[MAX_PASSWORD+1];
|
||||
memset (tmp, 'X', MAX_PASSWORD);
|
||||
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), "");
|
||||
SetWindowText (GetDlgItem (hwndDlg, IDC_PASSWORD), L"");
|
||||
|
||||
StringCbPrintfA (OrigKeyboardLayout, sizeof(OrigKeyboardLayout),"%08X", (DWORD) GetKeyboardLayout (NULL) & 0xFFFF);
|
||||
StringCbPrintfW (OrigKeyboardLayout, sizeof(OrigKeyboardLayout),L"%08X", (DWORD) GetKeyboardLayout (NULL) & 0xFFFF);
|
||||
|
||||
DWORD keybLayout = (DWORD) LoadKeyboardLayout ("00000409", KLF_ACTIVATE);
|
||||
DWORD keybLayout = (DWORD) LoadKeyboardLayout (L"00000409", KLF_ACTIVATE);
|
||||
|
||||
if (keybLayout != 0x00000409 && keybLayout != 0x04090409)
|
||||
{
|
||||
@@ -565,13 +571,13 @@ BOOL CALLBACK ExtcvPasswordDlgProc (HWND hwndDlg, UINT msg, WPARAM wParam, LPARA
|
||||
// Keyboard layout is not standard US
|
||||
|
||||
// Attempt to wipe the password stored in the input field buffer
|
||||
char tmp[MAX_PASSWORD+1];
|
||||
memset (tmp, 'X', MAX_PASSWORD);
|
||||
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), "");
|
||||
SetWindowText (GetDlgItem (hwndDlg, IDC_PASSWORD), L"");
|
||||
|
||||
keybLayout = (DWORD) LoadKeyboardLayout ("00000409", KLF_ACTIVATE);
|
||||
keybLayout = (DWORD) LoadKeyboardLayout (L"00000409", KLF_ACTIVATE);
|
||||
|
||||
if (keybLayout != 0x00000409 && keybLayout != 0x04090409)
|
||||
{
|
||||
@@ -651,15 +657,17 @@ BOOL CALLBACK ExtcvPasswordDlgProc (HWND hwndDlg, UINT msg, WPARAM wParam, LPARA
|
||||
|
||||
if (lw == IDCANCEL || lw == IDOK)
|
||||
{
|
||||
char tmp[MAX_PASSWORD+1];
|
||||
|
||||
wchar_t tmp[MAX_PASSWORD+1];
|
||||
|
||||
if (lw == IDOK)
|
||||
{
|
||||
if (mountOptions.ProtectHiddenVolume && hidVolProtKeyFilesParam.EnableKeyFiles)
|
||||
KeyFilesApply (hwndDlg, &mountOptions.ProtectedHidVolPassword, hidVolProtKeyFilesParam.FirstKeyFile, PasswordDlgVolume);
|
||||
|
||||
GetWindowText (GetDlgItem (hwndDlg, IDC_PASSWORD), (LPSTR) szXPwd->Text, MAX_PASSWORD + 1);
|
||||
szXPwd->Length = strlen ((char *) szXPwd->Text);
|
||||
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);
|
||||
@@ -686,10 +694,10 @@ BOOL CALLBACK ExtcvPasswordDlgProc (HWND hwndDlg, UINT msg, WPARAM wParam, LPARA
|
||||
}
|
||||
|
||||
// Attempt to wipe password stored in the input field buffer
|
||||
memset (tmp, 'X', MAX_PASSWORD);
|
||||
wmemset (tmp, L'X', MAX_PASSWORD);
|
||||
tmp[MAX_PASSWORD] = 0;
|
||||
SetWindowText (GetDlgItem (hwndDlg, IDC_PASSWORD), tmp);
|
||||
SetWindowText (GetDlgItem (hwndDlg, IDC_PASSWORD_PROT_HIDVOL), tmp);
|
||||
SetWindowText (GetDlgItem (hwndDlg, IDC_PASSWORD_PROT_HIDVOL), tmp);
|
||||
|
||||
if (hidVolProtKeyFilesParam.FirstKeyFile != NULL)
|
||||
{
|
||||
@@ -781,7 +789,7 @@ int RestoreVolumeHeader (HWND hwndDlg, char *lpszVolume)
|
||||
return 0;
|
||||
}
|
||||
|
||||
int ExtcvAskVolumePassword (HWND hwndDlg, const char* fileName, Password *password, int *pkcs5, int *pim, BOOL* truecryptMode, char *titleStringId, BOOL enableMountOptions)
|
||||
int ExtcvAskVolumePassword (HWND hwndDlg, const wchar_t* fileName, Password *password, int *pkcs5, int *pim, BOOL* truecryptMode, char *titleStringId, BOOL enableMountOptions)
|
||||
{
|
||||
int result;
|
||||
PasswordDlgParam dlgParam;
|
||||
@@ -794,7 +802,7 @@ int ExtcvAskVolumePassword (HWND hwndDlg, const char* fileName, Password *passwo
|
||||
dlgParam.pim = pim;
|
||||
dlgParam.truecryptMode = truecryptMode;
|
||||
|
||||
StringCbCopyA (PasswordDlgVolume, sizeof(PasswordDlgVolume), fileName);
|
||||
StringCbCopyW (PasswordDlgVolume, sizeof(PasswordDlgVolume), fileName);
|
||||
|
||||
result = DialogBoxParamW (hInst,
|
||||
MAKEINTRESOURCEW (IDD_PASSWORD_DLG), hwndDlg,
|
||||
@@ -914,9 +922,9 @@ BOOL CALLBACK MainDialogProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPa
|
||||
}
|
||||
else
|
||||
{
|
||||
char fileName[MAX_PATH];
|
||||
GetWindowText (GetDlgItem (hwndDlg, IDC_VOLUME), fileName, sizeof (fileName));
|
||||
ExpandVolumeWizard(hwndDlg, (char*)fileName);
|
||||
wchar_t fileName[MAX_PATH];
|
||||
GetWindowText (GetDlgItem (hwndDlg, IDC_VOLUME), fileName, ARRAYSIZE (fileName));
|
||||
ExpandVolumeWizard(hwndDlg, fileName);
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
@@ -930,7 +938,7 @@ BOOL CALLBACK MainDialogProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPa
|
||||
if (lw == IDM_HOMEPAGE )
|
||||
{
|
||||
ArrowWaitCursor ();
|
||||
ShellExecute (NULL, "open", "https://veracrypt.codeplex.com", NULL, NULL, SW_SHOWNORMAL);
|
||||
ShellExecute (NULL, L"open", L"https://veracrypt.codeplex.com", NULL, NULL, SW_SHOWNORMAL);
|
||||
Sleep (200);
|
||||
NormalCursor ();
|
||||
|
||||
@@ -965,7 +973,7 @@ BOOL CALLBACK MainDialogProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPa
|
||||
}
|
||||
|
||||
|
||||
int WINAPI WinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance, char *lpszCommandLine, int nCmdShow)
|
||||
int WINAPI wWinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance, wchar_t *lpszCommandLine, int nCmdShow)
|
||||
{
|
||||
int status;
|
||||
atexit (VeraCryptExpander::localcleanup);
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
IntermediateDirectory="Debug"
|
||||
ConfigurationType="1"
|
||||
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
|
||||
CharacterSet="2"
|
||||
CharacterSet="1"
|
||||
>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"
|
||||
@@ -104,13 +104,99 @@
|
||||
CommandLine="md "..\Debug\Setup Files" 2>NUL:
copy Debug\VeraCryptFormat.exe "..\Debug\Setup Files\VeraCrypt Format.exe" >NUL:
"
|
||||
/>
|
||||
</Configuration>
|
||||
<Configuration
|
||||
Name="Debug|x64"
|
||||
OutputDirectory="$(PlatformName)\$(ConfigurationName)"
|
||||
IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
|
||||
ConfigurationType="1"
|
||||
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
|
||||
CharacterSet="1"
|
||||
>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"
|
||||
TargetEnvironment="3"
|
||||
TypeLibraryName="$(SolutionDir)/$(ProjectName)/$(ProjectName).tlb"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories="..\Common;..\Crypto;..\;..\PKCS11"
|
||||
PreprocessorDefinitions="VOLFORMAT;WIN32;DEBUG;_DEBUG;_WINDOWS;_CRT_SECURE_NO_DEPRECATE;_CRT_NON_CONFORMING_SWPRINTFS"
|
||||
MinimalRebuild="true"
|
||||
BasicRuntimeChecks="3"
|
||||
RuntimeLibrary="1"
|
||||
BufferSecurityCheck="true"
|
||||
UsePrecompiledHeader="0"
|
||||
WarningLevel="4"
|
||||
DebugInformationFormat="3"
|
||||
DisableSpecificWarnings="4057;4100;4127;4201;4204;4701;4706"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManagedResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
AdditionalDependencies="comctl32.lib setupapi.lib ..\Crypto\x64\Debug\crypto.lib"
|
||||
OutputFile="$(OutDir)/VeraCryptFormat.exe"
|
||||
LinkIncremental="2"
|
||||
GenerateManifest="false"
|
||||
IgnoreAllDefaultLibraries="false"
|
||||
GenerateDebugInformation="true"
|
||||
ProgramDatabaseFile="$(OutDir)/Format.pdb"
|
||||
SubSystem="2"
|
||||
RandomizedBaseAddress="1"
|
||||
DataExecutionPrevention="2"
|
||||
TargetMachine="17"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCALinkTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManifestTool"
|
||||
AdditionalManifestFiles="Format.manifest"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXDCMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCBscMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCFxCopTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCAppVerifierTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"
|
||||
CommandLine="md "..\Debug\Setup Files" 2>NUL:
copy $(TargetPath) "..\Debug\Setup Files\VeraCrypt Format-x64.exe" >NUL:
"
|
||||
/>
|
||||
</Configuration>
|
||||
<Configuration
|
||||
Name="Release|Win32"
|
||||
OutputDirectory="Release"
|
||||
IntermediateDirectory="Release"
|
||||
ConfigurationType="1"
|
||||
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
|
||||
CharacterSet="2"
|
||||
CharacterSet="1"
|
||||
>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"
|
||||
@@ -192,99 +278,13 @@
|
||||
CommandLine="copy Release\VeraCryptFormat.exe "..\Release\Setup Files\VeraCrypt Format.exe""
|
||||
/>
|
||||
</Configuration>
|
||||
<Configuration
|
||||
Name="Debug|x64"
|
||||
OutputDirectory="$(PlatformName)\$(ConfigurationName)"
|
||||
IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
|
||||
ConfigurationType="1"
|
||||
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
|
||||
CharacterSet="2"
|
||||
>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"
|
||||
TargetEnvironment="3"
|
||||
TypeLibraryName="$(SolutionDir)/$(ProjectName)/$(ProjectName).tlb"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories="..\Common;..\Crypto;..\;..\PKCS11"
|
||||
PreprocessorDefinitions="VOLFORMAT;WIN32;DEBUG;_DEBUG;_WINDOWS;_CRT_SECURE_NO_DEPRECATE;_CRT_NON_CONFORMING_SWPRINTFS"
|
||||
MinimalRebuild="true"
|
||||
BasicRuntimeChecks="3"
|
||||
RuntimeLibrary="1"
|
||||
BufferSecurityCheck="true"
|
||||
UsePrecompiledHeader="0"
|
||||
WarningLevel="4"
|
||||
DebugInformationFormat="3"
|
||||
DisableSpecificWarnings="4057;4100;4127;4201;4204;4701;4706"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManagedResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
AdditionalDependencies="comctl32.lib setupapi.lib ..\Crypto\x64\Debug\crypto.lib"
|
||||
OutputFile="$(OutDir)/VeraCryptFormat.exe"
|
||||
LinkIncremental="2"
|
||||
GenerateManifest="false"
|
||||
IgnoreAllDefaultLibraries="false"
|
||||
GenerateDebugInformation="true"
|
||||
ProgramDatabaseFile="$(OutDir)/Format.pdb"
|
||||
SubSystem="2"
|
||||
RandomizedBaseAddress="1"
|
||||
DataExecutionPrevention="2"
|
||||
TargetMachine="17"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCALinkTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManifestTool"
|
||||
AdditionalManifestFiles="Format.manifest"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXDCMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCBscMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCFxCopTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCAppVerifierTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"
|
||||
CommandLine="md "..\Debug\Setup Files" 2>NUL:
copy $(TargetPath) "..\Debug\Setup Files\VeraCrypt Format-x64.exe" >NUL:
"
|
||||
/>
|
||||
</Configuration>
|
||||
<Configuration
|
||||
Name="Release|x64"
|
||||
OutputDirectory="$(PlatformName)\$(ConfigurationName)"
|
||||
IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
|
||||
ConfigurationType="1"
|
||||
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
|
||||
CharacterSet="2"
|
||||
CharacterSet="1"
|
||||
>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"
|
||||
@@ -396,7 +396,7 @@
|
||||
/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Release|Win32"
|
||||
Name="Debug|x64"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
@@ -404,7 +404,7 @@
|
||||
/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Debug|x64"
|
||||
Name="Release|Win32"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
@@ -432,7 +432,7 @@
|
||||
/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Release|Win32"
|
||||
Name="Debug|x64"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
@@ -440,7 +440,7 @@
|
||||
/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Debug|x64"
|
||||
Name="Release|Win32"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
@@ -495,7 +495,7 @@
|
||||
/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Release|Win32"
|
||||
Name="Debug|x64"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
@@ -503,7 +503,7 @@
|
||||
/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Debug|x64"
|
||||
Name="Release|Win32"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
@@ -531,7 +531,7 @@
|
||||
/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Release|Win32"
|
||||
Name="Debug|x64"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
@@ -539,7 +539,7 @@
|
||||
/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Debug|x64"
|
||||
Name="Release|Win32"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
@@ -587,7 +587,7 @@
|
||||
/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Release|Win32"
|
||||
Name="Debug|x64"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
@@ -595,7 +595,7 @@
|
||||
/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Debug|x64"
|
||||
Name="Release|Win32"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
@@ -751,11 +751,11 @@
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\Common\Resource.h"
|
||||
RelativePath=".\resource.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\resource.h"
|
||||
RelativePath="..\Common\Resource.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
@@ -796,6 +796,38 @@
|
||||
Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx"
|
||||
UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"
|
||||
>
|
||||
<File
|
||||
RelativePath="..\Boot\Windows\Release_Serpent_SHA2\BootSector.bin"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\Boot\Windows\Rescue_Twofish_SHA2\BootSector.bin"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\Boot\Windows\Rescue_Serpent_SHA2\BootSector.bin"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\Boot\Windows\Rescue_AES_SHA2\BootSector.bin"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\Boot\Windows\Rescue_SHA2\BootSector.bin"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\Boot\Windows\Release_SHA2\BootSector.bin"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\Boot\Windows\Release_AES_SHA2\BootSector.bin"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\Boot\Windows\Release_Twofish_SHA2\BootSector.bin"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\Format.manifest"
|
||||
>
|
||||
@@ -809,6 +841,10 @@
|
||||
SubType="Designer"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\Common\VeraCrypt_mounted.ico"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\Common\VeraCrypt_Volume.ico"
|
||||
>
|
||||
@@ -820,18 +856,6 @@
|
||||
<Filter
|
||||
Name="Common"
|
||||
>
|
||||
<File
|
||||
RelativePath="..\Boot\Windows\Rescue\BootLoader.com.gz"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\Boot\Windows\Rescue_Twofish\BootLoader.com.gz"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\Boot\Windows\Release_Serpent\BootLoader.com.gz"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\Boot\Windows\Release_AES\BootLoader.com.gz"
|
||||
>
|
||||
@@ -852,6 +876,18 @@
|
||||
RelativePath="..\Boot\Windows\Rescue_AES\BootLoader.com.gz"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\Boot\Windows\Rescue\BootLoader.com.gz"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\Boot\Windows\Rescue_Twofish\BootLoader.com.gz"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\Boot\Windows\Release_Serpent\BootLoader.com.gz"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\Boot\Windows\Rescue_AES\BootSector.bin"
|
||||
>
|
||||
@@ -896,7 +932,7 @@
|
||||
/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Release|Win32"
|
||||
Name="Debug|x64"
|
||||
ExcludedFromBuild="true"
|
||||
>
|
||||
<Tool
|
||||
@@ -904,7 +940,7 @@
|
||||
/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Debug|x64"
|
||||
Name="Release|Win32"
|
||||
ExcludedFromBuild="true"
|
||||
>
|
||||
<Tool
|
||||
@@ -950,6 +986,38 @@
|
||||
</File>
|
||||
</Filter>
|
||||
</Filter>
|
||||
<File
|
||||
RelativePath="..\Boot\Windows\Release_Serpent_SHA2\BootLoader.com.gz"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\Boot\Windows\Release_Twofish_SHA2\BootLoader.com.gz"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\Boot\Windows\Rescue_SHA2\BootLoader.com.gz"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\Boot\Windows\Rescue_AES_SHA2\BootLoader.com.gz"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\Boot\Windows\Rescue_Serpent_SHA2\BootLoader.com.gz"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\Boot\Windows\Rescue_Twofish_SHA2\BootLoader.com.gz"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\Boot\Windows\Release_SHA2\BootLoader.com.gz"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\Boot\Windows\Release_AES_SHA2\BootLoader.com.gz"
|
||||
>
|
||||
</File>
|
||||
</Files>
|
||||
<Globals>
|
||||
</Globals>
|
||||
|
||||
@@ -65,7 +65,7 @@ using namespace VeraCrypt;
|
||||
|
||||
// If the returned value is greater than 0, it is the desired volume size in NTFS sectors (not in bytes)
|
||||
// after shrinking has been performed. If there's any error, returns -1.
|
||||
static __int64 NewFileSysSizeAfterShrink (HANDLE dev, const char *devicePath, int64 *totalClusterCount, DWORD *bytesPerCluster, BOOL silent)
|
||||
static __int64 NewFileSysSizeAfterShrink (HANDLE dev, const wchar_t *devicePath, int64 *totalClusterCount, DWORD *bytesPerCluster, BOOL silent)
|
||||
{
|
||||
NTFS_VOLUME_DATA_BUFFER ntfsVolData;
|
||||
DWORD nBytesReturned;
|
||||
@@ -115,17 +115,17 @@ static __int64 NewFileSysSizeAfterShrink (HANDLE dev, const char *devicePath, in
|
||||
}
|
||||
|
||||
|
||||
BOOL CheckRequirementsForNonSysInPlaceEnc (HWND hwndDlg, const char *devicePath, BOOL silent)
|
||||
BOOL CheckRequirementsForNonSysInPlaceEnc (HWND hwndDlg, const wchar_t *devicePath, BOOL silent)
|
||||
{
|
||||
NTFS_VOLUME_DATA_BUFFER ntfsVolData;
|
||||
DWORD nBytesReturned;
|
||||
HANDLE dev;
|
||||
char szFileSysName [256];
|
||||
WCHAR szFileSysName [256];
|
||||
WCHAR devPath [MAX_PATH];
|
||||
char dosDev [TC_MAX_PATH] = {0};
|
||||
char devName [MAX_PATH] = {0};
|
||||
WCHAR dosDev [TC_MAX_PATH] = {0};
|
||||
WCHAR devName [MAX_PATH] = {0};
|
||||
int driveLetterNo = -1;
|
||||
char szRootPath[4] = {0, ':', '\\', 0};
|
||||
WCHAR szRootPath[4] = {0, L':', L'\\', 0};
|
||||
__int64 deviceSize;
|
||||
int partitionNumber = -1, driveNumber = -1;
|
||||
|
||||
@@ -146,8 +146,8 @@ BOOL CheckRequirementsForNonSysInPlaceEnc (HWND hwndDlg, const char *devicePath,
|
||||
|
||||
/* Volume type (must be a partition or a dynamic volume) */
|
||||
|
||||
if (sscanf (devicePath, "\\Device\\HarddiskVolume%d", &partitionNumber) != 1
|
||||
&& sscanf (devicePath, "\\Device\\Harddisk%d\\Partition%d", &driveNumber, &partitionNumber) != 2)
|
||||
if (swscanf (devicePath, L"\\Device\\HarddiskVolume%d", &partitionNumber) != 1
|
||||
&& swscanf (devicePath, L"\\Device\\Harddisk%d\\Partition%d", &driveNumber, &partitionNumber) != 2)
|
||||
{
|
||||
if (!silent)
|
||||
Error ("INPLACE_ENC_INVALID_PATH", hwndDlg);
|
||||
@@ -181,13 +181,12 @@ BOOL CheckRequirementsForNonSysInPlaceEnc (HWND hwndDlg, const char *devicePath,
|
||||
|
||||
/* Access to the partition */
|
||||
|
||||
StringCbCopyA ((char *) devPath, sizeof(devPath), devicePath);
|
||||
ToUNICODE ((char *) devPath, sizeof(devPath));
|
||||
StringCbCopyW (devPath, sizeof(devPath), devicePath);
|
||||
|
||||
driveLetterNo = GetDiskDeviceDriveLetter (devPath);
|
||||
|
||||
if (driveLetterNo >= 0)
|
||||
szRootPath[0] = (char) driveLetterNo + 'A';
|
||||
szRootPath[0] = (wchar_t) driveLetterNo + L'A';
|
||||
|
||||
if (FakeDosNameForDevice (devicePath, dosDev, sizeof(dosDev), devName, sizeof(devName),FALSE) != 0)
|
||||
{
|
||||
@@ -212,9 +211,9 @@ BOOL CheckRequirementsForNonSysInPlaceEnc (HWND hwndDlg, const char *devicePath,
|
||||
|
||||
/* File system type */
|
||||
|
||||
GetVolumeInformation (szRootPath, NULL, 0, NULL, NULL, NULL, szFileSysName, sizeof(szFileSysName));
|
||||
GetVolumeInformation (szRootPath, NULL, 0, NULL, NULL, NULL, szFileSysName, ARRAYSIZE (szFileSysName));
|
||||
|
||||
if (strncmp (szFileSysName, "NTFS", 4))
|
||||
if (wcsncmp (szFileSysName, L"NTFS", 4))
|
||||
{
|
||||
// The previous filesystem type detection method failed (or it's not NTFS) -- try an alternative method
|
||||
|
||||
@@ -328,15 +327,15 @@ BOOL CheckRequirementsForNonSysInPlaceEnc (HWND hwndDlg, const char *devicePath,
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
BOOL CheckRequirementsForNonSysInPlaceDec (HWND hwndDlg, const char *devicePath, BOOL silent)
|
||||
BOOL CheckRequirementsForNonSysInPlaceDec (HWND hwndDlg, const wchar_t *devicePath, BOOL silent)
|
||||
{
|
||||
int partitionNumber = -1, driveNumber = -1;
|
||||
|
||||
/* ---------- Checks that do not require admin rights ----------- */
|
||||
|
||||
/* Volume type (must be a partition or a dynamic volume) */
|
||||
if ((sscanf (devicePath, "\\Device\\HarddiskVolume%d", &partitionNumber) != 1
|
||||
&& sscanf (devicePath, "\\Device\\Harddisk%d\\Partition%d", &driveNumber, &partitionNumber) != 2)
|
||||
if ((swscanf (devicePath, L"\\Device\\HarddiskVolume%d", &partitionNumber) != 1
|
||||
&& swscanf (devicePath, L"\\Device\\Harddisk%d\\Partition%d", &driveNumber, &partitionNumber) != 2)
|
||||
|| partitionNumber == 0)
|
||||
{
|
||||
if (!silent)
|
||||
@@ -375,8 +374,8 @@ int EncryptPartitionInPlaceBegin (volatile FORMAT_VOL_PARAMETERS *volParams, vol
|
||||
HANDLE dev = INVALID_HANDLE_VALUE;
|
||||
DWORD dwError;
|
||||
char *header;
|
||||
char dosDev[TC_MAX_PATH] = {0};
|
||||
char devName[MAX_PATH] = {0};
|
||||
WCHAR dosDev[TC_MAX_PATH] = {0};
|
||||
WCHAR devName[MAX_PATH] = {0};
|
||||
int driveLetter = -1;
|
||||
WCHAR deviceName[MAX_PATH];
|
||||
uint64 dataAreaSize;
|
||||
@@ -415,8 +414,7 @@ int EncryptPartitionInPlaceBegin (volatile FORMAT_VOL_PARAMETERS *volParams, vol
|
||||
|
||||
dataAreaSize = GetVolumeDataAreaSize (volParams->hiddenVol, deviceSize);
|
||||
|
||||
StringCbCopyA ((char *)deviceName, sizeof(deviceName), volParams->volumePath);
|
||||
ToUNICODE ((char *)deviceName, sizeof(deviceName));
|
||||
StringCbCopyW (deviceName, sizeof(deviceName), volParams->volumePath);
|
||||
|
||||
driveLetter = GetDiskDeviceDriveLetter (deviceName);
|
||||
|
||||
@@ -665,7 +663,7 @@ int EncryptPartitionInPlaceBegin (volatile FORMAT_VOL_PARAMETERS *volParams, vol
|
||||
// Add the wizard to the system startup sequence if appropriate
|
||||
|
||||
if (!IsNonInstallMode ())
|
||||
ManageStartupSeqWiz (FALSE, "/prinplace");
|
||||
ManageStartupSeqWiz (FALSE, L"/prinplace");
|
||||
|
||||
|
||||
nStatus = ERR_SUCCESS;
|
||||
@@ -714,8 +712,8 @@ int EncryptPartitionInPlaceResume (HANDLE dev,
|
||||
byte *wipeBuffer = NULL;
|
||||
byte wipeRandChars [TC_WIPE_RAND_CHAR_COUNT];
|
||||
byte wipeRandCharsUpdate [TC_WIPE_RAND_CHAR_COUNT];
|
||||
char dosDev[TC_MAX_PATH] = {0};
|
||||
char devName[MAX_PATH] = {0};
|
||||
WCHAR dosDev[TC_MAX_PATH] = {0};
|
||||
WCHAR devName[MAX_PATH] = {0};
|
||||
WCHAR deviceName[MAX_PATH];
|
||||
int nStatus = ERR_SUCCESS;
|
||||
__int64 deviceSize;
|
||||
@@ -727,7 +725,7 @@ int EncryptPartitionInPlaceResume (HANDLE dev,
|
||||
int sectorSize;
|
||||
int i;
|
||||
DWORD n;
|
||||
char *devicePath = volParams->volumePath;
|
||||
WCHAR *devicePath = volParams->volumePath;
|
||||
Password *password = volParams->password;
|
||||
int pkcs5_prf = volParams->pkcs5;
|
||||
int pim = volParams->pim;
|
||||
@@ -781,8 +779,7 @@ int EncryptPartitionInPlaceResume (HANDLE dev,
|
||||
|
||||
if (dev == INVALID_HANDLE_VALUE)
|
||||
{
|
||||
StringCbCopyA ((char *)deviceName, sizeof(deviceName), devicePath);
|
||||
ToUNICODE ((char *)deviceName, sizeof(deviceName));
|
||||
StringCbCopyW (deviceName, sizeof(deviceName), devicePath);
|
||||
|
||||
if (FakeDosNameForDevice (devicePath, dosDev, sizeof(dosDev),devName, sizeof(devName),FALSE) != 0)
|
||||
{
|
||||
@@ -1188,8 +1185,8 @@ int DecryptPartitionInPlace (volatile FORMAT_VOL_PARAMETERS *volParams, volatile
|
||||
UINT64_STRUCT unitNo;
|
||||
char *buf = NULL;
|
||||
byte *tmpSectorBuf = NULL;
|
||||
char dosDev[TC_MAX_PATH] = {0};
|
||||
char devName[MAX_PATH] = {0};
|
||||
WCHAR dosDev[TC_MAX_PATH] = {0};
|
||||
WCHAR devName[MAX_PATH] = {0};
|
||||
WCHAR deviceName[MAX_PATH];
|
||||
int nStatus = ERR_SUCCESS;
|
||||
__int64 deviceSize;
|
||||
@@ -1201,7 +1198,7 @@ int DecryptPartitionInPlace (volatile FORMAT_VOL_PARAMETERS *volParams, volatile
|
||||
int sectorSize;
|
||||
int i;
|
||||
DWORD n;
|
||||
char *devicePath = volParams->volumePath;
|
||||
WCHAR *devicePath = volParams->volumePath;
|
||||
Password *password = volParams->password;
|
||||
HWND hwndDlg = volParams->hwndDlg;
|
||||
int pkcs5_prf = volParams->pkcs5;
|
||||
@@ -1247,8 +1244,7 @@ int DecryptPartitionInPlace (volatile FORMAT_VOL_PARAMETERS *volParams, volatile
|
||||
}
|
||||
|
||||
|
||||
StringCbCopyA ((char *)deviceName, sizeof(deviceName), devicePath);
|
||||
ToUNICODE ((char *)deviceName, sizeof(deviceName));
|
||||
StringCbCopyW (deviceName, sizeof(deviceName), devicePath);
|
||||
|
||||
if (FakeDosNameForDevice (devicePath, dosDev, sizeof(dosDev), devName, sizeof(devName), FALSE) != 0)
|
||||
{
|
||||
@@ -1355,7 +1351,7 @@ int DecryptPartitionInPlace (volatile FORMAT_VOL_PARAMETERS *volParams, volatile
|
||||
|
||||
// Add the wizard to the system startup sequence if appropriate
|
||||
if (!IsNonInstallMode ())
|
||||
ManageStartupSeqWiz (FALSE, "/prinplace");
|
||||
ManageStartupSeqWiz (FALSE, L"/prinplace");
|
||||
}
|
||||
|
||||
|
||||
@@ -1769,7 +1765,7 @@ closing_seq:
|
||||
}
|
||||
|
||||
|
||||
static HANDLE OpenPartitionVolume (HWND hwndDlg, const char *devName,
|
||||
static HANDLE OpenPartitionVolume (HWND hwndDlg, const wchar_t *devName,
|
||||
BOOL bExclusiveRequired,
|
||||
BOOL bSharedRequired,
|
||||
BOOL bSharedRequiresConfirmation,
|
||||
@@ -2015,7 +2011,7 @@ BOOL SaveNonSysInPlaceEncSettings (int delta, WipeAlgorithmId newWipeAlgorithm,
|
||||
}
|
||||
else if (FileExists (GetConfigPath (TC_APPD_FILENAME_NONSYS_INPLACE_ENC_WIPE)))
|
||||
{
|
||||
remove (GetConfigPath (TC_APPD_FILENAME_NONSYS_INPLACE_ENC_WIPE));
|
||||
_wremove (GetConfigPath (TC_APPD_FILENAME_NONSYS_INPLACE_ENC_WIPE));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2089,7 +2085,7 @@ closing_seq:
|
||||
}
|
||||
|
||||
|
||||
static int OpenBackupHeader (HANDLE dev, const char *devicePath, Password *password, int pkcs5, int pim, PCRYPTO_INFO *retMasterCryptoInfo, CRYPTO_INFO *headerCryptoInfo, __int64 deviceSize)
|
||||
static int OpenBackupHeader (HANDLE dev, const wchar_t *devicePath, Password *password, int pkcs5, int pim, PCRYPTO_INFO *retMasterCryptoInfo, CRYPTO_INFO *headerCryptoInfo, __int64 deviceSize)
|
||||
{
|
||||
LARGE_INTEGER offset;
|
||||
DWORD n;
|
||||
|
||||
@@ -29,8 +29,8 @@ enum nonsys_inplace_enc_status
|
||||
NONSYS_INPLACE_ENC_STATUS_ERROR
|
||||
};
|
||||
|
||||
BOOL CheckRequirementsForNonSysInPlaceEnc (HWND hwndDlg, const char *devicePath, BOOL silent);
|
||||
BOOL CheckRequirementsForNonSysInPlaceDec (HWND hwndDlg, const char *devicePath, BOOL silent);
|
||||
BOOL CheckRequirementsForNonSysInPlaceEnc (HWND hwndDlg, const wchar_t *devicePath, BOOL silent);
|
||||
BOOL CheckRequirementsForNonSysInPlaceDec (HWND hwndDlg, const wchar_t *devicePath, BOOL silent);
|
||||
int EncryptPartitionInPlaceBegin (volatile FORMAT_VOL_PARAMETERS *volParams, volatile HANDLE *outHandle, WipeAlgorithmId wipeAlgorithm);
|
||||
int EncryptPartitionInPlaceResume (HANDLE dev, volatile FORMAT_VOL_PARAMETERS *volParams, WipeAlgorithmId wipeAlgorithm, volatile BOOL *bTryToCorrectReadErrors);
|
||||
int DecryptPartitionInPlace (volatile FORMAT_VOL_PARAMETERS *volParams, volatile BOOL *DiscardUnreadableEncryptedSectors);
|
||||
@@ -38,13 +38,13 @@ void ShowInPlaceEncErrMsgWAltSteps (HWND hwndDlg, char *iniStrId, BOOL bErr);
|
||||
void SetNonSysInplaceEncUIStatus (int nonSysInplaceEncStatus);
|
||||
int FastVolumeHeaderUpdate (HANDLE dev, CRYPTO_INFO *headerCryptoInfo, CRYPTO_INFO *masterCryptoInfo, __int64 deviceSize);
|
||||
|
||||
static HANDLE OpenPartitionVolume (HWND hwndDlg, const char *devName, BOOL bExclusiveRequired, BOOL bSharedRequired, BOOL bSharedRequiresConfirmation, BOOL bShowAlternativeSteps, BOOL bSilent);
|
||||
static HANDLE OpenPartitionVolume (HWND hwndDlg, const wchar_t *devName, BOOL bExclusiveRequired, BOOL bSharedRequired, BOOL bSharedRequiresConfirmation, BOOL bShowAlternativeSteps, BOOL bSilent);
|
||||
static int DismountFileSystem (HWND hwndDlg, HANDLE dev, int driveLetter, BOOL bForcedAllowed, BOOL bForcedRequiresConfirmation, BOOL bSilent);
|
||||
static int ConcealNTFS (HANDLE dev);
|
||||
BOOL SaveNonSysInPlaceEncSettings (int delta, WipeAlgorithmId wipeAlgorithm, BOOL bDecrypting);
|
||||
static void ExportProgressStats (__int64 bytesDone, __int64 totalSize);
|
||||
int ZeroUnreadableSectors (HANDLE dev, LARGE_INTEGER startOffset, int64 size, int sectorSize, uint64 *zeroedSectorCount);
|
||||
static int OpenBackupHeader (HANDLE dev, const char *devicePath, Password *password, int pkcs5, int pim, PCRYPTO_INFO *retCryptoInfo, CRYPTO_INFO *headerCryptoInfo, __int64 deviceSize);
|
||||
static int OpenBackupHeader (HANDLE dev, const wchar_t *devicePath, Password *password, int pkcs5, int pim, PCRYPTO_INFO *retCryptoInfo, CRYPTO_INFO *headerCryptoInfo, __int64 deviceSize);
|
||||
BOOL MoveClustersBeforeThreshold (HANDLE volumeHandle, PWSTR volumeDevicePath, int64 clusterThreshold);
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
||||
Binary file not shown.
@@ -39,7 +39,7 @@ static void VerifySizeAndUpdate ( HWND hwndDlg , BOOL bUpdate );
|
||||
static void __cdecl sysEncDriveAnalysisThread (void *hwndDlgArg);
|
||||
static void __cdecl volTransformThreadFunction ( void *hwndDlg );
|
||||
static void LoadPage ( HWND hwndDlg , int nPageNo );
|
||||
__int64 PrintFreeSpace ( HWND hwndTextBox , char *lpszDrive , PLARGE_INTEGER lDiskFree );
|
||||
__int64 PrintFreeSpace ( HWND hwndTextBox , wchar_t *lpszDrive , PLARGE_INTEGER lDiskFree );
|
||||
void DisplaySizingErrorText ( HWND hwndTextBox );
|
||||
void EnableDisableFileNext ( HWND hComboBox , HWND hMainButton );
|
||||
BOOL QueryFreeSpace ( HWND hwndDlg , HWND hwndTextBox , BOOL display );
|
||||
@@ -49,7 +49,7 @@ void HandleOldAssignedDriveLetter (void);
|
||||
void AddCipher ( HWND hComboBox , char *lpszCipher , int nCipher );
|
||||
BOOL CALLBACK PageDialogProc ( HWND hwndDlg , UINT uMsg , WPARAM wParam , LPARAM lParam );
|
||||
BOOL CALLBACK MainDialogProc ( HWND hwndDlg , UINT uMsg , WPARAM wParam , LPARAM lParam );
|
||||
void ExtractCommandLine ( HWND hwndDlg , char *lpszCommandLine );
|
||||
void ExtractCommandLine ( HWND hwndDlg , wchar_t *lpszCommandLine );
|
||||
void DisplayRandPool (HWND hwndDlg, HWND hPoolDisplay, BOOL bShow);
|
||||
void DisplayPortionsOfKeys (HWND headerKeyHandle, HWND masterKeyHandle, char *headerKeyStr, char *masterKeyStr, BOOL hideKeys);
|
||||
int DetermineMaxHiddenVolSize (HWND hwndDlg);
|
||||
@@ -70,7 +70,7 @@ static void NonSysInplaceEncPause (void);
|
||||
static void NonSysInplaceEncResume (void);
|
||||
void ShowNonSysInPlaceEncUIStatus (void);
|
||||
void UpdateNonSysInPlaceEncControls (void);
|
||||
int MountHiddenVolHost ( HWND hwndDlg, char *volumePath, int *driveNo, Password *password, int pkcs5_prf, int pim, BOOL bReadOnly );
|
||||
int MountHiddenVolHost ( HWND hwndDlg, wchar_t *volumePath, int *driveNo, Password *password, int pkcs5_prf, int pim, BOOL bReadOnly );
|
||||
int AnalyzeHiddenVolumeHost (HWND hwndDlg, int *driveNo, __int64 hiddenVolHostSize, int *realClusterSize, __int64 *pnbrFreeClusters);
|
||||
int ScanVolClusterBitmap ( HWND hwndDlg, int *driveNo, __int64 nbrClusters, __int64 *nbrFreeClusters);
|
||||
static void WipeStart (void);
|
||||
|
||||
@@ -48,11 +48,11 @@ namespace VeraCrypt
|
||||
}
|
||||
|
||||
FavoriteVolume favorite;
|
||||
favorite.MountPoint = "X:\\";
|
||||
favorite.MountPoint[0] = (char) (prop.driveNo + 'A');
|
||||
favorite.MountPoint = L"X:\\";
|
||||
favorite.MountPoint[0] = (wchar_t) (prop.driveNo + L'A');
|
||||
|
||||
favorite.Path = WideToSingleString ((wchar_t *) prop.wszVolume);
|
||||
if (favorite.Path.find ("\\??\\") == 0)
|
||||
favorite.Path = prop.wszVolume;
|
||||
if (favorite.Path.find (L"\\??\\") == 0)
|
||||
favorite.Path = favorite.Path.substr (4);
|
||||
|
||||
if (wcslen (prop.wszLabel))
|
||||
@@ -64,30 +64,30 @@ namespace VeraCrypt
|
||||
if (IsVolumeDeviceHosted (favorite.Path.c_str()))
|
||||
{
|
||||
// Get GUID path
|
||||
string volumeDevPath = favorite.Path;
|
||||
wstring volumeDevPath = favorite.Path;
|
||||
|
||||
wchar_t resolvedVolumeDevPath[TC_MAX_PATH];
|
||||
if (ResolveSymbolicLink (SingleStringToWide (volumeDevPath).c_str(), resolvedVolumeDevPath, sizeof(resolvedVolumeDevPath)))
|
||||
volumeDevPath = WideToSingleString (resolvedVolumeDevPath);
|
||||
if (ResolveSymbolicLink (volumeDevPath.c_str(), resolvedVolumeDevPath, sizeof(resolvedVolumeDevPath)))
|
||||
volumeDevPath = resolvedVolumeDevPath;
|
||||
|
||||
char volumeName[TC_MAX_PATH];
|
||||
HANDLE find = FindFirstVolume (volumeName, sizeof (volumeName));
|
||||
wchar_t volumeName[TC_MAX_PATH];
|
||||
HANDLE find = FindFirstVolume (volumeName, ARRAYSIZE (volumeName));
|
||||
|
||||
if (find != INVALID_HANDLE_VALUE)
|
||||
{
|
||||
do
|
||||
{
|
||||
char findVolumeDevPath[TC_MAX_PATH];
|
||||
string vn = volumeName;
|
||||
wchar_t findVolumeDevPath[TC_MAX_PATH];
|
||||
wstring vn = volumeName;
|
||||
|
||||
if (QueryDosDevice (vn.substr (4, vn.size() - 5).c_str(), findVolumeDevPath, sizeof (findVolumeDevPath)) != 0
|
||||
if (QueryDosDevice (vn.substr (4, vn.size() - 5).c_str(), findVolumeDevPath, ARRAYSIZE (findVolumeDevPath)) != 0
|
||||
&& volumeDevPath == findVolumeDevPath)
|
||||
{
|
||||
favorite.VolumePathId = volumeName;
|
||||
break;
|
||||
}
|
||||
|
||||
} while (FindNextVolume (find, volumeName, sizeof (volumeName)));
|
||||
} while (FindNextVolume (find, volumeName, ARRAYSIZE (volumeName)));
|
||||
|
||||
FindVolumeClose (find);
|
||||
}
|
||||
@@ -101,9 +101,9 @@ namespace VeraCrypt
|
||||
|
||||
if (favorite.VolumePathId.empty()
|
||||
&& IsVolumeDeviceHosted (favorite.Path.c_str())
|
||||
&& favorite.Path.find ("\\\\?\\Volume{") != 0)
|
||||
&& favorite.Path.find (L"\\\\?\\Volume{") != 0)
|
||||
{
|
||||
Warning (favorite.Path.find ("\\Partition0") == string::npos ? "FAVORITE_ADD_PARTITION_TYPE_WARNING" : "FAVORITE_ADD_DRIVE_DEV_WARNING", hwndDlg);
|
||||
Warning (favorite.Path.find (L"\\Partition0") == wstring::npos ? "FAVORITE_ADD_PARTITION_TYPE_WARNING" : "FAVORITE_ADD_DRIVE_DEV_WARNING", hwndDlg);
|
||||
}
|
||||
|
||||
return OrganizeFavoriteVolumes (hwndDlg, systemFavorites, favorite);
|
||||
@@ -429,7 +429,7 @@ namespace VeraCrypt
|
||||
if (FavoriteVolumes.empty())
|
||||
return;
|
||||
|
||||
AppendMenu (FavoriteVolumesMenu, MF_SEPARATOR, 0, "");
|
||||
AppendMenu (FavoriteVolumesMenu, MF_SEPARATOR, 0, L"");
|
||||
|
||||
int i = 0;
|
||||
foreach (const FavoriteVolume &favorite, FavoriteVolumes)
|
||||
@@ -439,7 +439,7 @@ namespace VeraCrypt
|
||||
if (favorite.DisconnectedDevice)
|
||||
flags |= MF_GRAYED;
|
||||
|
||||
wstring menuText = SingleStringToWide (favorite.Path);
|
||||
wstring menuText = favorite.Path;
|
||||
if (favorite.DisconnectedDevice)
|
||||
menuText = favorite.Label.empty() ? wstring (L"(") + GetString ("FAVORITE_DISCONNECTED_DEV") + L")" : L"";
|
||||
|
||||
@@ -452,7 +452,7 @@ namespace VeraCrypt
|
||||
}
|
||||
|
||||
AppendMenuW (FavoriteVolumesMenu, flags, TC_FAVORITE_MENU_CMD_ID_OFFSET + i++,
|
||||
(menuText + L"\t" + SingleStringToWide (favorite.MountPoint).substr (0, 2)).c_str());
|
||||
(menuText + L"\t" + favorite.MountPoint.substr (0, 2)).c_str());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -464,7 +464,7 @@ namespace VeraCrypt
|
||||
int line = 0;
|
||||
foreach (const FavoriteVolume favorite, favorites)
|
||||
{
|
||||
ListItemAdd (favoriteListControl, line, (char *) favorite.MountPoint.substr (0, 2).c_str());
|
||||
ListItemAdd (favoriteListControl, line, (wchar_t *) favorite.MountPoint.substr (0, 2).c_str());
|
||||
FillListControlSubItems (favoriteListControl, line++, favorite);
|
||||
}
|
||||
}
|
||||
@@ -472,16 +472,16 @@ namespace VeraCrypt
|
||||
|
||||
static void FillListControlSubItems (HWND FavoriteListControl, int line, const FavoriteVolume &favorite)
|
||||
{
|
||||
ListSubItemSetW (FavoriteListControl, line, 1, (wchar_t *) favorite.Label.c_str());
|
||||
ListSubItemSet (FavoriteListControl, line, 1, (wchar_t *) favorite.Label.c_str());
|
||||
|
||||
if (favorite.DisconnectedDevice)
|
||||
ListSubItemSetW (FavoriteListControl, line, 2, (wchar_t *) (wstring (L"(") + GetString ("FAVORITE_DISCONNECTED_DEV") + L")").c_str());
|
||||
ListSubItemSet (FavoriteListControl, line, 2, (wchar_t *) (wstring (L"(") + GetString ("FAVORITE_DISCONNECTED_DEV") + L")").c_str());
|
||||
else
|
||||
ListSubItemSet (FavoriteListControl, line, 2, (char *) favorite.Path.c_str());
|
||||
ListSubItemSet (FavoriteListControl, line, 2, (wchar_t *) favorite.Path.c_str());
|
||||
}
|
||||
|
||||
|
||||
wstring GetFavoriteVolumeLabel (const string &volumePath, bool& useInExplorer)
|
||||
wstring GetFavoriteVolumeLabel (const wstring &volumePath, bool& useInExplorer)
|
||||
{
|
||||
foreach (const FavoriteVolume &favorite, FavoriteVolumes)
|
||||
{
|
||||
@@ -523,7 +523,7 @@ namespace VeraCrypt
|
||||
void LoadFavoriteVolumes (vector <FavoriteVolume> &favorites, bool systemFavorites, bool noUacElevation)
|
||||
{
|
||||
favorites.clear();
|
||||
string favoritesFilePath = systemFavorites ? GetServiceConfigPath (TC_APPD_FILENAME_SYSTEM_FAVORITE_VOLUMES, false) : GetConfigPath (TC_APPD_FILENAME_FAVORITE_VOLUMES);
|
||||
wstring favoritesFilePath = systemFavorites ? GetServiceConfigPath (TC_APPD_FILENAME_SYSTEM_FAVORITE_VOLUMES, false) : GetConfigPath (TC_APPD_FILENAME_FAVORITE_VOLUMES);
|
||||
|
||||
if (systemFavorites && !IsAdmin() && !noUacElevation)
|
||||
{
|
||||
@@ -560,10 +560,10 @@ namespace VeraCrypt
|
||||
FavoriteVolume favorite;
|
||||
|
||||
XmlGetAttributeText (xml, "mountpoint", mountPoint, sizeof (mountPoint));
|
||||
favorite.MountPoint = mountPoint;
|
||||
favorite.MountPoint = Utf8StringToWide (mountPoint);
|
||||
|
||||
XmlGetNodeText (xml, volume, sizeof (volume));
|
||||
favorite.Path = WideToSingleString (Utf8StringToWide (volume));
|
||||
favorite.Path = Utf8StringToWide (volume);
|
||||
|
||||
char label[1024];
|
||||
XmlGetAttributeText (xml, "label", label, sizeof (label));
|
||||
@@ -612,9 +612,9 @@ namespace VeraCrypt
|
||||
if (boolVal[0])
|
||||
favorite.UseLabelInExplorer = (boolVal[0] == '1') && !favorite.ReadOnly;
|
||||
|
||||
if (favorite.Path.find ("\\\\?\\Volume{") == 0 && favorite.Path.rfind ("}\\") == favorite.Path.size() - 2)
|
||||
if (favorite.Path.find (L"\\\\?\\Volume{") == 0 && favorite.Path.rfind (L"}\\") == favorite.Path.size() - 2)
|
||||
{
|
||||
string resolvedPath = VolumeGuidPathToDevicePath (favorite.Path);
|
||||
wstring resolvedPath = VolumeGuidPathToDevicePath (favorite.Path);
|
||||
if (!resolvedPath.empty())
|
||||
{
|
||||
favorite.DisconnectedDevice = false;
|
||||
@@ -688,26 +688,26 @@ namespace VeraCrypt
|
||||
FILE *f;
|
||||
int cnt = 0;
|
||||
|
||||
f = fopen (GetConfigPath (systemFavorites ? TC_APPD_FILENAME_SYSTEM_FAVORITE_VOLUMES : TC_APPD_FILENAME_FAVORITE_VOLUMES), "w,ccs=UTF-8");
|
||||
f = _wfopen (GetConfigPath (systemFavorites ? TC_APPD_FILENAME_SYSTEM_FAVORITE_VOLUMES : TC_APPD_FILENAME_FAVORITE_VOLUMES), L"w,ccs=UTF-8");
|
||||
if (f == NULL)
|
||||
{
|
||||
handleWin32Error (MainDlg, SRC_POS);
|
||||
return false;
|
||||
}
|
||||
|
||||
XmlWriteHeaderW (f);
|
||||
XmlWriteHeader (f);
|
||||
fputws (L"\n\t<favorites>", f);
|
||||
|
||||
foreach (const FavoriteVolume &favorite, favorites)
|
||||
{
|
||||
char tq[2048];
|
||||
wchar_t tq[2048];
|
||||
|
||||
if (systemFavorites && favorite.Path.find ("\\\\") == 0 && favorite.Path.find ("Volume{") == string::npos)
|
||||
if (systemFavorites && favorite.Path.find (L"\\\\") == 0 && favorite.Path.find (L"Volume{") == wstring::npos)
|
||||
Warning ("SYSTEM_FAVORITE_NETWORK_PATH_ERR", hwndDlg);
|
||||
|
||||
XmlQuoteText (!favorite.VolumePathId.empty() ? favorite.VolumePathId.c_str() : favorite.Path.c_str(), tq, sizeof (tq));
|
||||
XmlQuoteTextW (!favorite.VolumePathId.empty() ? favorite.VolumePathId.c_str() : favorite.Path.c_str(), tq, ARRAYSIZE (tq));
|
||||
|
||||
wstring s = L"\n\t\t<volume mountpoint=\"" + SingleStringToWide (favorite.MountPoint) + L"\"";
|
||||
wstring s = L"\n\t\t<volume mountpoint=\"" + favorite.MountPoint + L"\"";
|
||||
|
||||
if (!favorite.Label.empty())
|
||||
s += L" label=\"" + favorite.Label + L"\"";
|
||||
@@ -739,14 +739,14 @@ namespace VeraCrypt
|
||||
if (favorite.UseLabelInExplorer && !favorite.ReadOnly)
|
||||
s += L" useLabelInExplorer=\"1\"";
|
||||
|
||||
s += L">" + SingleStringToWide (tq) + L"</volume>";
|
||||
s += L">" + wstring (tq) + L"</volume>";
|
||||
|
||||
fwprintf (f, L"%ws", s.c_str());
|
||||
cnt++;
|
||||
}
|
||||
|
||||
fputws (L"\n\t</favorites>", f);
|
||||
XmlWriteFooterW (f);
|
||||
XmlWriteFooter (f);
|
||||
|
||||
if (!CheckFileStreamWriteErrors (hwndDlg, f, systemFavorites ? TC_APPD_FILENAME_SYSTEM_FAVORITE_VOLUMES : TC_APPD_FILENAME_FAVORITE_VOLUMES))
|
||||
{
|
||||
@@ -760,7 +760,7 @@ namespace VeraCrypt
|
||||
|
||||
if (systemFavorites)
|
||||
{
|
||||
finally_do ({ remove (GetConfigPath (TC_APPD_FILENAME_SYSTEM_FAVORITE_VOLUMES)); });
|
||||
finally_do ({ _wremove (GetConfigPath (TC_APPD_FILENAME_SYSTEM_FAVORITE_VOLUMES)); });
|
||||
|
||||
try
|
||||
{
|
||||
@@ -796,7 +796,7 @@ namespace VeraCrypt
|
||||
catch (...) { }
|
||||
}
|
||||
else
|
||||
remove (GetConfigPath (TC_APPD_FILENAME_FAVORITE_VOLUMES));
|
||||
_wremove (GetConfigPath (TC_APPD_FILENAME_FAVORITE_VOLUMES));
|
||||
}
|
||||
|
||||
return true;
|
||||
@@ -807,12 +807,12 @@ namespace VeraCrypt
|
||||
{
|
||||
if (favorite.Pim > 0)
|
||||
{
|
||||
char szTmp[MAX_PIM + 1];
|
||||
StringCbPrintfA (szTmp, sizeof(szTmp), "%d", favorite.Pim);
|
||||
wchar_t szTmp[MAX_PIM + 1];
|
||||
StringCbPrintfW (szTmp, sizeof(szTmp), L"%d", favorite.Pim);
|
||||
SetDlgItemText (hwndDlg, IDC_PIM, szTmp);
|
||||
}
|
||||
else
|
||||
SetDlgItemText (hwndDlg, IDC_PIM, "");
|
||||
SetDlgItemText (hwndDlg, IDC_PIM, L"");
|
||||
SetDlgItemTextW (hwndDlg, IDC_FAVORITE_LABEL, favorite.Label.c_str());
|
||||
SetCheckBox (hwndDlg, IDC_FAVORITE_USE_LABEL_IN_EXPLORER, favorite.UseLabelInExplorer);
|
||||
SetCheckBox (hwndDlg, IDC_FAVORITE_MOUNT_ON_LOGON, favorite.MountOnLogOn);
|
||||
@@ -886,24 +886,24 @@ namespace VeraCrypt
|
||||
|
||||
if (favorite.VolumePathId.empty()
|
||||
&& IsVolumeDeviceHosted (favorite.Path.c_str())
|
||||
&& favorite.Path.find ("\\\\?\\Volume{") != 0)
|
||||
&& favorite.Path.find (L"\\\\?\\Volume{") != 0)
|
||||
{
|
||||
bool partition = (favorite.Path.find ("\\Partition0") == string::npos);
|
||||
bool partition = (favorite.Path.find (L"\\Partition0") == wstring::npos);
|
||||
|
||||
if (!favorite.Label.empty())
|
||||
{
|
||||
ErrorDirect ((GetString (partition ? "FAVORITE_LABEL_PARTITION_TYPE_ERR" : "FAVORITE_LABEL_DEVICE_PATH_ERR") + wstring (L"\n\n") + SingleStringToWide (favorite.Path)).c_str(), hwndDlg);
|
||||
ErrorDirect ((GetString (partition ? "FAVORITE_LABEL_PARTITION_TYPE_ERR" : "FAVORITE_LABEL_DEVICE_PATH_ERR") + wstring (L"\n\n") + favorite.Path).c_str(), hwndDlg);
|
||||
favorite.Label.clear();
|
||||
}
|
||||
|
||||
if (favorite.MountOnArrival)
|
||||
{
|
||||
ErrorDirect ((GetString (partition ? "FAVORITE_ARRIVAL_MOUNT_PARTITION_TYPE_ERR" : "FAVORITE_ARRIVAL_MOUNT_DEVICE_PATH_ERR") + wstring (L"\n\n") + SingleStringToWide (favorite.Path)).c_str(), hwndDlg);
|
||||
ErrorDirect ((GetString (partition ? "FAVORITE_ARRIVAL_MOUNT_PARTITION_TYPE_ERR" : "FAVORITE_ARRIVAL_MOUNT_DEVICE_PATH_ERR") + wstring (L"\n\n") + favorite.Path).c_str(), hwndDlg);
|
||||
favorite.MountOnArrival = false;
|
||||
}
|
||||
}
|
||||
|
||||
if (favorite.MountOnArrival && favorite.Path.find ("\\\\") == 0 && favorite.Path.find ("Volume{") == string::npos)
|
||||
if (favorite.MountOnArrival && favorite.Path.find (L"\\\\") == 0 && favorite.Path.find (L"Volume{") == wstring::npos)
|
||||
{
|
||||
Error ("FAVORITE_ARRIVAL_MOUNT_NETWORK_PATH_ERR", hwndDlg);
|
||||
favorite.MountOnArrival = false;
|
||||
|
||||
@@ -34,9 +34,9 @@ namespace VeraCrypt
|
||||
{
|
||||
}
|
||||
|
||||
string Path;
|
||||
string MountPoint;
|
||||
string VolumePathId;
|
||||
wstring Path;
|
||||
wstring MountPoint;
|
||||
wstring VolumePathId;
|
||||
wstring Label;
|
||||
int Pim;
|
||||
|
||||
@@ -69,7 +69,7 @@ namespace VeraCrypt
|
||||
static void FillFavoriteVolumesMenu ();
|
||||
static void FillListControl (HWND favoriteListControl, vector <FavoriteVolume> &favorites);
|
||||
static void FillListControlSubItems (HWND favoriteListControl, int line, const FavoriteVolume &favorite);
|
||||
wstring GetFavoriteVolumeLabel (const string &volumePath, bool& useInExplorer);
|
||||
wstring GetFavoriteVolumeLabel (const wstring &volumePath, bool& useInExplorer);
|
||||
void LoadFavoriteVolumes ();
|
||||
void LoadFavoriteVolumes (vector <FavoriteVolume> &favorites, bool systemFavorites, bool noUacElevation = false);
|
||||
static void OnFavoriteVolumesUpdated ();
|
||||
|
||||
@@ -79,24 +79,14 @@ public:
|
||||
|
||||
virtual int STDMETHODCALLTYPE BackupVolumeHeader (LONG_PTR hwndDlg, BOOL bRequireConfirmation, BSTR lpszVolume)
|
||||
{
|
||||
USES_CONVERSION;
|
||||
CW2A szVolumeA(lpszVolume);
|
||||
MainDlg = (HWND) hwndDlg;
|
||||
if (szVolumeA.m_psz)
|
||||
return ::BackupVolumeHeader ((HWND) hwndDlg, bRequireConfirmation, szVolumeA.m_psz);
|
||||
else
|
||||
return ERR_OUTOFMEMORY;
|
||||
return ::BackupVolumeHeader ((HWND) hwndDlg, bRequireConfirmation, lpszVolume);
|
||||
}
|
||||
|
||||
virtual int STDMETHODCALLTYPE RestoreVolumeHeader (LONG_PTR hwndDlg, BSTR lpszVolume)
|
||||
{
|
||||
USES_CONVERSION;
|
||||
CW2A szVolumeA(lpszVolume);
|
||||
MainDlg = (HWND) hwndDlg;
|
||||
if (szVolumeA.m_psz)
|
||||
return ::RestoreVolumeHeader ((HWND) hwndDlg, szVolumeA.m_psz);
|
||||
else
|
||||
return ERR_OUTOFMEMORY;
|
||||
return ::RestoreVolumeHeader ((HWND) hwndDlg, lpszVolume);
|
||||
}
|
||||
|
||||
virtual DWORD STDMETHODCALLTYPE CallDriver (DWORD ioctl, BSTR input, BSTR *output)
|
||||
@@ -106,13 +96,8 @@ public:
|
||||
|
||||
virtual int STDMETHODCALLTYPE ChangePassword (BSTR volumePath, Password *oldPassword, Password *newPassword, int pkcs5, int wipePassCount, LONG_PTR hWnd)
|
||||
{
|
||||
USES_CONVERSION;
|
||||
CW2A volumePathA(volumePath);
|
||||
MainDlg = (HWND) hWnd;
|
||||
if (volumePathA.m_psz)
|
||||
return ::ChangePwd (volumePathA.m_psz, oldPassword, 0, 0, FALSE, newPassword, pkcs5, 0, wipePassCount, (HWND) hWnd);
|
||||
else
|
||||
return ERR_OUTOFMEMORY;
|
||||
return ::ChangePwd (volumePath, oldPassword, 0, 0, FALSE, newPassword, pkcs5, 0, wipePassCount, (HWND) hWnd);
|
||||
}
|
||||
|
||||
virtual DWORD STDMETHODCALLTYPE CopyFile (BSTR sourceFile, BSTR destinationFile)
|
||||
@@ -157,35 +142,20 @@ public:
|
||||
|
||||
virtual int STDMETHODCALLTYPE ChangePasswordEx (BSTR volumePath, Password *oldPassword, int old_pkcs5, Password *newPassword, int pkcs5, int wipePassCount, LONG_PTR hWnd)
|
||||
{
|
||||
USES_CONVERSION;
|
||||
CW2A volumePathA(volumePath);
|
||||
MainDlg = (HWND) hWnd;
|
||||
if (volumePathA.m_psz)
|
||||
return ::ChangePwd (volumePathA.m_psz, oldPassword, old_pkcs5, 0, FALSE, newPassword, pkcs5, 0, wipePassCount, (HWND) hWnd);
|
||||
else
|
||||
return ERR_OUTOFMEMORY;
|
||||
return ::ChangePwd (volumePath, oldPassword, old_pkcs5, 0, FALSE, newPassword, pkcs5, 0, wipePassCount, (HWND) hWnd);
|
||||
}
|
||||
|
||||
virtual int STDMETHODCALLTYPE ChangePasswordEx2 (BSTR volumePath, Password *oldPassword, int old_pkcs5, BOOL truecryptMode, Password *newPassword, int pkcs5, int wipePassCount, LONG_PTR hWnd)
|
||||
{
|
||||
USES_CONVERSION;
|
||||
CW2A volumePathA(volumePath);
|
||||
MainDlg = (HWND) hWnd;
|
||||
if (volumePathA.m_psz)
|
||||
return ::ChangePwd (volumePathA.m_psz, oldPassword, old_pkcs5, 0, truecryptMode, newPassword, pkcs5, 0, wipePassCount, (HWND) hWnd);
|
||||
else
|
||||
return ERR_OUTOFMEMORY;
|
||||
return ::ChangePwd (volumePath, oldPassword, old_pkcs5, 0, truecryptMode, newPassword, pkcs5, 0, wipePassCount, (HWND) hWnd);
|
||||
}
|
||||
|
||||
virtual int STDMETHODCALLTYPE ChangePasswordEx3 (BSTR volumePath, Password *oldPassword, int old_pkcs5, int old_pim, BOOL truecryptMode, Password *newPassword, int pkcs5, int pim, int wipePassCount, LONG_PTR hWnd)
|
||||
{
|
||||
USES_CONVERSION;
|
||||
CW2A volumePathA(volumePath);
|
||||
MainDlg = (HWND) hWnd;
|
||||
if (volumePathA.m_psz)
|
||||
return ::ChangePwd (volumePathA.m_psz, oldPassword, old_pkcs5, old_pim, truecryptMode, newPassword, pkcs5, pim, wipePassCount, (HWND) hWnd);
|
||||
else
|
||||
return ERR_OUTOFMEMORY;
|
||||
return ::ChangePwd (volumePath, oldPassword, old_pkcs5, old_pim, truecryptMode, newPassword, pkcs5, pim, wipePassCount, (HWND) hWnd);
|
||||
}
|
||||
|
||||
protected:
|
||||
@@ -245,7 +215,7 @@ ITrueCryptMainCom *GetElevatedInstance (HWND parent)
|
||||
}
|
||||
|
||||
|
||||
extern "C" int UacBackupVolumeHeader (HWND hwndDlg, BOOL bRequireConfirmation, char *lpszVolume)
|
||||
extern "C" int UacBackupVolumeHeader (HWND hwndDlg, BOOL bRequireConfirmation, wchar_t *lpszVolume)
|
||||
{
|
||||
CComPtr<ITrueCryptMainCom> tc;
|
||||
int r;
|
||||
@@ -255,7 +225,7 @@ extern "C" int UacBackupVolumeHeader (HWND hwndDlg, BOOL bRequireConfirmation, c
|
||||
if (ComGetInstance (hwndDlg, &tc))
|
||||
{
|
||||
CComBSTR volumeBstr;
|
||||
BSTR bstr = A2WBSTR(lpszVolume);
|
||||
BSTR bstr = W2BSTR(lpszVolume);
|
||||
if (bstr)
|
||||
{
|
||||
volumeBstr.Attach (bstr);
|
||||
@@ -273,7 +243,7 @@ extern "C" int UacBackupVolumeHeader (HWND hwndDlg, BOOL bRequireConfirmation, c
|
||||
}
|
||||
|
||||
|
||||
extern "C" int UacRestoreVolumeHeader (HWND hwndDlg, char *lpszVolume)
|
||||
extern "C" int UacRestoreVolumeHeader (HWND hwndDlg, wchar_t *lpszVolume)
|
||||
{
|
||||
CComPtr<ITrueCryptMainCom> tc;
|
||||
int r;
|
||||
@@ -283,7 +253,7 @@ extern "C" int UacRestoreVolumeHeader (HWND hwndDlg, char *lpszVolume)
|
||||
if (ComGetInstance (hwndDlg, &tc))
|
||||
{
|
||||
CComBSTR volumeBstr;
|
||||
BSTR bstr = A2WBSTR(lpszVolume);
|
||||
BSTR bstr = W2BSTR(lpszVolume);
|
||||
if (bstr)
|
||||
{
|
||||
volumeBstr.Attach (bstr);
|
||||
@@ -301,7 +271,7 @@ extern "C" int UacRestoreVolumeHeader (HWND hwndDlg, char *lpszVolume)
|
||||
}
|
||||
|
||||
|
||||
extern "C" int UacChangePwd (char *lpszVolume, Password *oldPassword, int old_pkcs5, int old_pim, BOOL truecryptMode, Password *newPassword, int pkcs5, int pim, int wipePassCount, HWND hwndDlg)
|
||||
extern "C" int UacChangePwd (wchar_t *lpszVolume, Password *oldPassword, int old_pkcs5, int old_pim, BOOL truecryptMode, Password *newPassword, int pkcs5, int pim, int wipePassCount, HWND hwndDlg)
|
||||
{
|
||||
CComPtr<ITrueCryptMainCom> tc;
|
||||
int r;
|
||||
@@ -311,16 +281,7 @@ extern "C" int UacChangePwd (char *lpszVolume, Password *oldPassword, int old_pk
|
||||
if (ComGetInstance (hwndDlg, &tc))
|
||||
{
|
||||
WaitCursor ();
|
||||
CComBSTR volumeBstr;
|
||||
BSTR bstr = A2WBSTR(lpszVolume);
|
||||
if (bstr)
|
||||
{
|
||||
volumeBstr.Attach (bstr);
|
||||
|
||||
r = tc->ChangePasswordEx3 (volumeBstr, oldPassword, old_pkcs5, old_pim, truecryptMode, newPassword, pkcs5, pim, wipePassCount, (LONG_PTR) hwndDlg);
|
||||
}
|
||||
else
|
||||
r = ERR_OUTOFMEMORY;
|
||||
r = tc->ChangePasswordEx3 (lpszVolume, oldPassword, old_pkcs5, old_pim, truecryptMode, newPassword, pkcs5, pim, wipePassCount, (LONG_PTR) hwndDlg);
|
||||
NormalCursor ();
|
||||
}
|
||||
else
|
||||
|
||||
@@ -24,9 +24,9 @@ extern "C" {
|
||||
#endif
|
||||
|
||||
BOOL ComServerMain ();
|
||||
int UacBackupVolumeHeader (HWND hwndDlg, BOOL bRequireConfirmation, char *lpszVolume);
|
||||
int UacRestoreVolumeHeader (HWND hwndDlg, char *lpszVolume);
|
||||
int UacChangePwd (char *lpszVolume, Password *oldPassword, int old_pkcs5, int old_pim, BOOL truecryptMode, Password *newPassword, int pkcs5, int pim, int wipePassCount, HWND hwndDlg);
|
||||
int UacBackupVolumeHeader (HWND hwndDlg, BOOL bRequireConfirmation, wchar_t *lpszVolume);
|
||||
int UacRestoreVolumeHeader (HWND hwndDlg, wchar_t *lpszVolume);
|
||||
int UacChangePwd (wchar_t *lpszVolume, Password *oldPassword, int old_pkcs5, int old_pim, BOOL truecryptMode, Password *newPassword, int pkcs5, int pim, int wipePassCount, HWND hwndDlg);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
||||
1030
src/Mount/Mount.c
1030
src/Mount/Mount.c
File diff suppressed because it is too large
Load Diff
@@ -73,7 +73,7 @@ void EnableDisableButtons ( HWND hwndDlg );
|
||||
BOOL VolumeSelected (HWND hwndDlg );
|
||||
void LoadSettings ( HWND hwndDlg );
|
||||
void SaveSettings ( HWND hwndDlg );
|
||||
BOOL SelectItem ( HWND hTree , char nLetter );
|
||||
BOOL SelectItem ( HWND hTree , wchar_t nLetter );
|
||||
void LoadDriveLetters ( HWND hwndDlg, HWND hTree, int drive );
|
||||
BOOL CALLBACK PasswordChangeDlgProc ( HWND hwndDlg , UINT msg , WPARAM wParam , LPARAM lParam );
|
||||
BOOL CALLBACK PasswordDlgProc ( HWND hwndDlg , UINT msg , WPARAM wParam , LPARAM lParam );
|
||||
@@ -83,7 +83,7 @@ LPARAM GetSelectedLong ( HWND hTree );
|
||||
LPARAM GetItemLong ( HWND hTree, int itemNo );
|
||||
BOOL CALLBACK CommandHelpDlgProc ( HWND hwndDlg , UINT msg , WPARAM wParam , LPARAM lParam );
|
||||
BOOL CALLBACK MainDialogProc ( HWND hwndDlg , UINT uMsg , WPARAM wParam , LPARAM lParam );
|
||||
void ExtractCommandLine ( HWND hwndDlg , char *lpszCommandLine );
|
||||
void ExtractCommandLine ( HWND hwndDlg , wchar_t *lpszCommandLine );
|
||||
static void WipeCache (HWND hwndDlg, BOOL silent);
|
||||
void OpenVolumeExplorerWindow (int driveNo);
|
||||
BOOL TaskBarIconAdd (HWND hwnd);
|
||||
@@ -101,11 +101,11 @@ int GetModeOfOperationByDriveNo (int nDosDriveNo);
|
||||
void ChangeMainWindowVisibility ();
|
||||
void LaunchVolCreationWizard (HWND hwndDlg);
|
||||
BOOL WholeSysDriveEncryption (BOOL bSilent);
|
||||
BOOL CheckSysEncMountWithoutPBA (HWND hwndDlg, const char *devicePath, BOOL quiet);
|
||||
BOOL TCBootLoaderOnInactiveSysEncDrive (char *szDevicePath);
|
||||
BOOL CheckSysEncMountWithoutPBA (HWND hwndDlg, const wchar_t *devicePath, BOOL quiet);
|
||||
BOOL TCBootLoaderOnInactiveSysEncDrive (wchar_t *szDevicePath);
|
||||
void CreateRescueDisk (HWND hwndDlg);
|
||||
int BackupVolumeHeader (HWND hwndDlg, BOOL bRequireConfirmation, const char *lpszVolume);
|
||||
int RestoreVolumeHeader (HWND hwndDlg, const char *lpszVolume);
|
||||
int BackupVolumeHeader (HWND hwndDlg, BOOL bRequireConfirmation, const wchar_t *lpszVolume);
|
||||
int RestoreVolumeHeader (HWND hwndDlg, const wchar_t *lpszVolume);
|
||||
void SecurityTokenPreferencesDialog (HWND hwndDlg);
|
||||
static BOOL CALLBACK PerformanceSettingsDlgProc (HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam);
|
||||
static BOOL CALLBACK BootLoaderPreferencesDlgProc (HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam);
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
IntermediateDirectory="Debug"
|
||||
ConfigurationType="1"
|
||||
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
|
||||
CharacterSet="2"
|
||||
CharacterSet="1"
|
||||
>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"
|
||||
@@ -110,103 +110,13 @@
|
||||
CommandLine="md "..\Debug\Setup Files" 2>NUL:
copy Debug\VeraCrypt.exe "..\Debug\Setup Files" >NUL:
"
|
||||
/>
|
||||
</Configuration>
|
||||
<Configuration
|
||||
Name="Release|Win32"
|
||||
OutputDirectory="Release"
|
||||
IntermediateDirectory="Release"
|
||||
ConfigurationType="1"
|
||||
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
|
||||
CharacterSet="2"
|
||||
>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"
|
||||
AdditionalIncludeDirectories=""
|
||||
TypeLibraryName="$(SolutionDir)/$(ProjectName)/$(ProjectName).tlb"
|
||||
OutputDirectory=""
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
AdditionalOptions="/w34189"
|
||||
Optimization="2"
|
||||
AdditionalIncludeDirectories="..\Common;..\Crypto;..\;..\PKCS11"
|
||||
PreprocessorDefinitions="TCMOUNT;WIN32;NDEBUG;_WINDOWS;_CRT_SECURE_NO_DEPRECATE;_CRT_NON_CONFORMING_SWPRINTFS"
|
||||
RuntimeLibrary="0"
|
||||
BufferSecurityCheck="true"
|
||||
UsePrecompiledHeader="0"
|
||||
AssemblerOutput="2"
|
||||
AssemblerListingLocation="$(IntDir)/"
|
||||
WarningLevel="4"
|
||||
DebugInformationFormat="0"
|
||||
DisableSpecificWarnings="4057;4100;4127;4201;4701;4706"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManagedResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
AdditionalDependencies="comctl32.lib setupapi.lib version.lib ..\Crypto\Release\crypto.lib"
|
||||
OutputFile="$(OutDir)/VeraCrypt.exe"
|
||||
LinkIncremental="1"
|
||||
GenerateManifest="false"
|
||||
IgnoreAllDefaultLibraries="false"
|
||||
GenerateDebugInformation="false"
|
||||
GenerateMapFile="true"
|
||||
SubSystem="2"
|
||||
OptimizeReferences="2"
|
||||
EnableCOMDATFolding="2"
|
||||
RandomizedBaseAddress="1"
|
||||
DataExecutionPrevention="2"
|
||||
TargetMachine="1"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCALinkTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManifestTool"
|
||||
AdditionalManifestFiles="Mount.manifest"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXDCMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCBscMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCFxCopTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCAppVerifierTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"
|
||||
CommandLine="copy Release\VeraCrypt.exe "..\Release\Setup Files""
|
||||
/>
|
||||
</Configuration>
|
||||
<Configuration
|
||||
Name="Debug|x64"
|
||||
OutputDirectory="$(PlatformName)\$(ConfigurationName)"
|
||||
IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
|
||||
ConfigurationType="1"
|
||||
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
|
||||
CharacterSet="2"
|
||||
CharacterSet="1"
|
||||
>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"
|
||||
@@ -292,13 +202,103 @@
|
||||
CommandLine="md "..\Debug\Setup Files" 2>NUL:
copy $(TargetPath) "..\Debug\Setup Files\VeraCrypt-x64.exe" >NUL:
"
|
||||
/>
|
||||
</Configuration>
|
||||
<Configuration
|
||||
Name="Release|Win32"
|
||||
OutputDirectory="Release"
|
||||
IntermediateDirectory="Release"
|
||||
ConfigurationType="1"
|
||||
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
|
||||
CharacterSet="1"
|
||||
>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"
|
||||
AdditionalIncludeDirectories=""
|
||||
TypeLibraryName="$(SolutionDir)/$(ProjectName)/$(ProjectName).tlb"
|
||||
OutputDirectory=""
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
AdditionalOptions="/w34189"
|
||||
Optimization="2"
|
||||
AdditionalIncludeDirectories="..\Common;..\Crypto;..\;..\PKCS11"
|
||||
PreprocessorDefinitions="TCMOUNT;WIN32;NDEBUG;_WINDOWS;_CRT_SECURE_NO_DEPRECATE;_CRT_NON_CONFORMING_SWPRINTFS"
|
||||
RuntimeLibrary="0"
|
||||
BufferSecurityCheck="true"
|
||||
UsePrecompiledHeader="0"
|
||||
AssemblerOutput="2"
|
||||
AssemblerListingLocation="$(IntDir)/"
|
||||
WarningLevel="4"
|
||||
DebugInformationFormat="0"
|
||||
DisableSpecificWarnings="4057;4100;4127;4201;4701;4706"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManagedResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
AdditionalDependencies="comctl32.lib setupapi.lib version.lib ..\Crypto\Release\crypto.lib"
|
||||
OutputFile="$(OutDir)/VeraCrypt.exe"
|
||||
LinkIncremental="1"
|
||||
GenerateManifest="false"
|
||||
IgnoreAllDefaultLibraries="false"
|
||||
GenerateDebugInformation="false"
|
||||
GenerateMapFile="true"
|
||||
SubSystem="2"
|
||||
OptimizeReferences="2"
|
||||
EnableCOMDATFolding="2"
|
||||
RandomizedBaseAddress="1"
|
||||
DataExecutionPrevention="2"
|
||||
TargetMachine="1"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCALinkTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManifestTool"
|
||||
AdditionalManifestFiles="Mount.manifest"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXDCMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCBscMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCFxCopTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCAppVerifierTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"
|
||||
CommandLine="copy Release\VeraCrypt.exe "..\Release\Setup Files""
|
||||
/>
|
||||
</Configuration>
|
||||
<Configuration
|
||||
Name="Release|x64"
|
||||
OutputDirectory="$(PlatformName)\$(ConfigurationName)"
|
||||
IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
|
||||
ConfigurationType="1"
|
||||
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
|
||||
CharacterSet="2"
|
||||
CharacterSet="1"
|
||||
>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"
|
||||
@@ -420,7 +420,7 @@
|
||||
/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Release|Win32"
|
||||
Name="Debug|x64"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
@@ -428,7 +428,7 @@
|
||||
/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Debug|x64"
|
||||
Name="Release|Win32"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
@@ -483,7 +483,7 @@
|
||||
/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Release|Win32"
|
||||
Name="Debug|x64"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
@@ -491,7 +491,7 @@
|
||||
/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Debug|x64"
|
||||
Name="Release|Win32"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
@@ -519,7 +519,7 @@
|
||||
/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Release|Win32"
|
||||
Name="Debug|x64"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
@@ -527,7 +527,7 @@
|
||||
/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Debug|x64"
|
||||
Name="Release|Win32"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
@@ -567,7 +567,7 @@
|
||||
/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Release|Win32"
|
||||
Name="Debug|x64"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
@@ -575,7 +575,7 @@
|
||||
/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Debug|x64"
|
||||
Name="Release|Win32"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
@@ -776,6 +776,38 @@
|
||||
Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx"
|
||||
UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"
|
||||
>
|
||||
<File
|
||||
RelativePath="..\Boot\Windows\Rescue_Serpent_SHA2\BootSector.bin"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\Boot\Windows\Rescue_AES_SHA2\BootSector.bin"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\Boot\Windows\Rescue_SHA2\BootSector.bin"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\Boot\Windows\Release_Twofish_SHA2\BootSector.bin"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\Boot\Windows\Release_Serpent_SHA2\BootSector.bin"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\Boot\Windows\Release_AES_SHA2\BootSector.bin"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\Boot\Windows\Release_SHA2\BootSector.bin"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\Boot\Windows\Rescue_Twofish_SHA2\BootSector.bin"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\Drive_icon_96dpi.bmp"
|
||||
>
|
||||
@@ -823,6 +855,18 @@
|
||||
<Filter
|
||||
Name="Common"
|
||||
>
|
||||
<File
|
||||
RelativePath="..\Boot\Windows\Rescue_Twofish\BootLoader.com.gz"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\Boot\Windows\Release_Serpent\BootLoader.com.gz"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\Boot\Windows\Release_AES\BootLoader.com.gz"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\Boot\Windows\Release\BootLoader.com.gz"
|
||||
>
|
||||
@@ -843,18 +887,6 @@
|
||||
RelativePath="..\Boot\Windows\Rescue\BootLoader.com.gz"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\Boot\Windows\Rescue_Twofish\BootLoader.com.gz"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\Boot\Windows\Release_Serpent\BootLoader.com.gz"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\Boot\Windows\Release_AES\BootLoader.com.gz"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\Boot\Windows\Rescue\BootSector.bin"
|
||||
>
|
||||
@@ -899,7 +931,7 @@
|
||||
/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Release|Win32"
|
||||
Name="Debug|x64"
|
||||
ExcludedFromBuild="true"
|
||||
>
|
||||
<Tool
|
||||
@@ -907,7 +939,7 @@
|
||||
/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Debug|x64"
|
||||
Name="Release|Win32"
|
||||
ExcludedFromBuild="true"
|
||||
>
|
||||
<Tool
|
||||
@@ -953,6 +985,38 @@
|
||||
</File>
|
||||
</Filter>
|
||||
</Filter>
|
||||
<File
|
||||
RelativePath="..\Boot\Windows\Rescue_AES_SHA2\BootLoader.com.gz"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\Boot\Windows\Rescue_Serpent_SHA2\BootLoader.com.gz"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\Boot\Windows\Rescue_Twofish_SHA2\BootLoader.com.gz"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\Boot\Windows\Release_SHA2\BootLoader.com.gz"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\Boot\Windows\Release_AES_SHA2\BootLoader.com.gz"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\Boot\Windows\Release_Serpent_SHA2\BootLoader.com.gz"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\Boot\Windows\Release_Twofish_SHA2\BootLoader.com.gz"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\Boot\Windows\Rescue_SHA2\BootLoader.com.gz"
|
||||
>
|
||||
</File>
|
||||
</Files>
|
||||
<Globals>
|
||||
</Globals>
|
||||
|
||||
@@ -27,14 +27,14 @@
|
||||
#include "../Format/FormatCom_i.c"
|
||||
|
||||
|
||||
extern "C" BOOL RegisterComServers (char *modulePath)
|
||||
extern "C" BOOL RegisterComServers (wchar_t *modulePath)
|
||||
{
|
||||
BOOL ret = TRUE;
|
||||
wchar_t mainModule[1024], formatModule[1024];
|
||||
CComPtr<ITypeLib> tl, tl2;
|
||||
|
||||
wsprintfW (mainModule, L"%hsVeraCrypt.exe", modulePath);
|
||||
wsprintfW (formatModule, L"%hsVeraCrypt Format.exe", modulePath);
|
||||
wsprintfW (mainModule, L"%sVeraCrypt.exe", modulePath);
|
||||
wsprintfW (formatModule, L"%sVeraCrypt Format.exe", modulePath);
|
||||
|
||||
UnRegisterTypeLib (LIBID_TrueCryptMainCom, TC_MAIN_COM_VERSION_MAJOR, TC_MAIN_COM_VERSION_MINOR, 0, SYS_WIN32);
|
||||
UnRegisterTypeLib (LIBID_TrueCryptFormatCom, TC_FORMAT_COM_VERSION_MAJOR, TC_FORMAT_COM_VERSION_MINOR, 0, SYS_WIN32);
|
||||
@@ -58,7 +58,7 @@ extern "C" BOOL RegisterComServers (char *modulePath)
|
||||
|| !SUCCEEDED (r = LoadTypeLib (formatModule, &tl2))
|
||||
|| !SUCCEEDED (r = RegisterTypeLib (tl2, formatModule, 0)))
|
||||
{
|
||||
MessageBox (MainDlg, _com_error (r).ErrorMessage(), TC_APP_NAME, MB_ICONERROR);
|
||||
MessageBox (MainDlg, _com_error (r).ErrorMessage(), _T(TC_APP_NAME), MB_ICONERROR);
|
||||
ret = FALSE;
|
||||
}
|
||||
|
||||
@@ -67,7 +67,7 @@ extern "C" BOOL RegisterComServers (char *modulePath)
|
||||
}
|
||||
|
||||
|
||||
extern "C" BOOL UnregisterComServers (char *modulePath)
|
||||
extern "C" BOOL UnregisterComServers (wchar_t *modulePath)
|
||||
{
|
||||
BOOL ret;
|
||||
|
||||
@@ -85,10 +85,10 @@ extern "C" BOOL UnregisterComServers (char *modulePath)
|
||||
CRegObject ro;
|
||||
ro.FinalConstruct ();
|
||||
|
||||
wsprintfW (module, L"%hsVeraCrypt.exe", modulePath);
|
||||
wsprintfW (module, L"%sVeraCrypt.exe", modulePath);
|
||||
ro.AddReplacement (L"MAIN_MODULE", module);
|
||||
|
||||
wsprintfW (module, L"%hsVeraCrypt Format.exe", modulePath);
|
||||
wsprintfW (module, L"%sVeraCrypt Format.exe", modulePath);
|
||||
ro.AddReplacement (L"FORMAT_MODULE", module);
|
||||
|
||||
wchar_t setupModule[MAX_PATH];
|
||||
|
||||
@@ -14,8 +14,8 @@
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
BOOL RegisterComServers (char *modulePath);
|
||||
BOOL UnregisterComServers (char *modulePath);
|
||||
BOOL RegisterComServers (wchar_t *modulePath);
|
||||
BOOL UnregisterComServers (wchar_t *modulePath);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
||||
@@ -25,33 +25,33 @@
|
||||
|
||||
/* create full directory tree. returns 0 for success, -1 if failure */
|
||||
int
|
||||
mkfulldir (char *oriPath, BOOL bCheckonly)
|
||||
mkfulldir (wchar_t *oriPath, BOOL bCheckonly)
|
||||
{
|
||||
struct _stat st;
|
||||
char *uniq_file;
|
||||
char path [TC_MAX_PATH];
|
||||
wchar_t *uniq_file;
|
||||
wchar_t path [TC_MAX_PATH];
|
||||
|
||||
StringCbCopyA (path, TC_MAX_PATH, oriPath);
|
||||
StringCbCopyW (path, TC_MAX_PATH, oriPath);
|
||||
|
||||
if (strlen (path) == 3 && path[1] == ':')
|
||||
if (wcslen (path) == 3 && path[1] == L':')
|
||||
goto is_root; /* keep final slash in root if present */
|
||||
|
||||
/* strip final forward or backslash if we have one! */
|
||||
uniq_file = strrchr (path, '\\');
|
||||
if (uniq_file && uniq_file[1] == '\0')
|
||||
uniq_file[0] = '\0';
|
||||
uniq_file = wcsrchr (path, L'\\');
|
||||
if (uniq_file && uniq_file[1] == L'\0')
|
||||
uniq_file[0] = L'\0';
|
||||
else
|
||||
{
|
||||
uniq_file = strrchr (path, '/');
|
||||
if (uniq_file && uniq_file[1] == '\0')
|
||||
uniq_file[0] = '\0';
|
||||
uniq_file = wcsrchr (path, L'/');
|
||||
if (uniq_file && uniq_file[1] == L'\0')
|
||||
uniq_file[0] = L'\0';
|
||||
}
|
||||
|
||||
is_root:
|
||||
if (bCheckonly)
|
||||
return _stat (path, &st);
|
||||
return _wstat (path, &st);
|
||||
|
||||
if (_stat (path, &st))
|
||||
if (_wstat (path, &st))
|
||||
return mkfulldir_internal (path);
|
||||
else
|
||||
return 0;
|
||||
@@ -59,52 +59,52 @@ mkfulldir (char *oriPath, BOOL bCheckonly)
|
||||
|
||||
|
||||
int
|
||||
mkfulldir_internal (char *path)
|
||||
mkfulldir_internal (wchar_t *path)
|
||||
{
|
||||
char *token;
|
||||
wchar_t *token;
|
||||
struct _stat st;
|
||||
static char tokpath[_MAX_PATH];
|
||||
static char trail[_MAX_PATH];
|
||||
static wchar_t tokpath[_MAX_PATH];
|
||||
static wchar_t trail[_MAX_PATH];
|
||||
|
||||
StringCbCopyA (tokpath, _MAX_PATH, path);
|
||||
trail[0] = '\0';
|
||||
StringCbCopyW (tokpath, _MAX_PATH, path);
|
||||
trail[0] = L'\0';
|
||||
|
||||
token = strtok (tokpath, "\\/");
|
||||
token = wcstok (tokpath, L"\\/");
|
||||
|
||||
if (tokpath[0] == '\\' && tokpath[1] == '\\')
|
||||
if (tokpath[0] == L'\\' && tokpath[1] == L'\\')
|
||||
{ /* unc */
|
||||
trail[0] = tokpath[0];
|
||||
trail[1] = tokpath[1];
|
||||
trail[2] = '\0';
|
||||
trail[2] = L'\0';
|
||||
if (token)
|
||||
{
|
||||
StringCbCatA (trail, _MAX_PATH, token);
|
||||
StringCbCatA (trail, _MAX_PATH, "\\");
|
||||
token = strtok (NULL, "\\/");
|
||||
StringCbCatW (trail, _MAX_PATH, token);
|
||||
StringCbCatW (trail, _MAX_PATH, L"\\");
|
||||
token = wcstok (NULL, L"\\/");
|
||||
if (token)
|
||||
{ /* get share name */
|
||||
StringCbCatA (trail, _MAX_PATH, token);
|
||||
StringCbCatA (trail, _MAX_PATH, "\\");
|
||||
StringCbCatW (trail, _MAX_PATH, token);
|
||||
StringCbCatW (trail, _MAX_PATH, L"\\");
|
||||
}
|
||||
token = strtok (NULL, "\\/");
|
||||
token = wcstok (NULL, L"\\/");
|
||||
}
|
||||
}
|
||||
|
||||
if (tokpath[1] == ':')
|
||||
if (tokpath[1] == L':')
|
||||
{ /* drive letter */
|
||||
StringCbCatA (trail, _MAX_PATH, tokpath);
|
||||
StringCbCatA (trail, _MAX_PATH, "\\");
|
||||
token = strtok (NULL, "\\/");
|
||||
StringCbCatW (trail, _MAX_PATH, tokpath);
|
||||
StringCbCatW (trail, _MAX_PATH, L"\\");
|
||||
token = wcstok (NULL, L"\\/");
|
||||
}
|
||||
|
||||
while (token != NULL)
|
||||
{
|
||||
int x;
|
||||
StringCbCatA (trail, _MAX_PATH, token);
|
||||
x = _mkdir (trail);
|
||||
StringCbCatA (trail, _MAX_PATH, "\\");
|
||||
token = strtok (NULL, "\\/");
|
||||
StringCbCatW (trail, _MAX_PATH, token);
|
||||
x = _wmkdir (trail);
|
||||
StringCbCatW (trail, _MAX_PATH, L"\\");
|
||||
token = wcstok (NULL, L"\\/");
|
||||
}
|
||||
|
||||
return _stat (path, &st);
|
||||
return _wstat (path, &st);
|
||||
}
|
||||
|
||||
@@ -15,8 +15,8 @@
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
int mkfulldir ( char *path , BOOL bCheckonly );
|
||||
int mkfulldir_internal ( char *path );
|
||||
int mkfulldir ( wchar_t *path , BOOL bCheckonly );
|
||||
int mkfulldir_internal ( wchar_t *path );
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
||||
@@ -22,20 +22,21 @@
|
||||
#include "Dir.h"
|
||||
#include "Language.h"
|
||||
#include "Resource.h"
|
||||
#include <tchar.h>
|
||||
#include <Strsafe.h>
|
||||
|
||||
#ifndef SRC_POS
|
||||
#define SRC_POS (__FUNCTION__ ":" TC_TO_STRING(__LINE__))
|
||||
#endif
|
||||
|
||||
#define OutputPackageFile "VeraCrypt Setup " VERSION_STRING ".exe"
|
||||
#define OutputPackageFile L"VeraCrypt Setup " _T(VERSION_STRING) L".exe"
|
||||
|
||||
#define MAG_START_MARKER "TCINSTRT"
|
||||
#define MAG_END_MARKER_OBFUSCATED "T/C/I/N/S/C/R/C"
|
||||
#define PIPE_BUFFER_LEN (4 * BYTES_PER_KB)
|
||||
|
||||
unsigned char MagEndMarker [sizeof (MAG_END_MARKER_OBFUSCATED)];
|
||||
char DestExtractPath [TC_MAX_PATH];
|
||||
wchar_t DestExtractPath [TC_MAX_PATH];
|
||||
DECOMPRESSED_FILE Decompressed_Files [NBR_COMPRESSED_FILES];
|
||||
|
||||
volatile char *PipeWriteBuf = NULL;
|
||||
@@ -64,21 +65,21 @@ static void DeobfuscateMagEndMarker (void)
|
||||
}
|
||||
|
||||
|
||||
static void PkgError (char *msg)
|
||||
static void PkgError (wchar_t *msg)
|
||||
{
|
||||
MessageBox (NULL, msg, "VeraCrypt", MB_ICONERROR | MB_SETFOREGROUND | MB_TOPMOST);
|
||||
MessageBox (NULL, msg, L"VeraCrypt", MB_ICONERROR | MB_SETFOREGROUND | MB_TOPMOST);
|
||||
}
|
||||
|
||||
|
||||
static void PkgWarning (char *msg)
|
||||
static void PkgWarning (wchar_t *msg)
|
||||
{
|
||||
MessageBox (NULL, msg, "VeraCrypt", MB_ICONWARNING | MB_SETFOREGROUND | MB_TOPMOST);
|
||||
MessageBox (NULL, msg, L"VeraCrypt", MB_ICONWARNING | MB_SETFOREGROUND | MB_TOPMOST);
|
||||
}
|
||||
|
||||
|
||||
static void PkgInfo (char *msg)
|
||||
static void PkgInfo (wchar_t *msg)
|
||||
{
|
||||
MessageBox (NULL, msg, "VeraCrypt", MB_ICONINFORMATION | MB_SETFOREGROUND | MB_TOPMOST);
|
||||
MessageBox (NULL, msg, L"VeraCrypt", MB_ICONINFORMATION | MB_SETFOREGROUND | MB_TOPMOST);
|
||||
}
|
||||
|
||||
|
||||
@@ -96,7 +97,7 @@ static void __cdecl PipeWriteThread (void *len)
|
||||
|
||||
if (PipeWriteBuf == NULL || (HANDLE) hChildStdinWrite == INVALID_HANDLE_VALUE)
|
||||
{
|
||||
PkgError ("Failed sending data to the STDIN pipe");
|
||||
PkgError (L"Failed sending data to the STDIN pipe");
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -109,7 +110,7 @@ static void __cdecl PipeWriteThread (void *len)
|
||||
|| bytesSent == 0
|
||||
|| bytesSent != sendBufSize)
|
||||
{
|
||||
PkgError ("Failed sending data to the STDIN pipe");
|
||||
PkgError (L"Failed sending data to the STDIN pipe");
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -121,7 +122,7 @@ static void __cdecl PipeWriteThread (void *len)
|
||||
|
||||
if (!CloseHandle (hChildStdinWrite))
|
||||
{
|
||||
PkgError ("Cannot close pipe");
|
||||
PkgError (L"Cannot close pipe");
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -140,6 +141,7 @@ static int CompressBuffer (char *out, char *in, int len)
|
||||
char pipeBuffer [PIPE_BUFFER_LEN];
|
||||
int res_len = 0;
|
||||
BOOL bGzipHeaderRead = FALSE;
|
||||
wchar_t szGzipCmd[64];
|
||||
|
||||
ZeroMemory (&startupInfo, sizeof (startupInfo));
|
||||
ZeroMemory (&procInfo, sizeof (procInfo));
|
||||
@@ -151,14 +153,14 @@ static int CompressBuffer (char *out, char *in, int len)
|
||||
|
||||
if (!CreatePipe (&hChildStdoutRead, &hChildStdoutWrite, &securityAttrib, 0))
|
||||
{
|
||||
PkgError ("Cannot create STDOUT pipe.");
|
||||
PkgError (L"Cannot create STDOUT pipe.");
|
||||
return 0;
|
||||
}
|
||||
SetHandleInformation (hChildStdoutRead, HANDLE_FLAG_INHERIT, 0);
|
||||
|
||||
if (!CreatePipe (&hChildStdinRead, &((HANDLE) hChildStdinWrite), &securityAttrib, 0))
|
||||
{
|
||||
PkgError ("Cannot create STDIN pipe.");
|
||||
PkgError (L"Cannot create STDIN pipe.");
|
||||
CloseHandle(hChildStdoutWrite);
|
||||
CloseHandle(hChildStdoutRead);
|
||||
return 0;
|
||||
@@ -174,9 +176,10 @@ static int CompressBuffer (char *out, char *in, int len)
|
||||
startupInfo.hStdError = hChildStdoutWrite;
|
||||
startupInfo.dwFlags |= STARTF_USESTDHANDLES | STARTF_USESHOWWINDOW;
|
||||
|
||||
if (!CreateProcess (NULL, "gzip --best", NULL, NULL, TRUE, 0, NULL, NULL, &startupInfo, &procInfo))
|
||||
StringCbCopyW (szGzipCmd, sizeof (szGzipCmd), L"gzip --best");
|
||||
if (!CreateProcess (NULL, szGzipCmd, NULL, NULL, TRUE, 0, NULL, NULL, &startupInfo, &procInfo))
|
||||
{
|
||||
PkgError ("Error: Cannot run gzip.\n\nBefore you can create a self-extracting VeraCrypt package, you need to have the open-source 'gzip' compression tool placed in any directory in the search path for executable files (for example, in 'C:\\Windows\\').\n\nNote: gzip can be freely downloaded e.g. from www.gzip.org");
|
||||
PkgError (L"Error: Cannot run gzip.\n\nBefore you can create a self-extracting VeraCrypt package, you need to have the open-source 'gzip' compression tool placed in any directory in the search path for executable files (for example, in 'C:\\Windows\\').\n\nNote: gzip can be freely downloaded e.g. from www.gzip.org");
|
||||
CloseHandle(hChildStdoutWrite);
|
||||
CloseHandle(hChildStdoutRead);
|
||||
CloseHandle(hChildStdinRead);
|
||||
@@ -193,7 +196,7 @@ static int CompressBuffer (char *out, char *in, int len)
|
||||
|
||||
if (!CloseHandle (hChildStdoutWrite))
|
||||
{
|
||||
PkgError ("Cannot close STDOUT write");
|
||||
PkgError (L"Cannot close STDOUT write");
|
||||
CloseHandle(hChildStdoutRead);
|
||||
CloseHandle(hChildStdinRead);
|
||||
return 0;
|
||||
@@ -231,37 +234,37 @@ static void WipeSignatureAreas (char *buffer)
|
||||
}
|
||||
|
||||
|
||||
BOOL MakeSelfExtractingPackage (HWND hwndDlg, char *szDestDir)
|
||||
BOOL MakeSelfExtractingPackage (HWND hwndDlg, wchar_t *szDestDir)
|
||||
{
|
||||
int i, x;
|
||||
unsigned char inputFile [TC_MAX_PATH];
|
||||
unsigned char outputFile [TC_MAX_PATH];
|
||||
unsigned char szTmpFilePath [TC_MAX_PATH];
|
||||
wchar_t inputFile [TC_MAX_PATH];
|
||||
wchar_t outputFile [TC_MAX_PATH];
|
||||
wchar_t szTmpFilePath [TC_MAX_PATH];
|
||||
unsigned char szTmp32bit [4] = {0};
|
||||
unsigned char *szTmp32bitPtr = szTmp32bit;
|
||||
unsigned char *buffer = NULL, *compressedBuffer = NULL;
|
||||
unsigned char *bufIndex = NULL;
|
||||
char tmpStr [2048];
|
||||
wchar_t tmpStr [2048];
|
||||
int bufLen = 0, compressedDataLen = 0, uncompressedDataLen = 0;
|
||||
|
||||
x = strlen (szDestDir);
|
||||
x = wcslen (szDestDir);
|
||||
if (x < 2)
|
||||
goto err;
|
||||
|
||||
if (szDestDir[x - 1] != '\\')
|
||||
StringCbCatA (szDestDir, MAX_PATH, "\\");
|
||||
if (szDestDir[x - 1] != L'\\')
|
||||
StringCbCatW (szDestDir, MAX_PATH, L"\\");
|
||||
|
||||
GetModuleFileName (NULL, inputFile, sizeof (inputFile));
|
||||
GetModuleFileName (NULL, inputFile, ARRAYSIZE (inputFile));
|
||||
|
||||
StringCbCopyA (outputFile, sizeof(outputFile), szDestDir);
|
||||
StringCbCatA (outputFile, sizeof(outputFile), OutputPackageFile);
|
||||
StringCbCopyW (outputFile, sizeof(outputFile), szDestDir);
|
||||
StringCbCatW (outputFile, sizeof(outputFile), OutputPackageFile);
|
||||
|
||||
// Clone 'VeraCrypt Setup.exe' to create the base of the new self-extracting archive
|
||||
|
||||
if (!TCCopyFile (inputFile, outputFile))
|
||||
{
|
||||
handleWin32Error (hwndDlg, SRC_POS);
|
||||
PkgError ("Cannot copy 'VeraCrypt Setup.exe' to the package");
|
||||
PkgError (L"Cannot copy 'VeraCrypt Setup.exe' to the package");
|
||||
goto err;
|
||||
}
|
||||
|
||||
@@ -271,15 +274,15 @@ BOOL MakeSelfExtractingPackage (HWND hwndDlg, char *szDestDir)
|
||||
|
||||
for (i = 0; i < sizeof (szCompressedFiles) / sizeof (szCompressedFiles[0]); i++)
|
||||
{
|
||||
StringCbPrintfA (szTmpFilePath, sizeof(szTmpFilePath), "%s%s", szDestDir, szCompressedFiles[i]);
|
||||
StringCbPrintfW (szTmpFilePath, sizeof(szTmpFilePath), L"%s%s", szDestDir, szCompressedFiles[i]);
|
||||
|
||||
if (!FileExists (szTmpFilePath))
|
||||
{
|
||||
char tmpstr [1000];
|
||||
wchar_t tmpstr [1000];
|
||||
|
||||
StringCbPrintfA (tmpstr, sizeof(tmpstr), "File not found:\n\n'%s'", szTmpFilePath);
|
||||
if (remove (outputFile))
|
||||
StringCbCatA (tmpstr, sizeof(tmpstr), "\nFailed also to delete package file");
|
||||
StringCbPrintfW (tmpstr, sizeof(tmpstr), L"File not found:\n\n'%s'", szTmpFilePath);
|
||||
if (_wremove (outputFile))
|
||||
StringCbCatW (tmpstr, sizeof(tmpstr), L"\nFailed also to delete package file");
|
||||
PkgError (tmpstr);
|
||||
goto err;
|
||||
}
|
||||
@@ -287,7 +290,7 @@ BOOL MakeSelfExtractingPackage (HWND hwndDlg, char *szDestDir)
|
||||
bufLen += (int) GetFileSize64 (szTmpFilePath);
|
||||
|
||||
bufLen += 2; // 16-bit filename length
|
||||
bufLen += strlen(szCompressedFiles[i]); // Filename
|
||||
bufLen += (wcslen(szCompressedFiles[i]) * sizeof (wchar_t)); // Filename
|
||||
bufLen += 4; // CRC-32
|
||||
bufLen += 4; // 32-bit file length
|
||||
}
|
||||
@@ -295,11 +298,11 @@ BOOL MakeSelfExtractingPackage (HWND hwndDlg, char *szDestDir)
|
||||
buffer = malloc (bufLen + 524288); // + 512K reserve
|
||||
if (buffer == NULL)
|
||||
{
|
||||
PkgError ("Cannot allocate memory for uncompressed data");
|
||||
if (remove (outputFile))
|
||||
PkgError ("Cannot allocate memory for uncompressed data.\nFailed also to delete package file");
|
||||
PkgError (L"Cannot allocate memory for uncompressed data");
|
||||
if (_wremove (outputFile))
|
||||
PkgError (L"Cannot allocate memory for uncompressed data.\nFailed also to delete package file");
|
||||
else
|
||||
PkgError ("Cannot allocate memory for uncompressed data");
|
||||
PkgError (L"Cannot allocate memory for uncompressed data");
|
||||
goto err;
|
||||
}
|
||||
|
||||
@@ -307,10 +310,10 @@ BOOL MakeSelfExtractingPackage (HWND hwndDlg, char *szDestDir)
|
||||
// Write the start marker
|
||||
if (!SaveBufferToFile (MAG_START_MARKER, outputFile, strlen (MAG_START_MARKER), TRUE, FALSE))
|
||||
{
|
||||
if (remove (outputFile))
|
||||
PkgError ("Cannot write the start marker\nFailed also to delete package file");
|
||||
if (_wremove (outputFile))
|
||||
PkgError (L"Cannot write the start marker\nFailed also to delete package file");
|
||||
else
|
||||
PkgError ("Cannot write the start marker");
|
||||
PkgError (L"Cannot write the start marker");
|
||||
goto err;
|
||||
}
|
||||
|
||||
@@ -323,28 +326,27 @@ BOOL MakeSelfExtractingPackage (HWND hwndDlg, char *szDestDir)
|
||||
DWORD tmpFileSize;
|
||||
unsigned char *tmpBuffer;
|
||||
|
||||
StringCbPrintfA (szTmpFilePath, sizeof(szTmpFilePath), "%s%s", szDestDir, szCompressedFiles[i]);
|
||||
StringCbPrintfW (szTmpFilePath, sizeof(szTmpFilePath), L"%s%s", szDestDir, szCompressedFiles[i]);
|
||||
|
||||
tmpBuffer = LoadFile (szTmpFilePath, &tmpFileSize);
|
||||
|
||||
if (tmpBuffer == NULL)
|
||||
{
|
||||
char tmpstr [1000];
|
||||
wchar_t tmpstr [1000];
|
||||
|
||||
free (tmpBuffer);
|
||||
StringCbPrintfA (tmpstr, sizeof(tmpstr), "Cannot load file \n'%s'", szTmpFilePath);
|
||||
if (remove (outputFile))
|
||||
StringCbCatA (tmpstr, sizeof(tmpstr), "\nFailed also to delete package file");
|
||||
StringCbPrintfW (tmpstr, sizeof(tmpstr), L"Cannot load file \n'%s'", szTmpFilePath);
|
||||
if (_wremove (outputFile))
|
||||
StringCbCatW (tmpstr, sizeof(tmpstr), L"\nFailed also to delete package file");
|
||||
PkgError (tmpstr);
|
||||
goto err;
|
||||
}
|
||||
|
||||
// Copy the filename length to the main buffer
|
||||
mputWord (bufIndex, (WORD) strlen(szCompressedFiles[i]));
|
||||
mputWord (bufIndex, (WORD) wcslen(szCompressedFiles[i]));
|
||||
|
||||
// Copy the filename to the main buffer
|
||||
memcpy (bufIndex, szCompressedFiles[i], strlen(szCompressedFiles[i]));
|
||||
bufIndex += strlen(szCompressedFiles[i]);
|
||||
wmemcpy ((wchar_t*)bufIndex, szCompressedFiles[i], wcslen(szCompressedFiles[i]));
|
||||
bufIndex += (wcslen(szCompressedFiles[i]) * sizeof (wchar_t));
|
||||
|
||||
// Compute CRC-32 hash of the uncompressed file and copy it to the main buffer
|
||||
mputLong (bufIndex, GetCrc32 (tmpBuffer, tmpFileSize));
|
||||
@@ -367,10 +369,10 @@ BOOL MakeSelfExtractingPackage (HWND hwndDlg, char *szDestDir)
|
||||
mputLong (szTmp32bitPtr, (unsigned __int32) uncompressedDataLen);
|
||||
if (!SaveBufferToFile (szTmp32bit, outputFile, sizeof (szTmp32bit), TRUE, FALSE))
|
||||
{
|
||||
if (remove (outputFile))
|
||||
PkgError ("Cannot write the total size of the uncompressed data.\nFailed also to delete package file");
|
||||
if (_wremove (outputFile))
|
||||
PkgError (L"Cannot write the total size of the uncompressed data.\nFailed also to delete package file");
|
||||
else
|
||||
PkgError ("Cannot write the total size of the uncompressed data");
|
||||
PkgError (L"Cannot write the total size of the uncompressed data");
|
||||
goto err;
|
||||
}
|
||||
|
||||
@@ -379,20 +381,20 @@ BOOL MakeSelfExtractingPackage (HWND hwndDlg, char *szDestDir)
|
||||
compressedBuffer = malloc (uncompressedDataLen + 524288); // + 512K reserve
|
||||
if (compressedBuffer == NULL)
|
||||
{
|
||||
if (remove (outputFile))
|
||||
PkgError ("Cannot allocate memory for compressed data.\nFailed also to delete package file");
|
||||
if (_wremove (outputFile))
|
||||
PkgError (L"Cannot allocate memory for compressed data.\nFailed also to delete package file");
|
||||
else
|
||||
PkgError ("Cannot allocate memory for compressed data");
|
||||
PkgError (L"Cannot allocate memory for compressed data");
|
||||
goto err;
|
||||
}
|
||||
|
||||
compressedDataLen = CompressBuffer (compressedBuffer, buffer, uncompressedDataLen);
|
||||
if (compressedDataLen <= 0)
|
||||
{
|
||||
if (remove (outputFile))
|
||||
PkgError ("Failed to compress the data.\nFailed also to delete package file");
|
||||
if (_wremove (outputFile))
|
||||
PkgError (L"Failed to compress the data.\nFailed also to delete package file");
|
||||
else
|
||||
PkgError ("Failed to compress the data");
|
||||
PkgError (L"Failed to compress the data");
|
||||
goto err;
|
||||
}
|
||||
|
||||
@@ -404,30 +406,30 @@ BOOL MakeSelfExtractingPackage (HWND hwndDlg, char *szDestDir)
|
||||
mputLong (szTmp32bitPtr, (unsigned __int32) compressedDataLen);
|
||||
if (!SaveBufferToFile (szTmp32bit, outputFile, sizeof (szTmp32bit), TRUE, FALSE))
|
||||
{
|
||||
if (remove (outputFile))
|
||||
PkgError ("Cannot write the total size of the compressed data.\nFailed also to delete package file");
|
||||
if (_wremove (outputFile))
|
||||
PkgError (L"Cannot write the total size of the compressed data.\nFailed also to delete package file");
|
||||
else
|
||||
PkgError ("Cannot write the total size of the compressed data");
|
||||
PkgError (L"Cannot write the total size of the compressed data");
|
||||
goto err;
|
||||
}
|
||||
|
||||
// Write the compressed data
|
||||
if (!SaveBufferToFile (compressedBuffer, outputFile, compressedDataLen, TRUE, FALSE))
|
||||
{
|
||||
if (remove (outputFile))
|
||||
PkgError ("Cannot write compressed data to the package.\nFailed also to delete package file");
|
||||
if (_wremove (outputFile))
|
||||
PkgError (L"Cannot write compressed data to the package.\nFailed also to delete package file");
|
||||
else
|
||||
PkgError ("Cannot write compressed data to the package");
|
||||
PkgError (L"Cannot write compressed data to the package");
|
||||
goto err;
|
||||
}
|
||||
|
||||
// Write the end marker
|
||||
if (!SaveBufferToFile (MagEndMarker, outputFile, strlen (MagEndMarker), TRUE, FALSE))
|
||||
{
|
||||
if (remove (outputFile))
|
||||
PkgError ("Cannot write the end marker.\nFailed also to delete package file");
|
||||
if (_wremove (outputFile))
|
||||
PkgError (L"Cannot write the end marker.\nFailed also to delete package file");
|
||||
else
|
||||
PkgError ("Cannot write the end marker");
|
||||
PkgError (L"Cannot write the end marker");
|
||||
goto err;
|
||||
}
|
||||
|
||||
@@ -444,10 +446,10 @@ BOOL MakeSelfExtractingPackage (HWND hwndDlg, char *szDestDir)
|
||||
if (tmpBuffer == NULL)
|
||||
{
|
||||
handleWin32Error (hwndDlg, SRC_POS);
|
||||
if (remove (outputFile))
|
||||
PkgError ("Cannot load the package to compute CRC.\nFailed also to delete package file");
|
||||
if (_wremove (outputFile))
|
||||
PkgError (L"Cannot load the package to compute CRC.\nFailed also to delete package file");
|
||||
else
|
||||
PkgError ("Cannot load the package to compute CRC");
|
||||
PkgError (L"Cannot load the package to compute CRC");
|
||||
goto err;
|
||||
}
|
||||
|
||||
@@ -460,15 +462,15 @@ BOOL MakeSelfExtractingPackage (HWND hwndDlg, char *szDestDir)
|
||||
|
||||
if (!SaveBufferToFile (szTmp32bit, outputFile, sizeof (szTmp32bit), TRUE, FALSE))
|
||||
{
|
||||
if (remove (outputFile))
|
||||
PkgError ("Cannot write the total size of the compressed data.\nFailed also to delete package file");
|
||||
if (_wremove (outputFile))
|
||||
PkgError (L"Cannot write the total size of the compressed data.\nFailed also to delete package file");
|
||||
else
|
||||
PkgError ("Cannot write the total size of the compressed data");
|
||||
PkgError (L"Cannot write the total size of the compressed data");
|
||||
goto err;
|
||||
}
|
||||
}
|
||||
|
||||
StringCbPrintfA (tmpStr, sizeof(tmpStr), "Self-extracting package successfully created (%s)", outputFile);
|
||||
StringCbPrintfW (tmpStr, sizeof(tmpStr), L"Self-extracting package successfully created (%s)", outputFile);
|
||||
PkgInfo (tmpStr);
|
||||
return TRUE;
|
||||
|
||||
@@ -490,9 +492,9 @@ BOOL VerifyPackageIntegrity (void)
|
||||
unsigned __int32 crc = 0;
|
||||
unsigned char *tmpBuffer;
|
||||
int tmpFileSize;
|
||||
char path [TC_MAX_PATH];
|
||||
wchar_t path [TC_MAX_PATH];
|
||||
|
||||
GetModuleFileName (NULL, path, sizeof (path));
|
||||
GetModuleFileName (NULL, path, ARRAYSIZE (path));
|
||||
|
||||
fileDataEndPos = (int) FindStringInFile (path, MagEndMarker, strlen (MagEndMarker));
|
||||
if (fileDataEndPos < 0)
|
||||
@@ -545,9 +547,9 @@ BOOL VerifyPackageIntegrity (void)
|
||||
// Determines whether we are a self-extracting package
|
||||
BOOL IsSelfExtractingPackage (void)
|
||||
{
|
||||
char path [TC_MAX_PATH];
|
||||
wchar_t path [TC_MAX_PATH];
|
||||
|
||||
GetModuleFileName (NULL, path, sizeof (path));
|
||||
GetModuleFileName (NULL, path, ARRAYSIZE (path));
|
||||
|
||||
return (FindStringInFile (path, MagEndMarker, strlen (MagEndMarker)) != -1);
|
||||
}
|
||||
@@ -578,7 +580,7 @@ static void FreeAllFileBuffers (void)
|
||||
// Creates a table of pointers to buffers containing the following objects for each file:
|
||||
// filename size, filename (not null-terminated!), file size, file CRC-32, uncompressed file contents.
|
||||
// For details, see the definition of the DECOMPRESSED_FILE structure.
|
||||
BOOL SelfExtractInMemory (char *path)
|
||||
BOOL SelfExtractInMemory (wchar_t *path)
|
||||
{
|
||||
int filePos = 0, fileNo = 0;
|
||||
int fileDataEndPos = 0;
|
||||
@@ -667,8 +669,8 @@ BOOL SelfExtractInMemory (char *path)
|
||||
Decompressed_Files[fileNo].fileNameLength = mgetWord (bufPos);
|
||||
|
||||
// Filename
|
||||
Decompressed_Files[fileNo].fileName = bufPos;
|
||||
bufPos += Decompressed_Files[fileNo].fileNameLength;
|
||||
Decompressed_Files[fileNo].fileName = (wchar_t*) bufPos;
|
||||
bufPos += (Decompressed_Files[fileNo].fileNameLength * sizeof (wchar_t));
|
||||
|
||||
// CRC-32 of the file
|
||||
Decompressed_Files[fileNo].crc = mgetLong (bufPos);
|
||||
@@ -711,13 +713,13 @@ void __cdecl ExtractAllFilesThread (void *hwndDlg)
|
||||
{
|
||||
int fileNo;
|
||||
BOOL bSuccess = FALSE;
|
||||
char packageFile [TC_MAX_PATH];
|
||||
wchar_t packageFile [TC_MAX_PATH];
|
||||
|
||||
InvalidateRect (GetDlgItem (GetParent (hwndDlg), IDD_INSTL_DLG), NULL, TRUE);
|
||||
|
||||
ClearLogWindow (hwndDlg);
|
||||
|
||||
GetModuleFileName (NULL, packageFile, sizeof (packageFile));
|
||||
GetModuleFileName (NULL, packageFile, ARRAYSIZE (packageFile));
|
||||
|
||||
if (!(bSuccess = SelfExtractInMemory (packageFile)))
|
||||
goto eaf_end;
|
||||
@@ -738,13 +740,13 @@ void __cdecl ExtractAllFilesThread (void *hwndDlg)
|
||||
|
||||
for (fileNo = 0; fileNo < NBR_COMPRESSED_FILES; fileNo++)
|
||||
{
|
||||
char fileName [TC_MAX_PATH] = {0};
|
||||
char filePath [TC_MAX_PATH] = {0};
|
||||
wchar_t fileName [TC_MAX_PATH] = {0};
|
||||
wchar_t filePath [TC_MAX_PATH] = {0};
|
||||
|
||||
// Filename
|
||||
StringCbCopyNA (fileName, sizeof(fileName), Decompressed_Files[fileNo].fileName, Decompressed_Files[fileNo].fileNameLength);
|
||||
StringCbCopyA (filePath, sizeof(filePath), DestExtractPath);
|
||||
StringCbCatA (filePath, sizeof(filePath), fileName);
|
||||
StringCchCopyNW (fileName, ARRAYSIZE(fileName), Decompressed_Files[fileNo].fileName, Decompressed_Files[fileNo].fileNameLength);
|
||||
StringCbCopyW (filePath, sizeof(filePath), DestExtractPath);
|
||||
StringCbCatW (filePath, sizeof(filePath), fileName);
|
||||
|
||||
StatusMessageParam (hwndDlg, "EXTRACTING_VERB", filePath);
|
||||
|
||||
|
||||
@@ -19,7 +19,7 @@ extern "C" {
|
||||
typedef struct
|
||||
{
|
||||
// WARNING: file name is NOT null-terminated (use fileNameLength).
|
||||
unsigned char *fileName;
|
||||
wchar_t *fileName;
|
||||
int fileNameLength;
|
||||
uint32 crc;
|
||||
__int32 fileLength;
|
||||
@@ -29,14 +29,14 @@ typedef struct
|
||||
extern DECOMPRESSED_FILE Decompressed_Files [NBR_COMPRESSED_FILES];
|
||||
|
||||
void SelfExtractStartupInit (void);
|
||||
BOOL SelfExtractInMemory (char *path);
|
||||
BOOL SelfExtractInMemory (wchar_t *path);
|
||||
void __cdecl ExtractAllFilesThread (void *hwndDlg);
|
||||
BOOL MakeSelfExtractingPackage (HWND hwndDlg, char *szDestDir);
|
||||
BOOL MakeSelfExtractingPackage (HWND hwndDlg, wchar_t *szDestDir);
|
||||
BOOL VerifyPackageIntegrity (void);
|
||||
BOOL IsSelfExtractingPackage (void);
|
||||
static void DeobfuscateMagEndMarker (void);
|
||||
|
||||
extern char DestExtractPath [TC_MAX_PATH];
|
||||
extern wchar_t DestExtractPath [TC_MAX_PATH];
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -19,146 +19,144 @@ extern "C" {
|
||||
#endif
|
||||
|
||||
// Specifies what files to install, where (determined by the prefix), and in what order
|
||||
static char *szFiles[]=
|
||||
static wchar_t *szFiles[]=
|
||||
{
|
||||
"AVeraCrypt User Guide.pdf",
|
||||
"ALicense.txt",
|
||||
"ALICENSE",
|
||||
"ANOTICE",
|
||||
"AVeraCrypt.exe",
|
||||
"AVeraCryptExpander.exe",
|
||||
"AVeraCrypt Format.exe",
|
||||
"AVeraCrypt-x86.exe",
|
||||
"AVeraCryptExpander-x86.exe",
|
||||
"AVeraCrypt Format-x86.exe",
|
||||
"AVeraCrypt-x64.exe",
|
||||
"AVeraCryptExpander-x64.exe",
|
||||
"AVeraCrypt Format-x64.exe",
|
||||
"Averacrypt.sys",
|
||||
"Averacrypt-x64.sys",
|
||||
"Dveracrypt.sys",
|
||||
"AVeraCrypt Setup.exe",
|
||||
"ALanguage.ar.xml",
|
||||
"ALanguage.be.xml",
|
||||
"ALanguage.bg.xml",
|
||||
"ALanguage.ca.xml",
|
||||
"ALanguage.cs.xml",
|
||||
"ALanguage.da.xml",
|
||||
"ALanguage.de.xml",
|
||||
"ALanguage.el.xml",
|
||||
"ALanguage.es.xml",
|
||||
"ALanguage.et.xml",
|
||||
"ALanguage.eu.xml",
|
||||
"ALanguage.fa.xml",
|
||||
"ALanguage.fi.xml",
|
||||
"ALanguage.fr.xml",
|
||||
"ALanguage.hu.xml",
|
||||
"ALanguage.id.xml",
|
||||
"ALanguage.it.xml",
|
||||
"ALanguage.ja.xml",
|
||||
"ALanguage.ka.xml",
|
||||
"ALanguage.ko.xml",
|
||||
"ALanguage.lv.xml",
|
||||
"ALanguage.my.xml",
|
||||
"ALanguage.nl.xml",
|
||||
"ALanguage.nn.xml",
|
||||
"ALanguage.pl.xml",
|
||||
"ALanguage.pt-br.xml",
|
||||
"ALanguage.ru.xml",
|
||||
"ALanguage.sk.xml",
|
||||
"ALanguage.sl.xml",
|
||||
"ALanguage.sv.xml",
|
||||
"ALanguage.tr.xml",
|
||||
"ALanguage.uk.xml",
|
||||
"ALanguage.uz.xml",
|
||||
"ALanguage.vi.xml",
|
||||
"ALanguage.zh-cn.xml",
|
||||
"ALanguage.zh-hk.xml",
|
||||
"ALanguage.zh-tw.xml"
|
||||
L"AVeraCrypt User Guide.pdf",
|
||||
L"ALicense.txt",
|
||||
L"ALICENSE",
|
||||
L"ANOTICE",
|
||||
L"AVeraCrypt.exe",
|
||||
L"AVeraCryptExpander.exe",
|
||||
L"AVeraCrypt Format.exe",
|
||||
L"AVeraCrypt-x86.exe",
|
||||
L"AVeraCryptExpander-x86.exe",
|
||||
L"AVeraCrypt Format-x86.exe",
|
||||
L"AVeraCrypt-x64.exe",
|
||||
L"AVeraCryptExpander-x64.exe",
|
||||
L"AVeraCrypt Format-x64.exe",
|
||||
L"Averacrypt.sys",
|
||||
L"Averacrypt-x64.sys",
|
||||
L"Dveracrypt.sys",
|
||||
L"AVeraCrypt Setup.exe",
|
||||
L"ALanguage.ar.xml",
|
||||
L"ALanguage.be.xml",
|
||||
L"ALanguage.bg.xml",
|
||||
L"ALanguage.ca.xml",
|
||||
L"ALanguage.cs.xml",
|
||||
L"ALanguage.da.xml",
|
||||
L"ALanguage.de.xml",
|
||||
L"ALanguage.el.xml",
|
||||
L"ALanguage.es.xml",
|
||||
L"ALanguage.et.xml",
|
||||
L"ALanguage.eu.xml",
|
||||
L"ALanguage.fa.xml",
|
||||
L"ALanguage.fi.xml",
|
||||
L"ALanguage.fr.xml",
|
||||
L"ALanguage.hu.xml",
|
||||
L"ALanguage.id.xml",
|
||||
L"ALanguage.it.xml",
|
||||
L"ALanguage.ja.xml",
|
||||
L"ALanguage.ka.xml",
|
||||
L"ALanguage.ko.xml",
|
||||
L"ALanguage.lv.xml",
|
||||
L"ALanguage.my.xml",
|
||||
L"ALanguage.nl.xml",
|
||||
L"ALanguage.nn.xml",
|
||||
L"ALanguage.pl.xml",
|
||||
L"ALanguage.pt-br.xml",
|
||||
L"ALanguage.ru.xml",
|
||||
L"ALanguage.sk.xml",
|
||||
L"ALanguage.sl.xml",
|
||||
L"ALanguage.sv.xml",
|
||||
L"ALanguage.tr.xml",
|
||||
L"ALanguage.uk.xml",
|
||||
L"ALanguage.uz.xml",
|
||||
L"ALanguage.vi.xml",
|
||||
L"ALanguage.zh-cn.xml",
|
||||
L"ALanguage.zh-hk.xml",
|
||||
L"ALanguage.zh-tw.xml"
|
||||
};
|
||||
|
||||
// Specifies what files are included in self-extracting packages (no other files will be packaged or extracted).
|
||||
static char *szCompressedFiles[]=
|
||||
static wchar_t *szCompressedFiles[]=
|
||||
{
|
||||
"VeraCrypt User Guide.pdf",
|
||||
"License.txt",
|
||||
"LICENSE",
|
||||
"NOTICE",
|
||||
"VeraCrypt.exe",
|
||||
"VeraCryptExpander.exe",
|
||||
"VeraCrypt Format.exe",
|
||||
"VeraCrypt-x64.exe",
|
||||
"VeraCryptExpander-x64.exe",
|
||||
"VeraCrypt Format-x64.exe",
|
||||
"veracrypt.sys",
|
||||
"veracrypt-x64.sys",
|
||||
"Language.ar.xml",
|
||||
"Language.be.xml",
|
||||
"Language.bg.xml",
|
||||
"Language.ca.xml",
|
||||
"Language.cs.xml",
|
||||
"Language.da.xml",
|
||||
"Language.de.xml",
|
||||
"Language.el.xml",
|
||||
"Language.es.xml",
|
||||
"Language.et.xml",
|
||||
"Language.eu.xml",
|
||||
"Language.fa.xml",
|
||||
"Language.fi.xml",
|
||||
"Language.fr.xml",
|
||||
"Language.hu.xml",
|
||||
"Language.id.xml",
|
||||
"Language.it.xml",
|
||||
"Language.ja.xml",
|
||||
"Language.ka.xml",
|
||||
"Language.ko.xml",
|
||||
"Language.lv.xml",
|
||||
"Language.my.xml",
|
||||
"Language.nl.xml",
|
||||
"Language.nn.xml",
|
||||
"Language.pl.xml",
|
||||
"Language.pt-br.xml",
|
||||
"Language.ru.xml",
|
||||
"Language.sk.xml",
|
||||
"Language.sl.xml",
|
||||
"Language.sv.xml",
|
||||
"Language.tr.xml",
|
||||
"Language.uk.xml",
|
||||
"Language.uz.xml",
|
||||
"Language.vi.xml",
|
||||
"Language.zh-cn.xml",
|
||||
"Language.zh-hk.xml",
|
||||
"Language.zh-tw.xml"
|
||||
L"VeraCrypt User Guide.pdf",
|
||||
L"License.txt",
|
||||
L"LICENSE",
|
||||
L"NOTICE",
|
||||
L"VeraCrypt.exe",
|
||||
L"VeraCryptExpander.exe",
|
||||
L"VeraCrypt Format.exe",
|
||||
L"VeraCrypt-x64.exe",
|
||||
L"VeraCryptExpander-x64.exe",
|
||||
L"VeraCrypt Format-x64.exe",
|
||||
L"veracrypt.sys",
|
||||
L"veracrypt-x64.sys",
|
||||
L"Language.ar.xml",
|
||||
L"Language.be.xml",
|
||||
L"Language.bg.xml",
|
||||
L"Language.ca.xml",
|
||||
L"Language.cs.xml",
|
||||
L"Language.da.xml",
|
||||
L"Language.de.xml",
|
||||
L"Language.el.xml",
|
||||
L"Language.es.xml",
|
||||
L"Language.et.xml",
|
||||
L"Language.eu.xml",
|
||||
L"Language.fa.xml",
|
||||
L"Language.fi.xml",
|
||||
L"Language.fr.xml",
|
||||
L"Language.hu.xml",
|
||||
L"Language.id.xml",
|
||||
L"Language.it.xml",
|
||||
L"Language.ja.xml",
|
||||
L"Language.ka.xml",
|
||||
L"Language.ko.xml",
|
||||
L"Language.lv.xml",
|
||||
L"Language.my.xml",
|
||||
L"Language.nl.xml",
|
||||
L"Language.nn.xml",
|
||||
L"Language.pl.xml",
|
||||
L"Language.pt-br.xml",
|
||||
L"Language.ru.xml",
|
||||
L"Language.sk.xml",
|
||||
L"Language.sl.xml",
|
||||
L"Language.sv.xml",
|
||||
L"Language.tr.xml",
|
||||
L"Language.uk.xml",
|
||||
L"Language.uz.xml",
|
||||
L"Language.vi.xml",
|
||||
L"Language.zh-cn.xml",
|
||||
L"Language.zh-hk.xml",
|
||||
L"Language.zh-tw.xml"
|
||||
};
|
||||
|
||||
#define FILENAME_64BIT_DRIVER "veracrypt-x64.sys"
|
||||
#define FILENAME_64BIT_DRIVER L"veracrypt-x64.sys"
|
||||
#define NBR_COMPRESSED_FILES (sizeof(szCompressedFiles) / sizeof(szCompressedFiles[0]))
|
||||
|
||||
void localcleanup (void);
|
||||
BOOL StatDeleteFile ( char *lpszFile, BOOL bCheckForOldFile );
|
||||
BOOL StatRemoveDirectory ( char *lpszDir );
|
||||
HRESULT CreateLink ( char *lpszPathObj , char *lpszArguments , char *lpszPathLink );
|
||||
void GetProgramPath ( HWND hwndDlg , char *path );
|
||||
BOOL StatDeleteFile ( wchar_t *lpszFile, BOOL bCheckForOldFile );
|
||||
BOOL StatRemoveDirectory ( wchar_t *lpszDir );
|
||||
HRESULT CreateLink ( wchar_t *lpszPathObj , wchar_t *lpszArguments , wchar_t *lpszPathLink );
|
||||
void GetProgramPath ( HWND hwndDlg , wchar_t *path );
|
||||
void StatusMessage (HWND hwndDlg, char *stringId);
|
||||
void StatusMessageParam (HWND hwndDlg, char *stringId, char *param);
|
||||
void StatusMessageParam (HWND hwndDlg, char *stringId, wchar_t *param);
|
||||
void ClearLogWindow (HWND hwndDlg);
|
||||
void StatusMessage ( HWND hwndDlg , char *stringId );
|
||||
void StatusMessageParam ( HWND hwndDlg , char *stringId , char *param );
|
||||
void RegMessage ( HWND hwndDlg , char *txt );
|
||||
void RegRemoveMessage (HWND hwndDlg, char *txt);
|
||||
void CopyMessage ( HWND hwndDlg , char *txt );
|
||||
void RemoveMessage ( HWND hwndDlg , char *txt );
|
||||
void IconMessage ( HWND hwndDlg , char *txt );
|
||||
void RegMessage ( HWND hwndDlg , wchar_t *txt );
|
||||
void RegRemoveMessage (HWND hwndDlg, wchar_t *txt);
|
||||
void CopyMessage ( HWND hwndDlg , wchar_t *txt );
|
||||
void RemoveMessage ( HWND hwndDlg , wchar_t *txt );
|
||||
void IconMessage ( HWND hwndDlg , wchar_t *txt );
|
||||
static int CALLBACK BrowseCallbackProc ( HWND hwnd , UINT uMsg , LPARAM lp , LPARAM pData );
|
||||
void LoadLicense ( HWND hwndDlg );
|
||||
void DetermineUpgradeDowngradeStatus (BOOL bCloseDriverHandle, LONG *driverVersionPtr);
|
||||
BOOL DoFilesInstall ( HWND hwndDlg , char *szDestDir );
|
||||
BOOL DoRegInstall ( HWND hwndDlg , char *szDestDir , BOOL bInstallType );
|
||||
BOOL DoFilesInstall ( HWND hwndDlg , wchar_t *szDestDir );
|
||||
BOOL DoRegInstall ( HWND hwndDlg , wchar_t *szDestDir , BOOL bInstallType );
|
||||
BOOL DoRegUninstall (HWND hwndDlg, BOOL bRemoveDeprecated);
|
||||
BOOL DoServiceUninstall ( HWND hwndDlg , char *lpszService );
|
||||
BOOL DoServiceUninstall ( HWND hwndDlg , wchar_t *lpszService );
|
||||
BOOL DoDriverUnload ( HWND hwndDlg );
|
||||
BOOL DoShortcutsInstall ( HWND hwndDlg , char *szDestDir , BOOL bProgGroup, BOOL bDesktopIcon );
|
||||
BOOL DoShortcutsUninstall (HWND hwndDlg, char *szDestDir);
|
||||
BOOL DoShortcutsInstall ( HWND hwndDlg , wchar_t *szDestDir , BOOL bProgGroup, BOOL bDesktopIcon );
|
||||
BOOL DoShortcutsUninstall (HWND hwndDlg, wchar_t *szDestDir);
|
||||
void OutcomePrompt ( HWND hwndDlg , BOOL bOK );
|
||||
void DoUninstall ( void *hwndDlg );
|
||||
void DoInstall ( void *hwndDlg );
|
||||
@@ -182,8 +180,8 @@ extern BOOL bDesktopIconStatusDetermined;
|
||||
extern BOOL SystemEncryptionUpdate;
|
||||
extern BOOL bRestartRequired;
|
||||
extern HMODULE volatile SystemRestoreDll;
|
||||
extern char InstallationPath[TC_MAX_PATH];
|
||||
extern char SetupFilesDir[TC_MAX_PATH];
|
||||
extern wchar_t InstallationPath[TC_MAX_PATH];
|
||||
extern wchar_t SetupFilesDir[TC_MAX_PATH];
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
IntermediateDirectory="Debug"
|
||||
ConfigurationType="1"
|
||||
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
|
||||
CharacterSet="2"
|
||||
CharacterSet="1"
|
||||
>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"
|
||||
@@ -108,7 +108,7 @@
|
||||
IntermediateDirectory="Release"
|
||||
ConfigurationType="1"
|
||||
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
|
||||
CharacterSet="2"
|
||||
CharacterSet="1"
|
||||
>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"
|
||||
@@ -374,11 +374,11 @@
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\Resource.h"
|
||||
RelativePath="..\Common\Resource.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\Common\Resource.h"
|
||||
RelativePath=".\Resource.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
|
||||
@@ -23,6 +23,7 @@
|
||||
#include "Common/Resource.h"
|
||||
#include "Resource.h"
|
||||
#include "Setup.h"
|
||||
#include <tchar.h>
|
||||
#include <Strsafe.h>
|
||||
|
||||
using namespace std;
|
||||
@@ -40,9 +41,9 @@ enum wizard_pages
|
||||
|
||||
HWND hCurPage = NULL; /* Handle to current wizard page */
|
||||
int nCurPageNo = -1; /* The current wizard page */
|
||||
char WizardDestInstallPath [TC_MAX_PATH];
|
||||
char WizardDestExtractPath [TC_MAX_PATH];
|
||||
char SelfFile [TC_MAX_PATH];
|
||||
wchar_t WizardDestInstallPath [TC_MAX_PATH];
|
||||
wchar_t WizardDestExtractPath [TC_MAX_PATH];
|
||||
wchar_t SelfFile [TC_MAX_PATH];
|
||||
|
||||
HBITMAP hbmWizardBitmapRescaled = NULL;
|
||||
|
||||
@@ -92,12 +93,12 @@ void localcleanupwiz (void)
|
||||
|
||||
static void InitWizardDestInstallPath (void)
|
||||
{
|
||||
if (strlen (WizardDestInstallPath) < 2)
|
||||
if (wcslen (WizardDestInstallPath) < 2)
|
||||
{
|
||||
StringCbCopyA (WizardDestInstallPath, sizeof(WizardDestInstallPath), InstallationPath);
|
||||
if (WizardDestInstallPath [strlen (WizardDestInstallPath) - 1] != '\\')
|
||||
StringCbCopyW (WizardDestInstallPath, sizeof(WizardDestInstallPath), InstallationPath);
|
||||
if (WizardDestInstallPath [wcslen (WizardDestInstallPath) - 1] != L'\\')
|
||||
{
|
||||
StringCbCatA (WizardDestInstallPath, sizeof(WizardDestInstallPath), "\\");
|
||||
StringCbCatW (WizardDestInstallPath, sizeof(WizardDestInstallPath), L"\\");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -228,7 +229,7 @@ BOOL CALLBACK PageDialogProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPa
|
||||
licenseText = GetLegalNotices ();
|
||||
if (licenseText != NULL)
|
||||
{
|
||||
SetWindowText (GetDlgItem (hwndDlg, IDC_LICENSE_TEXT), licenseText);
|
||||
SetWindowTextA (GetDlgItem (hwndDlg, IDC_LICENSE_TEXT), licenseText);
|
||||
free (licenseText);
|
||||
}
|
||||
else
|
||||
@@ -308,10 +309,10 @@ BOOL CALLBACK PageDialogProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPa
|
||||
|
||||
case EXTRACTION_OPTIONS_PAGE:
|
||||
|
||||
if (strlen(WizardDestExtractPath) < 2)
|
||||
if (wcslen(WizardDestExtractPath) < 2)
|
||||
{
|
||||
StringCbCopyA (WizardDestExtractPath, sizeof(WizardDestExtractPath), SetupFilesDir);
|
||||
StringCbCatNA (WizardDestExtractPath, sizeof(WizardDestExtractPath), "VeraCrypt\\", sizeof (WizardDestExtractPath) - strlen (WizardDestExtractPath) - 1);
|
||||
StringCbCopyW (WizardDestExtractPath, sizeof(WizardDestExtractPath), SetupFilesDir);
|
||||
StringCbCatNW (WizardDestExtractPath, sizeof(WizardDestExtractPath), L"VeraCrypt\\", ARRAYSIZE (WizardDestExtractPath) - wcslen (WizardDestExtractPath) - 1);
|
||||
}
|
||||
|
||||
SendMessage (GetDlgItem (hwndDlg, IDC_DESTINATION), EM_LIMITTEXT, TC_MAX_PATH - 1, 0);
|
||||
@@ -353,10 +354,10 @@ BOOL CALLBACK PageDialogProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPa
|
||||
EnableWindow (GetDlgItem (GetParent (hwndDlg), IDHELP), FALSE);
|
||||
EnableWindow (GetDlgItem (GetParent (hwndDlg), IDCANCEL), FALSE);
|
||||
|
||||
if (WizardDestExtractPath [strlen(WizardDestExtractPath)-1] != '\\')
|
||||
StringCbCatA (WizardDestExtractPath, sizeof(WizardDestExtractPath), "\\");
|
||||
if (WizardDestExtractPath [wcslen(WizardDestExtractPath)-1] != L'\\')
|
||||
StringCbCatW (WizardDestExtractPath, sizeof(WizardDestExtractPath), L"\\");
|
||||
|
||||
StringCbCopyA (DestExtractPath, sizeof(DestExtractPath), WizardDestExtractPath);
|
||||
StringCbCopyW (DestExtractPath, sizeof(DestExtractPath), WizardDestExtractPath);
|
||||
|
||||
InitProgressBar ();
|
||||
|
||||
@@ -406,9 +407,9 @@ BOOL CALLBACK PageDialogProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPa
|
||||
EnableWindow (GetDlgItem (hwndDlg, IDC_BROWSE), FALSE);
|
||||
EnableWindow (GetDlgItem (hwndDlg, IDC_ALL_USERS), FALSE);
|
||||
|
||||
char path[MAX_PATH];
|
||||
wchar_t path[MAX_PATH];
|
||||
SHGetSpecialFolderPath (hwndDlg, path, CSIDL_COMMON_PROGRAMS, 0);
|
||||
bForAllUsers = (_access ((string (path) + "\\" TC_APP_NAME).c_str(), 0) == 0);
|
||||
bForAllUsers = (_waccess ((wstring (path) + L"\\" _T(TC_APP_NAME)).c_str(), 0) == 0);
|
||||
}
|
||||
|
||||
// System Restore
|
||||
@@ -456,10 +457,10 @@ BOOL CALLBACK PageDialogProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPa
|
||||
|
||||
InitProgressBar ();
|
||||
|
||||
if (WizardDestInstallPath [strlen(WizardDestInstallPath)-1] != '\\')
|
||||
StringCbCatA (WizardDestInstallPath, sizeof(WizardDestInstallPath), "\\");
|
||||
if (WizardDestInstallPath [wcslen(WizardDestInstallPath)-1] != L'\\')
|
||||
StringCbCatW (WizardDestInstallPath, sizeof(WizardDestInstallPath), L"\\");
|
||||
|
||||
StringCbCopyA (InstallationPath, sizeof(InstallationPath), WizardDestInstallPath);
|
||||
StringCbCopyW (InstallationPath, sizeof(InstallationPath), WizardDestInstallPath);
|
||||
|
||||
WaitCursor ();
|
||||
|
||||
@@ -627,9 +628,9 @@ BOOL CALLBACK PageDialogProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPa
|
||||
case IDC_BROWSE:
|
||||
if (BrowseDirectories (hwndDlg, "SELECT_DEST_DIR", WizardDestExtractPath))
|
||||
{
|
||||
if (WizardDestExtractPath [strlen(WizardDestExtractPath)-1] != '\\')
|
||||
if (WizardDestExtractPath [wcslen(WizardDestExtractPath)-1] != L'\\')
|
||||
{
|
||||
StringCbCatA (WizardDestExtractPath, sizeof(WizardDestExtractPath), "\\");
|
||||
StringCbCatW (WizardDestExtractPath, sizeof(WizardDestExtractPath), L"\\");
|
||||
}
|
||||
SetDlgItemText (hwndDlg, IDC_DESTINATION, WizardDestExtractPath);
|
||||
}
|
||||
@@ -648,9 +649,9 @@ BOOL CALLBACK PageDialogProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPa
|
||||
case IDC_BROWSE:
|
||||
if (BrowseDirectories (hwndDlg, "SELECT_DEST_DIR", WizardDestInstallPath))
|
||||
{
|
||||
if (WizardDestInstallPath [strlen(WizardDestInstallPath)-1] != '\\')
|
||||
if (WizardDestInstallPath [wcslen(WizardDestInstallPath)-1] != L'\\')
|
||||
{
|
||||
StringCbCatA (WizardDestInstallPath, sizeof(WizardDestInstallPath), "\\");
|
||||
StringCbCatW (WizardDestInstallPath, sizeof(WizardDestInstallPath), L"\\");
|
||||
}
|
||||
SetDlgItemText (hwndDlg, IDC_DESTINATION, WizardDestInstallPath);
|
||||
}
|
||||
@@ -803,7 +804,7 @@ BOOL CALLBACK MainDialogProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPa
|
||||
{
|
||||
RECT rec;
|
||||
|
||||
GetModuleFileName (NULL, SelfFile, sizeof (SelfFile));
|
||||
GetModuleFileName (NULL, SelfFile, ARRAYSIZE (SelfFile));
|
||||
|
||||
MainDlg = hwndDlg;
|
||||
|
||||
@@ -829,7 +830,7 @@ BOOL CALLBACK MainDialogProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPa
|
||||
|
||||
SendMessage (GetDlgItem (hwndDlg, IDC_BOX_TITLE), WM_SETFONT, (WPARAM) hUserBoldFont, (LPARAM) TRUE);
|
||||
|
||||
SetWindowText (hwndDlg, "VeraCrypt Setup " VERSION_STRING);
|
||||
SetWindowText (hwndDlg, L"VeraCrypt Setup " _T(VERSION_STRING));
|
||||
|
||||
DonColorSchemeId = GetDonVal (2, 9);
|
||||
|
||||
@@ -899,7 +900,7 @@ BOOL CALLBACK MainDialogProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPa
|
||||
|
||||
HKEY hkey;
|
||||
|
||||
if (RegOpenKeyEx (HKEY_LOCAL_MACHINE, "SOFTWARE\\Microsoft\\Updates\\Windows 2000\\SP5\\Update Rollup 1", 0, KEY_READ, &hkey) != ERROR_SUCCESS)
|
||||
if (RegOpenKeyEx (HKEY_LOCAL_MACHINE, L"SOFTWARE\\Microsoft\\Updates\\Windows 2000\\SP5\\Update Rollup 1", 0, KEY_READ, &hkey) != ERROR_SUCCESS)
|
||||
{
|
||||
ErrorDirect (L"VeraCrypt requires Update Rollup 1 for Windows 2000 SP4 to be installed.\n\nFor more information, see http://support.microsoft.com/kb/891861", hwndDlg);
|
||||
AbortProcessSilent ();
|
||||
@@ -928,14 +929,14 @@ BOOL CALLBACK MainDialogProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPa
|
||||
|
||||
else if (nCurPageNo == EXTRACTION_OPTIONS_PAGE)
|
||||
{
|
||||
GetWindowText (GetDlgItem (hCurPage, IDC_DESTINATION), WizardDestExtractPath, sizeof (WizardDestExtractPath));
|
||||
GetWindowText (GetDlgItem (hCurPage, IDC_DESTINATION), WizardDestExtractPath, ARRAYSIZE (WizardDestExtractPath));
|
||||
|
||||
bStartExtraction = TRUE;
|
||||
}
|
||||
|
||||
else if (nCurPageNo == INSTALL_OPTIONS_PAGE)
|
||||
{
|
||||
GetWindowText (GetDlgItem (hCurPage, IDC_DESTINATION), WizardDestInstallPath, sizeof (WizardDestInstallPath));
|
||||
GetWindowText (GetDlgItem (hCurPage, IDC_DESTINATION), WizardDestInstallPath, ARRAYSIZE (WizardDestInstallPath));
|
||||
|
||||
bStartInstall = TRUE;
|
||||
}
|
||||
@@ -975,13 +976,13 @@ BOOL CALLBACK MainDialogProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPa
|
||||
|
||||
else if (nCurPageNo == EXTRACTION_OPTIONS_PAGE)
|
||||
{
|
||||
GetWindowText (GetDlgItem (hCurPage, IDC_DESTINATION), WizardDestExtractPath, sizeof (WizardDestExtractPath));
|
||||
GetWindowText (GetDlgItem (hCurPage, IDC_DESTINATION), WizardDestExtractPath, ARRAYSIZE (WizardDestExtractPath));
|
||||
nCurPageNo = WIZARD_MODE_PAGE + 1;
|
||||
}
|
||||
|
||||
else if (nCurPageNo == INSTALL_OPTIONS_PAGE)
|
||||
{
|
||||
GetWindowText (GetDlgItem (hCurPage, IDC_DESTINATION), WizardDestInstallPath, sizeof (WizardDestInstallPath));
|
||||
GetWindowText (GetDlgItem (hCurPage, IDC_DESTINATION), WizardDestInstallPath, ARRAYSIZE (WizardDestInstallPath));
|
||||
}
|
||||
|
||||
LoadPage (hwndDlg, --nCurPageNo);
|
||||
@@ -1156,7 +1157,7 @@ BOOL CALLBACK MainDialogProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPa
|
||||
|
||||
if (bOpenContainingFolder && bExtractOnly && bExtractionSuccessful)
|
||||
{
|
||||
ShellExecute (NULL, "open", WizardDestExtractPath, NULL, NULL, SW_SHOWNORMAL);
|
||||
ShellExecute (NULL, L"open", WizardDestExtractPath, NULL, NULL, SW_SHOWNORMAL);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user