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

Possible API signature change #1498

Closed
kmanc opened this issue Feb 4, 2022 · 4 comments
Closed

Possible API signature change #1498

kmanc opened this issue Feb 4, 2022 · 4 comments
Labels
question Further information is requested

Comments

@kmanc
Copy link

kmanc commented Feb 4, 2022

Which crate is this about?

windows

Crate version

0.32.0

Summary

processinformationclass no longer accepts an integer as an argument. The following worked in 0.30.0 but doesn't in 0.32.0

if let Err(error) = unsafe { NtQueryInformationProcess(processhandle, 0, processinformation, processinformationlength, returnlength) } {
        panic!("Could not get the entry point with ZwQueryInformationProcess: {error}");
}

Expected behavior

I might have missed something in the changelog that explains why this is the case, but I would expect the above code to compile assuming all of the other arguments are correct

Actual behavior

Compiler returns " ^ expected struct PROCESSINFOCLASS, found integer"

Additional comments

EDIT - I said the wrong type
No response

@kmanc kmanc added the bug Something isn't working label Feb 4, 2022
@kennykerr
Copy link
Collaborator

It likely changed here: #1482

Mentioned in the release notes here: https://github.com/microsoft/windows-rs/releases/tag/0.32.0

Here are the docs for the NtQueryInformationProcess function in the windows crate: https://microsoft.github.io/windows-docs-rs/doc/windows/Win32/System/Threading/fn.NtQueryInformationProcess.html

@kennykerr kennykerr added question Further information is requested and removed bug Something isn't working labels Feb 4, 2022
@kennykerr kennykerr changed the title Bug: Possible API signature change Feb 4, 2022
@kennykerr
Copy link
Collaborator

kennykerr commented Feb 4, 2022

Oh, I don't think the API signature has changed. PROCESSINFOCLASS was previously a type alias for the underlying type, i32, but is now a new struct type (#1393 and #1436).

@kmanc
Copy link
Author

kmanc commented Feb 4, 2022

Ahh ok, yeah that would explain it! I just changed my code to actually use the struct but was a bit confused at first when suddenly code that hadn't been changed was throwing an error at compile time. Thank you :)

@kennykerr
Copy link
Collaborator

Great, sorry for any confusion. 😊

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

No branches or pull requests

2 participants