On 05/17/2011 11:07 AM, Juan Lang wrote:
Hi Andrew,
- GetComputerNameW(name, &size);
- hostname_printfW(fmtW, name);
I'm pretty sure that's not what you want. GetComputerName returns the "NetBIOS name" of the computer, which is set in the registry. hostname prints the IP hostname of the computer. At least, my look at a Windows version's imports showed no import of GetComputerName, while there is an import of ws2_32.dll's gethostname (by ordinal). --Juan
You're right, I should have considered the fact that hostname.exe is classed as a TCP/IP utility. I didn't snoop at the native executable's imports, however, because I figured it would be spying too closely at the utility's implementation details.