1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-11-12 13:01:09 +03:00

Support manually disabling overlapped file I/O for Windows sub-platforms other than Windows CE.

FossilOrigin-Name: b9330b887cc8bed2b6b3e6c1b269788e08ccf50d
This commit is contained in:
mistachkin
2014-12-20 22:21:49 +00:00
parent cd54bab6fe
commit d9d812fc38
3 changed files with 14 additions and 14 deletions

View File

@@ -1,5 +1,5 @@
C Minor\sfixes\sand\senhancements\sto\sthe\sSQLITE_ENABLE_API_ARMOR\sfunctionality. C Support\smanually\sdisabling\soverlapped\sfile\sI/O\sfor\sWindows\ssub-platforms\sother\sthan\sWindows\sCE.
D 2014-12-20T21:14:14.374 D 2014-12-20T22:21:49.905
F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f
F Makefile.in 6c4f961fa91d0b4fa121946a19f9e5eac2f2f809 F Makefile.in 6c4f961fa91d0b4fa121946a19f9e5eac2f2f809
F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23 F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23
@@ -214,7 +214,7 @@ F src/os.h 3e57a24e2794a94d3cf2342c6d9a884888cd96bf
F src/os_common.h 92815ed65f805560b66166e3583470ff94478f04 F src/os_common.h 92815ed65f805560b66166e3583470ff94478f04
F src/os_setup.h c9d4553b5aaa6f73391448b265b89bed0b890faa F src/os_setup.h c9d4553b5aaa6f73391448b265b89bed0b890faa
F src/os_unix.c fb587121840f690101336879adfa6d0b2cd0e8c7 F src/os_unix.c fb587121840f690101336879adfa6d0b2cd0e8c7
F src/os_win.c ecb04a0dad2fa6fa659931a9d8f0f3aca33f908a F src/os_win.c 91d3d08e33ec0258d180d4c8255492f47d15e007
F src/os_win.h 09e751b20bbc107ffbd46e13555dc73576d88e21 F src/os_win.h 09e751b20bbc107ffbd46e13555dc73576d88e21
F src/pager.c 2cbaf886a6157c53a8061ea7e677f81620ff46eb F src/pager.c 2cbaf886a6157c53a8061ea7e677f81620ff46eb
F src/pager.h c3476e7c89cdf1c6914e50a11f3714e30b4e0a77 F src/pager.h c3476e7c89cdf1c6914e50a11f3714e30b4e0a77
@@ -1234,7 +1234,7 @@ F tool/vdbe_profile.tcl 67746953071a9f8f2f668b73fe899074e2c6d8c1
F tool/warnings-clang.sh f6aa929dc20ef1f856af04a730772f59283631d4 F tool/warnings-clang.sh f6aa929dc20ef1f856af04a730772f59283631d4
F tool/warnings.sh 0abfd78ceb09b7f7c27c688c8e3fe93268a13b32 F tool/warnings.sh 0abfd78ceb09b7f7c27c688c8e3fe93268a13b32
F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f
P de50f25ce3226fa4929b8236c72c88b739859d5f P cb3e4219ac9560d2773b85453aafda54b7c9346f
R c123b89e18af5f5ce6fabce3b17d012e R ac9484154ad6b155e9718a0c54a2f6d5
U mistachkin U mistachkin
Z 086c85a234ecd6ff163dc839ee55f963 Z f0b985b941d4fc82caba937840400408

View File

@@ -1 +1 @@
cb3e4219ac9560d2773b85453aafda54b7c9346f b9330b887cc8bed2b6b3e6c1b269788e08ccf50d

View File

