Skip to content

Conversation

uint-nate
Copy link
Contributor

@uint-nate uint-nate commented Sep 28, 2025

Potential solution for #3781

For reference, I used code built on this to generate the following bindings: https://github.com/uint-nate/pluginrust/blob/master/bindings/src/bindings.rs

        pub type EXPERIMENTAL_WebAuthNDecodeGetAssertionRequest = unsafe extern "system" fn(cbencoded : u32, pbencoded : *const u8, ppgetassertionrequest : *mut *mut _EXPERIMENTAL_WEBAUTHN_CTAPCBOR_GET_ASSERTION_REQUEST) -> windows_sys::core::HRESULT ;
        windows_link::link!("webauthn.dll" "system" fn EXPERIMENTAL_WebAuthNDecodeGetAssertionRequest(cbencoded : u32, pbencoded : *const u8, ppgetassertionrequest : *mut *mut _EXPERIMENTAL_WEBAUTHN_CTAPCBOR_GET_ASSERTION_REQUEST) -> windows_sys::core::HRESULT);

@uint-nate
Copy link
Contributor Author

@microsoft-github-policy-service agree

(shouldn't be necessary since I'm a MSFT employee but 🤷)

@uint-nate
Copy link
Contributor Author

@microsoft-github-policy-service agree company="Microsoft"

@uint-nate uint-nate force-pushed the jonesnl/sys_fn_ptrs branch 4 times, most recently from 2f85944 to 8dee533 Compare October 12, 2025 00:01
@uint-nate uint-nate force-pushed the jonesnl/sys_fn_ptrs branch from 8dee533 to b4c358d Compare October 12, 2025 01:05
@uint-nate uint-nate changed the title [DRAFT] Prototyping windows-sys fn ptr types [DRAFT] Add --sys-fn-ptrs for windows-sys fn ptr types Oct 12, 2025
@uint-nate uint-nate changed the title [DRAFT] Add --sys-fn-ptrs for windows-sys fn ptr types Add --sys-fn-ptrs for windows-sys fn ptr types Oct 12, 2025
@uint-nate uint-nate marked this pull request as ready for review October 12, 2025 02:59
@uint-nate
Copy link
Contributor Author

Updated so that if you specify --sys and --sys-fn-ptrs, then you'll get the function pointer types along side the function bindings.

Also attempted and hopefully successfully added a test for it. Not really familiar with the CI process here but I think the system yelled at me enough to get it mostly right?

This is my first Rust code that isn't just me playing around on toy projects, so happy to take any feedback around best practices that I may be ignorant of 😀.

@uint-nate
Copy link
Contributor Author

https://github.com/uint-nate/pluginrust/blob/master/bindings/src/bindings.rs is updated to use this new binding code.

@uint-nate
Copy link
Contributor Author

The current failures aren't coming from my code FWIW. If you want me to address them I can look into them though if that's the normal flow of things. Not sure if there was a library update or something.

@kennykerr
Copy link
Collaborator

That's a common problem as CI tests against Rust nightly builds as an early warning system. This PR is now blocked on #3789 where I address this.

Copy link
Collaborator

@kennykerr kennykerr left a comment

Choose a reason for hiding this comment

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

Looks good - thanks!

@kennykerr kennykerr merged commit 6bb1683 into microsoft:master Oct 17, 2025
29 checks passed
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