summaryrefslogtreecommitdiff
path: root/vendor/github.com/Microsoft/hcsshim/mksyscall_windows.go
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/github.com/Microsoft/hcsshim/mksyscall_windows.go')
-rw-r--r--vendor/github.com/Microsoft/hcsshim/mksyscall_windows.go11
1 files changed, 8 insertions, 3 deletions
diff --git a/vendor/github.com/Microsoft/hcsshim/mksyscall_windows.go b/vendor/github.com/Microsoft/hcsshim/mksyscall_windows.go
index 15660ddef..7647734de 100644
--- a/vendor/github.com/Microsoft/hcsshim/mksyscall_windows.go
+++ b/vendor/github.com/Microsoft/hcsshim/mksyscall_windows.go
@@ -300,7 +300,10 @@ func (r *Rets) SetErrorCode() string {
%s = %sErrno(r0)
}`
const hrCode = `if int32(r0) < 0 {
- %s = interop.Win32FromHresult(r0)
+ if r0&0x1fff0000 == 0x00070000 {
+ r0 &= 0xffff
+ }
+ %s = %sErrno(r0)
}`
if r.Name == "" && !r.ReturnsError {
return ""
@@ -310,7 +313,7 @@ func (r *Rets) SetErrorCode() string {
}
if r.Type == "error" {
if r.Name == "hr" {
- return fmt.Sprintf(hrCode, r.Name)
+ return fmt.Sprintf(hrCode, r.Name, syscalldot())
} else {
return fmt.Sprintf(code, r.Name, syscalldot())
}
@@ -773,7 +776,6 @@ func (src *Source) Generate(w io.Writer) error {
src.ExternalImport("golang.org/x/sys/windows")
}
}
- src.ExternalImport("github.com/Microsoft/hcsshim/internal/interop")
if *winio {
src.ExternalImport("github.com/Microsoft/go-winio")
}
@@ -788,6 +790,9 @@ func (src *Source) Generate(w io.Writer) error {
if !*systemDLL {
return syscalldot() + "NewLazyDLL(" + arg + ")"
}
+ if strings.HasPrefix(dll, "api_") || strings.HasPrefix(dll, "ext_") {
+ arg = strings.Replace(arg, "_", "-", -1)
+ }
switch pkgtype {
case pkgStd:
return syscalldot() + "NewLazyDLL(sysdll.Add(" + arg + "))"