]> granicus.if.org Git - imagemagick/commitdiff
(no commit message)
authorcristy <urban-warrior@git.imagemagick.org>
Thu, 17 Sep 2009 13:31:08 +0000 (13:31 +0000)
committercristy <urban-warrior@git.imagemagick.org>
Thu, 17 Sep 2009 13:31:08 +0000 (13:31 +0000)
magick/nt-base.c

index a8d3197e83e07935918f68b1ec3a39a451cacd12..dc787706ddc9888b197a6f559077a8dbf0e3529d 100644 (file)
@@ -834,9 +834,16 @@ static int NTLocateGhostscript(const char **product_family,int *major_version,
       hkey,
       root;
 
+    REGSAM
+      mode;
+
     (void) FormatMagickString(key,MaxTextExtent,"SOFTWARE\\%s",products[i]);
     root=HKEY_LOCAL_MACHINE;
-    if (RegOpenKeyExA(root,key,0,KEY_READ,&hkey) == ERROR_SUCCESS)
+    mode=KEY_READ;
+#if defined(KEY_WOW64_32KEY)
+    mode|=KEY_WOW64_32KEY;
+#endif
+    if (RegOpenKeyExA(root,key,0,mode,&hkey) == ERROR_SUCCESS)
       {
         DWORD
           extent;
@@ -866,9 +873,10 @@ static int NTLocateGhostscript(const char **product_family,int *major_version,
               *minor_version=minor;
               status=MagickTrue;
             }
-          }
        }
-    }
+       (void) RegCloseKey(hkey);
+     }
+  }
   if (status == MagickFalse)
     {
       *major_version=0;