2^32-2 = 4,294,967,294 or about 4GB. Based on Luthfi's earlier answer, I believe we have found the issue.
AbeloHost | Offshore Windows & Linux VPS | €5.99/month
Abelo - Today, 08:19 AM
Outsourcing for Startups! Highly Trained & Skilled Workers to Support your Business
Windtech - Yesterday, 11:03 PM
WP/Joomla Hosting, Fast and Reliable Database Host - Prewebhost!
webtech1 - Yesterday, 09:46 PM
Recent Blog Entries
Recent Status Updates
Last status I posted I said I would be active, could not have been more wrong!
edit word online
I created my first blog and first entry.
- Managed C++
- Visual Basic 4 / 5 / 6
- linked list
- hello world
Posted 08 March 2013 - 08:39 PM
WingedPanther had summed it up for you. Both your free space sizes surpass the limitation of SetFilePointer (when missing lpDistanceToMoveHigh). Actually it seems that my earlier answer was based from wrong documentation. The online documentation (which url I gave you already) states that the limitation would be (2^31)-2. So, actually the limitation is 2GB-2B. Now we have the answer to what caused the failure in your code.
The solution? Make SetFilePointer to use proper lpDistanceToMoveHigh value. I don't recommend to alter TFileStream, so you better rewrite your code to directly use windows api instead of TFileStream.
Edited by LuthfiHakim, 08 March 2013 - 08:39 PM.