内存拷贝函数memcpy()问题,100分(100分)

  • 主题发起人 主题发起人 xxd402
  • 开始时间 开始时间
X

xxd402

Unregistered / Unconfirmed
GUEST, unregistred user!
在vc6中可以使用的内存拷贝函数<br>void *memcpy( void *dest, const void *src, size_t count );<br>在delphi找不到了,不知道在delphi中是否有这个函数或是与其功能相似的函数<br>请各位富翁赐教!
 
你可以直接调用 API 函数:<br>BOOL ReadProcessMemory(<br>&nbsp; &nbsp; HANDLE hProcess, // handle of the process whose memory is read &nbsp;<br>&nbsp; &nbsp; LPCVOID lpBaseAddress, // address to start reading<br>&nbsp; &nbsp; LPVOID lpBuffer, // address of buffer to place read data<br>&nbsp; &nbsp; DWORD nSize, // number of bytes to read<br>&nbsp; &nbsp; LPDWORD lpNumberOfBytesRead // address of number of bytes read<br>&nbsp; &nbsp;);
 
Copies bytes from a source to a destination.<br><br>Unit<br><br>System<br><br>Category<br><br>miscellaneous routines<br><br>procedure Move(const Source; var Dest; Count: Integer);<br><br>Description<br><br>Move copies Count bytes from Source to Dest. No range checking is performed. Move compensates for overlaps between the source and destination blocks. <br><br>Whenever possible, use SizeOf to determine the count.
 
move 过程<br><br>var<br>&nbsp; A: array[1..4] of Char;<br>&nbsp; B: Integer;<br>begin<br>&nbsp; Move(A, B, SizeOf(B)); &nbsp;{ SizeOf = safety! }<br>end;
 
今天在win32 sdk中找了半天,我也找到了一个类似的,如下:<br>The CopyMemory function copies a block of memory from one location to another. <br>VOID CopyMemory (<br>&nbsp; &nbsp; PVOID Destination, // address of copy destination <br>&nbsp; &nbsp; CONST VOID *Source, // address of block to copy <br>&nbsp; &nbsp; DWORD Length // size, in bytes, of block to copy &nbsp;<br>&nbsp; &nbsp;); <br>&nbsp;Parameters<br>Destination<br>Points to the starting address of the copied block's destination. <br>Source<br>Points to the starting address of the block of memory to copy. <br>Length<br>Specifies the size, in bytes, of the block of memory to copy. <br>可能是borland把这个函数改写时更换了函数名。<br>
 
接受答案
 
多人接受答案了。
 

Similar threads

回复
0
查看
1K
不得闲
S
回复
0
查看
1K
SUNSTONE的Delphi笔记
S
S
回复
0
查看
923
SUNSTONE的Delphi笔记
S
后退
顶部