windows.cfg: Improved configuration for OpenProcess(). (#5651)
This commit is contained in:
parent
2d232dcaac
commit
f4df28d5ec
|
@ -4800,6 +4800,23 @@ HFONT CreateFont(
|
|||
<not-bool/>
|
||||
</arg>
|
||||
</function>
|
||||
<!-- HANDLE OpenProcess([in] DWORD dwDesiredAccess,
|
||||
[in] BOOL bInheritHandle,
|
||||
[in] DWORD dwProcessId); -->
|
||||
<function name="OpenProcess">
|
||||
<use-retval/>
|
||||
<noreturn>false</noreturn>
|
||||
<returnValue type="HANDLE"/>
|
||||
<arg nr="1" direction="in">
|
||||
<not-uninit/>
|
||||
</arg>
|
||||
<arg nr="2" direction="in">
|
||||
<not-uninit/>
|
||||
</arg>
|
||||
<arg nr="3" direction="in">
|
||||
<not-uninit/>
|
||||
</arg>
|
||||
</function>
|
||||
<!--VOID WINAPI FreeLibraryAndExitThread(
|
||||
_In_ HMODULE hModule,
|
||||
_In_ DWORD dwExitCode);-->
|
||||
|
|
|
@ -19,6 +19,13 @@
|
|||
#include <atlstr.h>
|
||||
#include <string>
|
||||
|
||||
void resourceLeak_OpenProcess(const DWORD dwDesiredAccess, const BOOL bInheritHandle, const DWORD dwProcessId)
|
||||
{
|
||||
HANDLE proc = OpenProcess(dwDesiredAccess, bInheritHandle, dwProcessId);
|
||||
if (proc != INVALID_HANDLE_VALUE) {}
|
||||
// cppcheck-suppress resourceLeak
|
||||
}
|
||||
|
||||
/// https://learn.microsoft.com/en-us/windows/console/flushconsoleinputbuffer
|
||||
BOOL unreachableCode_FlushConsoleInputBuffer(int &val)
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue