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

Functions missing the ComOutPtr attribute #1425

Closed
kennykerr opened this issue Jan 12, 2023 · 0 comments
Closed

Functions missing the ComOutPtr attribute #1425

kennykerr opened this issue Jan 12, 2023 · 0 comments
Assignees
Labels
broken api An API is inaccurate and could lead to runtime failure rust Critical for Rust adoption

Comments

@kennykerr
Copy link
Contributor

kennykerr commented Jan 12, 2023

The CoGetObjectContext example is a bug in the Win32 metadata. It is lacking the ComOutPtr attribute on the trailing void** parameter. For example, the metadata for CoCreateInstance is as follows:

public unsafe static extern HRESULT CoCreateInstance([In][Const] Guid* rclsid, [Optional][In] IUnknown pUnkOuter, [In] CLSCTX dwClsContext, [In][Const] Guid* riid, [Out][ComOutPtr] void** ppv);

But CoGetObjectContext is missing the ComOutPtr attribute:

public unsafe static extern HRESULT CoGetObjectContext([In][Const] Guid* riid, [Out] void** ppv);

At a glance, the following functions from the Windows.Win32.System.Com namespace are missing the ComOutPtr attribute:

CreateDataCache
BindMoniker
CoGetObject
CoGetObjectContext
CoGetClassObject
CoGetCallContext
CoGetCancelObject

I'll open an issue for these.

For the rest of the discussion, I agree that https://stackoverflow.com/ is a more appropriate platform.

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

@kennykerr kennykerr added the rust Critical for Rust adoption label Jan 12, 2023
@mikebattista mikebattista self-assigned this Jan 13, 2023
@mikebattista mikebattista added the broken api An API is inaccurate and could lead to runtime failure label Jan 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
broken api An API is inaccurate and could lead to runtime failure rust Critical for Rust adoption
Projects
None yet
Development

No branches or pull requests

2 participants