getPinvokeMap method

void getPinvokeMap(
  1. int tk,
  2. Pointer<Uint32> pdwMappingFlags,
  3. PWSTR? szImportName,
  4. int cchImportName,
  5. Pointer<Uint32> pchImportName,
  6. Pointer<Uint32> pmrImportDLL,
)

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

Throws a WindowsException on failure.

To learn more, see learn.microsoft.com/windows/win32/api/rometadataapi/nf-rometadataapi-imetadataimport-getpinvokemap.

Implementation

@pragma('vm:prefer-inline')
void getPinvokeMap(
  int tk,
  Pointer<Uint32> pdwMappingFlags,
  PWSTR? szImportName,
  int cchImportName,
  Pointer<Uint32> pchImportName,
  Pointer<Uint32> pmrImportDLL,
) {
  final hr$ = HRESULT(
    _GetPinvokeMapFn(
      ptr,
      tk,
      pdwMappingFlags,
      szImportName ?? nullptr,
      cchImportName,
      pchImportName,
      pmrImportDLL,
    ),
  );
  if (hr$.isError) throw WindowsException(hr$);
}