windows.cfg: Fix PostMessage() configuration

First argument is optional (allowed to be NULL). See also the annotation
"_In_opt_".
Reference:
https://docs.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-postmessagea
This commit is contained in:
versat 2019-09-18 09:22:57 +02:00
parent 5bf6bd1f5e
commit d08539fe17
2 changed files with 19 additions and 2 deletions

View File

@ -2738,15 +2738,30 @@ HFONT CreateFont(
_In_ UINT Msg,
_In_ WPARAM wParam,
_In_ LPARAM lParam); -->
<function name="SendMessage,SendMessageA,SendMessageW">
<noreturn>false</noreturn>
<arg nr="1" direction="in">
<not-null/>
<not-uninit/>
</arg>
<arg nr="2" direction="in">
<not-uninit/>
</arg>
<arg nr="3" direction="in">
<not-uninit/>
</arg>
<arg nr="4" direction="in">
<not-uninit/>
</arg>
</function>
<!-- BOOL WINAPI PostMessage(
_In_opt_ HWND hWnd,
_In_ UINT Msg,
_In_ WPARAM wParam,
_In_ LPARAM lParam); -->
<function name="SendMessage,SendMessageA,SendMessageW,PostMessage,PostMessageA,PostMessageW">
<function name="PostMessage,PostMessageA,PostMessageW">
<noreturn>false</noreturn>
<arg nr="1" direction="in">
<not-null/>
<not-uninit/>
</arg>
<arg nr="2" direction="in">

View File

@ -190,6 +190,8 @@ void validCode()
void * pAlloc1 = _aligned_malloc(100, 2);
_aligned_free(pAlloc1);
::PostMessage(nullptr, WM_QUIT, 0, 0);
// Valid Library usage, no leaks, valid arguments
HINSTANCE hInstLib = LoadLibrary(L"My.dll");
FreeLibrary(hInstLib);