mirror of
https://github.com/fastfetch-cli/fastfetch.git
synced 2026-11-04 05:54:17 +01:00
38b3aae1e3
by making C++ code more C++
26 lines
558 B
C++
26 lines
558 B
C++
extern "C" {
|
|
#include "processes.h"
|
|
}
|
|
#include "util/windows/wmi.hpp"
|
|
|
|
uint32_t ffDetectProcesses(FFinstance* instance, FFstrbuf* error)
|
|
{
|
|
FF_UNUSED(instance);
|
|
|
|
FFWmiQuery query(L"SELECT NumberOfProcesses FROM Win32_OperatingSystem", error);
|
|
if(!query)
|
|
return 0;
|
|
|
|
if(FFWmiRecord record = query.next())
|
|
{
|
|
uint64_t result = 0;
|
|
record.getUnsigned(L"NumberOfProcesses", &result);
|
|
return (uint32_t)result;
|
|
}
|
|
else
|
|
{
|
|
ffStrbufAppendS(error, "No Wmi result returned");
|
|
return 0;
|
|
}
|
|
}
|