Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Inconsistent annotation for 'WinMain'

I'm trying to get my code as perfect as possible, and I've cleaned up all errors and (other) warnings. I'm left with these two:

Warning C28253  Inconsistent annotation for 'WinMain': _Param_(2) has 'SAL_null(__no)' on this instance.
Warning C28252  Inconsistent annotation for 'WinMain': _Param_(2) has 'SAL_null(__maybe)' on the prior instance.

Here is my WinMain function

int CALLBACK WinMain( _In_ HINSTANCE hInstance, _In_ HINSTANCE hPrevInstance, _In_ LPSTR lpCmdLine, _In_ int nCmdShow );

Why is my second paramater HINSTANCE hPrevInstance not annotated correctly despite it being ripped straight from MSDN with the _In_ info?

like image 867
J. Doe Avatar asked Dec 24 '17 05:12

J. Doe


1 Answers

It is because the hPrevInstance argument actually has the _In_opt_ annotation rather than just _In_.

like image 169
SoronelHaetir Avatar answered Nov 12 '22 09:11

SoronelHaetir