mirror of
https://github.com/pbatard/rufus.git
synced 2025-05-31 23:08:26 -04:00
[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.
This commit is contained in:
parent
b854f70bae
commit
5004374277
37 changed files with 199 additions and 141 deletions
|
@ -89,19 +89,20 @@ int64_t read_sectors(HANDLE hDrive, uint64_t SectorSize,
|
|||
}
|
||||
|
||||
/*
|
||||
* The following calls use a bastardized fp on Windows that contains:
|
||||
* fp->_ptr: a Windows handle
|
||||
* fp->_bufsiz: the sector size
|
||||
* fp->_cnt: a file offset
|
||||
* The following calls use a hijacked fp on Windows that contains:
|
||||
* fp->_handle: a Windows handle
|
||||
* fp->_sector_size: the sector size
|
||||
* fp->_offset: a file offset
|
||||
*/
|
||||
int contains_data(FILE *fp, uint64_t Position,
|
||||
const void *pData, uint64_t Len)
|
||||
{
|
||||
unsigned char aucBuf[MAX_DATA_LEN];
|
||||
HANDLE hDrive = (HANDLE)fp->_ptr;
|
||||
uint64_t SectorSize = (uint64_t)fp->_bufsiz;
|
||||
FAKE_FD* fd = (FAKE_FD*)fp;
|
||||
HANDLE hDrive = (HANDLE)fd->_handle;
|
||||
uint64_t SectorSize = (uint64_t)fd->_sector_size;
|
||||
uint64_t StartSector, EndSector, NumSectors;
|
||||
Position += (uint64_t)fp->_cnt;
|
||||
Position += fd->_offset;
|
||||
|
||||
StartSector = Position/SectorSize;
|
||||
EndSector = (Position+Len+SectorSize-1)/SectorSize;
|
||||
|
@ -133,10 +134,11 @@ int write_data(FILE *fp, uint64_t Position,
|
|||
const void *pData, uint64_t Len)
|
||||
{
|
||||
unsigned char aucBuf[MAX_DATA_LEN];
|
||||
HANDLE hDrive = (HANDLE)fp->_ptr;
|
||||
uint64_t SectorSize = (uint64_t)fp->_bufsiz;
|
||||
FAKE_FD* fd = (FAKE_FD*)fp;
|
||||
HANDLE hDrive = (HANDLE)fd->_handle;
|
||||
uint64_t SectorSize = (uint64_t)fd->_sector_size;
|
||||
uint64_t StartSector, EndSector, NumSectors;
|
||||
Position += (uint64_t)fp->_cnt;
|
||||
Position += fd->_offset;
|
||||
|
||||
StartSector = Position/SectorSize;
|
||||
EndSector = (Position+Len+SectorSize-1)/SectorSize;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue