[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:
Pete Batard 2015-08-10 23:19:57 +01:00
parent b854f70bae
commit 5004374277
37 changed files with 199 additions and 141 deletions

View file

@ -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;