Platform SDK: Debugging and Error Handling

Toolhelp32ReadProcessMemory

Copies memory allocated to another process into an application-supplied buffer.

BOOL WINAPI Toolhelp32ReadProcessMemory(
  DWORD th32ProcessID,         
  LPCVOID lpBaseAddress,       
  LPVOID lpBuffer,             
  DWORD cbRead,                
  LPDWORD lpNumberOfBytesRead  
);

Parameters

th32ProcessID
[in] Identifier of the process whose memory is being copied. This parameter can be zero to copy the memory of the current process.
lpBaseAddress
[in] Base address in the specified process to read. Before transferring any data, the system verifies that all data in the base address and memory of the specified size is accessible for read access. If this is the case, the function proceeds. Otherwise, the function fails.
lpBuffer
[out] Pointer to a buffer that receives the contents of the address space of the specified process.
cbRead
[in] Number of bytes to read from the specified process.
lpNumberOfBytesRead
[out] Number of bytes copied to the specified buffer. If this parameter is NULL, it is ignored.

Return Values

Returns TRUE if successful.

Requirements

  Windows NT/2000: Requires Windows 2000.
  Windows 95/98: Requires Windows 95 or later.
  Header: Declared in Tlhelp32.h.
  Library: Use Kernel32.lib.

See Also

Tool Help Library Overview, Tool Help Functions