lfreist / hwinfo

cross platform C++ library for hardware information (CPU, RAM, GPU, ...)
MIT License
438 stars 76 forks source link

Why OS Architecture not the same on my windows system info? #46

Closed fiantyogalihp closed 1 year ago

fiantyogalihp commented 1 year ago

My code: `hwinfo::OS os; std::cout << "----------------------------------- OS ------------------------------------" << std::endl;

std::cout << std::left << std::setw(20) << "Operating System:";

std::cout << os.fullName() << std::endl;

std::cout << std::left << std::setw(20) << "short name:";

std::cout << os.name() << std::endl;

std::cout << std::left << std::setw(20) << "version:";

std::cout << os.version() << std::endl;

std::cout << std::left << std::setw(20) << "kernel:";

std::cout << os.kernel() << std::endl;

std::cout << std::left << std::setw(20) << "architecture:";

std::cout << (os.is32bit() ? "32 bit" : "64 bit") << std::endl;

std::cout << std::left << std::setw(20) << "endianess:";

std::cout << (os.isLittleEndian() ? "little endian" : "big endian") << std::endl;`

My code result image

My windows System Information: Screenshot 2023-07-07 113123

lfreist commented 1 year ago

Hi, Thank you for the report.

This bug is new to me and I could not reproduce it on my Windows machine. However, I have tried to harden the code responsible for the bit-architecture report in this commit. Could you please check, if it is working now?

fiantyogalihp commented 1 year ago

Thanks very much, now it's working at all 👍

My code is same to your example.cpp, and my result code: Screenshot 2023-07-07 201656


Oh ya... you might got typo in your example.cpp on line 103 at Main Board serial number :)

lfreist commented 1 year ago

Thanks for sharing your result and happy that I could fix the bug.

You might want to contribute your implementations of kernel and version to this library since they are empty for windows at the moment.