25 lines
516 B
C++
25 lines
516 B
C++
#include "smt4497-P1.h"
|
|
|
|
void LeeFabricanteCPU(char fabricante[], int tamfabricante)
|
|
{
|
|
|
|
int info[4];
|
|
__cpuid(info, 0);
|
|
int* p;
|
|
p = (int*) fabricante;
|
|
|
|
//usando puntero interpretando como int
|
|
p[0] = info[1];
|
|
p[1] = info[3];
|
|
p[2] = info[2];
|
|
|
|
//p[3] = 0; // puede ser un error porque "rellena mas 0's"
|
|
|
|
//usando memcpy interpretando como char
|
|
//memcpy(&fabricante[0], &info[1], 4); // == &fabricante
|
|
//memcpy(&fabricante[4], &info[3], 4);
|
|
//memcpy(&fabricante[8], &info[2], 4);
|
|
|
|
fabricante[12] = 0;
|
|
}
|