rufus/src/ms-sys/inc/file.h
Pete Batard 5004374277 [misc] update to VS2015 and fix VS code analysis issues
* Also update Bled to latest, as well as build scripts
* Note: Considering that Visual Studio 2015 is both freely and legally
  available for anyone who wants to use it to compile Rufus, starting
  with this commit, I will NOT be supporting any other version of Visual
  Studio but 2015.
2015-08-10 23:30:23 +01:00

36 lines
1.2 KiB
C

#ifndef FILE_H
#define FILE_H
#include <stdint.h>
/* Max valid value of uiLen for contains_data */
#define MAX_DATA_LEN 32768
/* We hijack the FILE structure for our own needs */
typedef struct {
void *_handle;
uint64_t _offset;
uint32_t _sector_size;
} FAKE_FD;
/* 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 Len at position Position.
The file pointer will change when calling this function! */
int write_data(FILE *fp, uint64_t Position,
const void *pData, uint64_t Len);
/* Writes nSectors of size SectorSize starting at sector StartSector */
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 */
int64_t read_sectors(void *hDrive, uint64_t SectorSize,
uint64_t StartSector, uint64_t nSectors,
void *pBuf);
#endif