Hier wird der Array befüllt :
Delphi-Quellcode:
SetLength(FaaiAdapters,1);
FaaiAdapters[0] := pAdapterList;
while FaaiAdapters[High(FaaiAdapters)].Next <> nil do begin
SetLength(FaaiAdapters,Length(FaaiAdapters)+1);
FaaiAdapters[High(FaaiAdapters)] := FaaiAdapters[High(FaaiAdapters)-1].Next;
end;
Und so ist der Aufruf von GetAdaptersAddresses :
Delphi-Quellcode:
PVOID = Pointer;
TGetAdapterAdresses = function (Family: ULONG; Flags: cardinal; Reserved: PVOID;
pAdapterAddresses: PIP_ADAPTER_ADDRESSES; pOutBufLen: PULONG): dword; stdcall;
error := AdaptersAddresses(AF_UNSPEC, 10, nil, nil, @buffer);
if error <> ERROR_BUFFER_OVERFLOW then
begin
FreeLibrary(hdll);
exit;
end;
GetMem(adapterextinfo, buffer);
error := AdaptersAddresses(AF_UNSPEC, 10, nil, adapterextinfo, @buffer);
if error = ERROR_SUCCESS then
Und in diesem Teil in Zeile 13 überschreibt er mir den Array FaaiAdapters.