This is a minimum c++ example to dump information (hardware ID, manufacturer etc..) about installed device using Windows SDK API.
Tested with
- Windows 10 21H2 (1904 build)
- MSVC 2019
- CMake 3.21.3
Clone the repository
git clone https://github.com/WesleyCh3n/WindowsDeviceInfoDumper.git
cd WindowsDeviceInfoDumper
CMake the project
mkdir build && cd build
cmake ..
cmake --build . --config Release
Then the executable will be in ./build/Release/
directory.
./devInfoDumper <filename>.json
Then there are both stdout
and <filename>.json
about device information.
If json value showing [Error: #]
, #
is windows system error code.
Go check out doc to see what happened.