Bonjour,
Je n'arrive pas à compiler cette fonction en X64 sous VS 2005.

Existe t'il une solution car je souhaiterai que cette fonction qu'elle tourne en X64.

J'ai cependant Visual Studio version 2008.


Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
 
bool IsInsideVMWare()
{
  bool rc = true;
 
  __try
  {
    __asm
    {
	  //mov eax,0
	  //mov [eax],0xff
      push   edx
      push   ecx
      push   ebx
 
      mov    eax, 'VMXh'
      mov    ebx, 0 // any value but not the MAGIC VALUE
 
      mov    ecx, 10 // get VMWare version
 
      mov    edx, 'VX' // port number
 
 
      in     eax, dx // read port
 
                     // on return EAX returns the VERSION
 
      cmp    ebx, 'VMXh' // is it a reply from VMWare?
 
      setz   [rc] // set return value
 
 
      pop    ebx
      pop    ecx
      pop    edx
    }
  }
  __except (1)
  //__except(EXCEPTION_EXECUTE_HANDLER)
  {
    rc = false;
  }
 
  return rc;
}
Merci