From: mistachkin Date: Fri, 22 Sep 2017 16:23:23 +0000 (+0000) Subject: Use the updated Win32 VFS semantics for winOpen from check-in [5d03c738e9] for WinRT... X-Git-Tag: version-3.21.0~62 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=3314062b9d710f64e03638d1a6d48e9bb3ae7d98;p=thirdparty%2Fsqlite.git Use the updated Win32 VFS semantics for winOpen from check-in [5d03c738e9] for WinRT, et al, as well. FossilOrigin-Name: 2c03d8b8f028b6a736aaf2cf8b28a51b3434cf341c95cf3a80469e0a24acdd98 --- diff --git a/manifest b/manifest index 35282026af..1938515870 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Partial\sbackout\sof\scheck-in\s[e0af9a904076].\s\sIt\sturns\sout\swe\sdo\sneed\ssome\nextra\sspace\sat\sthe\send\sof\sthe\srecord\sblob\sas\san\soverrun\sarea\sto\suse\swhen\ndecoding\sa\smaliciously\smalformed\srecord. -D 2017-09-22T12:52:31.525 +C Use\sthe\supdated\sWin32\sVFS\ssemantics\sfor\swinOpen\sfrom\scheck-in\s[5d03c738e9]\sfor\sWinRT,\set\sal,\sas\swell. +D 2017-09-22T16:23:23.946 F Makefile.in 4bc36d913c2e3e2d326d588d72f618ac9788b2fd4b7efda61102611a6495c3ff F Makefile.linux-gcc 7bc79876b875010e8c8f9502eb935ca92aa3c434 F Makefile.msc 6033b51b6aea702ea059f6ab2d47b1d3cef648695f787247dd4fb395fe60673f @@ -443,7 +443,7 @@ F src/os.h 8e976e59eb4ca1c0fca6d35ee803e38951cb0343 F src/os_common.h b2f4707a603e36811d9b1a13278bffd757857b85 F src/os_setup.h 0dbaea40a7d36bf311613d31342e0b99e2536586 F src/os_unix.c 3984fc069df59e26f000e30609611cecdb4e93293e6ee52313a473a7e874af1b -F src/os_win.c 5c802f05e706c87c6e4cc6e9527f3364c7a7178458f93dffa5e19ac2e8eef9c1 +F src/os_win.c 6892c3ff23b7886577e47f13d827ca220c0831bae3ce00eea8c258352692f8c6 F src/os_win.h 7b073010f1451abe501be30d12f6bc599824944a F src/pager.c 2aa56a99bb13128d9102e84c7a9f835e546cbb58f0861d481bc3db32973b1628 F src/pager.h 581698f2177e8bd4008fe4760898ce20b6133d1df22139b9101b5155f900df7a @@ -1655,8 +1655,7 @@ F vsixtest/vsixtest.tcl 6a9a6ab600c25a91a7acc6293828957a386a8a93 F vsixtest/vsixtest.vcxproj.data 2ed517e100c66dc455b492e1a33350c1b20fbcdc F vsixtest/vsixtest.vcxproj.filters 37e51ffedcdb064aad6ff33b6148725226cd608e F vsixtest/vsixtest_TemporaryKey.pfx e5b1b036facdb453873e7084e1cae9102ccc67a0 -P 0a12915b373cd0491a58d8f7a645711c620c70efced623e6b40aa01f23284157 -Q -e0af9a9040768adf8bba42a8780adeb6304bc442afb1f35d239d019db1624f40 -R 2559539454c3155961a04b42be8e4a30 -U drh -Z df9a1372bda63aba20d2b49e01e54f8d +P 403b88a894d877b85bcc33133abad06c3c576e4928de4a4b0c091f74c4015355 +R 7f08f0df04c939d1dd5a187c9ae3cc49 +U mistachkin +Z 321f82ff3326ba269549cfe661409f34 diff --git a/manifest.uuid b/manifest.uuid index d0bf777cd9..04153e1aac 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -403b88a894d877b85bcc33133abad06c3c576e4928de4a4b0c091f74c4015355 \ No newline at end of file +2c03d8b8f028b6a736aaf2cf8b28a51b3434cf341c95cf3a80469e0a24acdd98 \ No newline at end of file diff --git a/src/os_win.c b/src/os_win.c index 4c026c5c39..245a86045b 100644 --- a/src/os_win.c +++ b/src/os_win.c @@ -5063,14 +5063,19 @@ static int winOpen( extendedParameters.dwSecurityQosFlags = SECURITY_ANONYMOUS; extendedParameters.lpSecurityAttributes = NULL; extendedParameters.hTemplateFile = NULL; - while( (h = osCreateFile2((LPCWSTR)zConverted, - dwDesiredAccess, - dwShareMode, - dwCreationDisposition, - &extendedParameters))==INVALID_HANDLE_VALUE && - winRetryIoerr(&cnt, &lastErrno) ){ - /* Noop */ - } + do{ + h = osCreateFile2((LPCWSTR)zConverted, + dwDesiredAccess, + dwShareMode, + dwCreationDisposition, + &extendedParameters); + if( h!=INVALID_HANDLE_VALUE ) break; + if( isReadWrite ){ + int isRO = 0; + int rc2 = winAccess(pVfs, zName, SQLITE_ACCESS_READ, &isRO); + if( rc2==SQLITE_OK && isRO ) break; + } + }while( winRetryIoerr(&cnt, &lastErrno) ); #else do{ h = osCreateFileW((LPCWSTR)zConverted, @@ -5090,15 +5095,20 @@ static int winOpen( } #ifdef SQLITE_WIN32_HAS_ANSI else{ - while( (h = osCreateFileA((LPCSTR)zConverted, - dwDesiredAccess, - dwShareMode, NULL, - dwCreationDisposition, - dwFlagsAndAttributes, - NULL))==INVALID_HANDLE_VALUE && - winRetryIoerr(&cnt, &lastErrno) ){ - /* Noop */ - } + do{ + h = osCreateFileA((LPCSTR)zConverted, + dwDesiredAccess, + dwShareMode, NULL, + dwCreationDisposition, + dwFlagsAndAttributes, + NULL); + if( h!=INVALID_HANDLE_VALUE ) break; + if( isReadWrite ){ + int isRO = 0; + int rc2 = winAccess(pVfs, zName, SQLITE_ACCESS_READ, &isRO); + if( rc2==SQLITE_OK && isRO ) break; + } + }while( winRetryIoerr(&cnt, &lastErrno) ); } #endif winLogIoerr(cnt, __LINE__);