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

Simplify parameter binding for BSTR #2372

Merged
merged 1 commit into from
Mar 9, 2023
Merged

Simplify parameter binding for BSTR #2372

merged 1 commit into from
Mar 9, 2023

Conversation

kennykerr
Copy link
Collaborator

BSTR is relatively unusual as an input parameter since it is generally unnecessary, but it happens and can make certain APIs harder to use. This update just treats BSTR as any other generic borrowed type. Practically that means that you can pass None instead of having to create an empty BSTR for optional parameters. For example, connecting to a WMI server is a lot simpler:

let server =
    locator.ConnectServer(&BSTR::from("root\\cimv2"), None, None, None, 0, None, None)?;

@kennykerr kennykerr merged commit 301c48c into master Mar 9, 2023
@kennykerr kennykerr deleted the bstr branch March 9, 2023 20:57
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.

1 participant