mirror of
https://github.com/containers/skopeo.git
synced 2025-09-27 13:13:52 +00:00
fix(deps): update module github.com/containers/storage to v1.50.1
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
This commit is contained in:
2
vendor/github.com/Microsoft/hcsshim/internal/hcs/schema2/isolation_settings.go
generated
vendored
2
vendor/github.com/Microsoft/hcsshim/internal/hcs/schema2/isolation_settings.go
generated
vendored
@@ -17,5 +17,5 @@ type IsolationSettings struct {
|
||||
DebugPort int64 `json:"DebugPort,omitempty"`
|
||||
// Optional data passed by host on isolated virtual machine start
|
||||
LaunchData string `json:"LaunchData,omitempty"`
|
||||
HclEnabled bool `json:"HclEnabled,omitempty"`
|
||||
HclEnabled *bool `json:"HclEnabled,omitempty"`
|
||||
}
|
||||
|
2
vendor/github.com/Microsoft/hcsshim/internal/jobobject/jobobject.go
generated
vendored
2
vendor/github.com/Microsoft/hcsshim/internal/jobobject/jobobject.go
generated
vendored
@@ -167,7 +167,7 @@ func Create(ctx context.Context, options *Options) (_ *JobObject, err error) {
|
||||
//
|
||||
// Returns a JobObject structure and an error if there is one.
|
||||
func Open(ctx context.Context, options *Options) (_ *JobObject, err error) {
|
||||
if options == nil || (options != nil && options.Name == "") {
|
||||
if options == nil || options.Name == "" {
|
||||
return nil, errors.New("no job object name specified to open")
|
||||
}
|
||||
|
||||
|
29
vendor/github.com/Microsoft/hcsshim/internal/log/format.go
generated
vendored
29
vendor/github.com/Microsoft/hcsshim/internal/log/format.go
generated
vendored
@@ -4,11 +4,13 @@ import (
|
||||
"bytes"
|
||||
"context"
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"net"
|
||||
"reflect"
|
||||
"time"
|
||||
|
||||
"github.com/containerd/containerd/log"
|
||||
"github.com/sirupsen/logrus"
|
||||
"google.golang.org/protobuf/encoding/protojson"
|
||||
"google.golang.org/protobuf/proto"
|
||||
)
|
||||
@@ -60,22 +62,35 @@ func formatAddr(a net.Addr) string {
|
||||
func Format(ctx context.Context, v interface{}) string {
|
||||
b, err := encode(v)
|
||||
if err != nil {
|
||||
G(ctx).WithError(err).Warning("could not format value")
|
||||
// logging errors aren't really warning worthy, and can potentially spam a lot of logs out
|
||||
G(ctx).WithFields(logrus.Fields{
|
||||
logrus.ErrorKey: err,
|
||||
"type": fmt.Sprintf("%T", v),
|
||||
}).Debug("could not format value")
|
||||
return ""
|
||||
}
|
||||
|
||||
return string(b)
|
||||
}
|
||||
|
||||
func encode(v interface{}) ([]byte, error) {
|
||||
func encode(v interface{}) (_ []byte, err error) {
|
||||
if m, ok := v.(proto.Message); ok {
|
||||
// use canonical JSON encoding for protobufs (instead of [encoding/json])
|
||||
// https://protobuf.dev/programming-guides/proto3/#json
|
||||
return protojson.MarshalOptions{
|
||||
var b []byte
|
||||
b, err = protojson.MarshalOptions{
|
||||
AllowPartial: true,
|
||||
// protobuf defaults to camel case for JSON encoding; use proto field name instead (snake case)
|
||||
UseProtoNames: true,
|
||||
}.Marshal(m)
|
||||
if err == nil {
|
||||
// the protojson marshaller tries to unmarshal anypb.Any fields, which can
|
||||
// fail for types encoded with "github.com/containerd/typeurl/v2"
|
||||
// we can try creating a dedicated protoregistry.MessageTypeResolver that uses typeurl, but, its
|
||||
// more robust to fall back on json marshalling for errors in general
|
||||
return b, nil
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
buf := &bytes.Buffer{}
|
||||
@@ -83,8 +98,12 @@ func encode(v interface{}) ([]byte, error) {
|
||||
enc.SetEscapeHTML(false)
|
||||
enc.SetIndent("", "")
|
||||
|
||||
if err := enc.Encode(v); err != nil {
|
||||
return nil, err
|
||||
if jErr := enc.Encode(v); jErr != nil {
|
||||
if err != nil {
|
||||
// TODO (go1.20): use multierror via fmt.Errorf("...: %w; ...: %w", ...)
|
||||
return nil, fmt.Errorf("protojson encoding: %v; json encoding: %w", err, jErr)
|
||||
}
|
||||
return nil, fmt.Errorf("json encoding: %w", jErr)
|
||||
}
|
||||
|
||||
// encoder.Encode appends a newline to the end
|
||||
|
6
vendor/github.com/Microsoft/hcsshim/internal/log/scrub.go
generated
vendored
6
vendor/github.com/Microsoft/hcsshim/internal/log/scrub.go
generated
vendored
@@ -89,11 +89,11 @@ func scrubBridgeCreate(m genMap) error {
|
||||
}
|
||||
|
||||
func scrubLinuxHostedSystem(m genMap) error {
|
||||
if m, ok := index(m, "OciSpecification"); ok {
|
||||
if m, ok := index(m, "OciSpecification"); ok { //nolint:govet // shadow
|
||||
if _, ok := m["annotations"]; ok {
|
||||
m["annotations"] = map[string]string{_scrubbedReplacement: _scrubbedReplacement}
|
||||
}
|
||||
if m, ok := index(m, "process"); ok {
|
||||
if m, ok := index(m, "process"); ok { //nolint:govet // shadow
|
||||
if _, ok := m["env"]; ok {
|
||||
m["env"] = []string{_scrubbedReplacement}
|
||||
return nil
|
||||
@@ -113,7 +113,7 @@ func scrubExecuteProcess(m genMap) error {
|
||||
if !isRequestBase(m) {
|
||||
return ErrUnknownType
|
||||
}
|
||||
if m, ok := index(m, "Settings"); ok {
|
||||
if m, ok := index(m, "Settings"); ok { //nolint:govet // shadow
|
||||
if ss, ok := m["ProcessParameters"]; ok {
|
||||
// ProcessParameters is a json encoded struct passed as a regular sting field
|
||||
s, ok := ss.(string)
|
||||
|
8
vendor/github.com/Microsoft/hcsshim/internal/safefile/safeopen.go
generated
vendored
8
vendor/github.com/Microsoft/hcsshim/internal/safefile/safeopen.go
generated
vendored
@@ -276,7 +276,7 @@ func RemoveAllRelative(path string, root *os.File) error {
|
||||
}
|
||||
|
||||
// It is necessary to use os.Open as Readdirnames does not work with
|
||||
// OpenRelative. This is safe because the above lstatrelative fails
|
||||
// OpenRelative. This is safe because the above LstatRelative fails
|
||||
// if the target is outside the root, and we know this is not a
|
||||
// symlink from the above FILE_ATTRIBUTE_REPARSE_POINT check.
|
||||
fd, err := os.Open(filepath.Join(root.Name(), path))
|
||||
@@ -293,12 +293,12 @@ func RemoveAllRelative(path string, root *os.File) error {
|
||||
for {
|
||||
names, err1 := fd.Readdirnames(100)
|
||||
for _, name := range names {
|
||||
err1 := RemoveAllRelative(path+string(os.PathSeparator)+name, root)
|
||||
if err == nil {
|
||||
err = err1
|
||||
if err2 := RemoveAllRelative(path+string(os.PathSeparator)+name, root); err == nil {
|
||||
err = err2
|
||||
}
|
||||
}
|
||||
if err1 == io.EOF {
|
||||
// Readdirnames has no more files to return
|
||||
break
|
||||
}
|
||||
// If Readdirnames returned an error, use it.
|
||||
|
4
vendor/github.com/Microsoft/hcsshim/internal/wclayer/baselayerreader.go
generated
vendored
4
vendor/github.com/Microsoft/hcsshim/internal/wclayer/baselayerreader.go
generated
vendored
@@ -72,8 +72,8 @@ func (r *baseLayerReader) walkUntilCancelled() error {
|
||||
return err
|
||||
}
|
||||
|
||||
utilityVMAbsPath := filepath.Join(r.root, utilityVMPath)
|
||||
utilityVMFilesAbsPath := filepath.Join(r.root, utilityVMFilesPath)
|
||||
utilityVMAbsPath := filepath.Join(r.root, UtilityVMPath)
|
||||
utilityVMFilesAbsPath := filepath.Join(r.root, UtilityVMFilesPath)
|
||||
|
||||
// Ignore a UtilityVM without Files, that's not _really_ a UtiltyVM
|
||||
if _, err = os.Lstat(utilityVMFilesAbsPath); err != nil {
|
||||
|
13
vendor/github.com/Microsoft/hcsshim/internal/wclayer/converttobaselayer.go
generated
vendored
13
vendor/github.com/Microsoft/hcsshim/internal/wclayer/converttobaselayer.go
generated
vendored
@@ -5,7 +5,6 @@ import (
|
||||
"fmt"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"syscall"
|
||||
|
||||
"github.com/Microsoft/hcsshim/internal/hcserror"
|
||||
"github.com/Microsoft/hcsshim/internal/longpath"
|
||||
@@ -37,7 +36,7 @@ func ensureHive(path string, root *os.File) (err error) {
|
||||
return fmt.Errorf("getting path: %w", err)
|
||||
}
|
||||
|
||||
var key syscall.Handle
|
||||
var key winapi.ORHKey
|
||||
err = winapi.ORCreateHive(&key)
|
||||
if err != nil {
|
||||
return fmt.Errorf("creating hive: %w", err)
|
||||
@@ -72,7 +71,7 @@ func ensureBaseLayer(root *os.File) (hasUtilityVM bool, err error) {
|
||||
}
|
||||
}
|
||||
|
||||
stat, err := safefile.LstatRelative(utilityVMFilesPath, root)
|
||||
stat, err := safefile.LstatRelative(UtilityVMFilesPath, root)
|
||||
|
||||
if os.IsNotExist(err) {
|
||||
return false, nil
|
||||
@@ -83,7 +82,7 @@ func ensureBaseLayer(root *os.File) (hasUtilityVM bool, err error) {
|
||||
}
|
||||
|
||||
if !stat.Mode().IsDir() {
|
||||
fullPath := filepath.Join(root.Name(), utilityVMFilesPath)
|
||||
fullPath := filepath.Join(root.Name(), UtilityVMFilesPath)
|
||||
return false, errors.Errorf("%s has unexpected file mode %s", fullPath, stat.Mode().String())
|
||||
}
|
||||
|
||||
@@ -92,7 +91,7 @@ func ensureBaseLayer(root *os.File) (hasUtilityVM bool, err error) {
|
||||
// Just check that this exists as a regular file. If it exists but is not a valid registry hive,
|
||||
// ProcessUtilityVMImage will complain:
|
||||
// "The registry could not read in, or write out, or flush, one of the files that contain the system's image of the registry."
|
||||
bcdPath := filepath.Join(utilityVMFilesPath, bcdRelativePath)
|
||||
bcdPath := filepath.Join(UtilityVMFilesPath, bcdRelativePath)
|
||||
|
||||
stat, err = safefile.LstatRelative(bcdPath, root)
|
||||
if err != nil {
|
||||
@@ -122,12 +121,12 @@ func convertToBaseLayer(ctx context.Context, root *os.File) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
err = safefile.EnsureNotReparsePointRelative(utilityVMPath, root)
|
||||
err = safefile.EnsureNotReparsePointRelative(UtilityVMPath, root)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
utilityVMPath := filepath.Join(root.Name(), utilityVMPath)
|
||||
utilityVMPath := filepath.Join(root.Name(), UtilityVMPath)
|
||||
return ProcessUtilityVMImage(ctx, utilityVMPath)
|
||||
}
|
||||
|
||||
|
39
vendor/github.com/Microsoft/hcsshim/internal/wclayer/legacy.go
generated
vendored
39
vendor/github.com/Microsoft/hcsshim/internal/wclayer/legacy.go
generated
vendored
@@ -29,10 +29,19 @@ var mutatedUtilityVMFiles = map[string]bool{
|
||||
}
|
||||
|
||||
const (
|
||||
filesPath = `Files`
|
||||
hivesPath = `Hives`
|
||||
utilityVMPath = `UtilityVM`
|
||||
utilityVMFilesPath = `UtilityVM\Files`
|
||||
filesPath = `Files`
|
||||
HivesPath = `Hives`
|
||||
UtilityVMPath = `UtilityVM`
|
||||
UtilityVMFilesPath = `UtilityVM\Files`
|
||||
RegFilesPath = `Files\Windows\System32\config`
|
||||
BcdFilePath = `UtilityVM\Files\EFI\Microsoft\Boot\BCD`
|
||||
BootMgrFilePath = `UtilityVM\Files\EFI\Microsoft\Boot\bootmgfw.efi`
|
||||
ContainerBaseVhd = `blank-base.vhdx`
|
||||
ContainerScratchVhd = `blank.vhdx`
|
||||
UtilityVMBaseVhd = `SystemTemplateBase.vhdx`
|
||||
UtilityVMScratchVhd = `SystemTemplate.vhdx`
|
||||
LayoutFileName = `layout`
|
||||
UvmBuildFileName = `uvmbuildversion`
|
||||
)
|
||||
|
||||
func openFileOrDir(path string, mode uint32, createDisposition uint32) (file *os.File, err error) {
|
||||
@@ -243,11 +252,11 @@ func (r *legacyLayerReader) Next() (path string, size int64, fileInfo *winio.Fil
|
||||
if !hasPathPrefix(path, filesPath) {
|
||||
size = fe.fi.Size()
|
||||
r.backupReader = winio.NewBackupFileReader(f, false)
|
||||
if path == hivesPath || path == filesPath {
|
||||
if path == HivesPath || path == filesPath {
|
||||
// The Hives directory has a non-deterministic file time because of the
|
||||
// nature of the import process. Use the times from System_Delta.
|
||||
var g *os.File
|
||||
g, err = os.Open(filepath.Join(r.root, hivesPath, `System_Delta`))
|
||||
g, err = os.Open(filepath.Join(r.root, HivesPath, `System_Delta`))
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
@@ -409,7 +418,7 @@ func (w *legacyLayerWriter) CloseRoots() {
|
||||
|
||||
func (w *legacyLayerWriter) initUtilityVM() error {
|
||||
if !w.HasUtilityVM {
|
||||
err := safefile.MkdirRelative(utilityVMPath, w.destRoot)
|
||||
err := safefile.MkdirRelative(UtilityVMPath, w.destRoot)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
@@ -417,7 +426,7 @@ func (w *legacyLayerWriter) initUtilityVM() error {
|
||||
// clone the utility VM from the parent layer into this layer. Use hard
|
||||
// links to avoid unnecessary copying, since most of the files are
|
||||
// immutable.
|
||||
err = cloneTree(w.parentRoots[0], w.destRoot, utilityVMFilesPath, mutatedUtilityVMFiles)
|
||||
err = cloneTree(w.parentRoots[0], w.destRoot, UtilityVMFilesPath, mutatedUtilityVMFiles)
|
||||
if err != nil {
|
||||
return fmt.Errorf("cloning the parent utility VM image failed: %s", err)
|
||||
}
|
||||
@@ -592,7 +601,7 @@ func (w *legacyLayerWriter) Add(name string, fileInfo *winio.FileBasicInfo) erro
|
||||
return err
|
||||
}
|
||||
|
||||
if name == utilityVMPath {
|
||||
if name == UtilityVMPath {
|
||||
return w.initUtilityVM()
|
||||
}
|
||||
|
||||
@@ -601,11 +610,11 @@ func (w *legacyLayerWriter) Add(name string, fileInfo *winio.FileBasicInfo) erro
|
||||
}
|
||||
|
||||
name = filepath.Clean(name)
|
||||
if hasPathPrefix(name, utilityVMPath) {
|
||||
if hasPathPrefix(name, UtilityVMPath) {
|
||||
if !w.HasUtilityVM {
|
||||
return errors.New("missing UtilityVM directory")
|
||||
}
|
||||
if !hasPathPrefix(name, utilityVMFilesPath) && name != utilityVMFilesPath {
|
||||
if !hasPathPrefix(name, UtilityVMFilesPath) && name != UtilityVMFilesPath {
|
||||
return errors.New("invalid UtilityVM layer")
|
||||
}
|
||||
createDisposition := uint32(winapi.FILE_OPEN)
|
||||
@@ -699,7 +708,7 @@ func (w *legacyLayerWriter) Add(name string, fileInfo *winio.FileBasicInfo) erro
|
||||
return err
|
||||
}
|
||||
|
||||
if hasPathPrefix(name, hivesPath) {
|
||||
if hasPathPrefix(name, HivesPath) {
|
||||
w.backupWriter = winio.NewBackupFileWriter(f, false)
|
||||
w.bufWriter.Reset(w.backupWriter)
|
||||
} else {
|
||||
@@ -731,14 +740,14 @@ func (w *legacyLayerWriter) AddLink(name string, target string) error {
|
||||
// Look for cross-layer hard link targets in the parent layers, since
|
||||
// nothing is in the destination path yet.
|
||||
roots = w.parentRoots
|
||||
} else if hasPathPrefix(target, utilityVMFilesPath) {
|
||||
} else if hasPathPrefix(target, UtilityVMFilesPath) {
|
||||
// Since the utility VM is fully cloned into the destination path
|
||||
// already, look for cross-layer hard link targets directly in the
|
||||
// destination path.
|
||||
roots = []*os.File{w.destRoot}
|
||||
}
|
||||
|
||||
if roots == nil || (!hasPathPrefix(name, filesPath) && !hasPathPrefix(name, utilityVMFilesPath)) {
|
||||
if roots == nil || (!hasPathPrefix(name, filesPath) && !hasPathPrefix(name, UtilityVMFilesPath)) {
|
||||
return errors.New("invalid hard link in layer")
|
||||
}
|
||||
|
||||
@@ -777,7 +786,7 @@ func (w *legacyLayerWriter) Remove(name string) error {
|
||||
name = filepath.Clean(name)
|
||||
if hasPathPrefix(name, filesPath) {
|
||||
w.Tombstones = append(w.Tombstones, name)
|
||||
} else if hasPathPrefix(name, utilityVMFilesPath) {
|
||||
} else if hasPathPrefix(name, UtilityVMFilesPath) {
|
||||
err := w.initUtilityVM()
|
||||
if err != nil {
|
||||
return err
|
||||
|
37
vendor/github.com/Microsoft/hcsshim/internal/winapi/offlinereg.go
generated
vendored
Normal file
37
vendor/github.com/Microsoft/hcsshim/internal/winapi/offlinereg.go
generated
vendored
Normal file
@@ -0,0 +1,37 @@
|
||||
package winapi
|
||||
|
||||
// Offline registry management API
|
||||
|
||||
type ORHKey uintptr
|
||||
|
||||
type RegType uint32
|
||||
|
||||
const (
|
||||
// Registry value types: https://docs.microsoft.com/en-us/windows/win32/sysinfo/registry-value-types
|
||||
REG_TYPE_NONE RegType = 0
|
||||
REG_TYPE_SZ RegType = 1
|
||||
REG_TYPE_EXPAND_SZ RegType = 2
|
||||
REG_TYPE_BINARY RegType = 3
|
||||
REG_TYPE_DWORD RegType = 4
|
||||
REG_TYPE_DWORD_LITTLE_ENDIAN RegType = 4
|
||||
REG_TYPE_DWORD_BIG_ENDIAN RegType = 5
|
||||
REG_TYPE_LINK RegType = 6
|
||||
REG_TYPE_MULTI_SZ RegType = 7
|
||||
REG_TYPE_RESOURCE_LIST RegType = 8
|
||||
REG_TYPE_FULL_RESOURCE_DESCRIPTOR RegType = 9
|
||||
REG_TYPE_RESOURCE_REQUIREMENTS_LIST RegType = 10
|
||||
REG_TYPE_QWORD RegType = 11
|
||||
REG_TYPE_QWORD_LITTLE_ENDIAN RegType = 11
|
||||
)
|
||||
|
||||
//sys ORCreateHive(key *ORHKey) (win32err error) = offreg.ORCreateHive
|
||||
//sys ORMergeHives(hiveHandles []ORHKey, result *ORHKey) (win32err error) = offreg.ORMergeHives
|
||||
//sys OROpenHive(hivePath string, result *ORHKey) (win32err error) = offreg.OROpenHive
|
||||
//sys ORCloseHive(handle ORHKey) (win32err error) = offreg.ORCloseHive
|
||||
//sys ORSaveHive(handle ORHKey, hivePath string, osMajorVersion uint32, osMinorVersion uint32) (win32err error) = offreg.ORSaveHive
|
||||
//sys OROpenKey(handle ORHKey, subKey string, result *ORHKey) (win32err error) = offreg.OROpenKey
|
||||
//sys ORCloseKey(handle ORHKey) (win32err error) = offreg.ORCloseKey
|
||||
//sys ORCreateKey(handle ORHKey, subKey string, class uintptr, options uint32, securityDescriptor uintptr, result *ORHKey, disposition *uint32) (win32err error) = offreg.ORCreateKey
|
||||
//sys ORDeleteKey(handle ORHKey, subKey string) (win32err error) = offreg.ORDeleteKey
|
||||
//sys ORGetValue(handle ORHKey, subKey string, value string, valueType *uint32, data *byte, dataLen *uint32) (win32err error) = offreg.ORGetValue
|
||||
//sys ORSetValue(handle ORHKey, valueName string, valueType uint32, data *byte, dataLen uint32) (win32err error) = offreg.ORSetValue
|
5
vendor/github.com/Microsoft/hcsshim/internal/winapi/ofreg.go
generated
vendored
5
vendor/github.com/Microsoft/hcsshim/internal/winapi/ofreg.go
generated
vendored
@@ -1,5 +0,0 @@
|
||||
package winapi
|
||||
|
||||
//sys ORCreateHive(key *syscall.Handle) (regerrno error) = offreg.ORCreateHive
|
||||
//sys ORSaveHive(key syscall.Handle, file string, OsMajorVersion uint32, OsMinorVersion uint32) (regerrno error) = offreg.ORSaveHive
|
||||
//sys ORCloseHive(key syscall.Handle) (regerrno error) = offreg.ORCloseHive
|
159
vendor/github.com/Microsoft/hcsshim/internal/winapi/zsyscall_windows.go
generated
vendored
159
vendor/github.com/Microsoft/hcsshim/internal/winapi/zsyscall_windows.go
generated
vendored
@@ -96,8 +96,16 @@ var (
|
||||
procNtSetInformationFile = modntdll.NewProc("NtSetInformationFile")
|
||||
procRtlNtStatusToDosError = modntdll.NewProc("RtlNtStatusToDosError")
|
||||
procORCloseHive = modoffreg.NewProc("ORCloseHive")
|
||||
procORCloseKey = modoffreg.NewProc("ORCloseKey")
|
||||
procORCreateHive = modoffreg.NewProc("ORCreateHive")
|
||||
procORCreateKey = modoffreg.NewProc("ORCreateKey")
|
||||
procORDeleteKey = modoffreg.NewProc("ORDeleteKey")
|
||||
procORGetValue = modoffreg.NewProc("ORGetValue")
|
||||
procORMergeHives = modoffreg.NewProc("ORMergeHives")
|
||||
procOROpenHive = modoffreg.NewProc("OROpenHive")
|
||||
procOROpenKey = modoffreg.NewProc("OROpenKey")
|
||||
procORSaveHive = modoffreg.NewProc("ORSaveHive")
|
||||
procORSetValue = modoffreg.NewProc("ORSetValue")
|
||||
)
|
||||
|
||||
func LogonUser(username *uint16, domain *uint16, password *uint16, logonType uint32, logonProvider uint32, token *windows.Token) (err error) {
|
||||
@@ -622,35 +630,162 @@ func RtlNtStatusToDosError(status uint32) (winerr error) {
|
||||
return
|
||||
}
|
||||
|
||||
func ORCloseHive(key syscall.Handle) (regerrno error) {
|
||||
r0, _, _ := syscall.Syscall(procORCloseHive.Addr(), 1, uintptr(key), 0, 0)
|
||||
func ORCloseHive(handle ORHKey) (win32err error) {
|
||||
r0, _, _ := syscall.Syscall(procORCloseHive.Addr(), 1, uintptr(handle), 0, 0)
|
||||
if r0 != 0 {
|
||||
regerrno = syscall.Errno(r0)
|
||||
win32err = syscall.Errno(r0)
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
func ORCreateHive(key *syscall.Handle) (regerrno error) {
|
||||
func ORCloseKey(handle ORHKey) (win32err error) {
|
||||
r0, _, _ := syscall.Syscall(procORCloseKey.Addr(), 1, uintptr(handle), 0, 0)
|
||||
if r0 != 0 {
|
||||
win32err = syscall.Errno(r0)
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
func ORCreateHive(key *ORHKey) (win32err error) {
|
||||
r0, _, _ := syscall.Syscall(procORCreateHive.Addr(), 1, uintptr(unsafe.Pointer(key)), 0, 0)
|
||||
if r0 != 0 {
|
||||
regerrno = syscall.Errno(r0)
|
||||
win32err = syscall.Errno(r0)
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
func ORSaveHive(key syscall.Handle, file string, OsMajorVersion uint32, OsMinorVersion uint32) (regerrno error) {
|
||||
func ORCreateKey(handle ORHKey, subKey string, class uintptr, options uint32, securityDescriptor uintptr, result *ORHKey, disposition *uint32) (win32err error) {
|
||||
var _p0 *uint16
|
||||
_p0, regerrno = syscall.UTF16PtrFromString(file)
|
||||
if regerrno != nil {
|
||||
_p0, win32err = syscall.UTF16PtrFromString(subKey)
|
||||
if win32err != nil {
|
||||
return
|
||||
}
|
||||
return _ORSaveHive(key, _p0, OsMajorVersion, OsMinorVersion)
|
||||
return _ORCreateKey(handle, _p0, class, options, securityDescriptor, result, disposition)
|
||||
}
|
||||
|
||||
func _ORSaveHive(key syscall.Handle, file *uint16, OsMajorVersion uint32, OsMinorVersion uint32) (regerrno error) {
|
||||
r0, _, _ := syscall.Syscall6(procORSaveHive.Addr(), 4, uintptr(key), uintptr(unsafe.Pointer(file)), uintptr(OsMajorVersion), uintptr(OsMinorVersion), 0, 0)
|
||||
func _ORCreateKey(handle ORHKey, subKey *uint16, class uintptr, options uint32, securityDescriptor uintptr, result *ORHKey, disposition *uint32) (win32err error) {
|
||||
r0, _, _ := syscall.Syscall9(procORCreateKey.Addr(), 7, uintptr(handle), uintptr(unsafe.Pointer(subKey)), uintptr(class), uintptr(options), uintptr(securityDescriptor), uintptr(unsafe.Pointer(result)), uintptr(unsafe.Pointer(disposition)), 0, 0)
|
||||
if r0 != 0 {
|
||||
regerrno = syscall.Errno(r0)
|
||||
win32err = syscall.Errno(r0)
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
func ORDeleteKey(handle ORHKey, subKey string) (win32err error) {
|
||||
var _p0 *uint16
|
||||
_p0, win32err = syscall.UTF16PtrFromString(subKey)
|
||||
if win32err != nil {
|
||||
return
|
||||
}
|
||||
return _ORDeleteKey(handle, _p0)
|
||||
}
|
||||
|
||||
func _ORDeleteKey(handle ORHKey, subKey *uint16) (win32err error) {
|
||||
r0, _, _ := syscall.Syscall(procORDeleteKey.Addr(), 2, uintptr(handle), uintptr(unsafe.Pointer(subKey)), 0)
|
||||
if r0 != 0 {
|
||||
win32err = syscall.Errno(r0)
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
func ORGetValue(handle ORHKey, subKey string, value string, valueType *uint32, data *byte, dataLen *uint32) (win32err error) {
|
||||
var _p0 *uint16
|
||||
_p0, win32err = syscall.UTF16PtrFromString(subKey)
|
||||
if win32err != nil {
|
||||
return
|
||||
}
|
||||
var _p1 *uint16
|
||||
_p1, win32err = syscall.UTF16PtrFromString(value)
|
||||
if win32err != nil {
|
||||
return
|
||||
}
|
||||
return _ORGetValue(handle, _p0, _p1, valueType, data, dataLen)
|
||||
}
|
||||
|
||||
func _ORGetValue(handle ORHKey, subKey *uint16, value *uint16, valueType *uint32, data *byte, dataLen *uint32) (win32err error) {
|
||||
r0, _, _ := syscall.Syscall6(procORGetValue.Addr(), 6, uintptr(handle), uintptr(unsafe.Pointer(subKey)), uintptr(unsafe.Pointer(value)), uintptr(unsafe.Pointer(valueType)), uintptr(unsafe.Pointer(data)), uintptr(unsafe.Pointer(dataLen)))
|
||||
if r0 != 0 {
|
||||
win32err = syscall.Errno(r0)
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
func ORMergeHives(hiveHandles []ORHKey, result *ORHKey) (win32err error) {
|
||||
var _p0 *ORHKey
|
||||
if len(hiveHandles) > 0 {
|
||||
_p0 = &hiveHandles[0]
|
||||
}
|
||||
r0, _, _ := syscall.Syscall(procORMergeHives.Addr(), 3, uintptr(unsafe.Pointer(_p0)), uintptr(len(hiveHandles)), uintptr(unsafe.Pointer(result)))
|
||||
if r0 != 0 {
|
||||
win32err = syscall.Errno(r0)
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
func OROpenHive(hivePath string, result *ORHKey) (win32err error) {
|
||||
var _p0 *uint16
|
||||
_p0, win32err = syscall.UTF16PtrFromString(hivePath)
|
||||
if win32err != nil {
|
||||
return
|
||||
}
|
||||
return _OROpenHive(_p0, result)
|
||||
}
|
||||
|
||||
func _OROpenHive(hivePath *uint16, result *ORHKey) (win32err error) {
|
||||
r0, _, _ := syscall.Syscall(procOROpenHive.Addr(), 2, uintptr(unsafe.Pointer(hivePath)), uintptr(unsafe.Pointer(result)), 0)
|
||||
if r0 != 0 {
|
||||
win32err = syscall.Errno(r0)
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
func OROpenKey(handle ORHKey, subKey string, result *ORHKey) (win32err error) {
|
||||
var _p0 *uint16
|
||||
_p0, win32err = syscall.UTF16PtrFromString(subKey)
|
||||
if win32err != nil {
|
||||
return
|
||||
}
|
||||
return _OROpenKey(handle, _p0, result)
|
||||
}
|
||||
|
||||
func _OROpenKey(handle ORHKey, subKey *uint16, result *ORHKey) (win32err error) {
|
||||
r0, _, _ := syscall.Syscall(procOROpenKey.Addr(), 3, uintptr(handle), uintptr(unsafe.Pointer(subKey)), uintptr(unsafe.Pointer(result)))
|
||||
if r0 != 0 {
|
||||
win32err = syscall.Errno(r0)
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
func ORSaveHive(handle ORHKey, hivePath string, osMajorVersion uint32, osMinorVersion uint32) (win32err error) {
|
||||
var _p0 *uint16
|
||||
_p0, win32err = syscall.UTF16PtrFromString(hivePath)
|
||||
if win32err != nil {
|
||||
return
|
||||
}
|
||||
return _ORSaveHive(handle, _p0, osMajorVersion, osMinorVersion)
|
||||
}
|
||||
|
||||
func _ORSaveHive(handle ORHKey, hivePath *uint16, osMajorVersion uint32, osMinorVersion uint32) (win32err error) {
|
||||
r0, _, _ := syscall.Syscall6(procORSaveHive.Addr(), 4, uintptr(handle), uintptr(unsafe.Pointer(hivePath)), uintptr(osMajorVersion), uintptr(osMinorVersion), 0, 0)
|
||||
if r0 != 0 {
|
||||
win32err = syscall.Errno(r0)
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
func ORSetValue(handle ORHKey, valueName string, valueType uint32, data *byte, dataLen uint32) (win32err error) {
|
||||
var _p0 *uint16
|
||||
_p0, win32err = syscall.UTF16PtrFromString(valueName)
|
||||
if win32err != nil {
|
||||
return
|
||||
}
|
||||
return _ORSetValue(handle, _p0, valueType, data, dataLen)
|
||||
}
|
||||
|
||||
func _ORSetValue(handle ORHKey, valueName *uint16, valueType uint32, data *byte, dataLen uint32) (win32err error) {
|
||||
r0, _, _ := syscall.Syscall6(procORSetValue.Addr(), 5, uintptr(handle), uintptr(unsafe.Pointer(valueName)), uintptr(valueType), uintptr(unsafe.Pointer(data)), uintptr(dataLen), 0)
|
||||
if r0 != 0 {
|
||||
win32err = syscall.Errno(r0)
|
||||
}
|
||||
return
|
||||
}
|
||||
|
Reference in New Issue
Block a user