[Lazarus] OnGuard component: CreateMachineID not working?

John Repucci john.repucci at gmail.com
Thu Apr 28 04:49:21 CEST 2011


I'm seeing an oddity with the CreateMachineID function within the OnGuard
component.
Is there anyone who has used this component in depth?
Any idea who I would submit a ticket to or who can tell me if I'm doing
something wrong?

I'm using the CreateMachineID code to pull an id for networking, drives and
then Networking + Drives and the values I'm getting do not seem correct:

Network,    Drives,      Network + Drives
42312D6C, CA7CFA8F, 42312D6C

I would not expect that     Network = Network + Drives?

I did see the conversation about OnGuard in early 2010 about drive ID's, so
I'm getting leery of using the drive ID information.


var
  InfoSet  : TEsMachineInfoSet;
  HWInfo   : LongInt;
  HWInfoNW : LongInt;  // the Network HWInfo
  HWInfoDr : LongInt;  // the Drive HWInfo
  sHWInfo, sHWInfoNW, sHWInfoDr : String;
Begin
try
  InfoSet := [];
  InfoSet := InfoSet + [midNetwork];
  HWInfoNW := CreateMachineID(InfoSet);  // Request just the Network Info
  sHWInfoNW := BufferToHex(HWInfoNW, SizeOf(LongInt));

  InfoSet := [];
  InfoSet := InfoSet + [midDrives];
  HWInfoDR := CreateMachineID(InfoSet);  // request just the Drive Info
  sHWInfoDr := BufferToHex(HWInfoDr, SizeOf(LongInt));

  InfoSet := [];
  InfoSet := InfoSet + [midDrives] + [midNetwork];
  HWInfo := CreateMachineID(InfoSet);   //  Request both Network & Drive Info
  sHWInfo := BufferToHex(HWInfo, SizeOf(LongInt));

  Edit1.Text := sHWInfoNW + ', ' + sHWInfoDr + ', ' + sHWInfo;    //
Display the HWInfo
  except on E:Exception do
   ShowMessage(E.Message);
  end;
end.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20110427/b1f88b0b/attachment-0002.html>


More information about the Lazarus mailing list