diff options
author | Mounir IDRASSI <mounir.idrassi@idrix.fr> | 2021-01-01 23:59:37 +0100 |
---|---|---|
committer | Mounir IDRASSI <mounir.idrassi@idrix.fr> | 2021-01-02 01:16:40 +0100 |
commit | 3281b276b65912f0a6c265fb6f150f815b528937 (patch) | |
tree | a54de65af0d1a67b60b41378b362b2cfb93952ea | |
parent | 9881744c95737264c7cd9f13b3c70042c03584aa (diff) | |
download | VeraCrypt-3281b276b65912f0a6c265fb6f150f815b528937.tar.gz VeraCrypt-3281b276b65912f0a6c265fb6f150f815b528937.zip |
Windows: Fix various warnings
-rw-r--r-- | src/Driver/DriveFilter.c | 2 | ||||
-rw-r--r-- | src/Driver/EncryptedIoQueue.c | 2 | ||||
-rw-r--r-- | src/Driver/Ntvol.c | 6 | ||||
-rw-r--r-- | src/Setup/SelfExtract.c | 24 |
4 files changed, 17 insertions, 17 deletions
diff --git a/src/Driver/DriveFilter.c b/src/Driver/DriveFilter.c index dc836ebe..740ce949 100644 --- a/src/Driver/DriveFilter.c +++ b/src/Driver/DriveFilter.c @@ -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; diff --git a/src/Driver/EncryptedIoQueue.c b/src/Driver/EncryptedIoQueue.c index 6f1d3777..85b9a330 100644 --- a/src/Driver/EncryptedIoQueue.c +++ b/src/Driver/EncryptedIoQueue.c @@ -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) diff --git a/src/Driver/Ntvol.c b/src/Driver/Ntvol.c index 747fc026..45a07cdb 100644 --- a/src/Driver/Ntvol.c +++ b/src/Driver/Ntvol.c @@ -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; diff --git a/src/Setup/SelfExtract.c b/src/Setup/SelfExtract.c index e4791dae..34fb0b25 100644 --- a/src/Setup/SelfExtract.c +++ b/src/Setup/SelfExtract.c @@ -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; |