29 #define _WIN32_WINNT 0x0600 // For GetTickCount64 as per MSDN 30 #define SECURITY_WIN32 37 #include <boost/format.hpp> 39 #include <boost/date_time/posix_time/posix_time.hpp> 49 throw std::runtime_error(
"not available");
53 throw std::runtime_error(
"not available");
61 throw std::runtime_error(
"not available");
71 if (GetComputerName(buffer, &length) != 0) {
72 return std::string(buffer, length);
74 throw std::runtime_error(
76 boost::format(
"GetComputerName failed: %1%")
88 if (GetComputerObjectName(NameUniqueId, buffer, &length) != 0) {
89 return std::string(buffer, length);
91 throw std::runtime_error(
92 boost::str(boost::format(
"GetComputerObjectName(NameUniqueId)" 101 boost::uint64_t millisSinceBoot = GetTickCount64();
102 return boost::posix_time::microsec_clock::local_time()
103 - boost::posix_time::millisec(millisSinceBoot);
RSC_EXPORT std::string currentHostId()
Determine and return a unique id string of the local machine.
const unsigned int HOST_ID_MAX_LENGTH
RSC_EXPORT boost::posix_time::ptime currentBootTime()
Return the boot time of the local machine.
RSC_EXPORT std::string currentMachineVersion()
Determine and return the version within its type, usually the CPU identification string, of the local machine.
RSC_EXPORT std::string currentHostname()
Determine and return the hostname of the local machine.
std::string GetLastErrorString()
RSC_EXPORT std::string currentSoftwareVersion()
Determine and return the version of the operating system within its type, usually the kernel version ...
RSC_EXPORT std::string currentSoftwareType()
Determine and return the type of the operating system, usually the kernel name, running on the local ...
const unsigned int HOSTNAME_MAX_LENGTH
RSC_EXPORT std::string currentMachineType()
Determine and return the machine type, usually CPU architecture, of the local machine.