Add support for the ~MHz registry key

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



If anybody knows a handy call to find out the CPU speed (that doesn't
use QueryPerformanceFrequency), it would be nice to use it here.
Otherwise this fix will do.

ChangeLog:
Add support for the CPU ~MHz description key
Index: misc/cpu.c
===================================================================
RCS file: /home/wine/wine/misc/cpu.c,v
retrieving revision 1.32
diff -u -w -r1.32 cpu.c
--- misc/cpu.c	21 May 2003 18:24:34 -0000	1.32
+++ misc/cpu.c	29 Jun 2003 15:04:01 -0000
@@ -102,6 +102,7 @@
     static const WCHAR cpuW[] = {'C','e','n','t','r','a','l','P','r','o','c','e','s','s','o','r',0};
     static const WCHAR IdentifierW[] = {'I','d','e','n','t','i','f','i','e','r',0};
     static const WCHAR SysidW[] = {'A','T',' ','c','o','m','p','a','t','i','b','l','e',0};
+    static const WCHAR mhzKeyW[] = {'~','M','H','z',0};
 
     int i;
     HKEY hkey, system_key, cpu_key;
@@ -138,10 +139,16 @@
             if (!NtCreateKey( &hkey, KEY_ALL_ACCESS, &attr, 0, NULL, 0, NULL ))
             {
                 WCHAR idW[20];
+		 WCHAR mhzW[5];
+		 DWORD speed = 1000; /* for now, pretend we are on a gigahertz machine */
 
                 sprintf( id, "CPU %ld", info->dwProcessorType );
                 RtlMultiByteToUnicodeN( idW, sizeof(idW), NULL, id, strlen(id)+1 );
                 NtSetValueKey( hkey, &valueW, 0, REG_SZ, idW, (strlenW(idW)+1)*sizeof(WCHAR) );
+
+		 RtlFreeUnicodeString( &valueW );
+		 RtlInitUnicodeString( &valueW, mhzKeyW);
+	         NtSetValueKey( hkey, &valueW, 0, REG_DWORD, &speed, sizeof(DWORD) );
                 NtClose( hkey );
             }
             RtlFreeUnicodeString( &nameW );

[Index of Archives]     [Gimp for Windows]     [Red Hat]     [Samba]     [Yosemite Camping]     [Graphics Cards]     [Wine Home]

  Powered by Linux