IDkmMemoryOperation.ReadMemoryString Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Reads a null-terminated string from the target process process's memory. This can be used to read an ANSI or Unicode (UTF-8, UTF-16 or UTF-32) strings.
public:
cli::array <System::Byte> ^ ReadMemoryString(Microsoft::VisualStudio::Debugger::DkmProcess ^ process, System::UInt64 address, Microsoft::VisualStudio::Debugger::DkmReadMemoryFlags flags, System::UInt16 characterSize, int maxCharacters);
public byte[] ReadMemoryString (Microsoft.VisualStudio.Debugger.DkmProcess process, ulong address, Microsoft.VisualStudio.Debugger.DkmReadMemoryFlags flags, ushort characterSize, int maxCharacters);
public byte[]? ReadMemoryString (Microsoft.VisualStudio.Debugger.DkmProcess process, ulong address, Microsoft.VisualStudio.Debugger.DkmReadMemoryFlags flags, ushort characterSize, int maxCharacters);
abstract member ReadMemoryString : Microsoft.VisualStudio.Debugger.DkmProcess * uint64 * Microsoft.VisualStudio.Debugger.DkmReadMemoryFlags * uint16 * int -> byte[]
Public Function ReadMemoryString (process As DkmProcess, address As ULong, flags As DkmReadMemoryFlags, characterSize As UShort, maxCharacters As Integer) As Byte()
Parameters
- process
- DkmProcess
[In] DkmProcess represents a target process which is being debugged. The debugger debugs processes, so this is the basic unit of debugging. A DkmProcess can represent a system process or a virtual process such as minidumps.
- address
- UInt64
[In] The base address from which to read the target process's memory.
- flags
- DkmReadMemoryFlags
[In] Flags controlling the behavior of DkmProcess.ReadMemory and DkmProcess.ReadMemoryString.
- characterSize
- UInt16
[In] Number of bytes in each character. This should be set to 1 (ANSI/UTF-8), 2 (UTF-16) or 4 (UTF-32).
- maxCharacters
- Int32
[In] The maximum number of characters to read from the target process. When DkmReadMemoryFlags.AllowPartialRead is false, the request will fail if a null terminator isn't found within this range. This value should be reasonable. The Microsoft implementation will fail any request for more than 25 MBs of string memory.
Returns
[Out] The value of the string which was read from the target process. If DkmReadMemoryFlags.AllowPartialRead is clear, this memory will always include the null termination character. If DkmReadMemoryFlags.AllowPartialRead is specified, this buffer will not contain the null termination character if the read was truncated.
Exceptions
E_STRING_TOO_LONG indicates that the string could not be read within the specified maximum number of characters.