IMetaDataImport::GetPinvokeMap method (rometadataapi.h)

Gets a ModuleRef token to represent the target assembly of a PInvoke call.

Syntax

HRESULT GetPinvokeMap(
  [in]  mdToken     tk,
  [out] DWORD       *pdwMappingFlags,
  [out] LPWSTR      szImportName,
  [in]  ULONG       cchImportName,
  [out] ULONG       *pchImportName,
  [out] mdModuleRef *ptkImportDLL
);

Parameters

[in] tk

A FieldDef or MethodDef token to get the PInvoke mapping metadata for.

[out] pdwMappingFlags

A pointer to flags used for mapping. This value is a bitmask from the CorPinvokeMap enumeration.

[out] szImportName

The name of the unmanaged target DLL.

[in] cchImportName

The size in wide characters of szImportName.

[out] pchImportName

The number of wide characters returned in szImportName.

[out] ptkImportDLL

A pointer to a ModuleRef token that represents the unmanaged target object library.

Return value

If this method succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code.

Requirements

   
Target Platform Windows
Header rometadataapi.h

See also

IMetaDataImport