Windows programming

Moderators: None (Apply to moderate this forum)
Number of threads: 3711
Number of posts: 9173

This Forum Only
Post New Thread
Single Post View       Linear View       Threaded View      f

Report
ReadFile can not read more than approx. 67 MB Posted by sermat on 31 Jan 2005 at 6:37 PM
Hi to all members.
I have a little "c" program to read bytes from a hard drive. It works perfectly fine as long as the "nNumberOfBytesToRead" parameter in the ReadFile function (win32 API)is less than 67 MB (approx.). Anything bigger than that, results in the ReadFile function returning 0 (zero) indicating a failure of that function.
Could anybody put some light on this.
Many thanks to all,
Serge Matovic.
Report
Re: ReadFile can not read more than approx. 67 MB Posted by AsmGuru62 on 31 Jan 2005 at 8:49 PM
: Hi to all members.
: I have a little "c" program to read bytes from a hard drive. It works perfectly fine as long as the "nNumberOfBytesToRead" parameter in the ReadFile function (win32 API)is less than 67 MB (approx.). Anything bigger than that, results in the ReadFile function returning 0 (zero) indicating a failure of that function.
: Could anybody put some light on this.
: Many thanks to all,
: Serge Matovic.
:
Try to call GetLastError() and then go to MSDN and find out what happened.

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/debug/base/system_error_codes.asp

Report
Re: ReadFile can not read more than approx. 67 MB Posted by sermat on 31 Jan 2005 at 9:10 PM
: : Hi to all members.
: : I have a little "c" program to read bytes from a hard drive. It works perfectly fine as long as the "nNumberOfBytesToRead" parameter in the ReadFile function (win32 API)is less than 67 MB (approx.). Anything bigger than that, results in the ReadFile function returning 0 (zero) indicating a failure of that function.
: : Could anybody put some light on this.
: : Many thanks to all,
: : Serge Matovic.
: :
: Try to call GetLastError() and then go to MSDN and find out what happened.
:
: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/debug/base/system_error_codes.asp

:

Thanks AsmGuru62. Did as you suggested. The error code is 1450, and Msft site says this about it: "ERROR_NO_SYSTEM_RESOURCES Insufficient system resources exist to complete the requested service."
Well, I'm not sure what "resources" am I missing?
Any thoughts?
Serge Matovic.

Report
Re: ReadFile can not read more than approx. 67 MB Posted by biki on 31 Jan 2005 at 11:33 PM
could it be memory? or diskspace?

~Bikram

Report
Re: ReadFile can not read more than approx. 67 MB Posted by sermat on 1 Feb 2005 at 7:55 AM
: could it be memory? or diskspace?
:
~Bikram
:
: I don't know? To me, I seem to have plenty of resources, i.e: 512MB RAM, 80 GB hard drive, Windows 2000 Professional.


Report
Result: even WIndows has limits... Posted by AsmGuru62 on 1 Feb 2005 at 4:05 PM
My advice: use different algoritms to process your data. Process it by pieces, not as a whole huge thing.
Report
Re: Result: even WIndows has limits... Posted by sermat on 1 Feb 2005 at 4:19 PM
: My advice: use different algoritms to process your data. Process it by pieces, not as a whole huge thing.
:
YES, You are 100% correct. And that will not be difficult to do. I am still curious if Windows "can be forced" to deal with data larger than 64 MB?
Thanks to all, specially AsmGuru62.
serge.



 

Recent Jobs

Official Programmer's Heaven Blogs
Web Hosting | Browser and Social Games | Gadgets

Popular resources on Programmersheaven.com
Assembly | Basic | C | C# | C++ | Delphi | Flash | Java | JavaScript | Pascal | Perl | PHP | Python | Ruby | Visual Basic
© Copyright 2011 Programmersheaven.com - All rights reserved.
Reproduction in whole or in part, in any form or medium without express written permission is prohibited.
Violators of this policy may be subject to legal action. Please read our Terms Of Use and Privacy Statement for more information.
Operated by CommunityHeaven, a BootstrapLabs company.