From 208553465406ad92f4839977f2728025ed3992ae Mon Sep 17 00:00:00 2001 From: Joris Van Damme Date: Fri, 10 Aug 2007 10:04:47 +0000 Subject: [PATCH] tif_win32.c: use SetFilePointer instead of SetFilePointerEx --- ChangeLog | 7 +++++++ libtiff/tif_win32.c | 13 +++++++------ 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/ChangeLog b/ChangeLog index 2aae8da3..6db0644e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2007-08-10 Joris Van Damme + + * libtiff/tif_win32.c: use SetFilePointer instead of + SetFilePointerEx, as per bug + + http://bugzilla.remotesensing.org/show_bug.cgi?id=1580 + 2007-07-19 Andrey Kiselev * libtiff/tif_stream.cxx: Put all callback functions declarations diff --git a/libtiff/tif_win32.c b/libtiff/tif_win32.c index 94bccea6..a30814e0 100644 --- a/libtiff/tif_win32.c +++ b/libtiff/tif_win32.c @@ -1,4 +1,4 @@ -/* $Id: tif_win32.c,v 1.31 2007-07-11 15:52:48 joris Exp $ */ +/* $Id: tif_win32.c,v 1.32 2007-08-10 10:04:50 joris Exp $ */ /* * Copyright (c) 1988-1997 Sam Leffler @@ -95,9 +95,9 @@ _tiffWriteProc(thandle_t fd, void* buf, tmsize_t size) static uint64 _tiffSeekProc(thandle_t fd, uint64 off, int whence) { - LARGE_INTEGER off_in, off_out; + LARGE_INTEGER offli; DWORD dwMoveMethod; - off_in.QuadPart = off; + offli.QuadPart = off; switch(whence) { case SEEK_SET: @@ -113,9 +113,10 @@ _tiffSeekProc(thandle_t fd, uint64 off, int whence) dwMoveMethod = FILE_BEGIN; break; } - if (SetFilePointerEx(fd,off_in,&off_out,dwMoveMethod)==0) - off_out.QuadPart=0; - return(off_out.QuadPart); + offli.LowPart=SetFilePointer(fd,offli.LowPart,&offli.HighPart,dwMoveMethod); + if ((offli.LowPart==INVALID_SET_FILE_POINTER)&&(GetLastError()!=NO_ERROR)) + offli.QuadPart=0; + return(offli.QuadPart); } static int