large file support in Win32
alaricd at pengdows.com
Thu Sep 22 15:21:50 CEST 2005
GetFileSize shouldn't be the API call you are making you should be using
DWORD GetFileSize (HANDLE hFile, LPDWORD pHighOrder)
it returns a low order unsigned long, and if you want the larger portion
you need to pass in a pointer to a DWORD to get the HIGH ORDER portion
of the file size (greater than 4Gig).
Ryan Malayter wrote:
> Looking at the PLatform SDK documentation, it isn't clear that
> GetFileSize will fail when a file is > 4 GB. Maybe I'm reading it
> incorrectly, and it is certainly very vague, but nowhere does it say
> "if a file is greater than 4 GB, INVALID_FILE_SIZE will be returned".
> It only sayd about "if the function fails", not that a file size > 4GB
> will cause it to fail.
> I suppose the only thing to do would be to pass a lpFileSizeHigh value
> and test combinations with GetLastError to see what the function's
> behavior really is.
> On 9/22/05, Werner Koch <wk at gnupg.org> wrote:
>> On Wed, 21 Sep 2005 22:47:10 -0500, Ryan Malayter said:
>>> 09/18/2005 05:44 AM 45,284,360,192 myfile.bkf
>>> :literal data packet:
>>> mode b (62), created 1127307875, name="myfile.bkf",
>>> raw data: 2334687232 bytes
>> This number is exactly the remainder of 45284360192 / 2^32.
>> Thus my conclusion is that GetFizeSize does not return a proper error
>> as ist should according to the documentation. Maybe this did not
>> happen with W98.
>> The easiest way of fixing it would be using GetFileSizeEx but that
>> function is only available with W2000 Professional. So either I try to
>> figure out why GetFileSize does not return an error anymore or I need
>> to dynamically load GetFileSizeEx; did the later at other places too.
>> Many thanks for running this test.
> All problems can be solved by diplomacy, but violence and treachery
> are equally effective, and more fun.
> Gnupg-devel mailing list
> Gnupg-devel at gnupg.org
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 3544 bytes
Desc: S/MIME Cryptographic Signature
Url : /pipermail/attachments/20050922/d8751d1b/smime.bin
More information about the Gnupg-devel