$36 GRAYBYTE WORDPRESS FILE MANAGER $50

SERVER : vnpttt-amd7f72-h1.vietnix.vn #1 SMP Fri May 24 12:42:50 UTC 2024
SERVER IP : 103.200.23.149 | ADMIN IP 216.73.216.22
OPTIONS : CRL = ON | WGT = ON | SDO = OFF | PKEX = OFF
DEACTIVATED : NONE

/usr/lib/golang/src/internal/syscall/execenv/

HOME
Current File : /usr/lib/golang/src/internal/syscall/execenv//execenv_windows.go
// Copyright 2020 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.

//go:build windows

package execenv

import (
	"internal/syscall/windows"
	"syscall"
	"unsafe"
)

// Default will return the default environment
// variables based on the process attributes
// provided.
//
// If the process attributes contain a token, then
// the environment variables will be sourced from
// the defaults for that user token, otherwise they
// will be sourced from syscall.Environ().
func Default(sys *syscall.SysProcAttr) (env []string, err error) {
	if sys == nil || sys.Token == 0 {
		return syscall.Environ(), nil
	}
	var blockp *uint16
	err = windows.CreateEnvironmentBlock(&blockp, sys.Token, false)
	if err != nil {
		return nil, err
	}
	defer windows.DestroyEnvironmentBlock(blockp)

	const size = unsafe.Sizeof(*blockp)
	for *blockp != 0 { // environment block ends with empty string
		// find NUL terminator
		end := unsafe.Add(unsafe.Pointer(blockp), size)
		for *(*uint16)(end) != 0 {
			end = unsafe.Add(end, size)
		}

		entry := unsafe.Slice(blockp, (uintptr(end)-uintptr(unsafe.Pointer(blockp)))/2)
		env = append(env, syscall.UTF16ToString(entry))
		blockp = (*uint16)(unsafe.Add(end, size))
	}
	return
}

Current_dir [ NOT WRITEABLE ] Document_root [ WRITEABLE ]


[ Back ]
NAME
SIZE
LAST TOUCH
USER
CAN-I?
FUNCTIONS
..
--
4 Dec 2025 6.06 PM
root / root
0755
execenv_default.go
0.478 KB
4 Dec 2025 6.06 PM
root / root
0644
execenv_windows.go
1.27 KB
4 Dec 2025 6.06 PM
root / root
0644

GRAYBYTE WORDPRESS FILE MANAGER @ 2026 CONTACT ME
Static GIF