From f4df28d5ec3fa9ed73c25469530f995b3809738c Mon Sep 17 00:00:00 2001 From: orbitcowboy Date: Sat, 11 Nov 2023 14:08:21 +0100 Subject: [PATCH] windows.cfg: Improved configuration for OpenProcess(). (#5651) --- cfg/windows.cfg | 17 +++++++++++++++++ test/cfg/windows.cpp | 7 +++++++ 2 files changed, 24 insertions(+) diff --git a/cfg/windows.cfg b/cfg/windows.cfg index 2c44370679c..2fbeb4ff281 100644 --- a/cfg/windows.cfg +++ b/cfg/windows.cfg @@ -4800,6 +4800,23 @@ HFONT CreateFont( + + + + false + + + + + + + + + + + diff --git a/test/cfg/windows.cpp b/test/cfg/windows.cpp index ffcbd94ad5d..0d5f2d812c5 100644 --- a/test/cfg/windows.cpp +++ b/test/cfg/windows.cpp @@ -19,6 +19,13 @@ #include #include +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) {