Update module github.com/rootless-containers/rootlesskit/v2 to v2.1.0

Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
This commit is contained in:
renovate[bot]
2024-04-26 02:06:10 +00:00
committed by GitHub
parent 15cc8862c1
commit c2d7b5415f
4 changed files with 14 additions and 19 deletions

View File

@ -4,7 +4,6 @@ package winapi
import (
"errors"
"reflect"
"syscall"
"unsafe"
@ -14,11 +13,7 @@ import (
// Uint16BufferToSlice wraps a uint16 pointer-and-length into a slice
// for easier interop with Go APIs
func Uint16BufferToSlice(buffer *uint16, bufferLength int) (result []uint16) {
hdr := (*reflect.SliceHeader)(unsafe.Pointer(&result))
hdr.Data = uintptr(unsafe.Pointer(buffer))
hdr.Cap = bufferLength
hdr.Len = bufferLength
result = unsafe.Slice(buffer, bufferLength)
return
}