Enable Nullability on a couple of Interfaces#8394
Conversation
lonitra
left a comment
There was a problem hiding this comment.
Just a question, but otherwise LGTM
| System.Resources.Tools.ITargetAwareCodeDomProvider.SupportsProperty(System.Type! type, string! propertyName, bool isWritable) -> bool | ||
| System.Runtime.InteropServices.UCOMITypeLib.GetDocumentation(int index, out string! strName, out string! strDocString, out int dwHelpContext, out string! strHelpFile) -> void | ||
| System.Runtime.InteropServices.UCOMITypeLib.IsName(string! szNameBuf, int lHashVal) -> bool |
There was a problem hiding this comment.
Curious, how did you verify that these should be nonnull?
There was a problem hiding this comment.
Good catch, I checked the first link. But neglected to check the second. It looks like it can be null.
- https://learn.microsoft.com/en-us/dotnet/api/system.runtime.interopservices.ucomitypelib.getdocumentation?view=windowsdesktop-7.0#system-runtime-interopservices-ucomitypelib-getdocumentation(system-int32-system-string@-system-string@-system-int32@-system-string@)
- https://learn.microsoft.com/en-us/windows/win32/api/oaidl/nf-oaidl-itypelib-getdocumentation
There was a problem hiding this comment.
For the ITypeLib it should in-fact allow null. So I am wrong here.
There was a problem hiding this comment.
If the caller does not need the item name, then pBstrName can be null. So this would be true if we were using it as a standard pinvoke. We could pass null for the pointer value if we didn't want to get the strName. But since this interface has out parameters we aren't providing a pointer to a string. So it will always return the string value.
Does that make sense?
There was a problem hiding this comment.
I see what you're saying, yep makes sense. Thanks for taking some time to look into that.
Enable Nullability on a couple of Interfaces
Related: #8342
Microsoft Reviewers: Open in CodeFlow