ICorDebugMetaDataLocator::GetMetaData Method

Asks the debugger to return the full path to a module whose metadata is needed to complete an operation the debugger requested.

Syntax

HRESULT GetMetaData(
      [in] LPCWSTR wszImagePath,
      [in] DWORD   dwImageTimeStamp,
      [in] DWORD   dwImageSize,
      [in] ULONG32 cchPathBuffer,
      [out] ULONG32 * pcchPathBuffer,
      [out, size_is(cchPathBuffer), length_is(*pcchPathBuffer)]
               WCHAR wszPathBuffer[]
      );

Parameters

wszImagePath [in] A null-terminated string that represents the full path to the file. If the full path is not available, the name and extension of the file (filename.extension).

dwImageTimeStamp [in] The time stamp from the image's PE file headers. This parameter can potentially be used for a symbol server (SymSrv) lookup.

dwImageSize [in] The image size from PE file headers. This parameter can potentially be used for a SymSrv lookup.

cchPathBuffer [in] The character count in wszPathBuffer.

pcchPathBuffer [out] The count of WCHARs written to wszPathBuffer.

If the method returns E_NOT_SUFFICIENT_BUFFER, contains the count of WCHARs needed to store the path.

wszPathBuffer [out] Pointer to a buffer into which the debugger will copy the full path of the file that contains the requested metadata.

The ofReadOnly flag from the CorOpenFlags enumeration is used to request read-only access to the metadata in this file.

Return Value

This method returns the following specific HRESULTs as well as HRESULT errors that indicate method failure. All other failure HRESULTs indicate that the file is not retrievable.

HRESULT Description
S_OK The method completed successfully. wszPathBuffer contains the full path to the file and is null-terminated.
E_NOT_SUFFICIENT_BUFFER The current size of wszPathBuffer is not sufficient to hold the full path. In this case, pcchPathBuffer contains the needed count of WCHARs, including the terminating null character, and GetMetaData is called a second time with the requested buffer size.

Remarks

If wszImagePath contains a full path for a module from a dump, it specifies the path from the computer where the dump was collected. The file may not exist at this location, or an incorrect file with the same name may be stored on the path.

Requirements

Platforms: See System Requirements.

Header: CorDebug.idl, CorDebug.h

Library: CorGuids.lib

.NET Framework Versions: Available since 4

See also