From 8f803ac8d7a86c1b9171dfd2d1caef3730bc1e30 Mon Sep 17 00:00:00 2001 From: Oliver Stieber Date: Fri, 28 Jan 2005 11:29:03 +0000 Subject: [PATCH] Fill in the information in VendorIdentifier and make a better effort at filling in Identifier in the registry key. --- dlls/kernel/cpu.c | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/dlls/kernel/cpu.c b/dlls/kernel/cpu.c index 93610d0c706..2812afb7e69 100644 --- a/dlls/kernel/cpu.c +++ b/dlls/kernel/cpu.c @@ -111,6 +111,9 @@ static void create_registry_keys( const SYSTEM_INFO *info ) 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}; + static const WCHAR VendorIdentifierW[] = {'V','e','n','d','o','r','I','d','e','n','t','i','f','i','e','r',0}; + static const WCHAR VenidIntelW[] = {'G','e','n','u','i','n','e','I','n','t','e','l',0}; + /* static const WCHAR VenidAMDW[] = {'A','u','t','h','e','n','t','i','c','A','M','D',0}; */ unsigned int i; HKEY hkey, system_key, cpu_key; @@ -146,13 +149,21 @@ static void create_registry_keys( const SYSTEM_INFO *info ) RtlCreateUnicodeStringFromAsciiz( &nameW, num ); if (!NtCreateKey( &hkey, KEY_ALL_ACCESS, &attr, 0, NULL, 0, NULL )) { - WCHAR idW[20]; + WCHAR idW[40]; DWORD cpuMHz = cpuHz / 1000000; - sprintf( id, "CPU %ld", info->dwProcessorType ); + /*TODO: report 64bit processors properly*/ + RtlInitUnicodeString( &valueW, IdentifierW ); + sprintf( id, "x86 Family %d Model %d Stepping %d", + info->wProcessorLevel /*model and family are messed up*/, info->wProcessorLevel, info->wProcessorRevision); + RtlMultiByteToUnicodeN( idW, sizeof(idW), NULL, id, strlen(id)+1 ); NtSetValueKey( hkey, &valueW, 0, REG_SZ, idW, (strlenW(idW)+1)*sizeof(WCHAR) ); + /*TODO; report amd's properly*/ + RtlInitUnicodeString( &valueW, VendorIdentifierW ); + NtSetValueKey( hkey, &valueW, 0, REG_SZ, VenidIntelW, (strlenW(VenidIntelW)+1) * sizeof(WCHAR) ); + RtlInitUnicodeString( &valueW, mhzKeyW ); NtSetValueKey( hkey, &valueW, 0, REG_DWORD, &cpuMHz, sizeof(DWORD) ); NtClose( hkey );