File tree Expand file tree Collapse file tree 4 files changed +85
-0
lines changed Expand file tree Collapse file tree 4 files changed +85
-0
lines changed Original file line number Diff line number Diff line change 1+ {
2+ "configurations" : [
3+ {
4+ "name" : " x64-Debug" ,
5+ "generator" : " Ninja" ,
6+ "configurationType" : " Debug" ,
7+ "inheritEnvironments" : [ " msvc_x64_x64" ],
8+ "buildRoot" : " ${projectDir}\\ out\\ build\\ ${name}" ,
9+ "installRoot" : " ${projectDir}\\ out\\ install\\ ${name}" ,
10+ "cmakeCommandArgs" : " " ,
11+ "buildCommandArgs" : " " ,
12+ "ctestCommandArgs" : " " ,
13+ "cmakeToolchain" : " C:/Program Files/Microsoft Visual Studio/2022/Community/VC/vcpkg/scripts/buildsystems/vcpkg.cmake"
14+ }
15+ ]
16+ }
Original file line number Diff line number Diff line change 1+ #ifndef __WIL_TOOLHELP32_INCLUDED
2+ #define __WIL_TOOLHELP32_INCLUDED
3+ #include < TlHelp32.h>
4+ namespace wil
5+ {
6+ namespace details
7+ {
8+
9+ }
10+
11+ template <typename TCallback>
12+ void for_each_process (TCallback&& /* callback*/ )
13+ {
14+
15+ }
16+
17+ template <typename TCallback>
18+ void for_each_thread (TCallback&& /* callback*/ )
19+ {
20+
21+ }
22+
23+ template <typename TCallback>
24+ void for_each_module (TCallback&& /* callback*/ )
25+ {
26+
27+ }
28+
29+ template <typename TCallback>
30+ void for_each_heap (TCallback&& /* callback*/ )
31+ {
32+
33+ }
34+ }
35+
36+ #endif
Original file line number Diff line number Diff line change @@ -75,6 +75,7 @@ set(COMMON_SOURCES
7575 ${CMAKE_CURRENT_SOURCE_DIR} /WistdTests.cpp
7676 ${CMAKE_CURRENT_SOURCE_DIR} /wiTest.cpp
7777 ${CMAKE_CURRENT_SOURCE_DIR} /../natvis/wil.natvis
78+ ${CMAKE_CURRENT_SOURCE_DIR} /Toolhelp32Tests.cpp
7879 )
7980
8081if (MSVC )
Original file line number Diff line number Diff line change 1+ #include " common.h"
2+ #include < WinUser.h>
3+ #include < wil/toolhelp32.h>
4+ #include < cstring>
5+
6+ TEST_CASE (" Toolhelp32" , " [EnumProcesses]" )
7+ {
8+ wil::for_each_process ([](PROCESSENTRY32 entry) {
9+ REQUIRE_FALSE (std::strlen (entry.szExeFile ) == 0 );
10+ });
11+ }
12+
13+ TEST_CASE (" Toolhelp32" , " [EnumModules]" )
14+ {
15+ wil::for_each_module ([](MODULEENTRY32 entry) {
16+ REQUIRE_FALSE (std::strlen (entry.szExePath ) == 0 );
17+ });
18+ }
19+
20+ TEST_CASE (" Toolhelp32" , " [EnumThreads]" )
21+ {
22+ wil::for_each_thread ([](THREADENTRY32 entry) {
23+ REQUIRE_FALSE (entry.th32ThreadID == 0 );
24+ });
25+ }
26+
27+ TEST_CASE (" Toolhelp32" , " [EnumHeaps]" )
28+ {
29+ wil::for_each_heap ([](HEAPLIST32 entry) {
30+ REQUIRE_FALSE (entry.th32HeapID == 0 );
31+ });
32+ }
You can’t perform that action at this time.
0 commit comments