Schardl Robert
March 31st, 1999, 05:01 AM
Hy there!
I want to read the processor-ID or an other unique ID of a pc.
Does anybody know, how i can do this?
RKM
March 31st, 1999, 06:57 AM
There is really no such thing except under a PIII. About the best you can do is use the MAC number from the network card (if there is one there) or the serial number from the disk drive. Look on DejaNews and you will find plenty of examples of each.
A.Woitsch
April 9th, 1999, 04:00 AM
Just a solution, using MAC address.
I've got the code from Mats Bejedahl.
#include <nb30.h>
typedef struct _ASTAT_
{
ADAPTER_STATUS adapt;
NAME_BUFFER NameBuff [30];
}ASTAT, * PASTAT;
void GetMACAddr()
{
ASTAT Adapter;
NCB Ncb;
UCHAR uRetCode;
LANA_ENUM lenum;
int i;
memset( &Ncb, 0, sizeof(Ncb) );
Ncb.ncb_command = NCBENUM;
Ncb.ncb_buffer = (UCHAR *)&lenum;
Ncb.ncb_length = sizeof(lenum);
uRetCode = Netbios( &Ncb );
for(i=0; i < lenum.length ;i++)
{
memset( &Ncb, 0, sizeof(Ncb) );
Ncb.ncb_command = NCBRESET;
Ncb.ncb_lana_num = 0;
uRetCode = Netbios( &Ncb );
memset( &Ncb, 0, sizeof (Ncb) );
Ncb.ncb_command = NCBASTAT;
Ncb.ncb_lana_num = lenum.lana[i];
strcpy( (char*)Ncb.ncb_callname, "* " );
Ncb.ncb_buffer = (unsigned char *) &Adapter;
Ncb.ncb_length = sizeof(Adapter);
uRetCode = Netbios( &Ncb );
if ( uRetCode == 0 )
{
TRACE("MAC address %02X-%02X-%02X-%02X-%02X-%02X\n",
Adapter.adapt.adapter_address[0],
Adapter.adapt.adapter_address[1],
Adapter.adapt.adapter_address[2],
Adapter.adapt.adapter_address[3],
Adapter.adapt.adapter_address[4],
Adapter.adapt.adapter_address[5] );
}
}
}