windows.cfg: Ensure the return value is taken into account for memory (re)-allocation functions.

This commit is contained in:
orbitcowboy 2019-03-01 08:58:53 +01:00
parent 2fad53e4f8
commit 360823203f
2 changed files with 18 additions and 0 deletions

View File

@ -4490,6 +4490,7 @@ HFONT CreateFont(
size_t size);-->
<function name="_malloca">
<returnValue type="void *"/>
<use-retval/>
<noreturn>false</noreturn>
<arg nr="1">
<not-uninit/>
@ -4600,6 +4601,7 @@ HFONT CreateFont(
<function name="HeapAlloc">
<noreturn>false</noreturn>
<returnValue type="LPVOID"/>
<use-retval/>
<arg nr="1">
<not-uninit/>
</arg>
@ -4619,6 +4621,7 @@ HFONT CreateFont(
<function name="HeapReAlloc">
<noreturn>false</noreturn>
<returnValue type="LPVOID"/>
<use-retval/>
<arg nr="1">
<not-uninit/>
</arg>
@ -5309,6 +5312,7 @@ HFONT CreateFont(
<function name="LocalAlloc">
<noreturn>false</noreturn>
<returnValue type="HLOCAL"/>
<use-retval/>
<arg nr="1">
<not-uninit/>
<not-bool/>
@ -5327,6 +5331,7 @@ HFONT CreateFont(
<function name="LocalReAlloc">
<noreturn>false</noreturn>
<returnValue type="HLOCAL"/>
<use-retval/>
<arg nr="1">
<not-bool/>
</arg>
@ -7231,6 +7236,16 @@ HFONT CreateFont(
<define name="CO_E_ACNOTINITIALIZED" value="0x8001013F"/>
<define name="CO_E_CANCEL_DISABLED" value="0x80010140"/>
<define name="RPC_E_UNEXPECTED" value="0x8001FFFF"/>
<define name="LHND" value="0x0042"/>
<define name="LMEM_FIXED" value="0x0000"/>
<define name="LMEM_MOVEABLE" value="0x0002"/>
<define name="LMEM_ZEROINIT" value="0x0040"/>
<define name="LPTR" value="0x0040"/>
<define name="NONZEROLHND" value="0x0002"/>
<define name="NONZEROLPTR" value="0x0000"/>
<define name="HEAP_GENERATE_EXCEPTIONS" value="0x0004"/>
<define name="HEAP_NO_SERIALIZE" value="0x0001"/>
<define name="HEAP_ZERO_MEMORY" value="0x0008"/>
<!-- Winerror.h: COM Error Codes (Security and Setup) Ref.: https://msdn.microsoft.com/en-us/library/windows/desktop/dd542646(v=vs.85).aspx-->
<define name="ERROR_AUDITING_DISABLED" value="0xC0090001"/>
<define name="ERROR_ALL_SIDS_FILTERED" value="0xC0090002"/>

View File

@ -472,6 +472,7 @@ void ignoredReturnValue()
// cppcheck-suppress leakReturnValNotUsed
CreateEventEx(NULL, L"test", CREATE_EVENT_INITIAL_SET, EVENT_MODIFY_STATE);
// cppcheck-suppress ignoredReturnValue
// cppcheck-suppress leakReturnValNotUsed
_malloca(10);
// cppcheck-suppress ignoredReturnValue
@ -482,8 +483,10 @@ void ignoredReturnValue()
// cppcheck-suppress ignoredReturnValue
GetProcessHeap()
// cppcheck-suppress ignoredReturnValue
// cppcheck-suppress leakReturnValNotUsed
HeapAlloc(GetProcessHeap(), 0, 10);
// cppcheck-suppress ignoredReturnValue
// cppcheck-suppress leakReturnValNotUsed
HeapReAlloc(GetProcessHeap(), 0, 1, 0);