Update the osbuild/images to the version which introduces "dot notation" for distro release versions. - Replace all uses of distroregistry by distrofactory. - Delete local version of reporegistry and use the one from the osbuild/images. - Weldr: unify `createWeldrAPI()` and `createWeldrAPI2()` into a single `createTestWeldrAPI()` function`. - store/fixture: rework fixtures to allow overriding the host distro name and host architecture name. A cleanup function to restore the host distro and arch names is always part of the fixture struct. - Delete `distro_mock` package, since it is no longer used. - Bump the required version of osbuild to 98, because the OSCAP customization is using the 'compress_results' stage option, which is not available in older versions of osbuild. Signed-off-by: Tomáš Hozza <thozza@redhat.com>
25 lines
609 B
Go
25 lines
609 B
Go
//go:build windows
|
|
|
|
package interop
|
|
|
|
import (
|
|
"syscall"
|
|
"unsafe"
|
|
)
|
|
|
|
//go:generate go run github.com/Microsoft/go-winio/tools/mkwinsyscall -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)
|
|
}
|