Results 1 to 2 of 2

Thread: What's the max size copyable with CopyMemory API call?

  1. #1

    Thread Starter
    Frenzied Member
    Join Date
    Oct 2008
    Posts
    1,238

    What's the max size copyable with CopyMemory API call?

    I know that the referenc hpvDest and hpvSource can be defined as like:
    Byval hpvDest as Long
    so that I can use them in conjunction with varptr to work with memory locations directly (which then allows for adding and subtracting memory locations to move stuff in memory like an array), however I doubt that even though it is using a long (a SignedInt32) that it could actually transfer &h7FFFFFFF bytes at once. In fact it crashes when I try to copy merely 100000 (&H186A0) bytes at once. What is going on. Is it really incapable of transfering large ammounts of data at once? Will I need some kind of for-next loop to transfer several megabytes of data?

  2. #2
    Cumbrian Milk's Avatar
    Join Date
    Jan 2007
    Location
    0xDEADBEEF
    Posts
    2,448

    Re: What's the max size copyable with CopyMemory API call?

    I think the crash is more likely caused by trying to write to somewhere you are not supposed to.

    How about showing us an example of the code that is crashing. Also include the declare you are using for RtlMoveMemory as there are a few subtle variations.

    Edit: in answer to your question I believe the copy size is limited by the available contiguous memory and the size parameter which is defined as an unsigned integer of 32 bits.
    Last edited by Milk; Jul 4th, 2012 at 02:38 PM.
    W o t . S i g

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width