From 85ce7aa65d324fb81096cf6c037049cc7ab3c8ac Mon Sep 17 00:00:00 2001 From: Eric Heien Date: Wed, 29 Jan 2003 23:10:46 +0000 Subject: [PATCH] windows hostname fix svn path=/trunk/boinc/; revision=847 --- client/win/hostinfo_win.cpp | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/client/win/hostinfo_win.cpp b/client/win/hostinfo_win.cpp index 26de9f12ae..c9647d7e93 100755 --- a/client/win/hostinfo_win.cpp +++ b/client/win/hostinfo_win.cpp @@ -18,6 +18,7 @@ // #include +#include #include "client_types.h" #include "hostinfo.h" @@ -175,10 +176,20 @@ int get_host_info(HOST_INFO& host) { } get_host_disk_info(host.d_total, host.d_free); - + + // Open the WinSock dll so we can get host info + WORD wVersionRequested; + WSADATA wsdata; + wVersionRequested = MAKEWORD(1, 1); + WSAStartup(wVersionRequested, &wsdata); + + // Get host name/ip info get_local_domain_name(host.domain_name); get_local_ip_addr_str(host.ip_addr); + // Close the WinSock dll + WSACleanup(); + host.timezone = get_timezone(); MEMORYSTATUS mStatus;