Hola neokobu,
Esta función que yo utilizo funciona correctamente
Código Delphi
[-]function GetIPComputer: String;
var
wVersionRequested: Word;
wsaData: TWSAData;
pHostName: PHostEnt;
sComputerName: Array[0..128] of Char;
pIPComputer: PChar;
begin
wVersionRequested := MakeWord(1, 1);
WSAStartup(wVersionRequested, wsaData);
gethostname(@sComputerName, 128);
pHostName := gethostbyname(@sComputerName);
pIPComputer := inet_ntoa(PInAddr(pHostName^.h_addr_list^)^);
Result := pIPComputer;
WSACleanup;
end;
Un saludo.