ErrorCode property Null safety

int ErrorCode

Implementation

int get ErrorCode {
  final retValuePtr = calloc<Uint32>();

  final hr = Pointer<NativeFunction<_get_ErrorCode_Native>>.fromAddress(
          ptr.ref.vtable.elementAt(8).value)
      .asFunction<_get_ErrorCode_Dart>()(ptr.ref.lpVtbl, retValuePtr);
  if (FAILED(hr)) throw WindowsException(hr);

  final retValue = retValuePtr.value;
  free(retValuePtr);
  return retValue;
}