41 _tprintf(
_T(
"syntax: install x: [fs_type]\nwhere fs_type is fat or fat32\n"));
54 _tprintf(
_T(
"You must now copy freeldr.sys & freeldr.ini to %s.\n"),
argv[1]);
66 BYTE BootSectorBuffer[512];
67 DWORD dwNumberOfBytesWritten;
117 bRetVal =
WriteFile(hBackupFile, BootSectorBuffer, 512, &dwNumberOfBytesWritten,
NULL);
118 if (!bRetVal || (dwNumberOfBytesWritten != 512))
126 _tprintf(
_T(
"Boot sector backed up to file: %s\n"), szFileName);
135 BYTE BootSectorBuffer[512];
150 memcpy((fat_data+3), (BootSectorBuffer+3), 59 );
160 else if (
_tcsicmp(lpszVolumeType,
_T(
"fat32")) == 0)
165 memcpy((fat32_data+3), (BootSectorBuffer+3), 87 );
186 _tprintf(
_T(
"File system type %s unknown.\n"), lpszVolumeType);
190 _tprintf(
_T(
"%s boot sector installed.\n"), lpszVolumeType);
HANDLE OpenVolume(const TCHAR *Volume, BOOLEAN AllowRemote, BOOLEAN NtfsOnly)
BOOL BackupBootSector(LPCTSTR lpszVolumeName)
BOOL InstallBootSector(LPCTSTR lpszVolumeType)
BOOL ReadVolumeSector(ULONG SectorNumber, PVOID SectorBuffer)
BOOL WriteVolumeSector(ULONG SectorNumber, PVOID SectorBuffer)
#define INVALID_HANDLE_VALUE
BOOL WINAPI WriteFile(IN HANDLE hFile, IN LPCVOID lpBuffer, IN DWORD nNumberOfBytesToWrite OPTIONAL, OUT LPDWORD lpNumberOfBytesWritten, IN LPOVERLAPPED lpOverlapped OPTIONAL)
#define memcpy(s1, s2, n)
#define ERROR_ALREADY_EXISTS
DWORD WINAPI GetLastError(void)