From 08ff887056f6948eeb929fb3c6dfe1e8eb604e7d Mon Sep 17 00:00:00 2001 From: Steven Edwards Date: Tue, 1 Jun 2004 19:08:53 +0000 Subject: [PATCH] revert to 1.3. I didnt mean to commit that svn path=/trunk/; revision=9586 --- reactos/subsys/system/vmwinst/vmwinst.c | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/reactos/subsys/system/vmwinst/vmwinst.c b/reactos/subsys/system/vmwinst/vmwinst.c index 8813b48f891..dcca5ddaf7d 100644 --- a/reactos/subsys/system/vmwinst/vmwinst.c +++ b/reactos/subsys/system/vmwinst/vmwinst.c @@ -16,7 +16,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -/* $Id: vmwinst.c,v 1.4 2004/06/01 19:06:50 sedwards Exp $ +/* $Id: vmwinst.c,v 1.5 2004/06/01 19:08:53 sedwards Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS VMware(r) driver installation utility @@ -56,7 +56,24 @@ LONG WINAPI ExceptionHandler(LPEXCEPTION_POINTERS ExceptionInfo) BOOL DetectVMware(int *Version) { + int magic, ver; + + magic = 0; + ver = 0; + + /* Try using a VMware I/O port. If not running in VMware this'll throw an + exception! */ + __asm__ __volatile__("inl %%dx, %%eax" + : "=a" (ver), "=b" (magic) + : "0" (0x564d5868), "d" (0x5658), "c" (0xa)); + + if(magic == 0x564d5868) + { + *Version = ver; return TRUE; + } + + return FALSE; } BOOL