title: Detecting WinXP SP3 using MFC/C++ code returns true even in WinXP SP2
body: <p>Under windows 7 64bit I run my C++ app using compatibility mode "Windows XP service pack 2" and the following code which detects WinXP SP3 returns "TRUE" while it shouldn't. What seems to be wrong here ?</p>
  
  <pre><code>BOOL CUtils::Is_WinXP_SP3_or_Later() {
  
     OSVERSIONINFOEX osvi;
     DWORDLONG dwlConditionMask = 0;
     int op=VER_GREATER_EQUAL;
  
     // Initialize the OSVERSIONINFOEX structure.
  
     ZeroMemory(&amp;osvi, sizeof(OSVERSIONINFOEX));
     osvi.dwOSVersionInfoSize = sizeof(OSVERSIONINFOEX);
     osvi.dwMajorVersion = 5;
     osvi.dwMinorVersion = 1;
     osvi.wServicePackMajor = 3;
     osvi.wServicePackMinor = 0;
     osvi.dwBuildNumber = 2600;
  
     // Initialize the condition mask.
  
     VER_SET_CONDITION( dwlConditionMask, VER_MAJORVERSION, op );
     VER_SET_CONDITION( dwlConditionMask, VER_MINORVERSION, op );
     VER_SET_CONDITION( dwlConditionMask, VER_SERVICEPACKMAJOR, op );
     VER_SET_CONDITION( dwlConditionMask, VER_SERVICEPACKMINOR, op );
     //VER_SET_CONDITION( dwlConditionMask, VER_BUILDNUMBER, op );
  
     // Perform the test.
  
     return VerifyVersionInfo(
        &amp;osvi, 
        VER_MAJORVERSION | VER_MINORVERSION | 
        VER_SERVICEPACKMAJOR | VER_SERVICEPACKMINOR,
        dwlConditionMask);
  }
  </code></pre>