/ Check-in [2c03d8b8]
Login

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

Overview
Comment:Use the updated Win32 VFS semantics for winOpen from check-in [5d03c738e9] for WinRT, et al, as well.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: 2c03d8b8f028b6a736aaf2cf8b28a51b3434cf341c95cf3a80469e0a24acdd98
User & Date: mistachkin 2017-09-22 16:23:23
Context
2017-09-25
09:37
Add an extra snapshot related test case. check-in: 24a95e14 user: dan tags: trunk
2017-09-23
07:46
Experimental change so that snapshot transactions always lock the wal file - preventing writers or truncate-checkpointers from wrapping it. Closed-Leaf check-in: d71eeaab user: dan tags: snapshots-lock-wal
2017-09-22
20:18
Merge in all the trunk enhancements of the previous 7 months. The LIKE optimization has stopped working when there is an ESCAPE - that problem will be addressed in a subsequent check-in. Leaf check-in: 8d2a1cca user: drh tags: est_count_pragma
16:23
Use the updated Win32 VFS semantics for winOpen from check-in [5d03c738e9] for WinRT, et al, as well. check-in: 2c03d8b8 user: mistachkin tags: trunk
12:52
Partial backout of check-in [e0af9a904076]. It turns out we do need some extra space at the end of the record blob as an overrun area to use when decoding a maliciously malformed record. check-in: 403b88a8 user: drh tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/os_win.c.

  5059   5059       extendedParameters.dwSize = sizeof(CREATEFILE2_EXTENDED_PARAMETERS);
  5060   5060       extendedParameters.dwFileAttributes =
  5061   5061               dwFlagsAndAttributes & FILE_ATTRIBUTE_MASK;
  5062   5062       extendedParameters.dwFileFlags = dwFlagsAndAttributes & FILE_FLAG_MASK;
  5063   5063       extendedParameters.dwSecurityQosFlags = SECURITY_ANONYMOUS;
  5064   5064       extendedParameters.lpSecurityAttributes = NULL;
  5065   5065       extendedParameters.hTemplateFile = NULL;
  5066         -    while( (h = osCreateFile2((LPCWSTR)zConverted,
  5067         -                              dwDesiredAccess,
  5068         -                              dwShareMode,
  5069         -                              dwCreationDisposition,
  5070         -                              &extendedParameters))==INVALID_HANDLE_VALUE &&
  5071         -                              winRetryIoerr(&cnt, &lastErrno) ){
  5072         -               /* Noop */
  5073         -    }
         5066  +    do{
         5067  +      h = osCreateFile2((LPCWSTR)zConverted,
         5068  +                        dwDesiredAccess,
         5069  +                        dwShareMode,
         5070  +                        dwCreationDisposition,
         5071  +                        &extendedParameters);
         5072  +      if( h!=INVALID_HANDLE_VALUE ) break;
         5073  +      if( isReadWrite ){
         5074  +        int isRO = 0;
         5075  +        int rc2 = winAccess(pVfs, zName, SQLITE_ACCESS_READ, &isRO);
         5076  +        if( rc2==SQLITE_OK && isRO ) break;
         5077  +      }
         5078  +    }while( winRetryIoerr(&cnt, &lastErrno) );
  5074   5079   #else
  5075   5080       do{
  5076   5081         h = osCreateFileW((LPCWSTR)zConverted,
  5077   5082                           dwDesiredAccess,
  5078   5083                           dwShareMode, NULL,
  5079   5084                           dwCreationDisposition,
  5080   5085                           dwFlagsAndAttributes,
................................................................................
  5086   5091           if( rc2==SQLITE_OK && isRO ) break;
  5087   5092         }
  5088   5093       }while( winRetryIoerr(&cnt, &lastErrno) );
  5089   5094   #endif
  5090   5095     }
  5091   5096   #ifdef SQLITE_WIN32_HAS_ANSI
  5092   5097     else{
  5093         -    while( (h = osCreateFileA((LPCSTR)zConverted,
  5094         -                              dwDesiredAccess,
  5095         -                              dwShareMode, NULL,
  5096         -                              dwCreationDisposition,
  5097         -                              dwFlagsAndAttributes,
  5098         -                              NULL))==INVALID_HANDLE_VALUE &&
  5099         -                              winRetryIoerr(&cnt, &lastErrno) ){
  5100         -               /* Noop */
  5101         -    }
         5098  +    do{
         5099  +      h = osCreateFileA((LPCSTR)zConverted,
         5100  +                        dwDesiredAccess,
         5101  +                        dwShareMode, NULL,
         5102  +                        dwCreationDisposition,
         5103  +                        dwFlagsAndAttributes,
         5104  +                        NULL);
         5105  +      if( h!=INVALID_HANDLE_VALUE ) break;
         5106  +      if( isReadWrite ){
         5107  +        int isRO = 0;
         5108  +        int rc2 = winAccess(pVfs, zName, SQLITE_ACCESS_READ, &isRO);
         5109  +        if( rc2==SQLITE_OK && isRO ) break;
         5110  +      }
         5111  +    }while( winRetryIoerr(&cnt, &lastErrno) );
  5102   5112     }
  5103   5113   #endif
  5104   5114     winLogIoerr(cnt, __LINE__);
  5105   5115   
  5106   5116     OSTRACE(("OPEN file=%p, name=%s, access=%lx, rc=%s\n", h, zUtf8Name,
  5107   5117              dwDesiredAccess, (h==INVALID_HANDLE_VALUE) ? "failed" : "ok"));
  5108   5118