29 #define SECURITY_WIN32 36 #include <boost/format.hpp> 38 #include <boost/date_time/posix_time/posix_time.hpp> 48 throw std::runtime_error(
"not available");
52 throw std::runtime_error(
"not available");
60 throw std::runtime_error(
"not available");
70 if (GetComputerName(buffer, &length) != 0) {
71 return std::string(buffer, length);
73 throw std::runtime_error(
75 boost::format(
"GetComputerName failed: %1%")
87 if (GetComputerObjectName(NameUniqueId, buffer, &length) != 0) {
88 return std::string(buffer, length);
90 throw std::runtime_error(
91 boost::str(boost::format(
"GetComputerObjectName(NameUniqueId)" 100 boost::uint64_t millisSinceBoot = GetTickCount64();
101 return boost::posix_time::microsec_clock::local_time()
102 - 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.