Share via


IeXdi2Mem::WriteMemoryX (Windows Embedded CE 6.0)

1/5/2010

This method writes a block of data to linear memory.

Syntax

HRESULT WriteMemoryX(
  [in] DWORD dwCpuNum,
  [in] LINEAR_MEM_MAP_TYPE lmt,
  [in] ADDRESS_TYPE Address,
  [in] DWORD dwNbElemToWrite,
  [in] BYTE bAccessWidthInBytes,
  [in, size_is(dwNbElemToWrite* bAccessWidthInBytes)] const BYTE*
  pbWriteBuffer,
  [out] DWORD* pdwNbElementEffectWritten
);

Parameters

  • CPU number.
    This parameter should be 0 if this is not a symmetric multi-processor (SMP).

    Otherwise, assign dwCpuNum a value between 0 and n-1, where n is the CPU number in the SMP system.

  • lmt
    Linear memory map type.

    The following memory map types are used by convention:

    Value Description

    LMM_VIRT, 0

    Virtual memory

    LMM_PHYS, 1

    Physical memory

    LMM_IO, 2

    Peripheral I/O

    3 and higher

    Free for custom use

  • Address
    Starting address of the data buffer to be accessed on the target.
  • dwNbElemToRead
    Number of elements of bAccessWidthInBytes to be accessed.
  • bAccessWidthInBytes
    Data width in bytes, where byte=1, word=2, dword=4, and so on.
  • pbWriteBuffer
    Buffer for writing.

    pbWriteBuffer must be at least large enough to hold dwNbElemToWrite elements.

    Note

    The server should handle buffers of at least 64 KB.

  • pdwNbElementEffectWritten
    Number of elements effectively written.

    If the entire address range is not accessible, such as when at least one element in the range encounters an access violation, this returned value should be 0 to avoid unnecessary querying.

Return Value

The following table shows return values for this method.

Value Description

S_OK

Indicates the function was successful.

E_FAIL

Indicates an unspecified failure.

E_OUTOFMEMORY

Indicates an out of memory error.

E_INVALIDARG

Indicates one or more invalid arguments.

EXDI_E_COMMUNICATION

Indicates a communication error between host driver and debugging target.

EXDI_E_ACCESSVIOLATION

Indicates an access violation occurred on at least one element in the address range specified by the operation.

Remarks

The memory content provided to this function should be sanitized to remove artifacts of software breakpoints or other memory modifications produced by debugging activity in the driver, probe, or target device.

Requirements

Header eXDI2.h
Library ole32.lib, oleaut32.lib
Windows Embedded CE Windows CE 5.0 and later

See Also

Reference

IeXdi2Mem
IeXDI2 Interfaces