That's because you're working on a 32bit system where -1 happens to be a legitimate file size for your system. I expect that you'll have other problems as you can't seek beyond that size too. It's the classic memory model problem.
You can specify the memory model for STL objects (for lack of a better word), but the IOStream library isn't part of STL, so to my knowledge, you can't use it. Now that'd be a useful feature in a new version of the standard library (rather than the crap that's in it now).
You may already know that the WIN32 file functions have always been 64bit (to support the 64 bit filesystem). So you may have to resort to using them directly.
Then it seems a truly spectacular coincidence. Your post of the same over on stackoverflow seems to have the answer. Someone chose to use the max value of a 32 bit int as the error code.
If I had to guess, the code was originally written for 32bit systems, safe in the knowledge that nobody would ever seek this value as such a file size was impossible. So it does have a lot to do with 32 bit systems.