Closed NN--- closed 5 years ago
I like the idea, but it would take an incredible amount of time since I would have to read the help for each of the 10,000 functions and annotate each one. Thoughts on automating that?
Not sure what is the best way. If you look in SDK headers, they have several attributes specifying whether pointer is nullable or not for instance:
WINBASEAPI
BOOL
WINAPI
CreateProcessW(
_In_opt_ LPCWSTR lpApplicationName,
_Inout_opt_ LPWSTR lpCommandLine,
_In_opt_ LPSECURITY_ATTRIBUTES lpProcessAttributes,
_In_opt_ LPSECURITY_ATTRIBUTES lpThreadAttributes,
_In_ BOOL bInheritHandles,
_In_ DWORD dwCreationFlags,
_In_opt_ LPVOID lpEnvironment,
_In_opt_ LPCWSTR lpCurrentDirectory,
_In_ LPSTARTUPINFOW lpStartupInfo,
_Out_ LPPROCESS_INFORMATION lpProcessInformation
);
I have used the [Optional]
attribute on parameters that could be omitted by passing null
in the 2.0 release. Using the JetBrains attributes are the next step, but I wanted to get 2.0 out.
What do you think about adding annotations attributes ? https://www.jetbrains.com/help/resharper/Reference__Code_Annotation_Attributes.html