Toolhelp32ReadProcessMemory function

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

Syntax


BOOL WINAPI Toolhelp32ReadProcessMemory(
  _In_  DWORD   th32ProcessID,
  _In_  LPCVOID lpBaseAddress,
  _Out_ LPVOID  lpBuffer,
  _In_  SIZE_T  cbRead,
  _Out_ SIZE_T  lpNumberOfBytesRead
);

Parameters

th32ProcessID [in]

The identifier of the process whose memory is being copied. This parameter can be zero to copy the memory of the current process.

lpBaseAddress [in]

The 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]

A pointer to a buffer that receives the contents of the address space of the specified process.

cbRead [in]

The number of bytes to read from the specified process.

lpNumberOfBytesRead [out]

The number of bytes copied to the specified buffer. If this parameter is NULL, it is ignored.

Return value

Returns TRUE if successful.

Requirements

Minimum supported client

Windows XP [desktop apps only]

Minimum supported server

Windows Server 2003 [desktop apps only]

Header

TlHelp32.h

Library

Kernel32.lib

DLL

Kernel32.dll

See also

Process32First
Process32Next
Tool Help Functions

 

 

Community Additions

ADD
Show: