lundi 1 juin 2020

How to get current operating system version when running over a VMware virtual machine?

I have this simple function that return the current OS but it not work when running over a VMware virtual machine

inline DWORD GetOsVersion()
{
    OSVERSIONINFOEX info;
    ZeroMemory(&info, sizeof(OSVERSIONINFOEX));
    info.dwOSVersionInfoSize = sizeof(OSVERSIONINFOEX);
    GetVersionEx((LPOSVERSIONINFO)&info);

    return info.dwMajorVersion;
}  

Question :
How to get current operating system version when running over a VMware virtual machine ?

Environment:

  • Visual studio 2010
  • C++11

Aucun commentaire:

Enregistrer un commentaire