Accessing File > 4gb problem (was: Debugging Supreme Commander)

Stephan Rose kermos at
Tue Mar 20 04:25:02 CDT 2007

I apologize in advance if this ends up on the mailing list twice's been over 12 hours now and my e-mail, as my previous (but now
unimportant one) still didn't make it so I am going to try to resend
this. =)

Allright, I've got the bug nailed to the wall with all of its 6 legs.

What I don't know though is what to do about it. Still trying to find
the right sledgehammer to squash it with....

Problem boils down to this:

Supreme Commander has a .cab file that is just under 6 gigs in size.

0x178d42fce bytes to be exact

Now here are the last 5 file seek positions in order from first to last:


All those succeed fine. But #5 ...
0x1007bc160 results in NTSTATUS c000000d, Invalid Parameter.

That address is well within the range of the file though. 

The status occurs when lseek is called in this part of NtSetInformation,
don't mind my added debug fixme's =)

case FilePositionInformation:        
    const FILE_POSITION_INFORMATION *info = ptr;
    unsigned int* iptr = (unsigned

    FIXME( "%i, 0x%08x%08x\n", fd, *(iptr+1), *iptr);

    if (lseek( fd, info->CurrentByteOffset.QuadPart, SEEK_SET ) ==
        FIXME("Bad result from lseek");
        // Above fixme triggered past 4gb
        io->u.Status = FILE_GetNtStatus();
else io->u.Status = STATUS_INVALID_PARAMETER_3;

I checked sizeof(off_t) and it correctly reports as 8-bytes, so I am not
sure what the problem is and why this is happening. I know my system can
handle files > 4 dumped 9 gigs of relay output onto my hard
drive the first time I played with that debug channel =P

Any ideas?

On a bright note...I almost have my Supreme Commander CD Key memorized many people can say that!!! ;)



More information about the wine-devel mailing list