SQLite

Check-in [47beb55c5b]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:For Windows 8.x and higher, require the SQLITE_WIN32_WIN8_SECTOR_SIZE compile-time option in order to enable sector size determination.
Downloads: Tarball | ZIP archive
Timelines: family | ancestors | winSectorSize
Files: files | file ages | folders
SHA1: 47beb55c5bf3baa7a430c2f9bbd7ba9c19346d91
User & Date: mistachkin 2017-01-18 23:12:27.503
Context
2017-01-18
23:12
For Windows 8.x and higher, require the SQLITE_WIN32_WIN8_SECTOR_SIZE compile-time option in order to enable sector size determination. (Leaf check-in: 47beb55c5b user: mistachkin tags: winSectorSize)
19:36
Improve and update comments. (check-in: 2dc16d345b user: mistachkin tags: winSectorSize)
Changes
Unified Diff Ignore Whitespace Patch
Changes to src/os_win.c.
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
#else
  { "SetFilePointerEx",        (SYSCALL)0,                       0 },
#endif

#define osSetFilePointerEx ((BOOL(WINAPI*)(HANDLE,LARGE_INTEGER, \
        PLARGE_INTEGER,DWORD))aSyscall[65].pCurrent)

#if SQLITE_OS_WINRT || (defined(_WIN32_WINNT) && \
        _WIN32_WINNT >= _WIN32_WINNT_WIN8)
  { "GetFileInformationByHandleEx", (SYSCALL)GetFileInformationByHandleEx, 0 },
#else
  { "GetFileInformationByHandleEx", (SYSCALL)0,                  0 },
#endif

#define osGetFileInformationByHandleEx ((BOOL(WINAPI*)(HANDLE, \
        FILE_INFO_BY_HANDLE_CLASS,LPVOID,DWORD))aSyscall[66].pCurrent)







|
|







1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
#else
  { "SetFilePointerEx",        (SYSCALL)0,                       0 },
#endif

#define osSetFilePointerEx ((BOOL(WINAPI*)(HANDLE,LARGE_INTEGER, \
        PLARGE_INTEGER,DWORD))aSyscall[65].pCurrent)

#if SQLITE_OS_WINRT || (defined(SQLITE_WIN32_WIN8_SECTOR_SIZE) && \
        defined(_WIN32_WINNT) && _WIN32_WINNT >= _WIN32_WINNT_WIN8)
  { "GetFileInformationByHandleEx", (SYSCALL)GetFileInformationByHandleEx, 0 },
#else
  { "GetFileInformationByHandleEx", (SYSCALL)0,                  0 },
#endif

#define osGetFileInformationByHandleEx ((BOOL(WINAPI*)(HANDLE, \
        FILE_INFO_BY_HANDLE_CLASS,LPVOID,DWORD))aSyscall[66].pCurrent)
3680
3681
3682
3683
3684
3685
3686

3687
3688
3689
3690
3691
3692
3693
3694
**
** SQLite code assumes this function cannot fail. It also assumes that
** if two files are created in the same file-system directory (i.e.
** a database and its journal file) that the sector size will be the
** same for both.
*/
static int winSectorSize(sqlite3_file *id){

#if defined(_WIN32_WINNT) && _WIN32_WINNT >= _WIN32_WINNT_WIN8
  if( osIsWin8Plus() ){
    winFile *pFile = (winFile*)id;
    FILE_STORAGE_INFO info;
    memset(&info, 0, sizeof(FILE_STORAGE_INFO));
    if( osGetFileInformationByHandleEx(pFile->h, FileStorageInfo,
                                       &info, sizeof(info)) ){
      ULONG size = info.FileSystemEffectivePhysicalBytesPerSectorForAtomicity;







>
|







3680
3681
3682
3683
3684
3685
3686
3687
3688
3689
3690
3691
3692
3693
3694
3695
**
** SQLite code assumes this function cannot fail. It also assumes that
** if two files are created in the same file-system directory (i.e.
** a database and its journal file) that the sector size will be the
** same for both.
*/
static int winSectorSize(sqlite3_file *id){
#if defined(SQLITE_WIN32_WIN8_SECTOR_SIZE) && \
    defined(_WIN32_WINNT) && _WIN32_WINNT >= _WIN32_WINNT_WIN8
  if( osIsWin8Plus() ){
    winFile *pFile = (winFile*)id;
    FILE_STORAGE_INFO info;
    memset(&info, 0, sizeof(FILE_STORAGE_INFO));
    if( osGetFileInformationByHandleEx(pFile->h, FileStorageInfo,
                                       &info, sizeof(info)) ){
      ULONG size = info.FileSystemEffectivePhysicalBytesPerSectorForAtomicity;