Documentation ¶
Overview ¶
Package syscall contains an interface to the low-level operating system primitives. The details vary depending on the underlying system, and by default, godoc will display the syscall documentation for the current system. If you want godoc to display syscall documentation for another system, set $GOOS and $GOARCH to the desired system. For example, if you want to view documentation for freebsd/arm on linux/amd64, set $GOOS to freebsd and $GOARCH to arm. The primary use of syscall is inside other packages that provide a more portable interface to the system, such as "os", "time" and "net". Use those packages rather than this one if you can. For details of the functions and data types in this package consult the manuals for the appropriate operating system. These calls return err == nil to indicate success; otherwise err is an operating system error describing the failure. On most systems, that error has type Errno.
NOTE: Most of the functions, types, and constants defined in this package are also available in the golang.org/x/sys package. That package has more system call support than this one, and most new code should prefer that package where possible. See https://golang.org/s/go1.4-syscall for more information.
Index ¶
- Constants
- Variables
- func Accept(fd Handle) (nfd Handle, sa Sockaddr, err error)
- func AcceptEx(ls Handle, as Handle, buf *byte, rxdatalen uint32, laddrlen uint32, ...) (err error)
- func Bind(fd Handle, sa Sockaddr) (err error)
- func BytePtrFromString(s string) (*byte, error)
- func ByteSliceFromString(s string) ([]byte, error)
- func CancelIo(s Handle) (err error)
- func CancelIoEx(s Handle, o *Overlapped) (err error)
- func CertAddCertificateContextToStore(store Handle, certContext *CertContext, addDisposition uint32, ...) (err error)
- func CertCloseStore(store Handle, flags uint32) (err error)
- func CertFreeCertificateChain(ctx *CertChainContext)
- func CertFreeCertificateContext(ctx *CertContext) (err error)
- func CertGetCertificateChain(engine Handle, leaf *CertContext, time *Filetime, additionalStore Handle, ...) (err error)
- func CertVerifyCertificateChainPolicy(policyOID uintptr, chain *CertChainContext, para *CertChainPolicyPara, ...) (err error)
- func Chdir(path string) (err error)
- func Chmod(path string, mode uint32) (err error)
- func Chown(path string, uid int, gid int) (err error)
- func Clearenv()
- func Close(fd Handle) (err error)
- func CloseHandle(handle Handle) (err error)
- func CloseOnExec(fd Handle)
- func Closesocket(s Handle) (err error)
- func CommandLineToArgv(cmd *uint16, argc *int32) (argv *[8192]*[8192]uint16, err error)
- func ComputerName() (name string, err error)
- func Connect(fd Handle, sa Sockaddr) (err error)
- func ConnectEx(fd Handle, sa Sockaddr, sendBuf *byte, sendDataLen uint32, bytesSent *uint32, ...) error
- func ConvertSidToStringSid(sid *SID, stringSid **uint16) (err error)
- func ConvertStringSidToSid(stringSid *uint16, sid **SID) (err error)
- func CopySid(destSidLen uint32, destSid *SID, srcSid *SID) (err error)
- func CreateDirectory(path *uint16, sa *SecurityAttributes) (err error)
- func CreateHardLink(filename *uint16, existingfilename *uint16, reserved uintptr) (err error)
- func CreatePipe(readhandle *Handle, writehandle *Handle, sa *SecurityAttributes, size uint32) (err error)
- func CreateProcess(appName *uint16, commandLine *uint16, procSecurity *SecurityAttributes, ...) (err error)
- func CreateProcessAsUser(token Token, appName *uint16, commandLine *uint16, ...) (err error)
- func CreateSymbolicLink(symlinkfilename *uint16, targetfilename *uint16, flags uint32) (err error)
- func CryptAcquireContext(provhandle *Handle, container *uint16, provider *uint16, provtype uint32, ...) (err error)
- func CryptGenRandom(provhandle Handle, buflen uint32, buf *byte) (err error)
- func CryptReleaseContext(provhandle Handle, flags uint32) (err error)
- func DeleteFile(path *uint16) (err error)
- func DeviceIoControl(handle Handle, ioControlCode uint32, inBuffer *byte, inBufferSize uint32, ...) (err error)
- func DnsNameCompare(name1 *uint16, name2 *uint16) (same bool)
- func DnsQuery(name string, qtype uint16, options uint32, extra *byte, qrs **DNSRecord, ...) (status error)
- func DnsRecordListFree(rl *DNSRecord, freetype uint32)
- func DuplicateHandle(hSourceProcessHandle Handle, hSourceHandle Handle, hTargetProcessHandle Handle, ...) (err error)
- func Environ() []string
- func EscapeArg(s string) string
- func Exec(argv0 string, argv []string, envv []string) (err error)
- func Exit(code int)
- func ExitProcess(exitcode uint32)
- func Fchdir(fd Handle) (err error)
- func Fchmod(fd Handle, mode uint32) (err error)
- func Fchown(fd Handle, uid int, gid int) (err error)
- func FindClose(handle Handle) (err error)
- func FindNextFile(handle Handle, data *Win32finddata) (err error)
- func FlushFileBuffers(handle Handle) (err error)
- func FlushViewOfFile(addr uintptr, length uintptr) (err error)
- func FormatMessage(flags uint32, msgsrc uint32, msgid uint32, langid uint32, buf []uint16, ...) (n uint32, err error)deprecated
- func FreeAddrInfoW(addrinfo *AddrinfoW)
- func FreeEnvironmentStrings(envs *uint16) (err error)
- func FreeLibrary(handle Handle) (err error)
- func Fsync(fd Handle) (err error)
- func Ftruncate(fd Handle, length int64) (err error)
- func FullPath(name string) (path string, err error)
- func GetAcceptExSockaddrs(buf *byte, rxdatalen uint32, laddrlen uint32, raddrlen uint32, ...)
- func GetAdaptersInfo(ai *IpAdapterInfo, ol *uint32) (errcode error)
- func GetAddrInfoW(nodename *uint16, servicename *uint16, hints *AddrinfoW, result **AddrinfoW) (sockerr error)
- func GetCommandLine() (cmd *uint16)
- func GetComputerName(buf *uint16, n *uint32) (err error)
- func GetConsoleMode(console Handle, mode *uint32) (err error)
- func GetCurrentDirectory(buflen uint32, buf *uint16) (n uint32, err error)
- func GetEnvironmentStrings() (envs *uint16, err error)
- func GetEnvironmentVariable(name *uint16, buffer *uint16, size uint32) (n uint32, err error)
- func GetExitCodeProcess(handle Handle, exitcode *uint32) (err error)
- func GetFileAttributes(name *uint16) (attrs uint32, err error)
- func GetFileAttributesEx(name *uint16, level uint32, info *byte) (err error)
- func GetFileInformationByHandle(handle Handle, data *ByHandleFileInformation) (err error)
- func GetFileType(filehandle Handle) (n uint32, err error)
- func GetFullPathName(path *uint16, buflen uint32, buf *uint16, fname **uint16) (n uint32, err error)
- func GetIfEntry(pIfRow *MibIfRow) (errcode error)
- func GetLastError() (lasterr error)
- func GetLengthSid(sid *SID) (len uint32)
- func GetLongPathName(path *uint16, buf *uint16, buflen uint32) (n uint32, err error)
- func GetProcAddress(module Handle, procname string) (proc uintptr, err error)
- func GetProcessTimes(handle Handle, creationTime *Filetime, exitTime *Filetime, ...) (err error)
- func GetQueuedCompletionStatus(cphandle Handle, qty *uint32, key *uint32, overlapped **Overlapped, ...) errordeprecated
- func GetShortPathName(longpath *uint16, shortpath *uint16, buflen uint32) (n uint32, err error)
- func GetStartupInfo(startupInfo *StartupInfo) error
- func GetSystemTimeAsFileTime(time *Filetime)
- func GetTempPath(buflen uint32, buf *uint16) (n uint32, err error)
- func GetTimeZoneInformation(tzi *Timezoneinformation) (rc uint32, err error)
- func GetTokenInformation(t Token, infoClass uint32, info *byte, infoLen uint32, returnedLen *uint32) (err error)
- func GetUserNameEx(nameFormat uint32, nameBuffre *uint16, nSize *uint32) (err error)
- func GetUserProfileDirectory(t Token, dir *uint16, dirLen *uint32) (err error)
- func GetVersion() (ver uint32, err error)
- func Getegid() (egid int)
- func Getenv(key string) (value string, found bool)
- func Geteuid() (euid int)
- func Getgid() (gid int)
- func Getgroups() (gids []int, err error)
- func Getpagesize() int
- func Getpid() (pid int)
- func Getppid() (ppid int)
- func Getsockopt(s Handle, level int32, optname int32, optval *byte, optlen *int32) (err error)
- func GetsockoptInt(fd Handle, level, opt int) (int, error)
- func Gettimeofday(tv *Timeval) (err error)
- func Getuid() (uid int)
- func Getwd() (wd string, err error)
- func Lchown(path string, uid int, gid int) (err error)
- func Link(oldpath, newpath string) (err error)
- func Listen(s Handle, n int) (err error)
- func LoadCancelIoEx() error
- func LoadConnectEx() error
- func LoadCreateSymbolicLink() error
- func LoadGetAddrInfo() error
- func LoadSetFileCompletionNotificationModes() error
- func LookupAccountName(systemName *uint16, accountName *uint16, sid *SID, sidLen *uint32, ...) (err error)
- func LookupAccountSid(systemName *uint16, sid *SID, name *uint16, nameLen *uint32, ...) (err error)
- func MapViewOfFile(handle Handle, access uint32, offsetHigh uint32, offsetLow uint32, ...) (addr uintptr, err error)
- func Mkdir(path string, mode uint32) (err error)
- func MoveFile(from *uint16, to *uint16) (err error)
- func NetApiBufferFree(buf *byte) (neterr error)
- func NetGetJoinInformation(server *uint16, name **uint16, bufType *uint32) (neterr error)
- func NetUserGetInfo(serverName *uint16, userName *uint16, level uint32, buf **byte) (neterr error)
- func NewCallback(fn any) uintptr
- func NewCallbackCDecl(fn any) uintptr
- func Ntohs(netshort uint16) (u uint16)
- func OpenProcessToken(h Handle, access uint32, token *Token) (err error)
- func Pipe(p []Handle) (err error)
- func PostQueuedCompletionStatus(cphandle Handle, qty uint32, key uint32, overlapped *Overlapped) errordeprecated
- func Process32First(snapshot Handle, procEntry *ProcessEntry32) (err error)
- func Process32Next(snapshot Handle, procEntry *ProcessEntry32) (err error)
- func Read(fd Handle, p []byte) (n int, err error)
- func ReadConsole(console Handle, buf *uint16, toread uint32, read *uint32, inputControl *byte) (err error)
- func ReadDirectoryChanges(handle Handle, buf *byte, buflen uint32, watchSubTree bool, mask uint32, ...) (err error)
- func ReadFile(fd Handle, p []byte, done *uint32, overlapped *Overlapped) error
- func Readlink(path string, buf []byte) (n int, err error)
- func RegCloseKey(key Handle) (regerrno error)
- func RegEnumKeyEx(key Handle, index uint32, name *uint16, nameLen *uint32, reserved *uint32, ...) (regerrno error)
- func RegOpenKeyEx(key Handle, subkey *uint16, options uint32, desiredAccess uint32, ...) (regerrno error)
- func RegQueryInfoKey(key Handle, class *uint16, classLen *uint32, reserved *uint32, ...) (regerrno error)
- func RegQueryValueEx(key Handle, name *uint16, reserved *uint32, valtype *uint32, buf *byte, ...) (regerrno error)
- func RemoveDirectory(path *uint16) (err error)
- func Rename(oldpath, newpath string) (err error)
- func Rmdir(path string) (err error)
- func Seek(fd Handle, offset int64, whence int) (newoffset int64, err error)
- func Sendto(fd Handle, p []byte, flags int, to Sockaddr) (err error)
- func SetCurrentDirectory(path *uint16) (err error)
- func SetEndOfFile(handle Handle) (err error)
- func SetEnvironmentVariable(name *uint16, value *uint16) (err error)
- func SetFileAttributes(name *uint16, attrs uint32) (err error)
- func SetFileCompletionNotificationModes(handle Handle, flags uint8) (err error)
- func SetFilePointer(handle Handle, lowoffset int32, highoffsetptr *int32, whence uint32) (newlowoffset uint32, err error)
- func SetFileTime(handle Handle, ctime *Filetime, atime *Filetime, wtime *Filetime) (err error)
- func SetHandleInformation(handle Handle, mask uint32, flags uint32) (err error)
- func SetNonblock(fd Handle, nonblocking bool) (err error)
- func Setenv(key, value string) error
- func Setsockopt(s Handle, level int32, optname int32, optval *byte, optlen int32) (err error)
- func SetsockoptIPMreq(fd Handle, level, opt int, mreq *IPMreq) (err error)
- func SetsockoptIPv6Mreq(fd Handle, level, opt int, mreq *IPv6Mreq) (err error)
- func SetsockoptInet4Addr(fd Handle, level, opt int, value [4]byte) (err error)
- func SetsockoptInt(fd Handle, level, opt int, value int) (err error)
- func SetsockoptLinger(fd Handle, level, opt int, l *Linger) (err error)
- func SetsockoptTimeval(fd Handle, level, opt int, tv *Timeval) (err error)
- func Shutdown(fd Handle, how int) (err error)
- func StartProcess(argv0 string, argv []string, attr *ProcAttr) (pid int, handle uintptr, err error)
- func StringBytePtr(s string) *bytedeprecated
- func StringByteSlice(s string) []bytedeprecated
- func StringToUTF16(s string) []uint16deprecated
- func StringToUTF16Ptr(s string) *uint16deprecated
- func Symlink(path, link string) (err error)
- func TerminateProcess(handle Handle, exitcode uint32) (err error)
- func TimespecToNsec(ts Timespec) int64
- func TranslateAccountName(username string, from, to uint32, initSize int) (string, error)
- func TranslateName(accName *uint16, accNameFormat uint32, desiredNameFormat uint32, ...) (err error)
- func TransmitFile(s Handle, handle Handle, bytesToWrite uint32, bytsPerSend uint32, ...) (err error)
- func UTF16FromString(s string) ([]uint16, error)
- func UTF16PtrFromString(s string) (*uint16, error)
- func UTF16ToString(s []uint16) string
- func Unlink(path string) (err error)
- func UnmapViewOfFile(addr uintptr) (err error)
- func Unsetenv(key string) error
- func Utimes(path string, tv []Timeval) (err error)
- func UtimesNano(path string, ts []Timespec) (err error)
- func VirtualLock(addr uintptr, length uintptr) (err error)
- func VirtualUnlock(addr uintptr, length uintptr) (err error)
- func WSACleanup() (err error)
- func WSAEnumProtocols(protocols *int32, protocolBuffer *WSAProtocolInfo, bufferLength *uint32) (n int32, err error)
- func WSAIoctl(s Handle, iocc uint32, inbuf *byte, cbif uint32, outbuf *byte, cbob uint32, ...) (err error)
- func WSARecv(s Handle, bufs *WSABuf, bufcnt uint32, recvd *uint32, flags *uint32, ...) (err error)
- func WSARecvFrom(s Handle, bufs *WSABuf, bufcnt uint32, recvd *uint32, flags *uint32, ...) (err error)
- func WSASend(s Handle, bufs *WSABuf, bufcnt uint32, sent *uint32, flags uint32, ...) (err error)
- func WSASendTo(s Handle, bufs *WSABuf, bufcnt uint32, sent *uint32, flags uint32, ...) (err error)
- func WSASendto(s Handle, bufs *WSABuf, bufcnt uint32, sent *uint32, flags uint32, to Sockaddr, ...) (err error)
- func WSAStartup(verreq uint32, data *WSAData) (sockerr error)
- func WaitForSingleObject(handle Handle, waitMilliseconds uint32) (event uint32, err error)
- func Write(fd Handle, p []byte) (n int, err error)
- func WriteConsole(console Handle, buf *uint16, towrite uint32, written *uint32, reserved *byte) (err error)
- func WriteFile(fd Handle, p []byte, done *uint32, overlapped *Overlapped) error
- type AddrinfoW
- type ByHandleFileInformation
- type CertChainContext
- type CertChainElement
- type CertChainPara
- type CertChainPolicyPara
- type CertChainPolicyStatus
- type CertContext
- type CertEnhKeyUsage
- type CertInfo
- type CertRevocationCrlInfo
- type CertRevocationInfo
- type CertSimpleChain
- type CertTrustListInfo
- type CertTrustStatus
- type CertUsageMatch
- type Conn
- type DLL
- type DLLError
- type DNSMXData
- type DNSPTRData
- type DNSRecord
- type DNSSRVData
- type DNSTXTData
- type Errno
- func Syscall(trap, nargs, a1, a2, a3 uintptr) (r1, r2 uintptr, err Errno)deprecated
- func Syscall12(trap, nargs, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12 uintptr) (r1, r2 uintptr, err Errno)deprecated
- func Syscall15(...) (r1, r2 uintptr, err Errno)deprecated
- func Syscall18(...) (r1, r2 uintptr, err Errno)deprecated
- func Syscall6(trap, nargs, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2 uintptr, err Errno)deprecated
- func Syscall9(trap, nargs, a1, a2, a3, a4, a5, a6, a7, a8, a9 uintptr) (r1, r2 uintptr, err Errno)deprecated
- func SyscallN(trap uintptr, args ...uintptr) (r1, r2 uintptr, err Errno)
- type FileNotifyInformation
- type Filetime
- type GUID
- type Handle
- func CertOpenStore(storeProvider uintptr, msgAndCertEncodingType uint32, cryptProv uintptr, ...) (handle Handle, err error)
- func CertOpenSystemStore(hprov Handle, name *uint16) (store Handle, err error)
- func CreateFile(name *uint16, access uint32, mode uint32, sa *SecurityAttributes, ...) (handle Handle, err error)
- func CreateFileMapping(fhandle Handle, sa *SecurityAttributes, prot uint32, maxSizeHigh uint32, ...) (handle Handle, err error)
- func CreateIoCompletionPort(filehandle Handle, cphandle Handle, key uint32, threadcnt uint32) (Handle, error)deprecated
- func CreateToolhelp32Snapshot(flags uint32, processId uint32) (handle Handle, err error)
- func FindFirstFile(name *uint16, data *Win32finddata) (handle Handle, err error)
- func GetCurrentProcess() (pseudoHandle Handle, err error)
- func GetStdHandle(stdhandle int) (handle Handle, err error)
- func LoadLibrary(libname string) (handle Handle, err error)
- func LocalFree(hmem Handle) (handle Handle, err error)
- func Open(path string, mode int, perm uint32) (fd Handle, err error)
- func OpenProcess(da uint32, inheritHandle bool, pid uint32) (handle Handle, err error)
- func Socket(domain, typ, proto int) (fd Handle, err error)
- type Hostent
- type IPMreq
- type IPv6Mreq
- type InterfaceInfo
- type IpAdapterInfo
- type IpAddrString
- type IpAddressString
- type IpMaskString
- type LazyDLL
- type LazyProc
- type Linger
- type MibIfRow
- type Overlapped
- type Pointer
- type Proc
- type ProcAttr
- type ProcessEntry32
- type ProcessInformation
- type Protoent
- type RawConn
- type RawSockaddr
- type RawSockaddrAny
- type RawSockaddrInet4
- type RawSockaddrInet6
- type RawSockaddrUnix
- type Rusage
- type SID
- type SIDAndAttributes
- type SSLExtraCertChainPolicyPara
- type SecurityAttributes
- type Servent
- type Signal
- type Sockaddr
- type SockaddrGen
- type SockaddrInet4
- type SockaddrInet6
- type SockaddrUnix
- type StartupInfo
- type SysProcAttr
- type Systemtime
- type TCPKeepalive
- type Timespec
- type Timeval
- type Timezoneinformation
- type Token
- type Tokenprimarygroup
- type Tokenuser
- type TransmitFileBuffers
- type UserInfo10
- type WSABuf
- type WSAData
- type WSAProtocolChain
- type WSAProtocolInfo
- type WaitStatus
- func (w WaitStatus) Continued() bool
- func (w WaitStatus) CoreDump() bool
- func (w WaitStatus) ExitStatus() int
- func (w WaitStatus) Exited() bool
- func (w WaitStatus) Signal() Signal
- func (w WaitStatus) Signaled() bool
- func (w WaitStatus) StopSignal() Signal
- func (w WaitStatus) Stopped() bool
- func (w WaitStatus) TrapCause() int
- type Win32FileAttributeData
- type Win32finddata
- Bugs
Examples ¶
Constants ¶
const ( STANDARD_RIGHTS_REQUIRED = 0xf0000 STANDARD_RIGHTS_READ = 0x20000 STANDARD_RIGHTS_WRITE = 0x20000 STANDARD_RIGHTS_EXECUTE = 0x20000 STANDARD_RIGHTS_ALL = 0x1F0000 )
const ( NameUnknown = 0 NameFullyQualifiedDN = 1 NameSamCompatible = 2 NameDisplay = 3 NameUniqueId = 6 NameCanonical = 7 NameUserPrincipal = 8 NameCanonicalEx = 9 NameServicePrincipal = 10 NameDnsDomain = 12 )
const ( // do not reorder NetSetupUnknownStatus = iota NetSetupUnjoined NetSetupWorkgroupName NetSetupDomainName )
const ( // do not reorder SidTypeUser = 1 + iota SidTypeGroup SidTypeDomain SidTypeAlias SidTypeWellKnownGroup SidTypeDeletedAccount SidTypeInvalid SidTypeUnknown SidTypeComputer SidTypeLabel )
const ( // do not reorder TOKEN_ASSIGN_PRIMARY = 1 << iota TOKEN_DUPLICATE TOKEN_IMPERSONATE TOKEN_QUERY TOKEN_QUERY_SOURCE TOKEN_ADJUST_PRIVILEGES TOKEN_ADJUST_GROUPS TOKEN_ADJUST_DEFAULT TOKEN_ADJUST_SESSIONID TOKEN_ALL_ACCESS = STANDARD_RIGHTS_REQUIRED | TOKEN_ASSIGN_PRIMARY | TOKEN_DUPLICATE | TOKEN_IMPERSONATE | TOKEN_QUERY | TOKEN_QUERY_SOURCE | TOKEN_ADJUST_PRIVILEGES | TOKEN_ADJUST_GROUPS | TOKEN_ADJUST_DEFAULT | TOKEN_ADJUST_SESSIONID TOKEN_READ = STANDARD_RIGHTS_READ | TOKEN_QUERY TOKEN_WRITE = STANDARD_RIGHTS_WRITE | TOKEN_ADJUST_PRIVILEGES | TOKEN_ADJUST_GROUPS | TOKEN_ADJUST_DEFAULT TOKEN_EXECUTE = STANDARD_RIGHTS_EXECUTE )
const ( // do not reorder TokenUser = 1 + iota TokenGroups TokenPrivileges TokenOwner TokenPrimaryGroup TokenDefaultDacl TokenSource TokenType TokenImpersonationLevel TokenStatistics TokenRestrictedSids TokenSessionId TokenGroupsAndPrivileges TokenSessionReference TokenSandBoxInert TokenAuditPolicy TokenOrigin TokenElevationType TokenLinkedToken TokenElevation TokenHasRestrictions TokenAccessInformation TokenVirtualizationAllowed TokenVirtualizationEnabled TokenIntegrityLevel TokenUIAccess TokenMandatoryPolicy TokenLogonSid MaxTokenInfoClass )
const ( // Invented values to support what package os expects. O_RDONLY = 0x00000 O_WRONLY = 0x00001 O_RDWR = 0x00002 O_CREAT = 0x00040 O_EXCL = 0x00080 O_NOCTTY = 0x00100 O_TRUNC = 0x00200 O_NONBLOCK = 0x00800 O_APPEND = 0x00400 O_SYNC = 0x01000 O_ASYNC = 0x02000 O_CLOEXEC = 0x80000 )
const ( // More invented values for signals SIGHUP = Signal(0x1) SIGINT = Signal(0x2) SIGQUIT = Signal(0x3) SIGILL = Signal(0x4) SIGTRAP = Signal(0x5) SIGABRT = Signal(0x6) SIGBUS = Signal(0x7) SIGFPE = Signal(0x8) SIGKILL = Signal(0x9) SIGSEGV = Signal(0xb) SIGPIPE = Signal(0xd) SIGALRM = Signal(0xe) SIGTERM = Signal(0xf) )
const ( GENERIC_READ = 0x80000000 GENERIC_WRITE = 0x40000000 GENERIC_EXECUTE = 0x20000000 GENERIC_ALL = 0x10000000 FILE_LIST_DIRECTORY = 0x00000001 FILE_APPEND_DATA = 0x00000004 FILE_WRITE_ATTRIBUTES = 0x00000100 FILE_SHARE_READ = 0x00000001 FILE_SHARE_WRITE = 0x00000002 FILE_SHARE_DELETE = 0x00000004 FILE_ATTRIBUTE_READONLY = 0x00000001 FILE_ATTRIBUTE_HIDDEN = 0x00000002 FILE_ATTRIBUTE_SYSTEM = 0x00000004 FILE_ATTRIBUTE_DIRECTORY = 0x00000010 FILE_ATTRIBUTE_ARCHIVE = 0x00000020 FILE_ATTRIBUTE_NORMAL = 0x00000080 FILE_ATTRIBUTE_REPARSE_POINT = 0x00000400 INVALID_FILE_ATTRIBUTES = 0xffffffff CREATE_NEW = 1 CREATE_ALWAYS = 2 OPEN_EXISTING = 3 OPEN_ALWAYS = 4 TRUNCATE_EXISTING = 5 FILE_FLAG_OPEN_REPARSE_POINT = 0x00200000 FILE_FLAG_BACKUP_SEMANTICS = 0x02000000 FILE_FLAG_OVERLAPPED = 0x40000000 HANDLE_FLAG_INHERIT = 0x00000001 STARTF_USESTDHANDLES = 0x00000100 STARTF_USESHOWWINDOW = 0x00000001 DUPLICATE_CLOSE_SOURCE = 0x00000001 DUPLICATE_SAME_ACCESS = 0x00000002 STD_INPUT_HANDLE = -10 STD_OUTPUT_HANDLE = -11 STD_ERROR_HANDLE = -12 FILE_BEGIN = 0 FILE_CURRENT = 1 FILE_END = 2 LANG_ENGLISH = 0x09 SUBLANG_ENGLISH_US = 0x01 FORMAT_MESSAGE_ALLOCATE_BUFFER = 256 FORMAT_MESSAGE_IGNORE_INSERTS = 512 FORMAT_MESSAGE_FROM_STRING = 1024 FORMAT_MESSAGE_FROM_HMODULE = 2048 FORMAT_MESSAGE_FROM_SYSTEM = 4096 FORMAT_MESSAGE_ARGUMENT_ARRAY = 8192 FORMAT_MESSAGE_MAX_WIDTH_MASK = 255 MAX_PATH = 260 MAX_LONG_PATH = 32768 MAX_COMPUTERNAME_LENGTH = 15 TIME_ZONE_ID_UNKNOWN = 0 TIME_ZONE_ID_STANDARD = 1 TIME_ZONE_ID_DAYLIGHT = 2 IGNORE = 0 INFINITE = 0xffffffff WAIT_TIMEOUT = 258 WAIT_ABANDONED = 0x00000080 WAIT_OBJECT_0 = 0x00000000 WAIT_FAILED = 0xFFFFFFFF CREATE_NEW_PROCESS_GROUP = 0x00000200 CREATE_UNICODE_ENVIRONMENT = 0x00000400 PROCESS_TERMINATE = 1 PROCESS_QUERY_INFORMATION = 0x00000400 SYNCHRONIZE = 0x00100000 PAGE_READONLY = 0x02 PAGE_READWRITE = 0x04 PAGE_WRITECOPY = 0x08 PAGE_EXECUTE_READ = 0x20 PAGE_EXECUTE_READWRITE = 0x40 PAGE_EXECUTE_WRITECOPY = 0x80 FILE_MAP_COPY = 0x01 FILE_MAP_WRITE = 0x02 FILE_MAP_READ = 0x04 FILE_MAP_EXECUTE = 0x20 CTRL_C_EVENT = 0 CTRL_BREAK_EVENT = 1 CTRL_CLOSE_EVENT = 2 CTRL_LOGOFF_EVENT = 5 CTRL_SHUTDOWN_EVENT = 6 )
const ( // flags for CreateToolhelp32Snapshot TH32CS_SNAPHEAPLIST = 0x01 TH32CS_SNAPPROCESS = 0x02 TH32CS_SNAPTHREAD = 0x04 TH32CS_SNAPMODULE = 0x08 TH32CS_SNAPMODULE32 = 0x10 TH32CS_SNAPALL = TH32CS_SNAPHEAPLIST | TH32CS_SNAPMODULE | TH32CS_SNAPPROCESS | TH32CS_SNAPTHREAD TH32CS_INHERIT = 0x80000000 )
const ( // do not reorder FILE_NOTIFY_CHANGE_FILE_NAME = 1 << iota FILE_NOTIFY_CHANGE_DIR_NAME FILE_NOTIFY_CHANGE_ATTRIBUTES FILE_NOTIFY_CHANGE_SIZE FILE_NOTIFY_CHANGE_LAST_WRITE FILE_NOTIFY_CHANGE_LAST_ACCESS FILE_NOTIFY_CHANGE_CREATION )
const ( // do not reorder FILE_ACTION_ADDED = iota + 1 FILE_ACTION_REMOVED FILE_ACTION_MODIFIED FILE_ACTION_RENAMED_OLD_NAME FILE_ACTION_RENAMED_NEW_NAME )
const ( // wincrypt.h PROV_RSA_FULL = 1 PROV_RSA_SIG = 2 PROV_DSS = 3 PROV_FORTEZZA = 4 PROV_MS_EXCHANGE = 5 PROV_SSL = 6 PROV_RSA_SCHANNEL = 12 PROV_DSS_DH = 13 PROV_EC_ECDSA_SIG = 14 PROV_EC_ECNRA_SIG = 15 PROV_EC_ECDSA_FULL = 16 PROV_EC_ECNRA_FULL = 17 PROV_DH_SCHANNEL = 18 PROV_SPYRUS_LYNKS = 20 PROV_RNG = 21 PROV_INTEL_SEC = 22 PROV_REPLACE_OWF = 23 PROV_RSA_AES = 24 CRYPT_VERIFYCONTEXT = 0xF0000000 CRYPT_NEWKEYSET = 0x00000008 CRYPT_DELETEKEYSET = 0x00000010 CRYPT_MACHINE_KEYSET = 0x00000020 CRYPT_SILENT = 0x00000040 CRYPT_DEFAULT_CONTAINER_OPTIONAL = 0x00000080 USAGE_MATCH_TYPE_AND = 0 USAGE_MATCH_TYPE_OR = 1 X509_ASN_ENCODING = 0x00000001 PKCS_7_ASN_ENCODING = 0x00010000 CERT_STORE_PROV_MEMORY = 2 CERT_STORE_ADD_ALWAYS = 4 CERT_STORE_DEFER_CLOSE_UNTIL_LAST_FREE_FLAG = 0x00000004 CERT_TRUST_NO_ERROR = 0x00000000 CERT_TRUST_IS_NOT_TIME_VALID = 0x00000001 CERT_TRUST_IS_REVOKED = 0x00000004 CERT_TRUST_IS_NOT_SIGNATURE_VALID = 0x00000008 CERT_TRUST_IS_NOT_VALID_FOR_USAGE = 0x00000010 CERT_TRUST_IS_UNTRUSTED_ROOT = 0x00000020 CERT_TRUST_REVOCATION_STATUS_UNKNOWN = 0x00000040 CERT_TRUST_IS_CYCLIC = 0x00000080 CERT_TRUST_INVALID_EXTENSION = 0x00000100 CERT_TRUST_INVALID_POLICY_CONSTRAINTS = 0x00000200 CERT_TRUST_INVALID_BASIC_CONSTRAINTS = 0x00000400 CERT_TRUST_INVALID_NAME_CONSTRAINTS = 0x00000800 CERT_TRUST_HAS_NOT_SUPPORTED_NAME_CONSTRAINT = 0x00001000 CERT_TRUST_HAS_NOT_DEFINED_NAME_CONSTRAINT = 0x00002000 CERT_TRUST_HAS_NOT_PERMITTED_NAME_CONSTRAINT = 0x00004000 CERT_TRUST_HAS_EXCLUDED_NAME_CONSTRAINT = 0x00008000 CERT_TRUST_IS_OFFLINE_REVOCATION = 0x01000000 CERT_TRUST_NO_ISSUANCE_CHAIN_POLICY = 0x02000000 CERT_TRUST_IS_EXPLICIT_DISTRUST = 0x04000000 CERT_TRUST_HAS_NOT_SUPPORTED_CRITICAL_EXT = 0x08000000 CERT_CHAIN_POLICY_BASE = 1 CERT_CHAIN_POLICY_AUTHENTICODE = 2 CERT_CHAIN_POLICY_AUTHENTICODE_TS = 3 CERT_CHAIN_POLICY_SSL = 4 CERT_CHAIN_POLICY_BASIC_CONSTRAINTS = 5 CERT_CHAIN_POLICY_NT_AUTH = 6 CERT_CHAIN_POLICY_MICROSOFT_ROOT = 7 CERT_CHAIN_POLICY_EV = 8 CERT_E_EXPIRED = 0x800B0101 CERT_E_ROLE = 0x800B0103 CERT_E_PURPOSE = 0x800B0106 CERT_E_UNTRUSTEDROOT = 0x800B0109 CERT_E_CN_NO_MATCH = 0x800B010F AUTHTYPE_CLIENT = 1 AUTHTYPE_SERVER = 2 )
const ( GetFileExInfoStandard = 0 GetFileExMaxInfoLevel = 1 )
const ( // winuser.h SW_HIDE = 0 SW_NORMAL = 1 SW_SHOWNORMAL = 1 SW_SHOWMINIMIZED = 2 SW_SHOWMAXIMIZED = 3 SW_MAXIMIZE = 3 SW_SHOWNOACTIVATE = 4 SW_SHOW = 5 SW_MINIMIZE = 6 SW_SHOWMINNOACTIVE = 7 SW_SHOWNA = 8 SW_RESTORE = 9 SW_SHOWDEFAULT = 10 SW_FORCEMINIMIZE = 11 )
ShowWindow constants
const ( AF_UNSPEC = 0 AF_UNIX = 1 AF_INET = 2 AF_INET6 = 23 AF_NETBIOS = 17 SOCK_STREAM = 1 SOCK_DGRAM = 2 SOCK_RAW = 3 SOCK_SEQPACKET = 5 IPPROTO_IP = 0 IPPROTO_IPV6 = 0x29 IPPROTO_TCP = 6 IPPROTO_UDP = 17 SOL_SOCKET = 0xffff SO_REUSEADDR = 4 SO_KEEPALIVE = 8 SO_DONTROUTE = 16 SO_BROADCAST = 32 SO_LINGER = 128 SO_RCVBUF = 0x1002 SO_SNDBUF = 0x1001 SO_UPDATE_ACCEPT_CONTEXT = 0x700b SO_UPDATE_CONNECT_CONTEXT = 0x7010 IOC_OUT = 0x40000000 IOC_IN = 0x80000000 IOC_VENDOR = 0x18000000 IOC_INOUT = IOC_IN | IOC_OUT IOC_WS2 = 0x08000000 SIO_GET_EXTENSION_FUNCTION_POINTER = IOC_INOUT | IOC_WS2 | 6 SIO_KEEPALIVE_VALS = IOC_IN | IOC_VENDOR | 4 SIO_UDP_CONNRESET = IOC_IN | IOC_VENDOR | 12 IP_TOS = 0x3 IP_TTL = 0x4 IP_MULTICAST_IF = 0x9 IP_MULTICAST_TTL = 0xa IP_MULTICAST_LOOP = 0xb IP_ADD_MEMBERSHIP = 0xc IP_DROP_MEMBERSHIP = 0xd IPV6_V6ONLY = 0x1b IPV6_UNICAST_HOPS = 0x4 IPV6_MULTICAST_IF = 0x9 IPV6_MULTICAST_HOPS = 0xa IPV6_MULTICAST_LOOP = 0xb IPV6_JOIN_GROUP = 0xc IPV6_LEAVE_GROUP = 0xd SOMAXCONN = 0x7fffffff TCP_NODELAY = 1 SHUT_RD = 0 SHUT_WR = 1 SHUT_RDWR = 2 WSADESCRIPTION_LEN = 256 WSASYS_STATUS_LEN = 128 )
const ( S_IFMT = 0x1f000 S_IFIFO = 0x1000 S_IFCHR = 0x2000 S_IFDIR = 0x4000 S_IFBLK = 0x6000 S_IFREG = 0x8000 S_IFLNK = 0xa000 S_IFSOCK = 0xc000 S_ISUID = 0x800 S_ISGID = 0x400 S_ISVTX = 0x200 S_IRUSR = 0x100 S_IWRITE = 0x80 S_IWUSR = 0x80 S_IXUSR = 0x40 )
Invented values to support what package os expects.
const ( FILE_TYPE_CHAR = 0x0002 FILE_TYPE_DISK = 0x0001 FILE_TYPE_PIPE = 0x0003 FILE_TYPE_REMOTE = 0x8000 FILE_TYPE_UNKNOWN = 0x0000 )
const ( DNS_TYPE_A = 0x0001 DNS_TYPE_NS = 0x0002 DNS_TYPE_MD = 0x0003 DNS_TYPE_MF = 0x0004 DNS_TYPE_CNAME = 0x0005 DNS_TYPE_SOA = 0x0006 DNS_TYPE_MB = 0x0007 DNS_TYPE_MG = 0x0008 DNS_TYPE_MR = 0x0009 DNS_TYPE_NULL = 0x000a DNS_TYPE_WKS = 0x000b DNS_TYPE_PTR = 0x000c DNS_TYPE_HINFO = 0x000d DNS_TYPE_MINFO = 0x000e DNS_TYPE_MX = 0x000f DNS_TYPE_TEXT = 0x0010 DNS_TYPE_RP = 0x0011 DNS_TYPE_AFSDB = 0x0012 DNS_TYPE_X25 = 0x0013 DNS_TYPE_ISDN = 0x0014 DNS_TYPE_RT = 0x0015 DNS_TYPE_NSAP = 0x0016 DNS_TYPE_NSAPPTR = 0x0017 DNS_TYPE_SIG = 0x0018 DNS_TYPE_KEY = 0x0019 DNS_TYPE_PX = 0x001a DNS_TYPE_GPOS = 0x001b DNS_TYPE_AAAA = 0x001c DNS_TYPE_LOC = 0x001d DNS_TYPE_NXT = 0x001e DNS_TYPE_EID = 0x001f DNS_TYPE_NIMLOC = 0x0020 DNS_TYPE_SRV = 0x0021 DNS_TYPE_ATMA = 0x0022 DNS_TYPE_NAPTR = 0x0023 DNS_TYPE_KX = 0x0024 DNS_TYPE_CERT = 0x0025 DNS_TYPE_A6 = 0x0026 DNS_TYPE_DNAME = 0x0027 DNS_TYPE_SINK = 0x0028 DNS_TYPE_OPT = 0x0029 DNS_TYPE_DS = 0x002B DNS_TYPE_RRSIG = 0x002E DNS_TYPE_NSEC = 0x002F DNS_TYPE_DNSKEY = 0x0030 DNS_TYPE_DHCID = 0x0031 DNS_TYPE_UINFO = 0x0064 DNS_TYPE_UID = 0x0065 DNS_TYPE_GID = 0x0066 DNS_TYPE_UNSPEC = 0x0067 DNS_TYPE_ADDRS = 0x00f8 DNS_TYPE_TKEY = 0x00f9 DNS_TYPE_TSIG = 0x00fa DNS_TYPE_IXFR = 0x00fb DNS_TYPE_AXFR = 0x00fc DNS_TYPE_MAILB = 0x00fd DNS_TYPE_MAILA = 0x00fe DNS_TYPE_ALL = 0x00ff DNS_TYPE_ANY = 0x00ff DNS_TYPE_WINS = 0xff01 DNS_TYPE_WINSR = 0xff02 DNS_TYPE_NBSTAT = 0xff01 )
const ( // flags inside DNSRecord.Dw DnsSectionQuestion = 0x0000 DnsSectionAnswer = 0x0001 DnsSectionAuthority = 0x0002 DnsSectionAdditional = 0x0003 )
const ( TF_DISCONNECT = 1 TF_REUSE_SOCKET = 2 TF_WRITE_BEHIND = 4 TF_USE_DEFAULT_WORKER = 0 TF_USE_SYSTEM_THREAD = 16 TF_USE_KERNEL_APC = 32 )
const ( IFF_UP = 1 IFF_BROADCAST = 2 IFF_LOOPBACK = 4 IFF_POINTTOPOINT = 8 IFF_MULTICAST = 16 )
const ( // do not reorder HKEY_CLASSES_ROOT = 0x80000000 + iota HKEY_CURRENT_USER HKEY_LOCAL_MACHINE HKEY_USERS HKEY_PERFORMANCE_DATA HKEY_CURRENT_CONFIG HKEY_DYN_DATA KEY_QUERY_VALUE = 1 KEY_SET_VALUE = 2 KEY_CREATE_SUB_KEY = 4 KEY_ENUMERATE_SUB_KEYS = 8 KEY_NOTIFY = 16 KEY_CREATE_LINK = 32 KEY_WRITE = 0x20006 KEY_EXECUTE = 0x20019 KEY_READ = 0x20019 KEY_WOW64_64KEY = 0x0100 KEY_WOW64_32KEY = 0x0200 KEY_ALL_ACCESS = 0xf003f )
const ( // do not reorder REG_NONE = iota REG_SZ REG_EXPAND_SZ REG_BINARY REG_DWORD_LITTLE_ENDIAN REG_DWORD_BIG_ENDIAN REG_LINK REG_MULTI_SZ REG_RESOURCE_LIST REG_FULL_RESOURCE_DESCRIPTOR REG_RESOURCE_REQUIREMENTS_LIST REG_QWORD_LITTLE_ENDIAN REG_DWORD = REG_DWORD_LITTLE_ENDIAN REG_QWORD = REG_QWORD_LITTLE_ENDIAN )
const ( AI_PASSIVE = 1 AI_CANONNAME = 2 AI_NUMERICHOST = 4 )
const ( FILE_SKIP_COMPLETION_PORT_ON_SUCCESS = 1 FILE_SKIP_SET_EVENT_ON_HANDLE = 2 )
const ( WSAPROTOCOL_LEN = 255 MAX_PROTOCOL_CHAIN = 7 BASE_PROTOCOL = 1 LAYERED_PROTOCOL = 0 XP1_CONNECTIONLESS = 0x00000001 XP1_GUARANTEED_DELIVERY = 0x00000002 XP1_GUARANTEED_ORDER = 0x00000004 XP1_MESSAGE_ORIENTED = 0x00000008 XP1_PSEUDO_STREAM = 0x00000010 XP1_GRACEFUL_CLOSE = 0x00000020 XP1_EXPEDITED_DATA = 0x00000040 XP1_CONNECT_DATA = 0x00000080 XP1_DISCONNECT_DATA = 0x00000100 XP1_SUPPORT_BROADCAST = 0x00000200 XP1_SUPPORT_MULTIPOINT = 0x00000400 XP1_MULTIPOINT_CONTROL_PLANE = 0x00000800 XP1_MULTIPOINT_DATA_PLANE = 0x00001000 XP1_QOS_SUPPORTED = 0x00002000 XP1_UNI_SEND = 0x00008000 XP1_UNI_RECV = 0x00010000 XP1_IFS_HANDLES = 0x00020000 XP1_PARTIAL_MESSAGE = 0x00040000 XP1_SAN_SUPPORT_SDP = 0x00080000 PFL_MULTIPLE_PROTO_ENTRIES = 0x00000001 PFL_RECOMMENDED_PROTO_ENTRY = 0x00000002 PFL_HIDDEN = 0x00000004 PFL_MATCHES_PROTOCOL_ZERO = 0x00000008 PFL_NETWORKDIRECT_PROVIDER = 0x00000010 )
const ( FSCTL_GET_REPARSE_POINT = 0x900A8 MAXIMUM_REPARSE_DATA_BUFFER_SIZE = 16 * 1024 IO_REPARSE_TAG_SYMLINK = 0xA000000C SYMBOLIC_LINK_FLAG_DIRECTORY = 0x1 )
const APPLICATION_ERROR = 1 << 29
Windows reserves errors >= 1<<29 for application use.
const (
DNS_INFO_NO_RECORDS = 0x251D
)
const ImplementsGetwd = true
const InvalidHandle = ^Handle(0)
const MAXLEN_IFDESCR = 256
const MAXLEN_PHYSADDR = 8
const MAX_ADAPTER_ADDRESS_LENGTH = 8
const MAX_ADAPTER_DESCRIPTION_LENGTH = 128
const MAX_ADAPTER_NAME_LENGTH = 256
const MAX_INTERFACE_NAME_LEN = 256
const SIO_GET_INTERFACE_LIST = 0x4004747F
const UNIX_PATH_MAX = 108 // defined in afunix.h
Variables ¶
var ( Stdin = getStdHandle(STD_INPUT_HANDLE) Stdout = getStdHandle(STD_OUTPUT_HANDLE) Stderr = getStdHandle(STD_ERROR_HANDLE) )
var ( OID_PKIX_KP_SERVER_AUTH = []byte("1.3.6.1.5.5.7.3.1\x00") OID_SERVER_GATED_CRYPTO = []byte("1.3.6.1.4.1.311.10.3.3\x00") OID_SGC_NETSCAPE = []byte("2.16.840.1.113730.4.1\x00") )
var ForkLock sync.RWMutex
ForkLock is not used on Windows.
var SocketDisableIPv6 bool
For testing: clients can set this flag to force creation of IPv6 sockets to return EAFNOSUPPORT.
var WSAID_CONNECTEX = GUID{ 0x25a207b9, 0xddf3, 0x4660, [8]byte{0x8e, 0xe9, 0x76, 0xe5, 0x8c, 0x74, 0x06, 0x3e}, }
Functions ¶
func BytePtrFromString ¶ added in go1.1
BytePtrFromString returns a pointer to a NUL-terminated array of bytes containing the text of s. If s contains a NUL byte at any location, it returns (nil, EINVAL).
func ByteSliceFromString ¶ added in go1.1
ByteSliceFromString returns a NUL-terminated slice of bytes containing the text of s. If s contains a NUL byte at any location, it returns (nil, EINVAL).
func CancelIoEx ¶ added in go1.1
func CancelIoEx(s Handle, o *Overlapped) (err error)
func CertAddCertificateContextToStore ¶
func CertAddCertificateContextToStore(store Handle, certContext *CertContext, addDisposition uint32, storeContext **CertContext) (err error)
func CertCloseStore ¶
func CertFreeCertificateChain ¶
func CertFreeCertificateChain(ctx *CertChainContext)
func CertFreeCertificateContext ¶
func CertFreeCertificateContext(ctx *CertContext) (err error)
func CertGetCertificateChain ¶
func CertGetCertificateChain(engine Handle, leaf *CertContext, time *Filetime, additionalStore Handle, para *CertChainPara, flags uint32, reserved uintptr, chainCtx **CertChainContext) (err error)
func CertVerifyCertificateChainPolicy ¶
func CertVerifyCertificateChainPolicy(policyOID uintptr, chain *CertChainContext, para *CertChainPolicyPara, status *CertChainPolicyStatus) (err error)
func CloseHandle ¶
func CloseOnExec ¶
func CloseOnExec(fd Handle)
func Closesocket ¶
func CommandLineToArgv ¶
func ComputerName ¶
func ConvertSidToStringSid ¶
func ConvertStringSidToSid ¶
func CreateDirectory ¶
func CreateDirectory(path *uint16, sa *SecurityAttributes) (err error)
func CreateHardLink ¶ added in go1.4
func CreatePipe ¶
func CreatePipe(readhandle *Handle, writehandle *Handle, sa *SecurityAttributes, size uint32) (err error)
func CreateProcess ¶
func CreateProcess(appName *uint16, commandLine *uint16, procSecurity *SecurityAttributes, threadSecurity *SecurityAttributes, inheritHandles bool, creationFlags uint32, env *uint16, currentDir *uint16, startupInfo *StartupInfo, outProcInfo *ProcessInformation) (err error)
func CreateProcessAsUser ¶ added in go1.10
func CreateProcessAsUser(token Token, appName *uint16, commandLine *uint16, procSecurity *SecurityAttributes, threadSecurity *SecurityAttributes, inheritHandles bool, creationFlags uint32, env *uint16, currentDir *uint16, startupInfo *StartupInfo, outProcInfo *ProcessInformation) (err error)
func CreateSymbolicLink ¶ added in go1.4
func CryptAcquireContext ¶
func CryptReleaseContext ¶
func DeleteFile ¶
func DeviceIoControl ¶ added in go1.4
func DnsNameCompare ¶ added in go1.4
func DnsRecordListFree ¶
func DuplicateHandle ¶
func EscapeArg ¶
EscapeArg rewrites command line argument s as prescribed in https://msdn.microsoft.com/en-us/library/ms880421. This function returns "" (2 double quotes) if s is empty. Alternatively, these transformations are done:
- every back slash (\) is doubled, but only if immediately followed by double quote (");
- every double quote (") is escaped by back slash (\);
- finally, s is wrapped with double quotes (arg -> "arg"), but only if there is space or tab inside s.
func ExitProcess ¶
func ExitProcess(exitcode uint32)
func FindNextFile ¶
func FindNextFile(handle Handle, data *Win32finddata) (err error)
func FlushFileBuffers ¶
func FlushViewOfFile ¶
func FormatMessage
deprecated
func FormatMessage(flags uint32, msgsrc uint32, msgid uint32, langid uint32, buf []uint16, args *byte) (n uint32, err error)
FormatMessage is deprecated (msgsrc should be uintptr, not uint32, but can not be changed due to the Go 1 compatibility guarantee).
Deprecated: Use FormatMessage from golang.org/x/sys/windows instead.
func FreeAddrInfoW ¶ added in go1.1
func FreeAddrInfoW(addrinfo *AddrinfoW)
func FreeEnvironmentStrings ¶
func FreeLibrary ¶
func GetAcceptExSockaddrs ¶
func GetAcceptExSockaddrs(buf *byte, rxdatalen uint32, laddrlen uint32, raddrlen uint32, lrsa **RawSockaddrAny, lrsalen *int32, rrsa **RawSockaddrAny, rrsalen *int32)
func GetAdaptersInfo ¶
func GetAdaptersInfo(ai *IpAdapterInfo, ol *uint32) (errcode error)
func GetAddrInfoW ¶ added in go1.1
func GetCommandLine ¶
func GetCommandLine() (cmd *uint16)
func GetComputerName ¶
func GetConsoleMode ¶ added in go1.1
func GetCurrentDirectory ¶
func GetEnvironmentStrings ¶
func GetEnvironmentVariable ¶
func GetExitCodeProcess ¶
func GetFileAttributes ¶
func GetFileAttributesEx ¶
func GetFileInformationByHandle ¶
func GetFileInformationByHandle(handle Handle, data *ByHandleFileInformation) (err error)
func GetFileType ¶
func GetFullPathName ¶
func GetIfEntry ¶
func GetLastError ¶
func GetLastError() (lasterr error)
func GetLengthSid ¶
func GetLongPathName ¶
func GetProcessTimes ¶
func GetQueuedCompletionStatus
deprecated
func GetShortPathName ¶
func GetStartupInfo ¶
func GetStartupInfo(startupInfo *StartupInfo) error
func GetSystemTimeAsFileTime ¶
func GetSystemTimeAsFileTime(time *Filetime)
func GetTimeZoneInformation ¶
func GetTimeZoneInformation(tzi *Timezoneinformation) (rc uint32, err error)
func GetTokenInformation ¶
func GetUserNameEx ¶
func GetUserProfileDirectory ¶
func GetVersion ¶
func Getpagesize ¶
func Getpagesize() int
func Getsockopt ¶ added in go1.1
func Gettimeofday ¶
func LoadCancelIoEx ¶ added in go1.1
func LoadCancelIoEx() error
func LoadConnectEx ¶ added in go1.1
func LoadConnectEx() error
func LoadCreateSymbolicLink ¶ added in go1.4
func LoadCreateSymbolicLink() error
func LoadGetAddrInfo ¶ added in go1.1
func LoadGetAddrInfo() error
func LoadSetFileCompletionNotificationModes ¶ added in go1.2
func LoadSetFileCompletionNotificationModes() error
func LookupAccountName ¶
func LookupAccountSid ¶
func MapViewOfFile ¶
func NetApiBufferFree ¶
func NetGetJoinInformation ¶ added in go1.2
func NetUserGetInfo ¶
func NewCallback ¶
NewCallback converts a Go function to a function pointer conforming to the stdcall calling convention. This is useful when interoperating with Windows code requiring callbacks. The argument is expected to be a function with one uintptr-sized result. The function must not have arguments with size larger than the size of uintptr. Only a limited number of callbacks may be created in a single Go process, and any memory allocated for these callbacks is never released. Between NewCallback and NewCallbackCDecl, at least 1024 callbacks can always be created.
func NewCallbackCDecl ¶ added in go1.3
NewCallbackCDecl converts a Go function to a function pointer conforming to the cdecl calling convention. This is useful when interoperating with Windows code requiring callbacks. The argument is expected to be a function with one uintptr-sized result. The function must not have arguments with size larger than the size of uintptr. Only a limited number of callbacks may be created in a single Go process, and any memory allocated for these callbacks is never released. Between NewCallback and NewCallbackCDecl, at least 1024 callbacks can always be created.
func PostQueuedCompletionStatus
deprecated
func PostQueuedCompletionStatus(cphandle Handle, qty uint32, key uint32, overlapped *Overlapped) error
Deprecated: PostQueuedCompletionStatus has the wrong function signature. Use x/sys/windows.PostQueuedCompletionStatus.
func Process32First ¶ added in go1.4
func Process32First(snapshot Handle, procEntry *ProcessEntry32) (err error)
func Process32Next ¶ added in go1.4
func Process32Next(snapshot Handle, procEntry *ProcessEntry32) (err error)
func ReadConsole ¶ added in go1.1
func ReadDirectoryChanges ¶
func RegCloseKey ¶
func RegEnumKeyEx ¶
func RegEnumKeyEx(key Handle, index uint32, name *uint16, nameLen *uint32, reserved *uint32, class *uint16, classLen *uint32, lastWriteTime *Filetime) (regerrno error)
RegEnumKeyEx enumerates the subkeys of an open registry key. Each call retrieves information about one subkey. name is a buffer that should be large enough to hold the name of the subkey plus a null terminating character. nameLen is its length. On return, nameLen will contain the actual length of the subkey.
Should name not be large enough to hold the subkey, this function will return ERROR_MORE_DATA, and must be called again with an appropriately sized buffer.
reserved must be nil. class and classLen behave like name and nameLen but for the class of the subkey, except that they are optional. lastWriteTime, if not nil, will be populated with the time the subkey was last written.
The caller must enumerate all subkeys in order. That is RegEnumKeyEx must be called with index starting at 0, incrementing the index until the function returns ERROR_NO_MORE_ITEMS, or with the index of the last subkey (obtainable from RegQueryInfoKey), decrementing until index 0 is enumerated.
Successive calls to this API must happen on the same OS thread, so call runtime.LockOSThread before calling this function.
func RegOpenKeyEx ¶
func RegQueryInfoKey ¶
func RegQueryValueEx ¶
func RemoveDirectory ¶
func SetCurrentDirectory ¶
func SetEndOfFile ¶
func SetEnvironmentVariable ¶
func SetFileAttributes ¶
func SetFileCompletionNotificationModes ¶ added in go1.2
func SetFilePointer ¶
func SetFileTime ¶
func SetHandleInformation ¶
func SetNonblock ¶
func Setsockopt ¶
func SetsockoptIPv6Mreq ¶
func SetsockoptInet4Addr ¶
func StartProcess ¶
func StringBytePtr
deprecated
StringBytePtr returns a pointer to a NUL-terminated array of bytes. If s contains a NUL byte this function panics instead of returning an error.
Deprecated: Use BytePtrFromString instead.
func StringByteSlice
deprecated
func StringToUTF16
deprecated
StringToUTF16 returns the UTF-16 encoding of the UTF-8 string s, with a terminating NUL added. If s contains a NUL byte this function panics instead of returning an error.
Deprecated: Use UTF16FromString instead.
func StringToUTF16Ptr
deprecated
StringToUTF16Ptr returns pointer to the UTF-16 encoding of the UTF-8 string s, with a terminating NUL added. If s contains a NUL byte this function panics instead of returning an error.
Deprecated: Use UTF16PtrFromString instead.
func TerminateProcess ¶
func TimespecToNsec ¶ added in go1.1
func TranslateAccountName ¶
TranslateAccountName converts a directory service object name from one format to another.
func TranslateName ¶
func TransmitFile ¶
func TransmitFile(s Handle, handle Handle, bytesToWrite uint32, bytsPerSend uint32, overlapped *Overlapped, transmitFileBuf *TransmitFileBuffers, flags uint32) (err error)
func UTF16FromString ¶ added in go1.1
UTF16FromString returns the UTF-16 encoding of the UTF-8 string s, with a terminating NUL added. If s contains a NUL byte at any location, it returns (nil, EINVAL). Unpaired surrogates are encoded using WTF-8.
func UTF16PtrFromString ¶ added in go1.1
UTF16PtrFromString returns pointer to the UTF-16 encoding of the UTF-8 string s, with a terminating NUL added. If s contains a NUL byte at any location, it returns (nil, EINVAL). Unpaired surrogates are encoded using WTF-8.
func UTF16ToString ¶
UTF16ToString returns the UTF-8 encoding of the UTF-16 sequence s, with a terminating NUL removed. Unpaired surrogates are decoded using WTF-8 instead of UTF-8 encoding.
func UnmapViewOfFile ¶
func UtimesNano ¶ added in go1.1
func VirtualLock ¶
func VirtualUnlock ¶
func WSACleanup ¶
func WSACleanup() (err error)
func WSAEnumProtocols ¶ added in go1.2
func WSAEnumProtocols(protocols *int32, protocolBuffer *WSAProtocolInfo, bufferLength *uint32) (n int32, err error)
func WSARecvFrom ¶
func WSARecvFrom(s Handle, bufs *WSABuf, bufcnt uint32, recvd *uint32, flags *uint32, from *RawSockaddrAny, fromlen *int32, overlapped *Overlapped, croutine *byte) (err error)
func WSASendTo ¶
func WSASendTo(s Handle, bufs *WSABuf, bufcnt uint32, sent *uint32, flags uint32, to *RawSockaddrAny, tolen int32, overlapped *Overlapped, croutine *byte) (err error)
func WSAStartup ¶
func WaitForSingleObject ¶
func WriteConsole ¶ added in go1.1
Types ¶
type ByHandleFileInformation ¶
type CertChainContext ¶
type CertChainContext struct { Size uint32 TrustStatus CertTrustStatus ChainCount uint32 Chains **CertSimpleChain LowerQualityChainCount uint32 LowerQualityChains **CertChainContext HasRevocationFreshnessTime uint32 RevocationFreshnessTime uint32 }
type CertChainElement ¶
type CertChainElement struct { Size uint32 CertContext *CertContext TrustStatus CertTrustStatus RevocationInfo *CertRevocationInfo IssuanceUsage *CertEnhKeyUsage ApplicationUsage *CertEnhKeyUsage ExtendedErrorInfo *uint16 }
type CertChainPara ¶
type CertChainPara struct { Size uint32 RequestedUsage CertUsageMatch RequstedIssuancePolicy CertUsageMatch URLRetrievalTimeout uint32 CheckRevocationFreshnessTime uint32 RevocationFreshnessTime uint32 CacheResync *Filetime }
type CertChainPolicyPara ¶
type CertChainPolicyStatus ¶
type CertContext ¶
type CertContext struct { EncodingType uint32 EncodedCert *byte Length uint32 CertInfo *CertInfo Store Handle }
func CertCreateCertificateContext ¶
func CertCreateCertificateContext(certEncodingType uint32, certEncoded *byte, encodedLen uint32) (context *CertContext, err error)
func CertEnumCertificatesInStore ¶
func CertEnumCertificatesInStore(store Handle, prevContext *CertContext) (context *CertContext, err error)
type CertEnhKeyUsage ¶
type CertRevocationCrlInfo ¶ added in go1.11
type CertRevocationCrlInfo struct { }
type CertRevocationInfo ¶
type CertSimpleChain ¶
type CertSimpleChain struct { Size uint32 TrustStatus CertTrustStatus NumElements uint32 Elements **CertChainElement TrustListInfo *CertTrustListInfo HasRevocationFreshnessTime uint32 RevocationFreshnessTime uint32 }
type CertTrustListInfo ¶ added in go1.11
type CertTrustListInfo struct { }
type CertTrustStatus ¶
type CertUsageMatch ¶
type CertUsageMatch struct { Type uint32 Usage CertEnhKeyUsage }
type Conn ¶ added in go1.9
type Conn interface { // SyscallConn returns a raw network connection. SyscallConn() (RawConn, error) }
Conn is implemented by some types in the net and os packages to provide access to the underlying file descriptor or handle.
type DLL ¶
A DLL implements access to a single DLL.
func LoadDLL ¶
LoadDLL loads the named DLL file into memory.
If name is not an absolute path and is not a known system DLL used by Go, Windows will search for the named DLL in many locations, causing potential DLL preloading attacks.
Use LazyDLL in golang.org/x/sys/windows for a secure way to load system DLLs.
func MustLoadDLL ¶
MustLoadDLL is like LoadDLL but panics if load operation fails.
func (*DLL) FindProc ¶
FindProc searches DLL d for procedure named name and returns *Proc if found. It returns an error if search fails.
func (*DLL) MustFindProc ¶
MustFindProc is like DLL.FindProc but panics if search fails.
type DNSPTRData ¶
type DNSPTRData struct {
Host *uint16
}
type DNSSRVData ¶
type DNSTXTData ¶
type Errno ¶
type Errno uintptr
Errno is the Windows error number.
Errno values can be tested against error values using errors.Is. For example:
_, _, err := syscall.Syscall(...) if errors.Is(err, fs.ErrNotExist) ...
const ( // Windows errors. ERROR_FILE_NOT_FOUND Errno = 2 ERROR_PATH_NOT_FOUND Errno = 3 ERROR_ACCESS_DENIED Errno = 5 ERROR_NO_MORE_FILES Errno = 18 ERROR_HANDLE_EOF Errno = 38 ERROR_NETNAME_DELETED Errno = 64 ERROR_FILE_EXISTS Errno = 80 ERROR_BROKEN_PIPE Errno = 109 ERROR_BUFFER_OVERFLOW Errno = 111 ERROR_INSUFFICIENT_BUFFER Errno = 122 ERROR_MOD_NOT_FOUND Errno = 126 ERROR_PROC_NOT_FOUND Errno = 127 ERROR_DIR_NOT_EMPTY Errno = 145 ERROR_ALREADY_EXISTS Errno = 183 ERROR_ENVVAR_NOT_FOUND Errno = 203 ERROR_MORE_DATA Errno = 234 ERROR_OPERATION_ABORTED Errno = 995 ERROR_IO_PENDING Errno = 997 ERROR_NOT_FOUND Errno = 1168 ERROR_PRIVILEGE_NOT_HELD Errno = 1314 WSAEACCES Errno = 10013 WSAENOPROTOOPT Errno = 10042 WSAECONNABORTED Errno = 10053 WSAECONNRESET Errno = 10054 )
const ( ENOENT Errno = ERROR_FILE_NOT_FOUND ENOTDIR Errno = ERROR_PATH_NOT_FOUND )
Go names for Windows errors.
const ( E2BIG Errno = APPLICATION_ERROR + iota EACCES EADDRINUSE EADDRNOTAVAIL EADV EAFNOSUPPORT EAGAIN EALREADY EBADE EBADF EBADFD EBADMSG EBADR EBADRQC EBADSLT EBFONT EBUSY ECANCELED ECHILD ECHRNG ECOMM ECONNABORTED ECONNREFUSED ECONNRESET EDEADLK EDEADLOCK EDESTADDRREQ EDOM EDOTDOT EDQUOT EEXIST EFAULT EFBIG EHOSTDOWN EHOSTUNREACH EIDRM EILSEQ EINPROGRESS EINTR EINVAL EIO EISCONN EISDIR EISNAM EKEYEXPIRED EKEYREJECTED EKEYREVOKED EL2HLT EL2NSYNC EL3HLT EL3RST ELIBACC ELIBBAD ELIBEXEC ELIBMAX ELIBSCN ELNRNG ELOOP EMEDIUMTYPE EMFILE EMLINK EMSGSIZE EMULTIHOP ENAMETOOLONG ENAVAIL ENETDOWN ENETRESET ENETUNREACH ENFILE ENOANO ENOBUFS ENOCSI ENODATA ENODEV ENOEXEC ENOKEY ENOLCK ENOLINK ENOMEDIUM ENOMEM ENOMSG ENONET ENOPKG ENOPROTOOPT ENOSPC ENOSR ENOSTR ENOSYS ENOTBLK ENOTCONN ENOTEMPTY ENOTNAM ENOTRECOVERABLE ENOTSOCK ENOTSUP ENOTTY ENOTUNIQ ENXIO EOPNOTSUPP EOVERFLOW EOWNERDEAD EPERM EPFNOSUPPORT EPIPE EPROTO EPROTONOSUPPORT EPROTOTYPE ERANGE EREMCHG EREMOTE EREMOTEIO ERESTART EROFS ESHUTDOWN ESOCKTNOSUPPORT ESPIPE ESRCH ESRMNT ESTALE ESTRPIPE ETIME ETIMEDOUT ETOOMANYREFS ETXTBSY EUCLEAN EUNATCH EUSERS EWOULDBLOCK EXDEV EXFULL EWINDOWS )
Invented values to support what package os and others expects.
type FileNotifyInformation ¶
type Filetime ¶
func NsecToFiletime ¶
func (*Filetime) Nanoseconds ¶
Nanoseconds returns Filetime ft in nanoseconds since Epoch (00:00:00 UTC, January 1, 1970).
type Handle ¶
type Handle uintptr
func CertOpenStore ¶
func CertOpenSystemStore ¶
func CreateFile ¶
func CreateFileMapping ¶
func CreateToolhelp32Snapshot ¶ added in go1.4
func FindFirstFile ¶
func FindFirstFile(name *uint16, data *Win32finddata) (handle Handle, err error)
func GetCurrentProcess ¶
func GetStdHandle ¶
func LoadLibrary ¶
Example ¶
package main import ( "syscall" ) func abort(funcname string, err error) { panic(funcname + " failed: " + err.Error()) } func main() { h, err := syscall.LoadLibrary("kernel32.dll") if err != nil { abort("LoadLibrary", err) } defer syscall.FreeLibrary(h) proc, err := syscall.GetProcAddress(h, "GetVersion") if err != nil { abort("GetProcAddress", err) } r, _, _ := syscall.Syscall(uintptr(proc), 0, 0, 0, 0) major := byte(r) minor := uint8(r >> 8) build := uint16(r >> 16) print("windows version ", major, ".", minor, " (Build ", build, ")\n") }
Output:
func OpenProcess ¶
type Hostent ¶
func GetHostByName ¶
type InterfaceInfo ¶
type InterfaceInfo struct { Flags uint32 Address SockaddrGen BroadcastAddress SockaddrGen Netmask SockaddrGen }
type IpAdapterInfo ¶
type IpAdapterInfo struct { Next *IpAdapterInfo ComboIndex uint32 AdapterName [MAX_ADAPTER_NAME_LENGTH + 4]byte Description [MAX_ADAPTER_DESCRIPTION_LENGTH + 4]byte AddressLength uint32 Address [MAX_ADAPTER_ADDRESS_LENGTH]byte Index uint32 Type uint32 DhcpEnabled uint32 CurrentIpAddress *IpAddrString IpAddressList IpAddrString GatewayList IpAddrString DhcpServer IpAddrString HaveWins bool PrimaryWinsServer IpAddrString SecondaryWinsServer IpAddrString LeaseObtained int64 LeaseExpires int64 }
type IpAddrString ¶
type IpAddrString struct { Next *IpAddrString IpAddress IpAddressString IpMask IpMaskString Context uint32 }
type IpAddressString ¶
type IpAddressString struct {
String [16]byte
}
type IpMaskString ¶
type IpMaskString IpAddressString
type LazyDLL ¶
type LazyDLL struct { Name string // contains filtered or unexported fields }
A LazyDLL implements access to a single DLL. It will delay the load of the DLL until the first call to its LazyDLL.Handle method or to one of its LazyProc's Addr method.
LazyDLL is subject to the same DLL preloading attacks as documented on LoadDLL.
Use LazyDLL in golang.org/x/sys/windows for a secure way to load system DLLs.
func NewLazyDLL ¶
type LazyProc ¶
type LazyProc struct { Name string // contains filtered or unexported fields }
A LazyProc implements access to a procedure inside a LazyDLL. It delays the lookup until the LazyProc.Addr, LazyProc.Call, or LazyProc.Find method is called.
func (*LazyProc) Addr ¶
Addr returns the address of the procedure represented by p. The return value can be passed to Syscall to run the procedure.
type MibIfRow ¶
type MibIfRow struct { Name [MAX_INTERFACE_NAME_LEN]uint16 Index uint32 Type uint32 Mtu uint32 Speed uint32 PhysAddrLen uint32 PhysAddr [MAXLEN_PHYSADDR]byte AdminStatus uint32 OperStatus uint32 LastChange uint32 InOctets uint32 InUcastPkts uint32 InNUcastPkts uint32 InDiscards uint32 InErrors uint32 InUnknownProtos uint32 OutOctets uint32 OutUcastPkts uint32 OutNUcastPkts uint32 OutDiscards uint32 OutErrors uint32 OutQLen uint32 DescrLen uint32 Descr [MAXLEN_IFDESCR]byte }
type Overlapped ¶
type Pointer ¶ added in go1.11
type Pointer *struct{}
Pointer represents a pointer to an arbitrary Windows type.
Pointer-typed fields may point to one of many different types. It's up to the caller to provide a pointer to the appropriate type, cast to Pointer. The caller must obey the unsafe.Pointer rules while doing so.
type Proc ¶
A Proc implements access to a procedure inside a DLL.
func (*Proc) Addr ¶
Addr returns the address of the procedure represented by p. The return value can be passed to Syscall to run the procedure.
func (*Proc) Call ¶
Call executes procedure p with arguments a.
The returned error is always non-nil, constructed from the result of GetLastError. Callers must inspect the primary return value to decide whether an error occurred (according to the semantics of the specific function being called) before consulting the error. The error always has type Errno.
On amd64, Call can pass and return floating-point values. To pass an argument x with C type "float", use uintptr(math.Float32bits(x)). To pass an argument with C type "double", use uintptr(math.Float64bits(x)). Floating-point return values are returned in r2. The return value for C type "float" is math.Float32frombits(uint32(r2)). For C type "double", it is math.Float64frombits(uint64(r2)).
type ProcessEntry32 ¶ added in go1.4
type ProcessInformation ¶
type Protoent ¶
func GetProtoByName ¶
type RawConn ¶ added in go1.9
type RawConn interface { // Control invokes f on the underlying connection's file // descriptor or handle. // The file descriptor fd is guaranteed to remain valid while // f executes but not after f returns. Control(f func(fd uintptr)) error // Read invokes f on the underlying connection's file // descriptor or handle; f is expected to try to read from the // file descriptor. // If f returns true, Read returns. Otherwise Read blocks // waiting for the connection to be ready for reading and // tries again repeatedly. // The file descriptor is guaranteed to remain valid while f // executes but not after f returns. Read(f func(fd uintptr) (done bool)) error // Write is like Read but for writing. Write(f func(fd uintptr) (done bool)) error }
A RawConn is a raw network connection.
type RawSockaddr ¶
type RawSockaddrAny ¶
type RawSockaddrAny struct { Addr RawSockaddr Pad [100]int8 }
func (*RawSockaddrAny) Sockaddr ¶
func (rsa *RawSockaddrAny) Sockaddr() (Sockaddr, error)
type RawSockaddrInet4 ¶
type RawSockaddrInet6 ¶ added in go1.1
type RawSockaddrUnix ¶ added in go1.12
type RawSockaddrUnix struct { Family uint16 Path [UNIX_PATH_MAX]int8 }
type Rusage ¶
type Rusage struct { CreationTime Filetime ExitTime Filetime KernelTime Filetime UserTime Filetime }
Invented structures to support what package os expects.
type SID ¶
type SID struct{}
The security identifier (SID) structure is a variable-length structure used to uniquely identify users or groups.
func LookupSID ¶
LookupSID retrieves a security identifier sid for the account and the name of the domain on which the account was found. System specify target computer to search.
func StringToSid ¶
StringToSid converts a string-format security identifier sid into a valid, functional sid.
func (*SID) LookupAccount ¶
LookupAccount retrieves the name of the account for this sid and the name of the first domain on which this sid is found. System specify target computer to search for.
type SIDAndAttributes ¶
type SecurityAttributes ¶
type Sockaddr ¶
type Sockaddr interface {
// contains filtered or unexported methods
}
func Getpeername ¶
func Getsockname ¶
type SockaddrGen ¶
type SockaddrGen [24]byte
type SockaddrInet4 ¶
type SockaddrInet6 ¶
type SockaddrUnix ¶
type SockaddrUnix struct { Name string // contains filtered or unexported fields }
type StartupInfo ¶
type SysProcAttr ¶
type SysProcAttr struct { HideWindow bool CmdLine string // used if non-empty, else the windows command line is built by escaping the arguments passed to StartProcess CreationFlags uint32 Token Token // if set, runs new process in the security context represented by the token ProcessAttributes *SecurityAttributes // if set, applies these security attributes as the descriptor for the new process ThreadAttributes *SecurityAttributes // if set, applies these security attributes as the descriptor for the main thread of the new process NoInheritHandles bool // if set, no handles are inherited by the new process, not even the standard handles, contained in ProcAttr.Files, nor the ones contained in AdditionalInheritedHandles AdditionalInheritedHandles []Handle // a list of additional handles, already marked as inheritable, that will be inherited by the new process ParentProcess Handle // if non-zero, the new process regards the process given by this handle as its parent process, and AdditionalInheritedHandles, if set, should exist in this parent process }
type Systemtime ¶
type TCPKeepalive ¶ added in go1.3
type Timespec ¶
Timespec is an invented structure on Windows, but here for consistency with the syscall package for other operating systems.
func NsecToTimespec ¶ added in go1.1
type Timeval ¶
Invented values to support what package os expects.
func NsecToTimeval ¶
func (*Timeval) Nanoseconds ¶
type Timezoneinformation ¶
type Timezoneinformation struct { Bias int32 StandardName [32]uint16 StandardDate Systemtime StandardBias int32 DaylightName [32]uint16 DaylightDate Systemtime DaylightBias int32 }
type Token ¶
type Token Handle
An access token contains the security information for a logon session. The system creates an access token when a user logs on, and every process executed on behalf of the user has a copy of the token. The token identifies the user, the user's groups, and the user's privileges. The system uses the token to control access to securable objects and to control the ability of the user to perform various system-related operations on the local computer.
func OpenCurrentProcessToken ¶
OpenCurrentProcessToken opens the access token associated with current process.
func (Token) GetTokenPrimaryGroup ¶
func (t Token) GetTokenPrimaryGroup() (*Tokenprimarygroup, error)
GetTokenPrimaryGroup retrieves access token t primary group information. A pointer to a SID structure representing a group that will become the primary group of any objects created by a process using this access token.
func (Token) GetTokenUser ¶
GetTokenUser retrieves access token t user account information.
func (Token) GetUserProfileDirectory ¶
GetUserProfileDirectory retrieves path to the root directory of the access token t user's profile.
type Tokenprimarygroup ¶
type Tokenprimarygroup struct {
PrimaryGroup *SID
}
type Tokenuser ¶
type Tokenuser struct {
User SIDAndAttributes
}
type TransmitFileBuffers ¶
type UserInfo10 ¶
type WSAData ¶
type WSAData struct { Version uint16 HighVersion uint16 MaxSockets uint16 MaxUdpDg uint16 VendorInfo *byte Description [WSADESCRIPTION_LEN + 1]byte SystemStatus [WSASYS_STATUS_LEN + 1]byte }
type WSAProtocolChain ¶ added in go1.2
type WSAProtocolChain struct { ChainLen int32 ChainEntries [MAX_PROTOCOL_CHAIN]uint32 }
type WSAProtocolInfo ¶ added in go1.2
type WSAProtocolInfo struct { ServiceFlags1 uint32 ServiceFlags2 uint32 ServiceFlags3 uint32 ServiceFlags4 uint32 ProviderFlags uint32 ProviderId GUID CatalogEntryId uint32 ProtocolChain WSAProtocolChain Version int32 AddressFamily int32 MaxSockAddr int32 MinSockAddr int32 SocketType int32 Protocol int32 ProtocolMaxOffset int32 NetworkByteOrder int32 SecurityScheme int32 MessageSize uint32 ProviderReserved uint32 ProtocolName [WSAPROTOCOL_LEN + 1]uint16 }
type WaitStatus ¶
type WaitStatus struct {
ExitCode uint32
}
func (WaitStatus) Continued ¶
func (w WaitStatus) Continued() bool
func (WaitStatus) CoreDump ¶
func (w WaitStatus) CoreDump() bool
func (WaitStatus) ExitStatus ¶
func (w WaitStatus) ExitStatus() int
func (WaitStatus) Exited ¶
func (w WaitStatus) Exited() bool
func (WaitStatus) Signal ¶
func (w WaitStatus) Signal() Signal
func (WaitStatus) Signaled ¶
func (w WaitStatus) Signaled() bool
func (WaitStatus) StopSignal ¶
func (w WaitStatus) StopSignal() Signal
func (WaitStatus) Stopped ¶
func (w WaitStatus) Stopped() bool
func (WaitStatus) TrapCause ¶
func (w WaitStatus) TrapCause() int
type Win32FileAttributeData ¶
Notes ¶
Bugs ¶
The definition of Linger is not appropriate for direct use with Setsockopt and Getsockopt. Use SetsockoptLinger instead.