mirror of
https://github.com/veracrypt/VeraCrypt.git
synced 2025-11-12 03:18:26 -06:00
Windows: Full UNICODE rewrite and implement support for UNICODE passwords.
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user