Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix MSIHANDLE parameter modification in Rust 1.78.0+ #33

Merged
merged 1 commit into from
Jun 17, 2024

Conversation

ZachNo
Copy link
Contributor

@ZachNo ZachNo commented Jun 11, 2024

Rust 1.78.0 seems to have changed the behavior of passing references into FFI functions so that mut is required for it to be mutable. (I assume as it should have always done)

I was running into issues with the open_view command returning a null MSIHANDLE, when the MSI log shows that it should returning the newly created MSI handle from the OpenView call.

Changing the function signature to include mut makes my previously working pre-1.78.0 custom action work again in 1.78.0

Ran cargo test --all-features and all passed.

Copy link
Owner

@heaths heaths left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great, thanks! Yeah, they probably should've been mut in the first place. It crossed my mind, but since it worked without and didn't require everyone to declare mut locals I figured, "Why make em' jump through hoops unnecessarily." The answer was "future proofing" 😄!

@heaths heaths merged commit b2dde43 into heaths:main Jun 17, 2024
1 check passed
@heaths
Copy link
Owner

heaths commented Jun 17, 2024

Do you need a new build anytime soon? I've been working on a few minor changes for better testing but haven't had much time. If you need something sooner, I can get a point release out.

@ZachNo
Copy link
Contributor Author

ZachNo commented Jun 18, 2024

Thanks! I'm personally not in a huge rush, but an updated release may help anyone else scratching their head as to why the package doesn't appear to work in some cases with the newest Rust versions c:

@heaths
Copy link
Owner

heaths commented Jun 18, 2024

I went ahead and released https://github.com/heaths/msica-rs/releases/tag/v0.4.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants