MCPcopy Create free account
hub / github.com/Kitware/CMake / kwsysProcess_List_New

Function kwsysProcess_List_New

Source/kwsys/ProcessWin32.c:2255–2305  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2253};
2254
2255static kwsysProcess_List* kwsysProcess_List_New(void)
2256{
2257 OSVERSIONINFO osv;
2258 kwsysProcess_List* self;
2259
2260 /* Allocate and initialize the list object. */
2261 if (!(self = (kwsysProcess_List*)malloc(sizeof(kwsysProcess_List)))) {
2262 return 0;
2263 }
2264 memset(self, 0, sizeof(*self));
2265
2266 /* Select an implementation. */
2267 ZeroMemory(&osv, sizeof(osv));
2268 osv.dwOSVersionInfoSize = sizeof(osv);
2269#ifdef KWSYS_WINDOWS_DEPRECATED_GetVersionEx
2270# pragma warning(push)
2271# ifdef __INTEL_COMPILER
2272# pragma warning(disable : 1478)
2273# elif defined __clang__
2274# pragma clang diagnostic push
2275# pragma clang diagnostic ignored "-Wdeprecated-declarations"
2276# else
2277# pragma warning(disable : 4996)
2278# endif
2279#endif
2280 GetVersionEx(&osv);
2281#ifdef KWSYS_WINDOWS_DEPRECATED_GetVersionEx
2282# ifdef __clang__
2283# pragma clang diagnostic pop
2284# else
2285# pragma warning(pop)
2286# endif
2287#endif
2288 self->NT4 =
2289 (osv.dwPlatformId == VER_PLATFORM_WIN32_NT && osv.dwMajorVersion < 5) ? 1
2290 : 0;
2291
2292 /* Initialize the selected implementation. */
2293 if (!(self->NT4 ? kwsysProcess_List__New_NT4(self)
2294 : kwsysProcess_List__New_Snapshot(self))) {
2295 kwsysProcess_List_Delete(self);
2296 return 0;
2297 }
2298
2299 /* Update to the current set of processes. */
2300 if (!kwsysProcess_List_Update(self)) {
2301 kwsysProcess_List_Delete(self);
2302 return 0;
2303 }
2304 return self;
2305}
2306
2307static void kwsysProcess_List_Delete(kwsysProcess_List* self)
2308{

Callers 1

kwsysProcessKillTreeFunction · 0.85

Calls 4

kwsysProcess_List_DeleteFunction · 0.85
kwsysProcess_List_UpdateFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…