@@ -2479,7 +2479,7 @@ static int winRead(
int amt, /* Number of bytes to read */ int amt, /* Number of bytes to read */
sqlite3_int64 offset /* Begin reading at this offset */ sqlite3_int64 offset /* Begin reading at this offset */
){ ){
#if !SQLITE_OS_WINCE #if !SQLITE_OS_WINCE && !defined(SQLITE_WIN32_NO_OVERLAPPED)
OVERLAPPED overlapped; /* The offset for ReadFile. */ OVERLAPPED overlapped; /* The offset for ReadFile. */
#endif #endif
winFile *pFile = (winFile*)id; /* file handle */ winFile *pFile = (winFile*)id; /* file handle */
@@ -2511,7 +2511,7 @@ static int winRead(
} }
#endif #endif
#if SQLITE_OS_WINCE #if SQLITE_OS_WINCE || defined(SQLITE_WIN32_NO_OVERLAPPED)
if( winSeekFile(pFile, offset) ){ if( winSeekFile(pFile, offset) ){
OSTRACE(("READ file=%p, rc=SQLITE_FULL\n", pFile->h)); OSTRACE(("READ file=%p, rc=SQLITE_FULL\n", pFile->h));
return SQLITE_FULL; return SQLITE_FULL;
@@ -2583,13 +2583,13 @@ static int winWrite(
} }
#endif #endif
#if SQLITE_OS_WINCE #if SQLITE_OS_WINCE || defined(SQLITE_WIN32_NO_OVERLAPPED)
rc = winSeekFile(pFile, offset); rc = winSeekFile(pFile, offset);
if( rc==0 ){ if( rc==0 ){
#else #else
{ {
#endif #endif
#if !SQLITE_OS_WINCE #if !SQLITE_OS_WINCE && !defined(SQLITE_WIN32_NO_OVERLAPPED)
OVERLAPPED overlapped; /* The offset for WriteFile. */ OVERLAPPED overlapped; /* The offset for WriteFile. */
#endif #endif
u8 *aRem = (u8 *)pBuf; /* Data yet to be written */ u8 *aRem = (u8 *)pBuf; /* Data yet to be written */
@@ -2597,14 +2597,14 @@ static int winWrite(
DWORD nWrite; /* Bytes written by each WriteFile() call */ DWORD nWrite; /* Bytes written by each WriteFile() call */
DWORD lastErrno = NO_ERROR; /* Value returned by GetLastError() */ DWORD lastErrno = NO_ERROR; /* Value returned by GetLastError() */
#if !SQLITE_OS_WINCE #if !SQLITE_OS_WINCE && !defined(SQLITE_WIN32_NO_OVERLAPPED)
memset(&overlapped, 0, sizeof(OVERLAPPED)); memset(&overlapped, 0, sizeof(OVERLAPPED));
overlapped.Offset = (LONG)(offset & 0xffffffff); overlapped.Offset = (LONG)(offset & 0xffffffff);
overlapped.OffsetHigh = (LONG)((offset>>32) & 0x7fffffff); overlapped.OffsetHigh = (LONG)((offset>>32) & 0x7fffffff);
#endif #endif
while( nRem>0 ){ while( nRem>0 ){
#if SQLITE_OS_WINCE #if SQLITE_OS_WINCE || defined(SQLITE_WIN32_NO_OVERLAPPED)
if( !osWriteFile(pFile->h, aRem, nRem, &nWrite, 0) ){ if( !osWriteFile(pFile->h, aRem, nRem, &nWrite, 0) ){
#else #else
if( !osWriteFile(pFile->h, aRem, nRem, &nWrite, &overlapped) ){ if( !osWriteFile(pFile->h, aRem, nRem, &nWrite, &overlapped) ){
@@ -2617,7 +2617,7 @@ static int winWrite(
lastErrno = osGetLastError(); lastErrno = osGetLastError();
break; break;
} }
#if !SQLITE_OS_WINCE #if !SQLITE_OS_WINCE && !defined(SQLITE_WIN32_NO_OVERLAPPED)
offset += nWrite; offset += nWrite;
overlapped.Offset = (LONG)(offset & 0xffffffff); overlapped.Offset = (LONG)(offset & 0xffffffff);
overlapped.OffsetHigh = (LONG)((offset>>32) & 0x7fffffff); overlapped.OffsetHigh = (LONG)((offset>>32) & 0x7fffffff);