Parameter.fromToken constructor
Creates a parameter object from a provided token.
Implementation
factory Parameter.fromToken(Scope scope, int token) => using((Arena arena) {
final ptkMethodDef = arena<mdMethodDef>();
final pulSequence = arena<ULONG>();
final szName = arena<WCHAR>(MAX_STRING_SIZE).cast<Utf16>();
final pchName = arena<ULONG>();
final pdwAttr = arena<DWORD>();
final pdwCPlusTypeFlag = arena<DWORD>();
final ppValue = arena<UVCP_CONSTANT>();
final pcchValue = arena<ULONG>();
final reader = scope.reader;
final hr = reader.GetParamProps(
token,
ptkMethodDef,
pulSequence,
szName,
MAX_STRING_SIZE,
pchName,
pdwAttr,
pdwCPlusTypeFlag,
ppValue,
pcchValue);
if (SUCCEEDED(hr)) {
return Parameter(
scope,
token,
ptkMethodDef.value,
pulSequence.value,
pdwAttr.value,
TypeIdentifier.fromValue(pdwCPlusTypeFlag.value),
szName.toDartString(),
ppValue.value.asTypedList(pcchValue.value));
} else {
throw WindowsException(hr);
}
});