Platform SDK: Debugging and Error Handling

ReadProcessMemoryProc

The ReadProcessMemoryProc function is an application-defined callback function used with the StackWalk function. It is called when StackWalk needs to read memory from the address space of the process.

The PREAD_PROCESS_MEMORY_ROUTINE type defines a pointer to this callback function. ReadProcessMemoryProc is a placeholder for the application-defined function name.

BOOL ReadProcessMemoryProc(
  HANDLE hProcess,
  DWORD lpBaseAddress,
  PVOID lpBuffer,
  DWORD nSize,
  PDWORD lpNumberOfBytesRead
);

The PREAD_PROCESS_MEMORY_ROUTINE64 type defines a pointer to this callback function. ReadProcessMemoryProc64 is a placeholder for the application-defined function name.

BOOL ReadProcessMemoryProc64(
  HANDLE hProcess,
  DWORD64 lpBaseAddress,
  PVOID lpBuffer,
  DWORD nSize,
  LPDWORD lpNumberOfBytesRead
);

Parameters

hProcess
[in] Handle to the process for which the stack trace is generated.
lpBaseAddress
[in] Specifies the base address of the memory to be read.
lpBuffer
[in] Receives the memory to be read.
nSize
[in] Specifies the size, in bytes, of the memory to be read.
lpNumberOfBytesRead
[in] Receives the number of bytes actually read.

Return Value

If the function succeeds, the return value should be TRUE. If the function fails, the return value should be FALSE.

Requirements

  Windows NT/2000: Requires Windows NT 4.0 or later.
  Windows 95/98: Requires Windows 95 or later. Available as a redistributable for Windows 95.
  Header: Declared in Dbghelp.h.

See Also

Debug Help Library Overview, DbgHelp Functions, StackWalk