Windows: Fix various warnings

This commit is contained in:
Mounir IDRASSI 2021-01-01 23:59:37 +01:00
parent 9881744c95
commit 3281b276b6
No known key found for this signature in database
GPG Key ID: 02C30AE90FAE4A6F
4 changed files with 17 additions and 17 deletions

View File

@ -362,7 +362,7 @@ static void ComputeBootLoaderFingerprint(PDEVICE_OBJECT LowerDeviceObject, byte*
NTSTATUS saveStatus = STATUS_INVALID_PARAMETER; NTSTATUS saveStatus = STATUS_INVALID_PARAMETER;
#ifdef _WIN64 #ifdef _WIN64
XSTATE_SAVE SaveState; XSTATE_SAVE SaveState;
if (g_isIntel && HasSAVX()) if (IsCpuIntel() && HasSAVX())
saveStatus = KeSaveExtendedProcessorStateVC(XSTATE_MASK_GSSE, &SaveState); saveStatus = KeSaveExtendedProcessorStateVC(XSTATE_MASK_GSSE, &SaveState);
#else #else
KFLOATING_SAVE floatingPointState; KFLOATING_SAVE floatingPointState;

View File

@ -398,7 +398,7 @@ static VOID IoThreadProc (PVOID threadArg)
for (subFragment = 0 ; subFragment < 3; ++subFragment) for (subFragment = 0 ; subFragment < 3; ++subFragment)
{ {
LARGE_INTEGER subFragmentOffset; LARGE_INTEGER subFragmentOffset;
ULONG subFragmentLength; ULONG subFragmentLength = 0;
subFragmentOffset.QuadPart = request->Offset.QuadPart; subFragmentOffset.QuadPart = request->Offset.QuadPart;
switch (subFragment) switch (subFragment)

View File

@ -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 volume that is not within the scope of system encryption, or
// header of a system hidden volume (containing a hidden OS) // 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) if (mount->UseBackupHeader && lDiskLength.QuadPart <= TC_TOTAL_VOLUME_HEADERS_SIZE)
continue; continue;

View File

@ -132,7 +132,7 @@ BOOL MakeSelfExtractingPackage (HWND hwndDlg, wchar_t *szDestDir)
wchar_t tmpStr [2048]; wchar_t tmpStr [2048];
int bufLen = 0, compressedDataLen = 0, uncompressedDataLen = 0; int bufLen = 0, compressedDataLen = 0, uncompressedDataLen = 0;
x = wcslen (szDestDir); x = (int) wcslen (szDestDir);
if (x < 2) if (x < 2)
goto err; goto err;
@ -179,7 +179,7 @@ BOOL MakeSelfExtractingPackage (HWND hwndDlg, wchar_t *szDestDir)
bufLen += (int) GetFileSize64 (szTmpFilePath); bufLen += (int) GetFileSize64 (szTmpFilePath);
bufLen += 2; // 16-bit filename length 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; // CRC-32
bufLen += 4; // 32-bit file length bufLen += 4; // 32-bit file length
} }
@ -197,7 +197,7 @@ BOOL MakeSelfExtractingPackage (HWND hwndDlg, wchar_t *szDestDir)
// Write the start marker // 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)) if (_wremove (outputFile))
PkgError (L"Cannot write the start marker\nFailed also to delete package file"); 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 // Write the end marker
if (!SaveBufferToFile (MagEndMarker, outputFile, strlen (MagEndMarker), TRUE, FALSE)) if (!SaveBufferToFile (MagEndMarker, outputFile, (DWORD) strlen (MagEndMarker), TRUE, FALSE))
{ {
if (_wremove (outputFile)) if (_wremove (outputFile))
PkgError (L"Cannot write the end marker.\nFailed also to delete package file"); 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; return FALSE;
} }
fileDataEndPos = (int) FindStringInFile (path, MagEndMarker, strlen (MagEndMarker)); fileDataEndPos = (int) FindStringInFile (path, MagEndMarker, (int) strlen (MagEndMarker));
if (fileDataEndPos < 0) if (fileDataEndPos < 0)
{ {
Error ("DIST_PACKAGE_CORRUPTED", NULL); Error ("DIST_PACKAGE_CORRUPTED", NULL);
@ -416,13 +416,13 @@ BOOL VerifyPackageIntegrity (const wchar_t *path)
} }
fileDataEndPos--; 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) if (fileDataStartPos < 0)
{ {
Error ("DIST_PACKAGE_CORRUPTED", NULL); Error ("DIST_PACKAGE_CORRUPTED", NULL);
return FALSE; return FALSE;
} }
fileDataStartPos += strlen (MAG_START_MARKER); fileDataStartPos += (int) strlen (MAG_START_MARKER);
if (!LoadInt32 (path, &crc, fileDataEndPos + strlen (MagEndMarker) + 1)) 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). // Zero all bytes that change when an exe is digitally signed (except appended blocks).
WipeSignatureAreas (tmpBuffer); WipeSignatureAreas (tmpBuffer);
if (crc != GetCrc32 (tmpBuffer, fileDataEndPos + 1 + strlen (MagEndMarker))) if (crc != GetCrc32 (tmpBuffer, fileDataEndPos + 1 + (int) strlen (MagEndMarker)))
{ {
free (tmpBuffer); free (tmpBuffer);
Error ("DIST_PACKAGE_CORRUPTED", NULL); Error ("DIST_PACKAGE_CORRUPTED", NULL);
@ -463,7 +463,7 @@ BOOL IsSelfExtractingPackage (void)
GetModuleFileName (NULL, path, ARRAYSIZE (path)); 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(); FreeAllFileBuffers();
fileDataEndPos = (int) FindStringInFile (path, MagEndMarker, strlen (MagEndMarker)); fileDataEndPos = (int) FindStringInFile (path, MagEndMarker, (int) strlen (MagEndMarker));
if (fileDataEndPos < 0) if (fileDataEndPos < 0)
{ {
Error ("CANNOT_READ_FROM_PACKAGE", NULL); Error ("CANNOT_READ_FROM_PACKAGE", NULL);
@ -514,14 +514,14 @@ BOOL SelfExtractInMemory (wchar_t *path)
fileDataEndPos--; 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) if (fileDataStartPos < 0)
{ {
Error ("CANNOT_READ_FROM_PACKAGE", NULL); Error ("CANNOT_READ_FROM_PACKAGE", NULL);
return FALSE; return FALSE;
} }
fileDataStartPos += strlen (MAG_START_MARKER); fileDataStartPos += (int) strlen (MAG_START_MARKER);
filePos = fileDataStartPos; filePos = fileDataStartPos;