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

Stephan Rose kermos at
Mon Mar 19 17:51:09 CDT 2007

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.

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