Windows: work around Go 1.6.2/Nano Server TP5 issue

This works around golang/go#15286 by explicitly loading shell32.dll at
load time, ensuring that syscall can load it dynamically during process
startup.

Signed-off-by: John Starks <jostarks@microsoft.com>
Signed-off-by: Antonio Murdaca <runcom@redhat.com>
This commit is contained in:
John Starks 2016-05-20 10:38:31 -07:00 committed by Antonio Murdaca
parent 765ab2b692
commit 9b1a322d9e
1 changed files with 13 additions and 0 deletions

View File

@ -1,5 +1,18 @@
package main
import (
"sync/atomic"
_ "github.com/docker/docker/autogen/winresources/docker"
)
//go:cgo_import_dynamic main.dummy CommandLineToArgvW%2 "shell32.dll"
var dummy uintptr
func init() {
// Ensure that this import is not removed by the linker. This is used to
// ensure that shell32.dll is loaded by the system loader, preventing
// go#15286 from triggering on Nano Server TP5.
atomic.LoadUintptr(&dummy)
}