Bug 603204: Block D3D9 on windows 2000. r=bjacob
authorBas Schouten <bschouten@mozilla.com>
Tue, 12 Oct 2010 23:27:14 +0200
changeset 55386 acffa474bd6d62711f50a623023b4836ab05f35a
parent 55384 7819e11aa46fc371fddd653fcf8a5a29133a731a
child 55389 7b9f262dda1ae228acd28a1d436554ff62f476b0
push idunknown
push userunknown
push dateunknown
reviewersbjacob
bugs603204
milestone2.0b8pre
Bug 603204: Block D3D9 on windows 2000. r=bjacob
widget/public/nsIGfxInfo.idl
widget/src/windows/GfxInfo.cpp
--- a/widget/public/nsIGfxInfo.idl
+++ b/widget/public/nsIGfxInfo.idl
@@ -99,16 +99,18 @@ interface nsIGfxInfo : nsISupports
   /* This feature is blocked on this driver version. Updating driver will typically unblock it. */
   const long FEATURE_BLOCKED_DRIVER_VERSION = 2;
   /* This feature is blocked on this device, regardless of driver version.
    * Typically means we hit too many driver crashes without a good reason to hope for them to
    * get fixed soon. */
   const long FEATURE_BLOCKED_DEVICE = 3;
   /* This feature is available and can be used, but is not suggested (e.g. shouldn't be used by default */
   const long FEATURE_DISCOURAGED = 4;
+  /* This feature is blocked on this OS version. */
+  const long FEATURE_BLOCKED_OS_VERSION = 5;
 
   /**
    * Ask about a feature, and return the status of that feature
    */
   long getFeatureStatus(in long aFeature);
 
   /*
    * Ask about a feature, return the minimum driver version required for it if its status is
--- a/widget/src/windows/GfxInfo.cpp
+++ b/widget/src/windows/GfxInfo.cpp
@@ -572,16 +572,23 @@ ParseDriverVersion(nsAString& aVersion, 
 nsresult
 GfxInfo::GetFeatureStatusImpl(PRInt32 aFeature, PRInt32 *aStatus, nsAString & aSuggestedDriverVersion)
 {
   *aStatus = nsIGfxInfo::FEATURE_NO_INFO;
   aSuggestedDriverVersion.SetIsVoid(PR_TRUE);
 
   PRInt32 status = nsIGfxInfo::FEATURE_NO_INFO;
 
+  if (aFeature == FEATURE_DIRECT3D_9_LAYERS &&
+      gfxWindowsPlatform::WindowsOSVersion() < gfxWindowsPlatform::kWindowsXP)
+  {
+    *aStatus = FEATURE_BLOCKED_OS_VERSION;
+    return NS_OK;
+  }
+
   PRUint32 adapterVendor = 0;
   PRUint32 adapterDeviceID = 0;
   nsAutoString adapterDriverVersionString;
   if (NS_FAILED(GetAdapterVendorID(&adapterVendor)) ||
       NS_FAILED(GetAdapterDeviceID(&adapterDeviceID)) ||
       NS_FAILED(GetAdapterDriverVersion(adapterDriverVersionString)))
   {
     return NS_ERROR_FAILURE;