summaryrefslogtreecommitdiff
path: root/vendor/golang.org/x/sys/windows
diff options
context:
space:
mode:
authorValentin Rothberg <rothberg@redhat.com>2022-01-10 13:47:12 +0100
committerValentin Rothberg <rothberg@redhat.com>2022-01-10 16:25:37 +0100
commitb7380a7c367246fa50b2380a99dbff39c4dc78d0 (patch)
tree5ab5bd236e3f6f0e9036287a16740b184aa3c40b /vendor/golang.org/x/sys/windows
parent6ed2c639ac614b8292660fda604d3a8f6cbb42b7 (diff)
downloadpodman-b7380a7c367246fa50b2380a99dbff39c4dc78d0.tar.gz
podman-b7380a7c367246fa50b2380a99dbff39c4dc78d0.tar.bz2
podman-b7380a7c367246fa50b2380a99dbff39c4dc78d0.zip
vendor c/common
Also update the e2e pull test to account for the changes when pulling from the dir transport. Images pulled via the dir transport are not tagged anymore; the path is not a reliable source. Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
Diffstat (limited to 'vendor/golang.org/x/sys/windows')
-rw-r--r--vendor/golang.org/x/sys/windows/exec_windows.go37
-rw-r--r--vendor/golang.org/x/sys/windows/types_windows.go4
2 files changed, 12 insertions, 29 deletions
diff --git a/vendor/golang.org/x/sys/windows/exec_windows.go b/vendor/golang.org/x/sys/windows/exec_windows.go
index 7a11e83b7..855698bb2 100644
--- a/vendor/golang.org/x/sys/windows/exec_windows.go
+++ b/vendor/golang.org/x/sys/windows/exec_windows.go
@@ -9,8 +9,6 @@ package windows
import (
errorspkg "errors"
"unsafe"
-
- "golang.org/x/sys/internal/unsafeheader"
)
// EscapeArg rewrites command line argument s as prescribed
@@ -147,8 +145,12 @@ func NewProcThreadAttributeList(maxAttrCount uint32) (*ProcThreadAttributeListCo
}
return nil, err
}
+ alloc, err := LocalAlloc(LMEM_FIXED, uint32(size))
+ if err != nil {
+ return nil, err
+ }
// size is guaranteed to be ≥1 by InitializeProcThreadAttributeList.
- al := &ProcThreadAttributeListContainer{data: (*ProcThreadAttributeList)(unsafe.Pointer(&make([]byte, size)[0]))}
+ al := &ProcThreadAttributeListContainer{data: (*ProcThreadAttributeList)(unsafe.Pointer(alloc))}
err = initializeProcThreadAttributeList(al.data, maxAttrCount, 0, &size)
if err != nil {
return nil, err
@@ -157,36 +159,17 @@ func NewProcThreadAttributeList(maxAttrCount uint32) (*ProcThreadAttributeListCo
}
// Update modifies the ProcThreadAttributeList using UpdateProcThreadAttribute.
-// Note that the value passed to this function will be copied into memory
-// allocated by LocalAlloc, the contents of which should not contain any
-// Go-managed pointers, even if the passed value itself is a Go-managed
-// pointer.
func (al *ProcThreadAttributeListContainer) Update(attribute uintptr, value unsafe.Pointer, size uintptr) error {
- alloc, err := LocalAlloc(LMEM_FIXED, uint32(size))
- if err != nil {
- return err
- }
- var src, dst []byte
- hdr := (*unsafeheader.Slice)(unsafe.Pointer(&src))
- hdr.Data = value
- hdr.Cap = int(size)
- hdr.Len = int(size)
- hdr = (*unsafeheader.Slice)(unsafe.Pointer(&dst))
- hdr.Data = unsafe.Pointer(alloc)
- hdr.Cap = int(size)
- hdr.Len = int(size)
- copy(dst, src)
- al.heapAllocations = append(al.heapAllocations, alloc)
- return updateProcThreadAttribute(al.data, 0, attribute, unsafe.Pointer(alloc), size, nil, nil)
+ al.pointers = append(al.pointers, value)
+ return updateProcThreadAttribute(al.data, 0, attribute, value, size, nil, nil)
}
// Delete frees ProcThreadAttributeList's resources.
func (al *ProcThreadAttributeListContainer) Delete() {
deleteProcThreadAttributeList(al.data)
- for i := range al.heapAllocations {
- LocalFree(Handle(al.heapAllocations[i]))
- }
- al.heapAllocations = nil
+ LocalFree(Handle(unsafe.Pointer(al.data)))
+ al.data = nil
+ al.pointers = nil
}
// List returns the actual ProcThreadAttributeList to be passed to StartupInfoEx.
diff --git a/vendor/golang.org/x/sys/windows/types_windows.go b/vendor/golang.org/x/sys/windows/types_windows.go
index 73087bf5e..655447e8f 100644
--- a/vendor/golang.org/x/sys/windows/types_windows.go
+++ b/vendor/golang.org/x/sys/windows/types_windows.go
@@ -938,8 +938,8 @@ type StartupInfoEx struct {
type ProcThreadAttributeList struct{}
type ProcThreadAttributeListContainer struct {
- data *ProcThreadAttributeList
- heapAllocations []uintptr
+ data *ProcThreadAttributeList
+ pointers []unsafe.Pointer
}
type ProcessInformation struct {