system-info
Description
info is a lightweight C module that collects hardware and software information on Windows exclusively via the Windows API and the Windows registry. The module uses no WMI, WMIC, OLE or COM in any form. All data is read with direct Win32 API calls and registry queries, making the module fast, dependency-free and easy to audit. All wide strings are transcoded to UTF-8 in the internal representation, so consumers work with plain char buffers.
The module provides a flat data-oriented API: each function fills a buffer or structure passed by the caller and returns an element count or status. No global variables, no internal allocations outliving a call, no threads and no init/shutdown sequence - a function can be called at any time, and repeated calls are safe. The sources do not depend on a specific compiler within the MinGW-w64 toolchain: the same files build as C via gcc and as C++ via g++ with no changes (the public header is wrapped in extern "C"). The repository also contains test_info - a small console demo app that links the module and prints the collected data; the demo is secondary, the module is the main result and can be used in any C/C++ project.
Modules used
- kernel32.dll - registry access, system information, memory state, time, disk enumeration, dynamic loading of ntdll.dll
- advapi32.dll - Service Control Manager: service enumeration and configuration queries
- user32.dll - monitor enumeration, keyboard layouts, virtual screen, raw input device list
- gdi32.dll - device capabilities: DPI, color depth, refresh rate
- psapi.dll - process module enumeration, kernel driver enumeration
- version.dll - keyboard layout language names
- setupapi.dll - network-class device enumeration
- ntdll.dll - RtlGetVersion for the real OS version (loaded dynamically at runtime, not linked)
Technologies
- Language: C/C++
- Compiler: MinGW-w64 gcc/g++ (x86_64)
- Platform: Windows 10 / 11, x64
- API: Win32 API, Windows registry, SetupAPI, PSAPI, Toolhelp32
- Dependencies: none - system DLLs only, no third-party libraries
- Output encoding: UTF-8 (all wide strings transcoded via WideCharToMultiByte)
- License GNU AGPL v3 (Affero GPL)