Share via


IMetaDataImport::GetPinvokeMap Method

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

HRESULT GetPinvokeMap (
    mdToken       tk,
    DWORD         *pdwMappingFlags,
    LPWSTR        szImportName,
    ULONG         cchImportName,
    ULONG         *pchImportName,
    mdModuleRef   *pmrImportDLL
);

Parameters

Parameter Description

tk

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

pdwMappingFlags

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

szImportName

[out] The name of the unmanaged target DLL.

cchImportName

[in] The size in wide characters of szImportName.

pchImportName

[out] The number of wide characters returned in szImportName.

pmrImportDLL

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

Requirements

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

Header: Cor.h

Library: Included as a resource in Mscoree.dll

.NET Framework Version: 2.0, 1.1, 1.0

See Also

Reference

IMetaDataImport Interface
IMetaDataImport2 Interface