Skip to content

Fix breaking change in win32 package #75050

@timsneath

Description

@timsneath

The win32 package has a minor breaking change between 2.0.0-nullsafety.8 and 2.0.0-nullsafety.9. The Windows implementation of path_provider_windows needs to be updated to take account of this change.

Details (for those who care)

As the Dart FFI API stabilizes, the new guidance is to pass around Pointer<STRUCT_NAME>, rather than Pointer<STRUCT_NAME>.ref if you need access to the native backing store. In the win32 package, which has functions that make it easier to access various struct members, the initial plan was to use extension methods on Pointer to provide those functions, but that creates inconsistency between helper functions and the struct members themselves. @dcharkes helped me find a better way of doing this.

So in code, instead of something like:

final guid = calloc<GUID>()..setGUID(IID_IDispatch);

you write:

final guid = calloc<GUID>()..ref.setGUID(IID_IDispatch);

Metadata

Metadata

Assignees

No one assigned

    Labels

    p: path_providerPlugin that provides resolved paths to some platform directoriesplatform-windowsBuilding on or for Windows specifically

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions