...

Source file src/github.com/Microsoft/hcsshim/internal/hns/zsyscall_windows.go

Documentation: github.com/Microsoft/hcsshim/internal/hns

     1  //go:build windows
     2  
     3  // Code generated by 'go generate' using "github.com/Microsoft/go-winio/tools/mkwinsyscall"; DO NOT EDIT.
     4  
     5  package hns
     6  
     7  import (
     8  	"syscall"
     9  	"unsafe"
    10  
    11  	"golang.org/x/sys/windows"
    12  )
    13  
    14  var _ unsafe.Pointer
    15  
    16  // Do the interface allocations only once for common
    17  // Errno values.
    18  const (
    19  	errnoERROR_IO_PENDING = 997
    20  )
    21  
    22  var (
    23  	errERROR_IO_PENDING error = syscall.Errno(errnoERROR_IO_PENDING)
    24  	errERROR_EINVAL     error = syscall.EINVAL
    25  )
    26  
    27  // errnoErr returns common boxed Errno values, to prevent
    28  // allocations at runtime.
    29  func errnoErr(e syscall.Errno) error {
    30  	switch e {
    31  	case 0:
    32  		return errERROR_EINVAL
    33  	case errnoERROR_IO_PENDING:
    34  		return errERROR_IO_PENDING
    35  	}
    36  	// TODO: add more here, after collecting data on the common
    37  	// error values see on Windows. (perhaps when running
    38  	// all.bat?)
    39  	return e
    40  }
    41  
    42  var (
    43  	modvmcompute = windows.NewLazySystemDLL("vmcompute.dll")
    44  
    45  	procHNSCall = modvmcompute.NewProc("HNSCall")
    46  )
    47  
    48  func _hnsCall(method string, path string, object string, response **uint16) (hr error) {
    49  	var _p0 *uint16
    50  	_p0, hr = syscall.UTF16PtrFromString(method)
    51  	if hr != nil {
    52  		return
    53  	}
    54  	var _p1 *uint16
    55  	_p1, hr = syscall.UTF16PtrFromString(path)
    56  	if hr != nil {
    57  		return
    58  	}
    59  	var _p2 *uint16
    60  	_p2, hr = syscall.UTF16PtrFromString(object)
    61  	if hr != nil {
    62  		return
    63  	}
    64  	return __hnsCall(_p0, _p1, _p2, response)
    65  }
    66  
    67  func __hnsCall(method *uint16, path *uint16, object *uint16, response **uint16) (hr error) {
    68  	hr = procHNSCall.Find()
    69  	if hr != nil {
    70  		return
    71  	}
    72  	r0, _, _ := syscall.Syscall6(procHNSCall.Addr(), 4, uintptr(unsafe.Pointer(method)), uintptr(unsafe.Pointer(path)), uintptr(unsafe.Pointer(object)), uintptr(unsafe.Pointer(response)), 0, 0)
    73  	if int32(r0) < 0 {
    74  		if r0&0x1fff0000 == 0x00070000 {
    75  			r0 &= 0xffff
    76  		}
    77  		hr = syscall.Errno(r0)
    78  	}
    79  	return
    80  }
    81  

View as plain text