]> Cypherpunks repositories - gostls13.git/commit
os: Use GetComputerNameEx to get Hostname on win32
authorCarlos Castillo <cookieo9@gmail.com>
Tue, 24 Feb 2015 10:35:55 +0000 (02:35 -0800)
committerAlex Brainman <alex.brainman@gmail.com>
Wed, 25 Feb 2015 23:16:44 +0000 (23:16 +0000)
commit59e546633d5b41f69971bd9f019f5e54c600fa17
tree00f41d4932194e365cf3afb9d97ecc4b5f26a853
parentca0be6f849f227c409b06819d9b2d349a8045098
os: Use GetComputerNameEx to get Hostname on win32

The existing Hostname function uses the GetComputerName system
function in windows to determine the hostname. It has some downsides:

  - The name is limited to 15 characters.
  - The name returned is for NetBIOS, other OS's return a DNS name

This change adds to the internal/syscall/windows package a
GetComputerNameEx function, and related enum constants. They are used
instead of the syscall.ComputerName function to implement os.Hostname
on windows.

Fixes #9982

Change-Id: Idc8782785eb1eea37e64022bd201699ce9c4b39c
Reviewed-on: https://go-review.googlesource.com/5852
Reviewed-by: Alex Brainman <alex.brainman@gmail.com>
Run-TryBot: Alex Brainman <alex.brainman@gmail.com>
Reviewed-by: Carlos Castillo <cookieo9@gmail.com>
Reviewed-by: Yasuhiro MATSUMOTO <mattn.jp@gmail.com>
src/cmd/dist/build.go
src/go/build/deps_test.go
src/internal/syscall/windows/syscall_windows.go
src/internal/syscall/windows/zsyscall_windows.go
src/os/sys_windows.go