mirror of
https://github.com/pbatard/rufus.git
synced 2025-05-27 13:14:26 -04:00
[bb] fix bad blocks check for 64 bit
* 32 bit bad blocks check is too limited for large drives and result in erroneous computations * 32 bit also means that 2TB would be absolute limit, which may be too low in case for USB HDD checks * This fix makes bad blocks check and related calls 64 bit compliant * also improve on bad block reports
This commit is contained in:
parent
3721b0a570
commit
a9c47a4922
6 changed files with 194 additions and 161 deletions
|
@ -1,27 +1,29 @@
|
|||
#ifndef FILE_H
|
||||
#define FILE_H
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
/* Max valid value of uiLen for contains_data */
|
||||
#define MAX_DATA_LEN 8192
|
||||
|
||||
/* Checks if a file contains a data pattern of length uiLen at position
|
||||
ulPositoin. The file pointer will change when calling this function! */
|
||||
int contains_data(FILE *fp, size_t ulPosition,
|
||||
const void *pData, size_t uiLen);
|
||||
/* Checks if a file contains a data pattern of length Len at position
|
||||
Position. The file pointer will change when calling this function! */
|
||||
int contains_data(FILE *fp, uint64_t Position,
|
||||
const void *pData, uint64_t Len);
|
||||
|
||||
/* Writes a data pattern of length uiLen at position ulPositoin.
|
||||
/* Writes a data pattern of length Len at position Position.
|
||||
The file pointer will change when calling this function! */
|
||||
int write_data(FILE *fp, size_t ulPosition,
|
||||
const void *pData, size_t uiLen);
|
||||
int write_data(FILE *fp, uint64_t Position,
|
||||
const void *pData, uint64_t Len);
|
||||
|
||||
/* Writes nSectors of size SectorSize starting at sector StartSector */
|
||||
int write_sectors(void *hDrive, size_t SectorSize,
|
||||
size_t StartSector, size_t nSectors,
|
||||
const void *pBuf);
|
||||
int64_t write_sectors(void *hDrive, uint64_t SectorSize,
|
||||
uint64_t StartSector, uint64_t nSectors,
|
||||
const void *pBuf);
|
||||
|
||||
/* Reads nSectors of size SectorSize starting at sector StartSector */
|
||||
int read_sectors(void *hDrive, size_t SectorSize,
|
||||
size_t StartSector, size_t nSectors,
|
||||
void *pBuf);
|
||||
int64_t read_sectors(void *hDrive, uint64_t SectorSize,
|
||||
uint64_t StartSector, uint64_t nSectors,
|
||||
void *pBuf);
|
||||
|
||||
#endif
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue