1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-11-14 00:22:38 +03:00

Use SetFilePointerEx() instead of SetFilePointer() on winRT.

FossilOrigin-Name: 36efafc618017b6448f222776d0143e5f98d1e65
This commit is contained in:
drh
2012-03-01 22:06:30 +00:00
parent 7acec68a6e
commit 8045df0a7d
3 changed files with 23 additions and 7 deletions

View File

@@ -567,7 +567,11 @@ static struct win_syscall {
#define osSetEndOfFile ((BOOL(WINAPI*)(HANDLE))aSyscall[51].pCurrent)
#if SQLITE_OS_WINRT
{ "SetFilePointer", (SYSCALL)0, 0 },
#else
{ "SetFilePointer", (SYSCALL)SetFilePointer, 0 },
#endif
#define osSetFilePointer ((DWORD(WINAPI*)(HANDLE,LONG,PLONG, \
DWORD))aSyscall[52].pCurrent)
@@ -1563,6 +1567,7 @@ static BOOL winceLockFileEx(
# define INVALID_SET_FILE_POINTER ((DWORD)-1)
#endif
#if SQLITE_OS_WINRT==0
/*
** Move the current position of the file handle passed as the first
** argument to offset iOffset within the file. If successful, return 0.
@@ -1596,6 +1601,17 @@ static int seekWinFile(winFile *pFile, sqlite3_int64 iOffset){
return 0;
}
#else /* if SQLITE_OS_WINRT==1 */
/*
** Same function as above, except that this implementation works for
** windowsRT.
*/
static int seekWinFile(winFile *pFile, sqlite3_int64 iOffset){
LARGE_INTEGER x;
x.QuadPart = iOffset;
return SetFilePointerEx(pFile->h, x, 0, FILE_BEGIN) ? 0 : 1;
}
#endif
/*
** Close a file.