Ignore:
Timestamp:
Mar 3, 2000, 12:16:00 PM (25 years ago)
Author:
sandervl
Message:

moved registry apis into kernel32 + cleanup

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/kernel32/cpu.cpp

    r2802 r2984  
    1 /* $Id: cpu.cpp,v 1.6 2000-02-16 14:25:36 sandervl Exp $ */
     1/* $Id: cpu.cpp,v 1.7 2000-03-03 11:15:57 sandervl Exp $ */
    22/*
    33 * Odin win32 CPU apis
     
    2121#include "debugtools.h"
    2222#include <cpuhlp.h>
    23 #include "initsystem.h"
    2423
    2524#define DBG_LOCALLOG    DBG_cpu
     
    102101
    103102        /* Create this registry key for all systems */
    104         if (ADVAPI32_RegCreateKeyA(HKEY_LOCAL_MACHINE,"HARDWARE\\DESCRIPTION\\System\\CentralProcessor",&hkey)!=ERROR_SUCCESS) {
     103        if (RegCreateKeyA(HKEY_LOCAL_MACHINE,"HARDWARE\\DESCRIPTION\\System\\CentralProcessor",&hkey)!=ERROR_SUCCESS) {
    105104            dprintf(("Unable to register CPU information\n"));
    106105        }
     
    113112                sprintf(buf,"%d",i);
    114113                if (xhkey)
    115                         ADVAPI32_RegCloseKey(xhkey);
    116                 ADVAPI32_RegCreateKeyA(hkey,buf,&xhkey);
     114                        RegCloseKey(xhkey);
     115                RegCreateKeyA(hkey,buf,&xhkey);
    117116
    118117                signature = GetCPUSignature();
     
    137136                sprintf(buf,"CPU %ld",cachedsi.dwProcessorType);
    138137                if (xhkey) {
    139                         ADVAPI32_RegSetValueExA(xhkey,"Identifier",0,REG_SZ,(LPBYTE)buf,strlen(buf));
     138                        RegSetValueExA(xhkey,"Identifier",0,REG_SZ,(LPBYTE)buf,strlen(buf));
    140139                        memset(buf, 0, sizeof(buf));
    141140                        GetCPUVendorString(buf);
    142                         ADVAPI32_RegSetValueExA(xhkey,"VendorIdentifier",0,REG_SZ,(LPBYTE)buf,strlen(buf));
     141                        RegSetValueExA(xhkey,"VendorIdentifier",0,REG_SZ,(LPBYTE)buf,strlen(buf));
    143142                }
    144143                cachedsi.wProcessorRevision = signature & 0xf;
     
    162161                if (features & CPUID_FPU_PRESENT) {
    163162                        if (i == 0) {
    164                                 if(ADVAPI32_RegCreateKeyA(HKEY_LOCAL_MACHINE,"HARDWARE\\DESCRIPTION\\System\\FloatingPointProcessor",&fpukey)!=ERROR_SUCCESS)
     163                                if(RegCreateKeyA(HKEY_LOCAL_MACHINE,"HARDWARE\\DESCRIPTION\\System\\FloatingPointProcessor",&fpukey)!=ERROR_SUCCESS)
    165164                                        dprintf(("Unable to register FPU information\n"));
    166165                        }
     
    168167                        if(fpukey) {
    169168                                sprintf(buf,"%d",i);
    170                                 ADVAPI32_RegCreateKeyA(fpukey,buf,&xhfpukey);
     169                                RegCreateKeyA(fpukey,buf,&xhfpukey);
    171170                        }
    172171                }
     
    177176
    178177        if (xhkey)
    179                 ADVAPI32_RegCloseKey(xhkey);
     178                RegCloseKey(xhkey);
    180179        if (hkey)
    181                 ADVAPI32_RegCloseKey(hkey);
     180                RegCloseKey(hkey);
    182181        if (xhfpukey)
    183                 ADVAPI32_RegCloseKey(xhfpukey);
     182                RegCloseKey(xhfpukey);
    184183        if (fpukey)
    185                 ADVAPI32_RegCloseKey(fpukey);
     184                RegCloseKey(fpukey);
    186185
    187186}
Note: See TracChangeset for help on using the changeset viewer.