Word;
begin
FillChar(NCB, SizeOf(NCB), 0);
FillChar(AdpStat, SizeOf(AdpStat), 0);
NCB.Command := NCB_ADPSTAT;
NCB.Buf := @AdpStat;
NCB.Length := Sizeof(AdpStat);
FillChar(NCB.CallName, Sizeof(TNBName), $20);
NCB.CallName[0] := Byte(''*'');
NCB.Lana_Num := LanaNum;
RetCode := NetBiosCmd(NCB);
if RetCode = NRC_GOODRET then begin
Result := Format(''%2.2x:%2.2x:%2.2x:%2.2x:%2.2x:%2.2x'',
[AdpStat.ID[0],
AdpStat.ID,
AdpStat.ID,
AdpStat.ID,
AdpStat.ID,
AdpStat.ID
]);
end else begin
Result := ''??:??:??:??:??:??'';
end;
end;
procedure TForm1.Button1Click(Sender: TObject);
begin
Close;
end;
procedure TForm1.FormCreate(Sender: TObject);
var
L_Enum : TLana_Enum;
RetCode: Word;
i: Integer;
begin
L_Enum := NbLanaEnum; { enumerate lanas for WI
N NT }
if L_Enum.Length = 0 then begin
Button1.Caption := Format(''LanaEnum err=%2.2x'', [L_Enum.Lana[0]]);
exit;
end;
for i := 0 to (L_Enum.Length - 1)do begin { for every lana found
}
RetCode := NbReset(L_Enum.Lana[i]); { Reset lana for WIN NT
}
if RetCode <> NRC_GOODRET then begin
Button1.Caption := Format(''Reset Lana %d err=%2.2x'',[i, RetCode
]);
exit;
end;
{ Get MAC Address &nbs