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

Various enums have the incorrect underlying type making certain functions un-linkable and un-callable #1221

Closed
kennykerr opened this issue Sep 2, 2022 · 5 comments · Fixed by #1225
Labels
rust Critical for Rust adoption

Comments

@kennykerr
Copy link
Contributor

__imp__AcceptSecurityContext@40 __imp__AcceptSecurityContext@36
__imp__InitializeSecurityContextA@52 __imp__InitializeSecurityContextA@48
__imp__InitializeSecurityContextW@52 __imp__InitializeSecurityContextW@48
__imp__SaslAcceptSecurityContext@40 __imp__SaslAcceptSecurityContext@36
__imp__SaslInitializeSecurityContextA@52 __imp__SaslInitializeSecurityContextA@48
__imp__SaslInitializeSecurityContextW@52 __imp__SaslInitializeSecurityContextW@48

These all looks like win32metadata bugs where the signatures are improperly declared, mixing 32 bit and 64 bit integer types. For example, the win32metadata uses enums like ASC_REQ_FLAGS instead of unsigned 32 bit parameters but the enum's underlying type is an unsigned 64 bit integer. Same for ISC_REQ_FLAGS. This then throws off the stdcall stack size calculation and of course makes these functions uncallable.

I wish the win32metadata could just validate this against the lib files in the SDK using dumpbin.

I'll create a win32metadata issue for this.

Originally posted by @kennykerr in microsoft/windows-rs#1999 (comment)

@elachlan
Copy link
Contributor

elachlan commented Sep 2, 2022

Similar issue in #1213. It has a counter case of a field being moved from uint to byte because the enum values are byte sized. Would this change fail the suggested validation?

@kennykerr
Copy link
Contributor Author

Yes.

@kennykerr
Copy link
Contributor Author

If nothing else, we should have a test here that validates that the transformation to enum didn't change the size of any parameters in the process.

@sotteson1
Copy link
Contributor

I have code that is supposed to be checking for this, but there was a problem that was keeping it from working on parameters (was working only for fields).

@riverar
Copy link
Collaborator

riverar commented Sep 6, 2022

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

Successfully merging a pull request may close this issue.

4 participants