Copy second sector of the fat32 bootsector instead of the fat(12/16) bootsector.

Fixed several compiler warnings.

svn path=/trunk/; revision=4046
This commit is contained in:
Eric Kohl 2003-01-19 17:01:38 +00:00
parent ac0965daf7
commit 3960f23e28
2 changed files with 9 additions and 9 deletions

View file

@ -71,7 +71,7 @@ BOOL BackupBootSector(LPCTSTR lpszVolumeName)
// //
// Generate the next filename // 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 // Try to create a new file, fail if exists
@ -93,7 +93,7 @@ BOOL BackupBootSector(LPCTSTR lpszVolumeName)
if (!(GetLastError() != ERROR_ALREADY_EXISTS)) if (!(GetLastError() != ERROR_ALREADY_EXISTS))
{ {
_tprintf(_T("%s:%d: "), __FILE__, __LINE__); _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; return FALSE;
} }
} }
@ -115,7 +115,7 @@ BOOL BackupBootSector(LPCTSTR lpszVolumeName)
{ {
CloseHandle(hBackupFile); CloseHandle(hBackupFile);
_tprintf(_T("%s:%d: "), __FILE__, __LINE__); _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; return FALSE;
} }
@ -171,7 +171,7 @@ BOOL InstallBootSector(LPCTSTR lpszVolumeType)
// //
// Write out new extra sector // Write out new extra sector
// //
if (!WriteVolumeSector(14, (fat_data+512) )) if (!WriteVolumeSector(14, (fat32_data+512)))
{ {
return FALSE; return FALSE;
} }

View file

@ -58,7 +58,7 @@ BOOL OpenVolume(LPCTSTR lpszVolumeName)
if (hDiskVolume == INVALID_HANDLE_VALUE) if (hDiskVolume == INVALID_HANDLE_VALUE)
{ {
_tprintf(_T("%s:%d: "), __FILE__, __LINE__); _tprintf(_T("%s:%d: "), __FILE__, __LINE__);
_tprintf(_T("Failed. Error code %d.\n"), GetLastError()); _tprintf(_T("Failed. Error code %ld.\n"), GetLastError());
return FALSE; return FALSE;
} }
@ -87,7 +87,7 @@ BOOL ReadVolumeSector(ULONG SectorNumber, PVOID SectorBuffer)
if (dwFilePosition != (SectorNumber * 512)) if (dwFilePosition != (SectorNumber * 512))
{ {
_tprintf(_T("%s:%d: "), __FILE__, __LINE__); _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; return FALSE;
} }
@ -95,7 +95,7 @@ BOOL ReadVolumeSector(ULONG SectorNumber, PVOID SectorBuffer)
if (!bRetVal || (dwNumberOfBytesRead != 512)) if (!bRetVal || (dwNumberOfBytesRead != 512))
{ {
_tprintf(_T("%s:%d: "), __FILE__, __LINE__); _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; return FALSE;
} }
@ -119,7 +119,7 @@ BOOL WriteVolumeSector(ULONG SectorNumber, PVOID SectorBuffer)
if (dwFilePosition != (SectorNumber * 512)) if (dwFilePosition != (SectorNumber * 512))
{ {
_tprintf(_T("%s:%d: "), __FILE__, __LINE__); _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; return FALSE;
} }
@ -127,7 +127,7 @@ BOOL WriteVolumeSector(ULONG SectorNumber, PVOID SectorBuffer)
if (!bRetVal || (dwNumberOfBytesWritten != 512)) if (!bRetVal || (dwNumberOfBytesWritten != 512))
{ {
_tprintf(_T("%s:%d: "), __FILE__, __LINE__); _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; return FALSE;
} }