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

LPBSTR parameters should retain metadata about their being BSTRs #947

Closed
AArnott opened this issue May 31, 2022 · 6 comments
Closed

LPBSTR parameters should retain metadata about their being BSTRs #947

AArnott opened this issue May 31, 2022 · 6 comments
Assignees
Labels
usability Touch-up to improve the user experience for a language projection

Comments

@AArnott
Copy link
Member

AArnott commented May 31, 2022

The QueryPathOfRegTypeLib function is documented as having a last parameter that is an [out] LPBSTR. But in the metadata, we just get [out] uint16** as the parameter type. This blocks projections from providing friendly methods (e.g. returning a string).
Can the metadata be fixed as has been done with other APIs that accept BSTR for example, so that projections can offer better APIs?

@AArnott AArnott added the usability Touch-up to improve the user experience for a language projection label May 31, 2022
@kennykerr
Copy link
Contributor

Agreed. Note that the docs are wrong:

The caller allocates the BSTR that is passed in, and must free it after use.

Should be something like:

The callee allocates the BSTR and the caller must free it after use.

@AArnott
Copy link
Member Author

AArnott commented Jun 1, 2022

Whoa, that's quite the doc mistake. How do you know it's a doc bug?
I was surprised that if the caller was supposed to allocate the string that the docs didn't indicate how large the buffer must be or that the length wasn't passed in as an argument.

@kennykerr
Copy link
Contributor

kennykerr commented Jun 1, 2022

How do you know it's a doc bug?

I looked up the implementation because it sounded wrong. 😏

@AArnott
Copy link
Member Author

AArnott commented Jun 1, 2022

I sent feedback on that doc. Do you suppose they should use SysFreeString?

@kennykerr
Copy link
Contributor

Yes, the caller should free with SysFreeString.

@mikebattista mikebattista self-assigned this Jun 7, 2022
@mikebattista mikebattista reopened this Feb 21, 2023
@mikebattista
Copy link
Collaborator

Per feedback from @kennykerr, remapping all LPBSTR occurrences to BSTR* would be better than introducing PBSTR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
usability Touch-up to improve the user experience for a language projection
Projects
None yet
Development

No branches or pull requests

3 participants