What you describe gets the local IPs of the device that your code is running it. It does not get the IPs of other devices on the local network.
You don't need to use the IdStackXXX units directly in this example, just the base IdStack unit by itself will suffice. The correct way to use TIdStack methods is to call them on the global GStack object. Indy can instantiate the correct derived class for you based on the local OS platform, eg:
uses
IdGlobal, IdStack;
function GetLocalIpList(Name: string): TStringList;
var
Lista: TIdStackLocalAddressList;
temp: TIdStackLocalAddress;
I: Integer;
begin
Result := TStringList.Create;
try
TIdStack.IncUsage; // instantiates GStack if needed...
try
Lista := TIdStackLocalAddressList.Create;
try
GStack.GetLocalAddressList(Lista);
for I := 0 to Lista.Count-1 do begin
temp := Lista[I];
if temp.IPVersion = Id_IPv4 then
Result.add(temp.IPAddress);
end;
finally
Lista.Free;
end;
finally
TIdStack.DecUsage; // frees GStack if needed...
end;
except
Result.Free;
raise;
end;
end;