mirror of
https://github.com/veracrypt/VeraCrypt
synced 2024-11-24 12:03:28 +01:00
Windows: Fix various warnings
This commit is contained in:
parent
9881744c95
commit
3281b276b6
@ -362,7 +362,7 @@ static void ComputeBootLoaderFingerprint(PDEVICE_OBJECT LowerDeviceObject, byte*
|
||||
NTSTATUS saveStatus = STATUS_INVALID_PARAMETER;
|
||||
#ifdef _WIN64
|
||||
XSTATE_SAVE SaveState;
|
||||
if (g_isIntel && HasSAVX())
|
||||
if (IsCpuIntel() && HasSAVX())
|
||||
saveStatus = KeSaveExtendedProcessorStateVC(XSTATE_MASK_GSSE, &SaveState);
|
||||
#else
|
||||
KFLOATING_SAVE floatingPointState;
|
||||
|
@ -398,7 +398,7 @@ static VOID IoThreadProc (PVOID threadArg)
|
||||
for (subFragment = 0 ; subFragment < 3; ++subFragment)
|
||||
{
|
||||
LARGE_INTEGER subFragmentOffset;
|
||||
ULONG subFragmentLength;
|
||||
ULONG subFragmentLength = 0;
|
||||
subFragmentOffset.QuadPart = request->Offset.QuadPart;
|
||||
|
||||
switch (subFragment)
|
||||
|
@ -43,14 +43,14 @@ NTSTATUS TCOpenVolume (PDEVICE_OBJECT DeviceObject,
|
||||
PWSTR pwszMountVolume,
|
||||
BOOL bRawDevice)
|
||||
{
|
||||
FILE_STANDARD_INFORMATION FileStandardInfo = {0};
|
||||
FILE_STANDARD_INFORMATION FileStandardInfo = { 0 };
|
||||
FILE_BASIC_INFORMATION FileBasicInfo;
|
||||
OBJECT_ATTRIBUTES oaFileAttributes;
|
||||
UNICODE_STRING FullFileName;
|
||||
IO_STATUS_BLOCK IoStatusBlock;
|
||||
PCRYPTO_INFO cryptoInfoPtr = NULL;
|
||||
PCRYPTO_INFO tmpCryptoInfo = NULL;
|
||||
LARGE_INTEGER lDiskLength = {0};
|
||||
LARGE_INTEGER lDiskLength = { 0 };
|
||||
__int64 partitionStartingOffset = 0;
|
||||
int volumeType;
|
||||
char *readBuffer = 0;
|
||||
@ -484,7 +484,7 @@ NTSTATUS TCOpenVolume (PDEVICE_OBJECT DeviceObject,
|
||||
// Header of a volume that is not within the scope of system encryption, or
|
||||
// header of a system hidden volume (containing a hidden OS)
|
||||
|
||||
LARGE_INTEGER headerOffset;
|
||||
LARGE_INTEGER headerOffset = {0};
|
||||
|
||||
if (mount->UseBackupHeader && lDiskLength.QuadPart <= TC_TOTAL_VOLUME_HEADERS_SIZE)
|
||||
continue;
|
||||
|
@ -132,7 +132,7 @@ BOOL MakeSelfExtractingPackage (HWND hwndDlg, wchar_t *szDestDir)
|
||||
wchar_t tmpStr [2048];
|
||||
int bufLen = 0, compressedDataLen = 0, uncompressedDataLen = 0;
|
||||
|
||||
x = wcslen (szDestDir);
|
||||
x = (int) wcslen (szDestDir);
|
||||
if (x < 2)
|
||||
goto err;
|
||||
|
||||
@ -179,7 +179,7 @@ BOOL MakeSelfExtractingPackage (HWND hwndDlg, wchar_t *szDestDir)
|
||||
bufLen += (int) GetFileSize64 (szTmpFilePath);
|
||||
|
||||
bufLen += 2; // 16-bit filename length
|
||||
bufLen += (wcslen(szCompressedFiles[i]) * sizeof (wchar_t)); // Filename
|
||||
bufLen += (int) (wcslen(szCompressedFiles[i]) * sizeof (wchar_t)); // Filename
|
||||
bufLen += 4; // CRC-32
|
||||
bufLen += 4; // 32-bit file length
|
||||
}
|
||||
@ -197,7 +197,7 @@ BOOL MakeSelfExtractingPackage (HWND hwndDlg, wchar_t *szDestDir)
|
||||
|
||||
|
||||
// Write the start marker
|
||||
if (!SaveBufferToFile (MAG_START_MARKER, outputFile, strlen (MAG_START_MARKER), TRUE, FALSE))
|
||||
if (!SaveBufferToFile (MAG_START_MARKER, outputFile, (DWORD) strlen (MAG_START_MARKER), TRUE, FALSE))
|
||||
{
|
||||
if (_wremove (outputFile))
|
||||
PkgError (L"Cannot write the start marker\nFailed also to delete package file");
|
||||
@ -324,7 +324,7 @@ BOOL MakeSelfExtractingPackage (HWND hwndDlg, wchar_t *szDestDir)
|
||||
}
|
||||
|
||||
// Write the end marker
|
||||
if (!SaveBufferToFile (MagEndMarker, outputFile, strlen (MagEndMarker), TRUE, FALSE))
|
||||
if (!SaveBufferToFile (MagEndMarker, outputFile, (DWORD) strlen (MagEndMarker), TRUE, FALSE))
|
||||
{
|
||||
if (_wremove (outputFile))
|
||||
PkgError (L"Cannot write the end marker.\nFailed also to delete package file");
|
||||
@ -408,7 +408,7 @@ BOOL VerifyPackageIntegrity (const wchar_t *path)
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
fileDataEndPos = (int) FindStringInFile (path, MagEndMarker, strlen (MagEndMarker));
|
||||
fileDataEndPos = (int) FindStringInFile (path, MagEndMarker, (int) strlen (MagEndMarker));
|
||||
if (fileDataEndPos < 0)
|
||||
{
|
||||
Error ("DIST_PACKAGE_CORRUPTED", NULL);
|
||||
@ -416,13 +416,13 @@ BOOL VerifyPackageIntegrity (const wchar_t *path)
|
||||
}
|
||||
fileDataEndPos--;
|
||||
|
||||
fileDataStartPos = (int) FindStringInFile (path, MAG_START_MARKER, strlen (MAG_START_MARKER));
|
||||
fileDataStartPos = (int) FindStringInFile (path, MAG_START_MARKER, (int) strlen (MAG_START_MARKER));
|
||||
if (fileDataStartPos < 0)
|
||||
{
|
||||
Error ("DIST_PACKAGE_CORRUPTED", NULL);
|
||||
return FALSE;
|
||||
}
|
||||
fileDataStartPos += strlen (MAG_START_MARKER);
|
||||
fileDataStartPos += (int) strlen (MAG_START_MARKER);
|
||||
|
||||
|
||||
if (!LoadInt32 (path, &crc, fileDataEndPos + strlen (MagEndMarker) + 1))
|
||||
@ -443,7 +443,7 @@ BOOL VerifyPackageIntegrity (const wchar_t *path)
|
||||
// Zero all bytes that change when an exe is digitally signed (except appended blocks).
|
||||
WipeSignatureAreas (tmpBuffer);
|
||||
|
||||
if (crc != GetCrc32 (tmpBuffer, fileDataEndPos + 1 + strlen (MagEndMarker)))
|
||||
if (crc != GetCrc32 (tmpBuffer, fileDataEndPos + 1 + (int) strlen (MagEndMarker)))
|
||||
{
|
||||
free (tmpBuffer);
|
||||
Error ("DIST_PACKAGE_CORRUPTED", NULL);
|
||||
@ -463,7 +463,7 @@ BOOL IsSelfExtractingPackage (void)
|
||||
|
||||
GetModuleFileName (NULL, path, ARRAYSIZE (path));
|
||||
|
||||
return (FindStringInFile (path, MagEndMarker, strlen (MagEndMarker)) != -1);
|
||||
return (FindStringInFile (path, MagEndMarker, (int) strlen (MagEndMarker)) != -1);
|
||||
}
|
||||
|
||||
|
||||
@ -505,7 +505,7 @@ BOOL SelfExtractInMemory (wchar_t *path)
|
||||
|
||||
FreeAllFileBuffers();
|
||||
|
||||
fileDataEndPos = (int) FindStringInFile (path, MagEndMarker, strlen (MagEndMarker));
|
||||
fileDataEndPos = (int) FindStringInFile (path, MagEndMarker, (int) strlen (MagEndMarker));
|
||||
if (fileDataEndPos < 0)
|
||||
{
|
||||
Error ("CANNOT_READ_FROM_PACKAGE", NULL);
|
||||
@ -514,14 +514,14 @@ BOOL SelfExtractInMemory (wchar_t *path)
|
||||
|
||||
fileDataEndPos--;
|
||||
|
||||
fileDataStartPos = (int) FindStringInFile (path, MAG_START_MARKER, strlen (MAG_START_MARKER));
|
||||
fileDataStartPos = (int) FindStringInFile (path, MAG_START_MARKER, (int) strlen (MAG_START_MARKER));
|
||||
if (fileDataStartPos < 0)
|
||||
{
|
||||
Error ("CANNOT_READ_FROM_PACKAGE", NULL);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
fileDataStartPos += strlen (MAG_START_MARKER);
|
||||
fileDataStartPos += (int) strlen (MAG_START_MARKER);
|
||||
|
||||
filePos = fileDataStartPos;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user