View Single Post
  #4  
Old 11-08-2016, 02:50 AM
Rantor777 Rantor777 is offline
Junior Member
 
Join Date: Nov 2016
Location: 127.0.0.1
Posts: 10
Default Method #002

PHP Code:
Function GetPrimaryNicMacAddressString
Type   
TGUID 
Record     
A
Bword;     
DMSword;     
MAC: Array[ 1..6 Of byte;   
End
Var   
UuidCreateFunc: Function(Var guidTGUID): HResultstdcall;   
handleTHandle;  
 
gTGUID;   
WinVer_OSVersionInfoA;  
iinteger;   
//  ErrCode : HResult; 
Begin   
Try     
WinVer.dwOSVersionInfoSize := sizeof(WinVer); 
// Size     
getversionex(WinVer);  
    
handle := LoadLibrary('RPCRT4.DLL'); 
 
If 
WinVer.dwMajorVersion >= 5 Then {Windows 2000 or later}       
@
UuidCreateFunc := GetProcAddress(Handle'UuidCreateSequential')     
Else 
// (Win98 o menor)       
@UuidCreateFunc := GetProcAddress(Handle'UuidCreate');     
UuidCreateFunc(g); 
 
Result := '';     
For 
:= 1 To 6 Do Result := Result IntToHex(g.MAC], 2); 
   
xcept     
Result 
:= ''

End
End
Reply With Quote