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

Support COM-style query signatures with unconventional parameter positions #1805

Merged
merged 9 commits into from
Jun 9, 2022

Conversation

kennykerr
Copy link
Collaborator

@kennykerr kennykerr commented Jun 7, 2022

Fixes #1354

@robmikh let me know what you think of the transformation of ICompositionDrawingSurfaceInterop.

@kennykerr kennykerr changed the title Support COM-style query signatures that don Support COM-style query signatures with unconventional parameter positions Jun 7, 2022
@robmikh
Copy link
Member

robmikh commented Jun 7, 2022

It looks great!

@riverar
Copy link
Collaborator

riverar commented Jun 7, 2022

Do you want to loosen up the type check on the ComOutPtr parameter? (Seems to be limited to void** right now.) That would let in trouble makers like:

// Windows.Win32.Graphics.Direct2D.ID2D1Factory1
unsafe HRESULT GetEffectProperties([In][Const] Guid* effectId, [Out][ComOutPtr] ID2D1Properties* properties);

// Windows.Win32.UI.Shell.IHlinkBrowseContext
unsafe HRESULT Clone([In] IUnknown piunkOuter, [In][Const] Guid* riid, [Out][ComOutPtr] IUnknown* ppiunkObj);

@kennykerr
Copy link
Collaborator Author

I think it might be better to fix those in metadata. That way we can confirm they are truly meant to be void**.

Case law: microsoft/win32metadata#446

crates/libs/bindgen/src/gen.rs Outdated Show resolved Hide resolved
crates/libs/metadata/src/reader/mod.rs Outdated Show resolved Hide resolved
crates/libs/metadata/src/reader/mod.rs Show resolved Hide resolved
crates/libs/metadata/src/reader/mod.rs Show resolved Hide resolved
}
_ => {
let name = self.param_name(param.def);
if let ArrayInfo::Fixed(fixed) = param.array_info {
Copy link
Contributor

Choose a reason for hiding this comment

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

Instead of the chained if let ArrayInfo and continue calls you can turn this all into a match expression.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

There seem to be quite a few such candidates. I can tackle these separately.

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.

IMMDevice.Activate fails with IAudioSessionManager2
4 participants