-
Notifications
You must be signed in to change notification settings - Fork 466
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
Update windows-bindgen
dependency
#1347
Conversation
pub type HINSTANCE = *mut core::ffi::c_void; | ||
pub type HKEY = *mut core::ffi::c_void; | ||
pub const HKEY_LOCAL_MACHINE: HKEY = -2147483646i32 as _; | ||
pub type HMODULE = *mut core::ffi::c_void; | ||
pub type HRESULT = i32; | ||
pub type IMAGE_FILE_MACHINE = u16; | ||
pub const IMAGE_FILE_MACHINE_AMD64: IMAGE_FILE_MACHINE = 34404u16; | ||
pub const IID_IUnknown: GUID = GUID::from_u128(0x00000000_0000_0000_c000_000000000046); | ||
#[repr(C)] | ||
pub struct IUnknown_Vtbl { | ||
pub QueryInterface: unsafe extern "system" fn( | ||
this: *mut core::ffi::c_void, | ||
iid: *const GUID, | ||
interface: *mut *mut core::ffi::c_void, | ||
) -> HRESULT, | ||
pub AddRef: unsafe extern "system" fn(this: *mut core::ffi::c_void) -> u32, | ||
pub Release: unsafe extern "system" fn(this: *mut core::ffi::c_void) -> u32, | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: I wonder why these are added?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The metadata used to described HMODULE
- required by FreeLibrary
and friends - actually depends on HINSTANCE
.
Similarly, CoCreateInstance
depends on IUnknown
.
This is what I meant by the following in the PR description:
There are a handful of additional types in the output. Those reflect a more complete representation of the requested filters and their dependencies.
The bindgen
crate doesn't know whether you actually need these dependencies but it includes them as there are cases where they are definitely required.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, thanks for the detailed explanation!
Updates the
cc
crate to use the latest version of thewindows-bindgen
crate.https://github.com/microsoft/windows-rs/releases/tag/0.61.0
A few notes worth mentioning about this change:
bindgen
arguments have been simplified and I've updated them to produce the same form of output.--etc
option can be used to avoid having to parse the filter file yourself.Here's more detailed information on the latest version of the
windows-bindgen
crate:microsoft/windows-rs#3359
Adding @ChrisDenton as he originally came up with this model for the Rust project. I figure you'll be updating the bindings for the Rust compiler/library yourself so I thought I'd take a stab at this smaller project.