diff --git a/freeldr/install/install.c b/freeldr/install/install.c index 536dd49ff91..8156f7c5d21 100644 --- a/freeldr/install/install.c +++ b/freeldr/install/install.c @@ -71,7 +71,7 @@ BOOL BackupBootSector(LPCTSTR lpszVolumeName) // // Generate the next filename // - _stprintf(szFileName, _T("%s\\bootsect.%03d"), lpszVolumeName, Count); + _stprintf(szFileName, _T("%s\\bootsect.%03ld"), lpszVolumeName, Count); // // Try to create a new file, fail if exists @@ -93,7 +93,7 @@ BOOL BackupBootSector(LPCTSTR lpszVolumeName) if (!(GetLastError() != ERROR_ALREADY_EXISTS)) { _tprintf(_T("%s:%d: "), __FILE__, __LINE__); - _tprintf(_T("Boot sector backup failed. Error code %d.\n"), GetLastError()); + _tprintf(_T("Boot sector backup failed. Error code %ld.\n"), GetLastError()); return FALSE; } } @@ -115,7 +115,7 @@ BOOL BackupBootSector(LPCTSTR lpszVolumeName) { CloseHandle(hBackupFile); _tprintf(_T("%s:%d: "), __FILE__, __LINE__); - _tprintf(_T("WriteFile() failed. Error code %d.\n"), GetLastError()); + _tprintf(_T("WriteFile() failed. Error code %ld.\n"), GetLastError()); return FALSE; } @@ -171,7 +171,7 @@ BOOL InstallBootSector(LPCTSTR lpszVolumeType) // // Write out new extra sector // - if (!WriteVolumeSector(14, (fat_data+512) )) + if (!WriteVolumeSector(14, (fat32_data+512))) { return FALSE; } diff --git a/freeldr/install/volume.c b/freeldr/install/volume.c index 43a9dd3a762..373fc4d9634 100644 --- a/freeldr/install/volume.c +++ b/freeldr/install/volume.c @@ -58,7 +58,7 @@ BOOL OpenVolume(LPCTSTR lpszVolumeName) if (hDiskVolume == INVALID_HANDLE_VALUE) { _tprintf(_T("%s:%d: "), __FILE__, __LINE__); - _tprintf(_T("Failed. Error code %d.\n"), GetLastError()); + _tprintf(_T("Failed. Error code %ld.\n"), GetLastError()); return FALSE; } @@ -87,7 +87,7 @@ BOOL ReadVolumeSector(ULONG SectorNumber, PVOID SectorBuffer) if (dwFilePosition != (SectorNumber * 512)) { _tprintf(_T("%s:%d: "), __FILE__, __LINE__); - _tprintf(_T("SetFilePointer() failed. Error code %d.\n"), GetLastError()); + _tprintf(_T("SetFilePointer() failed. Error code %ld.\n"), GetLastError()); return FALSE; } @@ -95,7 +95,7 @@ BOOL ReadVolumeSector(ULONG SectorNumber, PVOID SectorBuffer) if (!bRetVal || (dwNumberOfBytesRead != 512)) { _tprintf(_T("%s:%d: "), __FILE__, __LINE__); - _tprintf(_T("ReadFile() failed. Error code %d.\n"), GetLastError()); + _tprintf(_T("ReadFile() failed. Error code %ld.\n"), GetLastError()); return FALSE; } @@ -119,7 +119,7 @@ BOOL WriteVolumeSector(ULONG SectorNumber, PVOID SectorBuffer) if (dwFilePosition != (SectorNumber * 512)) { _tprintf(_T("%s:%d: "), __FILE__, __LINE__); - _tprintf(_T("SetFilePointer() failed. Error code %d.\n"), GetLastError()); + _tprintf(_T("SetFilePointer() failed. Error code %ld.\n"), GetLastError()); return FALSE; } @@ -127,7 +127,7 @@ BOOL WriteVolumeSector(ULONG SectorNumber, PVOID SectorBuffer) if (!bRetVal || (dwNumberOfBytesWritten != 512)) { _tprintf(_T("%s:%d: "), __FILE__, __LINE__); - _tprintf(_T("WriteFile() failed. Error code %d.\n"), GetLastError()); + _tprintf(_T("WriteFile() failed. Error code %ld.\n"), GetLastError()); return FALSE; }