-C Merge\supdates\sfrom\strunk.
-D 2017-01-13T22:21:39.681
+C When\sdetermining\ssector\ssizes\son\sWindows\s7\sand\sVista,\smake\ssure\sthe\starget\sfile\sis\son\sthe\ssame\svolume\sas\scorresponding\sroot\sdirectory.
+D 2017-01-18T00:27:09.238
F Makefile.in 41bd4cad981487345c4a84081074bcdb876e4b2e
F Makefile.linux-gcc 7bc79876b875010e8c8f9502eb935ca92aa3c434
F Makefile.msc b8ca53350ae545e3562403d5da2a69cec79308da
F src/os_common.h b2f4707a603e36811d9b1a13278bffd757857b85
F src/os_setup.h 0dbaea40a7d36bf311613d31342e0b99e2536586
F src/os_unix.c 30e2c43e4955db990e5b5a81e901f8aa74cc8820
-F src/os_win.c 9fbb3876ef282302ef6df6471900f283f3e4b13b
+F src/os_win.c 3f683f1905763c164b86defac39d26d385e51337
F src/os_win.h 7b073010f1451abe501be30d12f6bc599824944a
F src/pager.c 9dc72d23eebbdf992bd69f2ab954d0d3a27c7340
F src/pager.h d1e944291030351f362a0a7da9b5c3e34e603e39
F vsixtest/vsixtest.vcxproj.data 2ed517e100c66dc455b492e1a33350c1b20fbcdc
F vsixtest/vsixtest.vcxproj.filters 37e51ffedcdb064aad6ff33b6148725226cd608e
F vsixtest/vsixtest_TemporaryKey.pfx e5b1b036facdb453873e7084e1cae9102ccc67a0
-P 6e388423c492c52aef221bd14f66482e0365d86d 97914266cb4ec63b0c9185ab139673139bd2f0ed
-R f0d2b77c6b50a6ed012f904a1192a950
+P 8b42b8e31af03e82c091d4585d03f4edf49c0af9
+R 54c7eca6d191dae8a7d69c2ecb72fa12
U mistachkin
-Z 65e45b71c22d7b500900d481cc9e7fd9
+Z 1bce5ab5842f735fc55be60d9204e773
HANDLE,DWORD,LPVOID,DWORD,LPVOID,DWORD,LPVOID, \
LPOVERLAPPED))aSyscall[80].pCurrent)
+#if defined(_WIN32_WINNT) && _WIN32_WINNT >= _WIN32_WINNT_VISTA
+ { "GetVolumeInformationByHandleW", (SYSCALL)GetVolumeInformationByHandleW, 0 },
+#else
+ { "GetVolumeInformationByHandleW", (SYSCALL)0, 0 },
+#endif
+
+#define osGetVolumeInformationByHandleW ((BOOL(WINAPI*)( \
+ HANDLE,LPWSTR,DWORD,LPDWORD,LPDWORD,LPDWORD,LPWSTR, \
+ DWORD))aSyscall[81].pCurrent)
+
+#if defined(_WIN32_WINNT) && _WIN32_WINNT >= _WIN32_WINNT_VISTA
+ { "GetVolumeInformationW", (SYSCALL)GetVolumeInformationW, 0 },
+#else
+ { "GetVolumeInformationW", (SYSCALL)0, 0 },
+#endif
+
+#define osGetVolumeInformationW ((BOOL(WINAPI*)( \
+ LPCWSTR,LPWSTR,DWORD,LPDWORD,LPDWORD,LPDWORD,LPWSTR, \
+ DWORD))aSyscall[82].pCurrent)
+
}; /* End of the overrideable system calls */
/*
return SQLITE_NOTFOUND;
}
+#if defined(_WIN32_WINNT) && _WIN32_WINNT >= _WIN32_WINNT_VISTA
+/*
+** This function attempts to determine if the specified file resides on the
+** same volume as the corresponding root directory. If not, the specified
+** file may be impacted by a hard link, symbolic link, or reparse point (e.g.
+** junction).
+**
+** This function may return false even when the file is on the same volume
+** as the corresponding root directory. This function may return true only
+** when there is no doubt that the specified file is on the same volume as
+** the corresponding root directory associated with the volume.
+*/
+static BOOL winIsOnSameVolume(winFile *pFile){
+ WCHAR zRoot[] = L"_:\\\0"; /* underscore will be drive letter */
+ DWORD dwFileVolumeSerialNumber = 0;
+ DWORD dwRootVolumeSerialNumber = 0;
+
+ if ( !osGetVolumeInformationByHandleW(pFile->h, NULL, 0,
+ &dwFileVolumeSerialNumber, NULL,
+ NULL, NULL, 0) ){
+ return FALSE;
+ }
+ zRoot[0] = (WCHAR)pFile->zPath[0]; /* 'A' to 'Z' only, upper/lower case */
+ if( !osGetVolumeInformationW(zRoot, NULL, 0, &dwRootVolumeSerialNumber,
+ NULL, NULL, NULL, 0) ){
+ return FALSE;
+ }
+ return (dwFileVolumeSerialNumber == dwRootVolumeSerialNumber);
+}
+#endif
+
/*
** Return the sector size in bytes of the underlying block device for
** the specified file. This is almost always 512 bytes, but may be
}
#elif defined(_WIN32_WINNT) && _WIN32_WINNT >= _WIN32_WINNT_VISTA
winFile *pFile = (winFile*)id;
- if( winIsDriveLetterAndColon(pFile->zPath) ){
+ 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 */
/* Double-check that the aSyscall[] array has been constructed
** correctly. See ticket [bb3a86e890c8e96ab] */
- assert( ArraySize(aSyscall)==81 );
+ assert( ArraySize(aSyscall)==83 );
/* get memory map allocation granularity */
memset(&winSysInfo, 0, sizeof(SYSTEM_INFO));