[ wxwindows-Bugs-1764805 ] wxSeek with negative offset fails on WinCE

SourceForge.net noreply at sourceforge.net
Tue Feb 26 06:16:21 PST 2008


Bugs item #1764805, was opened at 2007-07-31 18:15
Message generated for change (Comment added) made by juliansmart
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=109863&aid=1764805&group_id=9863

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: WinCE specific
Group: Platform specific
>Status: Closed
>Resolution: Fixed
Priority: 5
Private: No
Submitted By: andrej (truten)
Assigned to: Julian Smart (juliansmart)
Summary: wxSeek with negative offset fails on WinCE

Initial Comment:
src\msw\wince\filefnwce.cpp
wxSeek with negative offset fails on WinCE

WinCE has a different interpretation of ::SetFilePointer() than Windows. WinCE does not support the lpDistanceToMoveHigh parameter. The help says it should be set to NULL or the value of the pointer should be 0 (this is the way how it's used in wxSeek())
But if you pass a valid pointer with the value 0 and a negative offset than the function fails. I guess if the lpDistanceToMoveHigh is not NULL it interprets the lDistanceToMove parameter as a unsigned value which would explain the behavior.

Here some examples to make it more clear:

this works:
Long lHigh = 0;
SetFilePointer( fd, 20, &lHigh, FILE_BEGIN);

this doesn't:
Long lHigh = 0;
SetFilePointer( fd, -20, &lHigh, FILE_END);

setting the parameter lpDistanceToMoveHigh to NULL works in both cases:
SetFilePointer( fd, 20, NULL, FILE_BEGIN);
SetFilePointer( fd, -20, NULL, FILE_END);

On Desktop all combinations are working.

I would suggest to use always NULL for the lpDistanceToMoveHigh since it's not supported at all on WinCE.

----------------------------------------------------------------------

>Comment By: Julian Smart (juliansmart)
Date: 2008-02-26 14:16

Message:
Logged In: YES 
user_id=59495
Originator: NO

Thanks; I've set this parameter to NULL in 2.8 and trunk.

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=109863&aid=1764805&group_id=9863




More information about the wx-dev mailing list