containerized-data-importer/vendor/github.com/Microsoft/hcsshim/internal/interop/interop.go
Tomasz Barański 536af6b1ad
Replace skopeo (#1322)
* Updated dependencies
Signed-off-by: Tomasz Baranski <tbaransk@redhat.com>

* Replace skopeo with containers API.

This commit removes dependence on skopeo (binary) and uses containers
API. By doing that we're able to opimize the use of storage (scratch)
space, storage I/O and download bandwith.

Signed-off-by: Tomasz Baranski <tbaransk@redhat.com>

* Fixing rebase - dependencies kerfuffle.

Signed-off-by: Tomasz Baranski <tbaransk@redhat.com>

* Handling docker-format images as well as OCI.

Signed-off-by: Tomasz Baranski <tbaransk@redhat.com>

* Fix for missing code-generator module.

Signed-off-by: Tomasz Baranski <tbaransk@redhat.com>

* Remove regex, image file in registry images are matched by a path
prefix.

Signed-off-by: Tomasz Baranski <tbaransk@redhat.com>

* Added nginx proxy in front of docker registry for a rate-limited access.

Signed-off-by: Tomasz Baranski <tbaransk@redhat.com>
2020-08-22 05:52:00 +02:00

24 lines
567 B
Go

package interop
import (
"syscall"
"unsafe"
)
//go:generate go run ../../mksyscall_windows.go -output zsyscall_windows.go interop.go
//sys coTaskMemFree(buffer unsafe.Pointer) = api_ms_win_core_com_l1_1_0.CoTaskMemFree
func ConvertAndFreeCoTaskMemString(buffer *uint16) string {
str := syscall.UTF16ToString((*[1 << 29]uint16)(unsafe.Pointer(buffer))[:])
coTaskMemFree(unsafe.Pointer(buffer))
return str
}
func Win32FromHresult(hr uintptr) syscall.Errno {
if hr&0x1fff0000 == 0x00070000 {
return syscall.Errno(hr & 0xffff)
}
return syscall.Errno(hr)
}