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

Return null when Variant contains BSTR #53030

Merged
merged 2 commits into from
May 20, 2021
Merged

Conversation

kant2002
Copy link
Contributor

I found this one when implement VARIANT marshalling for NativeAOT. Without that I have to resort to duplicate implementation in that class.
PR where I discover this - dotnet/runtimelab#1142
Problem is Marshal.PtrToStringBSTR throw exception when passed IntPtr.Zero, but Marshal.StringToBSTR produce IntPtr.Zero when given null.

I found this one when implement VARIANT marshalling for NativeAOT. Without that I have to resort to duplicate implementation in that class.
PR where I discover this - dotnet/runtimelab#1142
Problem is `Marshal.PtrToStringBSTR` throw exception when passed `IntPtr.Zero`, but `Marshal.StringToBSTR` produce `IntPtr.Zero` when given null.
@AaronRobinsonMSFT AaronRobinsonMSFT merged commit 999c9c0 into dotnet:main May 20, 2021
@kant2002 kant2002 deleted the patch-1 branch May 21, 2021 05:07
@ghost ghost locked as resolved and limited conversation to collaborators Jun 20, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants