/ Check-in [8d429a59]
Login
SQLite training in Houston TX on 2019-11-05 (details)
Part of the 2019 Tcl Conference

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

Overview
Comment:Minimize the requested permissions when opening the volume on Windows 7 and Vista.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | winSectorSize
Files: files | file ages | folders
SHA1: 8d429a59cdad1693827b41369d642f9486c01155
User & Date: mistachkin 2017-01-18 19:06:41
Context
2017-01-18
19:36
Improve and update comments. check-in: 2dc16d34 user: mistachkin tags: winSectorSize
19:06
Minimize the requested permissions when opening the volume on Windows 7 and Vista. check-in: 8d429a59 user: mistachkin tags: winSectorSize
01:11
Add runtime version checking for winSectorSize. check-in: cb9d1ab3 user: mistachkin tags: winSectorSize
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to src/os_win.c.

3697
3698
3699
3700
3701
3702
3703
3704
3705
3706
3707
3708
3709
3710
3711
3712
    if( winIsDriveLetterAndColon(pFile->zPath) && winIsOnSameVolume(pFile) ){
      WCHAR zDisk[] = L"\\\\.\\_:\0"; /* underscore will be drive letter */
      HANDLE hDisk;
      zDisk[4] = (WCHAR)pFile->zPath[0]; /* 'A' to 'Z' only, upper/lower case */
      assert( (zDisk[4]>=L'A' && zDisk[4]<=L'Z')
           || (zDisk[4]>=L'a' && zDisk[4]<=L'z')
      );
      hDisk = osCreateFileW(zDisk, STANDARD_RIGHTS_READ,
                            FILE_SHARE_READ | FILE_SHARE_WRITE, NULL,
                            OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
      if( hDisk!=NULL ){
        STORAGE_PROPERTY_QUERY query;
        STORAGE_ACCESS_ALIGNMENT_DESCRIPTOR alignment;
        DWORD bytes = 0;
        memset(&query, 0, sizeof(STORAGE_PROPERTY_QUERY));
        memset(&alignment, 0, sizeof(STORAGE_ACCESS_ALIGNMENT_DESCRIPTOR));







<
|







3697
3698
3699
3700
3701
3702
3703

3704
3705
3706
3707
3708
3709
3710
3711
    if( winIsDriveLetterAndColon(pFile->zPath) && winIsOnSameVolume(pFile) ){
      WCHAR zDisk[] = L"\\\\.\\_:\0"; /* underscore will be drive letter */
      HANDLE hDisk;
      zDisk[4] = (WCHAR)pFile->zPath[0]; /* 'A' to 'Z' only, upper/lower case */
      assert( (zDisk[4]>=L'A' && zDisk[4]<=L'Z')
           || (zDisk[4]>=L'a' && zDisk[4]<=L'z')
      );

      hDisk = osCreateFileW(zDisk, 0, FILE_SHARE_READ | FILE_SHARE_WRITE, NULL,
                            OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
      if( hDisk!=NULL ){
        STORAGE_PROPERTY_QUERY query;
        STORAGE_ACCESS_ALIGNMENT_DESCRIPTOR alignment;
        DWORD bytes = 0;
        memset(&query, 0, sizeof(STORAGE_PROPERTY_QUERY));
        memset(&alignment, 0, sizeof(STORAGE_ACCESS_ALIGNMENT_DESCRIPTOR));