Partilhar via


ICLRDataTarget Interface

Provides methods for interaction with a target item of the common language runtime (CLR).

interface ICLRDataTarget : IUnknown {
        
    HRESULT GetCurrentThreadID (
        [out] ULONG32           *threadID
    );
        
    HRESULT GetImageBase (
        [in, string] LPCWSTR    imagePath,
        [out] CLRDATA_ADDRESS   *baseAddress
    );
        
    HRESULT GetMachineType (
        [out] ULONG32           *machineType
    );
        
    HRESULT GetPointerSize (
        [out] ULONG32           *pointerSize
    );
        
    HRESULT GetThreadContext (
        [in] ULONG32            threadID,
        [in] ULONG32            contextFlags,
        [in] ULONG32            contextSize,
        [out, size_is(contextSize)] 
            BYTE                *context
    );
        
    HRESULT GetTLSValue (
        [in] ULONG32            threadID,
        [in] ULONG32            index,
        [out] CLRDATA_ADDRESS   *value
    );
        
    HRESULT ReadVirtual (
        [in] CLRDATA_ADDRESS    address,
        [out, size_is(bytesRequested), length_is(*bytesRead)] 
            BYTE                *buffer,
        [in] ULONG32            bytesRequested,
        [out] ULONG32           *bytesRead
    );
        
    HRESULT Request (
        [in] ULONG32            reqCode,
        [in] ULONG32            inBufferSize,
        [in, size_is(inBufferSize)] 
            BYTE                *inBuffer,
        [in] ULONG32            outBufferSize,
        [out, size_is(outBufferSize)] 
            BYTE                *outBuffer
    );
        
    HRESULT SetThreadContext (
        [in] ULONG32            threadID,
        [in] ULONG32            contextSize,
        [in, size_is(contextSize)] 
             BYTE               *context
    );
        
    HRESULT SetTLSValue (
        [in] ULONG32            threadID,
        [in] ULONG32            index,
        [in] CLRDATA_ADDRESS    value
    );
        
    HRESULT WriteVirtual (
        [in] CLRDATA_ADDRESS    address,
        [in, size_is(bytesRequested)] 
                         BYTE               *buffer,
        [in] ULONG32            bytesRequested,
        [out] ULONG32           *bytesWritten
    );
        
};

Methods

Method Description

ICLRDataTarget::GetCurrentThreadID Method

Gets the operating system identifier for the current thread.

ICLRDataTarget::GetImageBase Method

Gets the base memory address for the specified image.

ICLRDataTarget::GetMachineType Method

Gets an identifier for the kind of instruction set that the target process is using.

ICLRDataTarget::GetPointerSize Method

Gets the size, in bytes, of a pointer to the current target.

ICLRDataTarget::GetThreadContext Method

Gets a pointer to the context of the thread with the specified identifier.

ICLRDataTarget::GetTLSValue Method

Gets a value in thread local storage (TLS) at the specified index for the specified thread.

ICLRDataTarget::ReadVirtual Method

Reads data from the specified virtual memory address into the specified buffer.

ICLRDataTarget::Request Method

Called by the common language runtime (CLR) data access services to request an operation, as defined by the implementation.

ICLRDataTarget::SetThreadContext Method

Sets the current context of the specified thread in the target process.

ICLRDataTarget::SetTLSValue Method

Sets a value in the thread local storage (TLS) of the specified thread in the target process.

ICLRDataTarget::WriteVirtual Method

Writes data from the specified buffer to the specified virtual memory address.

Remarks

The API client (that is, the debugger) must implement this interface as appropriate for the particular target item. For example, a live process would have an implementation different from that of a memory dump.

Requirements

Platforms: Windows 2000, Windows XP, Windows Server 2003 family

Header: ClrData.idl

Library: CorGuids.lib

.NET Framework Version: 2.0

See Also

Reference

ICLRDataTarget2 Interface

Other Resources

Debugging Interfaces