Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Sign In with Facebook Sign In with Google Sign In with OpenID

Categories

We have migrated to a new platform! Please note that you will need to reset your password to log in (your credentials are still in-tact though). Please contact lee@programmersheaven.com if you have questions.
Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

ReadFile can not read more than approx. 67 MB

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.

Comments

  • AsmGuru62AsmGuru62 Posts: 6,519Member
    : 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.
    :
    [blue]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[/blue]
  • sermatsermat Posts: 4Member
    : : 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.
    : :
    : [blue]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[/blue]
    :

    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.

  • bikibiki Posts: 492Member
    could it be memory? or diskspace?
    [hr];-) [b][size=4][red]~Bikram[/red][/size][/b]

  • sermatsermat Posts: 4Member
    : could it be memory? or diskspace?
    : [hr];-) [b][size=4][red]~Bikram[/red][/size][/b]
    :
    : I don't know? To me, I seem to have plenty of resources, i.e: 512MB RAM, 80 GB hard drive, Windows 2000 Professional.


  • AsmGuru62AsmGuru62 Posts: 6,519Member
    [blue]My advice: use different algoritms to process your data. Process it by pieces, not as a whole huge thing.[/blue]
  • sermatsermat Posts: 4Member
    : [blue]My advice: use different algoritms to process your data. Process it by pieces, not as a whole huge thing.[/blue]
    :
    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, [red]specially AsmGuru62[/red].
    serge.
Sign In or Register to comment.