-
Notifications
You must be signed in to change notification settings - Fork 122
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
SAL annotations are incorrectly being interpreted as Optional
#805
Comments
Optional
This seems to be a much larger problem of misapplying |
Think #803 is also related, and overall related to SAL annotation parser needing some tweaks. win32metadata/sources/ClangSharpSourceToWinmd/MetadataSyntaxTreeCleaner.cs Lines 779 to 807 in e20e414
|
The SAL annotation for
IWeakReferenceSource.GetWeakReference
indicates that its parameter is__RPC__deref_out_opt
, which indicates that the caller must provide a valid pointer - it is not optional - but that it may return a null pointer back to the caller. The two canonical implementations (WRL and C++/WinRT) both treat it as required and will AV if a valid pointer is not provided.The metadata should remove the
[Optional]
attribute to correctly describe APIs with this annotation.The text was updated successfully, but these errors were encountered: