ReadFile can not read more than approx. 67 MB - Programmers Heaven

Howdy, Stranger!

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

Categories

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.