#include "vm_tools_version.h"
#if !defined(WINNT_DDK)
# include "hostinfo.h"
+# include "str.h"
#endif
/*
uint32 dummy;
#if !defined(WINNT_DDK)
- if (VmCheckSafe(Hostinfo_TouchXen)) {
- Debug("%s: detected Xen.\n", __FUNCTION__);
- return FALSE;
- }
+ char *hypervisorSig;
- if (VmCheckSafe(Hostinfo_TouchVirtualPC)) {
- Debug("%s: detected Virtual PC.\n", __FUNCTION__);
- return FALSE;
- }
+ /*
+ * Check for other environments like Xen and VirtualPC only if we haven't
+ * already detected that we are on a VMware hypervisor. See PR 1035346.
+ */
+ hypervisorSig = Hostinfo_HypervisorCPUIDSig();
+ if (hypervisorSig == NULL ||
+ Str_Strcmp(hypervisorSig, CPUID_VMWARE_HYPERVISOR_VENDOR_STRING) != 0) {
- if (!VmCheckSafe(Hostinfo_TouchBackDoor)) {
- Debug("%s: backdoor not detected.\n", __FUNCTION__);
- return FALSE;
+ free(hypervisorSig);
+
+ if (VmCheckSafe(Hostinfo_TouchXen)) {
+ Debug("%s: detected Xen.\n", __FUNCTION__);
+ return FALSE;
+ }
+
+ if (VmCheckSafe(Hostinfo_TouchVirtualPC)) {
+ Debug("%s: detected Virtual PC.\n", __FUNCTION__);
+ return FALSE;
+ }
+
+ if (!VmCheckSafe(Hostinfo_TouchBackDoor)) {
+ Debug("%s: backdoor not detected.\n", __FUNCTION__);
+ return FALSE;
+ }
+
+ } else {
+ free(hypervisorSig);
}
/* It should be safe to use the backdoor without a crash handler now. */