windows.cfg: Improved configuration of OpenThread() (#5653)
This commit is contained in:
parent
a6b7a8c1cc
commit
b201ef26cb
|
@ -4803,7 +4803,10 @@ HFONT CreateFont(
|
|||
<!-- HANDLE OpenProcess([in] DWORD dwDesiredAccess,
|
||||
[in] BOOL bInheritHandle,
|
||||
[in] DWORD dwProcessId); -->
|
||||
<function name="OpenProcess">
|
||||
<!-- HANDLE OpenThread ([in] DWORD dwDesiredAccess,
|
||||
[in] BOOL bInheritHandle,
|
||||
[in] DWORD dwThreadId); -->
|
||||
<function name="OpenProcess,OpenThread">
|
||||
<use-retval/>
|
||||
<noreturn>false</noreturn>
|
||||
<returnValue type="HANDLE"/>
|
||||
|
|
|
@ -19,6 +19,13 @@
|
|||
#include <atlstr.h>
|
||||
#include <string>
|
||||
|
||||
void resourceLeak_OpenThread(const DWORD dwDesiredAccess, const BOOL bInheritHandle, const DWORD dwThreadId)
|
||||
{
|
||||
HANDLE proc = OpenThread(dwDesiredAccess, bInheritHandle, dwThreadId);
|
||||
if (proc != INVALID_HANDLE_VALUE) {}
|
||||
// cppcheck-suppress resourceLeak
|
||||
}
|
||||
|
||||
void resourceLeak_OpenProcess(const DWORD dwDesiredAccess, const BOOL bInheritHandle, const DWORD dwProcessId)
|
||||
{
|
||||
HANDLE proc = OpenProcess(dwDesiredAccess, bInheritHandle, dwProcessId);
|
||||
|
|
Loading…
Reference in New Issue