Debugging Tools for Windows

ExtRemoteData::GetString

The GetString method reads a null-terminated string from the target's memory. The string is located in the beginning of the region represented by the ExtRemoteData object.

PSTR
  GetString(
    OUT PSTR  Buffer,
    IN ULONG  BufferChars,
    IN ULONG  MaxChars = 1024,
    IN bool MustFit = false
    ) throw(...);

PWSTR
  GetString(
    OUT PWSTR  Buffer,
    IN ULONG  BufferChars,
    IN ULONG  MaxChars = 1024,
    IN bool  MustFit = false
    ) throw(...);

Parameters

Buffer
Receives the null-terminated string read from the target. The type of Buffer must be the same as the type of the string on the target. If the string is a Unicode string, the type of Buffer must be PWSTR. If the string is a multibyte string, the type of Buffer must be PSTR.

Note the remainder of the Buffer buffer, after the string, can be overwritten by this method.

BufferChars
Specifies the size, in characters, of the Buffer buffer.
MaxChars
Specifies the maximum number of characters to read from the target.
MustFit
Specifies what happens if the string is larger than BufferChars characters. If MustFit is true and the string is larger than BufferChars characters, an ExtRemoteException will be thrown. If MustFit is false and the string is larger than BufferChars characters, the string will be truncated and null-terminated to fit inside the Buffer buffer.

Return Value

GetString returns the null-terminated string that was read from the target. This is Buffer.

Comments

This method can only be used if the region represented by the ExtRemoteData object is in virtual memory. It will not work if the region specifies physical memory.

Requirements

Headers: Defined in Engextcpp.hpp. Include Engextcpp.hpp.

See Also

ExtRemoteData, ExtRemoteData::ReadBuffer

Build machine: CAPEBUILD