mirror of
https://github.com/go-vgo/robotgo.git
synced 2025-06-04 16:03:54 +00:00
try to add Windows partial methods and update packages
This commit is contained in:
parent
fe836c3aae
commit
01841ab92d
16
Gopkg.lock
generated
16
Gopkg.lock
generated
@ -16,6 +16,12 @@
|
|||||||
revision = "a41e3c4b706f6ae8dfbff342b06e40fa4d2d0506"
|
revision = "a41e3c4b706f6ae8dfbff342b06e40fa4d2d0506"
|
||||||
version = "v1.2.1"
|
version = "v1.2.1"
|
||||||
|
|
||||||
|
[[projects]]
|
||||||
|
branch = "master"
|
||||||
|
name = "github.com/lxn/win"
|
||||||
|
packages = ["."]
|
||||||
|
revision = "7e1250ba2e7749fb9eb865da9ee93fb5a2fe73f1"
|
||||||
|
|
||||||
[[projects]]
|
[[projects]]
|
||||||
name = "github.com/shirou/gopsutil"
|
name = "github.com/shirou/gopsutil"
|
||||||
packages = [
|
packages = [
|
||||||
@ -26,8 +32,8 @@
|
|||||||
"net",
|
"net",
|
||||||
"process"
|
"process"
|
||||||
]
|
]
|
||||||
revision = "eeb1d38d69593f121e060d24d17f7b1f0936b203"
|
revision = "4a180b209f5f494e5923cfce81ea30ba23915877"
|
||||||
version = "v2.18.05"
|
version = "v2.18.06"
|
||||||
|
|
||||||
[[projects]]
|
[[projects]]
|
||||||
branch = "master"
|
branch = "master"
|
||||||
@ -45,7 +51,7 @@
|
|||||||
branch = "master"
|
branch = "master"
|
||||||
name = "golang.org/x/image"
|
name = "golang.org/x/image"
|
||||||
packages = ["bmp"]
|
packages = ["bmp"]
|
||||||
revision = "af66defab954cb421ca110193eed9477c8541e2a"
|
revision = "cc896f830cedae125428bc9fe1b0362aa91b3fb1"
|
||||||
|
|
||||||
[[projects]]
|
[[projects]]
|
||||||
branch = "master"
|
branch = "master"
|
||||||
@ -54,11 +60,11 @@
|
|||||||
"unix",
|
"unix",
|
||||||
"windows"
|
"windows"
|
||||||
]
|
]
|
||||||
revision = "6c888cc515d3ed83fc103cf1d84468aad274b0a7"
|
revision = "151529c776cdc58ddbe7963ba9af779f3577b419"
|
||||||
|
|
||||||
[solve-meta]
|
[solve-meta]
|
||||||
analyzer-name = "dep"
|
analyzer-name = "dep"
|
||||||
analyzer-version = 1
|
analyzer-version = 1
|
||||||
inputs-digest = "aced52ab90c19ab02a6a92216b5d4d097e45428090dcdb67eaaeb52604ea29c0"
|
inputs-digest = "b0823ba26a4b2c75bed4b3f87b65fcf3b8f7dcbe253b3f5449e7d39546493625"
|
||||||
solver-name = "gps-cdcl"
|
solver-name = "gps-cdcl"
|
||||||
solver-version = 1
|
solver-version = 1
|
||||||
|
@ -33,6 +33,10 @@
|
|||||||
branch = "master"
|
branch = "master"
|
||||||
name = "github.com/vcaesar/imgo"
|
name = "github.com/vcaesar/imgo"
|
||||||
|
|
||||||
|
[[constraint]]
|
||||||
|
branch = "master"
|
||||||
|
name = "github.com/lxn/win"
|
||||||
|
|
||||||
[prune]
|
[prune]
|
||||||
go-tests = true
|
go-tests = true
|
||||||
unused-packages = true
|
unused-packages = true
|
||||||
|
16
robotgo_win.go
Normal file
16
robotgo_win.go
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
// +build windows
|
||||||
|
|
||||||
|
package robotgo
|
||||||
|
|
||||||
|
import (
|
||||||
|
"syscall"
|
||||||
|
|
||||||
|
"github.com/lxn/win"
|
||||||
|
)
|
||||||
|
|
||||||
|
// FindWindow find window hwnd by name
|
||||||
|
func FindWindow(str string) win.HWND {
|
||||||
|
hwnd := win.FindWindow(nil, syscall.StringToUTF16Ptr(str))
|
||||||
|
|
||||||
|
return hwnd
|
||||||
|
}
|
27
vendor/github.com/lxn/win/AUTHORS
generated
vendored
Normal file
27
vendor/github.com/lxn/win/AUTHORS
generated
vendored
Normal file
@ -0,0 +1,27 @@
|
|||||||
|
# This is the official list of 'win' authors for copyright purposes.
|
||||||
|
|
||||||
|
# Names should be added to this file as
|
||||||
|
# Name or Organization <email address>
|
||||||
|
# The email address is not required for organizations.
|
||||||
|
|
||||||
|
# Please keep the list sorted.
|
||||||
|
|
||||||
|
# Contributors
|
||||||
|
# ============
|
||||||
|
|
||||||
|
Alexander Neumann <an2048@googlemail.com>
|
||||||
|
Aman Gupta <aman@tmm1.net>
|
||||||
|
Anton Lahti <antonlahti@gmail.com>
|
||||||
|
Benny Siegert <bsiegert@gmail.com>
|
||||||
|
Bruno Bigras <bigras.bruno@gmail.com>
|
||||||
|
Carl Kittelberger <icedream@icedream.pw>
|
||||||
|
Carlos Cobo <toqueteos@gmail.com>
|
||||||
|
Cary Cherng <ccherng@gmail.com>
|
||||||
|
David Porter <david@porter.me>
|
||||||
|
Hill <zhubicen@gmail.com>
|
||||||
|
Joseph Watson <jtwatson@linux-consulting.us>
|
||||||
|
Kevin Pors <krpors@gmail.com>
|
||||||
|
ktye <ktye@users.noreply.github.com>
|
||||||
|
mycaosf <mycaosf@gmail.com>
|
||||||
|
ryujimiya <ryujimiya236@gmail.com>
|
||||||
|
wsf01 <wf1337@sina.com>
|
23
vendor/github.com/lxn/win/LICENSE
generated
vendored
Normal file
23
vendor/github.com/lxn/win/LICENSE
generated
vendored
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
Copyright (c) 2010 The win Authors. All rights reserved.
|
||||||
|
|
||||||
|
Redistribution and use in source and binary forms, with or without
|
||||||
|
modification, are permitted provided that the following conditions
|
||||||
|
are met:
|
||||||
|
1. Redistributions of source code must retain the above copyright
|
||||||
|
notice, this list of conditions and the following disclaimer.
|
||||||
|
2. Redistributions in binary form must reproduce the above copyright
|
||||||
|
notice, this list of conditions and the following disclaimer in the
|
||||||
|
documentation and/or other materials provided with the distribution.
|
||||||
|
3. The names of the authors may not be used to endorse or promote products
|
||||||
|
derived from this software without specific prior written permission.
|
||||||
|
|
||||||
|
THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS OR
|
||||||
|
IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
||||||
|
OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
||||||
|
IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||||
|
INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
||||||
|
NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||||
|
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||||
|
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||||
|
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||||
|
THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
15
vendor/github.com/lxn/win/README.mdown
generated
vendored
Normal file
15
vendor/github.com/lxn/win/README.mdown
generated
vendored
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
About win
|
||||||
|
=========
|
||||||
|
|
||||||
|
win is a Windows API wrapper package for Go.
|
||||||
|
|
||||||
|
Originally part of [walk](https://github.com/lxn/walk), it is now a separate
|
||||||
|
project.
|
||||||
|
|
||||||
|
Setup
|
||||||
|
=====
|
||||||
|
|
||||||
|
Make sure you have a working Go installation.
|
||||||
|
See [Getting Started](http://golang.org/doc/install.html)
|
||||||
|
|
||||||
|
Now run `go get github.com/lxn/win`
|
136
vendor/github.com/lxn/win/advapi32.go
generated
vendored
Normal file
136
vendor/github.com/lxn/win/advapi32.go
generated
vendored
Normal file
@ -0,0 +1,136 @@
|
|||||||
|
// Copyright 2010 The win Authors. All rights reserved.
|
||||||
|
// Use of this source code is governed by a BSD-style
|
||||||
|
// license that can be found in the LICENSE file.
|
||||||
|
|
||||||
|
// +build windows
|
||||||
|
|
||||||
|
package win
|
||||||
|
|
||||||
|
import (
|
||||||
|
"syscall"
|
||||||
|
"unsafe"
|
||||||
|
)
|
||||||
|
|
||||||
|
const KEY_READ REGSAM = 0x20019
|
||||||
|
const KEY_WRITE REGSAM = 0x20006
|
||||||
|
|
||||||
|
const (
|
||||||
|
HKEY_CLASSES_ROOT HKEY = 0x80000000
|
||||||
|
HKEY_CURRENT_USER HKEY = 0x80000001
|
||||||
|
HKEY_LOCAL_MACHINE HKEY = 0x80000002
|
||||||
|
HKEY_USERS HKEY = 0x80000003
|
||||||
|
HKEY_PERFORMANCE_DATA HKEY = 0x80000004
|
||||||
|
HKEY_CURRENT_CONFIG HKEY = 0x80000005
|
||||||
|
HKEY_DYN_DATA HKEY = 0x80000006
|
||||||
|
)
|
||||||
|
|
||||||
|
const (
|
||||||
|
ERROR_NO_MORE_ITEMS = 259
|
||||||
|
)
|
||||||
|
|
||||||
|
type (
|
||||||
|
ACCESS_MASK uint32
|
||||||
|
HKEY HANDLE
|
||||||
|
REGSAM ACCESS_MASK
|
||||||
|
)
|
||||||
|
|
||||||
|
const (
|
||||||
|
REG_NONE uint64 = 0 // No value type
|
||||||
|
REG_SZ = 1 // Unicode nul terminated string
|
||||||
|
REG_EXPAND_SZ = 2 // Unicode nul terminated string
|
||||||
|
// (with environment variable references)
|
||||||
|
REG_BINARY = 3 // Free form binary
|
||||||
|
REG_DWORD = 4 // 32-bit number
|
||||||
|
REG_DWORD_LITTLE_ENDIAN = 4 // 32-bit number (same as REG_DWORD)
|
||||||
|
REG_DWORD_BIG_ENDIAN = 5 // 32-bit number
|
||||||
|
REG_LINK = 6 // Symbolic Link (unicode)
|
||||||
|
REG_MULTI_SZ = 7 // Multiple Unicode strings
|
||||||
|
REG_RESOURCE_LIST = 8 // Resource list in the resource map
|
||||||
|
REG_FULL_RESOURCE_DESCRIPTOR = 9 // Resource list in the hardware description
|
||||||
|
REG_RESOURCE_REQUIREMENTS_LIST = 10
|
||||||
|
REG_QWORD = 11 // 64-bit number
|
||||||
|
REG_QWORD_LITTLE_ENDIAN = 11 // 64-bit number (same as REG_QWORD)
|
||||||
|
|
||||||
|
)
|
||||||
|
|
||||||
|
var (
|
||||||
|
// Library
|
||||||
|
libadvapi32 uintptr
|
||||||
|
|
||||||
|
// Functions
|
||||||
|
regCloseKey uintptr
|
||||||
|
regOpenKeyEx uintptr
|
||||||
|
regQueryValueEx uintptr
|
||||||
|
regEnumValue uintptr
|
||||||
|
regSetValueEx uintptr
|
||||||
|
)
|
||||||
|
|
||||||
|
func init() {
|
||||||
|
// Library
|
||||||
|
libadvapi32 = MustLoadLibrary("advapi32.dll")
|
||||||
|
|
||||||
|
// Functions
|
||||||
|
regCloseKey = MustGetProcAddress(libadvapi32, "RegCloseKey")
|
||||||
|
regOpenKeyEx = MustGetProcAddress(libadvapi32, "RegOpenKeyExW")
|
||||||
|
regQueryValueEx = MustGetProcAddress(libadvapi32, "RegQueryValueExW")
|
||||||
|
regEnumValue = MustGetProcAddress(libadvapi32, "RegEnumValueW")
|
||||||
|
regSetValueEx = MustGetProcAddress(libadvapi32, "RegSetValueExW")
|
||||||
|
}
|
||||||
|
|
||||||
|
func RegCloseKey(hKey HKEY) int32 {
|
||||||
|
ret, _, _ := syscall.Syscall(regCloseKey, 1,
|
||||||
|
uintptr(hKey),
|
||||||
|
0,
|
||||||
|
0)
|
||||||
|
|
||||||
|
return int32(ret)
|
||||||
|
}
|
||||||
|
|
||||||
|
func RegOpenKeyEx(hKey HKEY, lpSubKey *uint16, ulOptions uint32, samDesired REGSAM, phkResult *HKEY) int32 {
|
||||||
|
ret, _, _ := syscall.Syscall6(regOpenKeyEx, 5,
|
||||||
|
uintptr(hKey),
|
||||||
|
uintptr(unsafe.Pointer(lpSubKey)),
|
||||||
|
uintptr(ulOptions),
|
||||||
|
uintptr(samDesired),
|
||||||
|
uintptr(unsafe.Pointer(phkResult)),
|
||||||
|
0)
|
||||||
|
|
||||||
|
return int32(ret)
|
||||||
|
}
|
||||||
|
|
||||||
|
func RegQueryValueEx(hKey HKEY, lpValueName *uint16, lpReserved, lpType *uint32, lpData *byte, lpcbData *uint32) int32 {
|
||||||
|
ret, _, _ := syscall.Syscall6(regQueryValueEx, 6,
|
||||||
|
uintptr(hKey),
|
||||||
|
uintptr(unsafe.Pointer(lpValueName)),
|
||||||
|
uintptr(unsafe.Pointer(lpReserved)),
|
||||||
|
uintptr(unsafe.Pointer(lpType)),
|
||||||
|
uintptr(unsafe.Pointer(lpData)),
|
||||||
|
uintptr(unsafe.Pointer(lpcbData)))
|
||||||
|
|
||||||
|
return int32(ret)
|
||||||
|
}
|
||||||
|
|
||||||
|
func RegEnumValue(hKey HKEY, index uint32, lpValueName *uint16, lpcchValueName *uint32, lpReserved, lpType *uint32, lpData *byte, lpcbData *uint32) int32 {
|
||||||
|
ret, _, _ := syscall.Syscall9(regEnumValue, 8,
|
||||||
|
uintptr(hKey),
|
||||||
|
uintptr(index),
|
||||||
|
uintptr(unsafe.Pointer(lpValueName)),
|
||||||
|
uintptr(unsafe.Pointer(lpcchValueName)),
|
||||||
|
uintptr(unsafe.Pointer(lpReserved)),
|
||||||
|
uintptr(unsafe.Pointer(lpType)),
|
||||||
|
uintptr(unsafe.Pointer(lpData)),
|
||||||
|
uintptr(unsafe.Pointer(lpcbData)),
|
||||||
|
0)
|
||||||
|
return int32(ret)
|
||||||
|
}
|
||||||
|
|
||||||
|
func RegSetValueEx(hKey HKEY, lpValueName *uint16, lpReserved, lpDataType uint64, lpData *byte, cbData uint32) int32 {
|
||||||
|
ret, _, _ := syscall.Syscall6(regSetValueEx, 6,
|
||||||
|
uintptr(hKey),
|
||||||
|
uintptr(unsafe.Pointer(lpValueName)),
|
||||||
|
uintptr(lpReserved),
|
||||||
|
uintptr(lpDataType),
|
||||||
|
uintptr(unsafe.Pointer(lpData)),
|
||||||
|
uintptr(cbData))
|
||||||
|
return int32(ret)
|
||||||
|
}
|
86
vendor/github.com/lxn/win/combobox.go
generated
vendored
Normal file
86
vendor/github.com/lxn/win/combobox.go
generated
vendored
Normal file
@ -0,0 +1,86 @@
|
|||||||
|
// Copyright 2010 The win Authors. All rights reserved.
|
||||||
|
// Use of this source code is governed by a BSD-style
|
||||||
|
// license that can be found in the LICENSE file.
|
||||||
|
|
||||||
|
// +build windows
|
||||||
|
|
||||||
|
package win
|
||||||
|
|
||||||
|
// ComboBox return values
|
||||||
|
const (
|
||||||
|
CB_OKAY = 0
|
||||||
|
CB_ERR = ^uintptr(0) // -1
|
||||||
|
CB_ERRSPACE = ^uintptr(1) // -2
|
||||||
|
)
|
||||||
|
|
||||||
|
// ComboBox notifications
|
||||||
|
const (
|
||||||
|
CBN_ERRSPACE = -1
|
||||||
|
CBN_SELCHANGE = 1
|
||||||
|
CBN_DBLCLK = 2
|
||||||
|
CBN_SETFOCUS = 3
|
||||||
|
CBN_KILLFOCUS = 4
|
||||||
|
CBN_EDITCHANGE = 5
|
||||||
|
CBN_EDITUPDATE = 6
|
||||||
|
CBN_DROPDOWN = 7
|
||||||
|
CBN_CLOSEUP = 8
|
||||||
|
CBN_SELENDOK = 9
|
||||||
|
CBN_SELENDCANCEL = 10
|
||||||
|
)
|
||||||
|
|
||||||
|
// ComboBox styles
|
||||||
|
const (
|
||||||
|
CBS_SIMPLE = 0x0001
|
||||||
|
CBS_DROPDOWN = 0x0002
|
||||||
|
CBS_DROPDOWNLIST = 0x0003
|
||||||
|
CBS_OWNERDRAWFIXED = 0x0010
|
||||||
|
CBS_OWNERDRAWVARIABLE = 0x0020
|
||||||
|
CBS_AUTOHSCROLL = 0x0040
|
||||||
|
CBS_OEMCONVERT = 0x0080
|
||||||
|
CBS_SORT = 0x0100
|
||||||
|
CBS_HASSTRINGS = 0x0200
|
||||||
|
CBS_NOINTEGRALHEIGHT = 0x0400
|
||||||
|
CBS_DISABLENOSCROLL = 0x0800
|
||||||
|
CBS_UPPERCASE = 0x2000
|
||||||
|
CBS_LOWERCASE = 0x4000
|
||||||
|
)
|
||||||
|
|
||||||
|
// ComboBox messages
|
||||||
|
const (
|
||||||
|
CB_GETEDITSEL = 0x0140
|
||||||
|
CB_LIMITTEXT = 0x0141
|
||||||
|
CB_SETEDITSEL = 0x0142
|
||||||
|
CB_ADDSTRING = 0x0143
|
||||||
|
CB_DELETESTRING = 0x0144
|
||||||
|
CB_DIR = 0x0145
|
||||||
|
CB_GETCOUNT = 0x0146
|
||||||
|
CB_GETCURSEL = 0x0147
|
||||||
|
CB_GETLBTEXT = 0x0148
|
||||||
|
CB_GETLBTEXTLEN = 0x0149
|
||||||
|
CB_INSERTSTRING = 0x014A
|
||||||
|
CB_RESETCONTENT = 0x014B
|
||||||
|
CB_FINDSTRING = 0x014C
|
||||||
|
CB_SELECTSTRING = 0x014D
|
||||||
|
CB_SETCURSEL = 0x014E
|
||||||
|
CB_SHOWDROPDOWN = 0x014F
|
||||||
|
CB_GETITEMDATA = 0x0150
|
||||||
|
CB_SETITEMDATA = 0x0151
|
||||||
|
CB_GETDROPPEDCONTROLRECT = 0x0152
|
||||||
|
CB_SETITEMHEIGHT = 0x0153
|
||||||
|
CB_GETITEMHEIGHT = 0x0154
|
||||||
|
CB_SETEXTENDEDUI = 0x0155
|
||||||
|
CB_GETEXTENDEDUI = 0x0156
|
||||||
|
CB_GETDROPPEDSTATE = 0x0157
|
||||||
|
CB_FINDSTRINGEXACT = 0x0158
|
||||||
|
CB_SETLOCALE = 0x0159
|
||||||
|
CB_GETLOCALE = 0x015A
|
||||||
|
CB_GETTOPINDEX = 0x015b
|
||||||
|
CB_SETTOPINDEX = 0x015c
|
||||||
|
CB_GETHORIZONTALEXTENT = 0x015d
|
||||||
|
CB_SETHORIZONTALEXTENT = 0x015e
|
||||||
|
CB_GETDROPPEDWIDTH = 0x015f
|
||||||
|
CB_SETDROPPEDWIDTH = 0x0160
|
||||||
|
CB_INITSTORAGE = 0x0161
|
||||||
|
CB_MULTIPLEADDSTRING = 0x0163
|
||||||
|
CB_GETCOMBOBOXINFO = 0x0164
|
||||||
|
)
|
343
vendor/github.com/lxn/win/comctl32.go
generated
vendored
Normal file
343
vendor/github.com/lxn/win/comctl32.go
generated
vendored
Normal file
@ -0,0 +1,343 @@
|
|||||||
|
// Copyright 2016 The win Authors. All rights reserved.
|
||||||
|
// Use of this source code is governed by a BSD-style
|
||||||
|
// license that can be found in the LICENSE file.
|
||||||
|
|
||||||
|
// +build windows
|
||||||
|
|
||||||
|
package win
|
||||||
|
|
||||||
|
import (
|
||||||
|
"syscall"
|
||||||
|
"unsafe"
|
||||||
|
)
|
||||||
|
|
||||||
|
// Button control messages
|
||||||
|
const (
|
||||||
|
BCM_FIRST = 0x1600
|
||||||
|
BCM_GETIDEALSIZE = BCM_FIRST + 0x0001
|
||||||
|
BCM_SETIMAGELIST = BCM_FIRST + 0x0002
|
||||||
|
BCM_GETIMAGELIST = BCM_FIRST + 0x0003
|
||||||
|
BCM_SETTEXTMARGIN = BCM_FIRST + 0x0004
|
||||||
|
BCM_GETTEXTMARGIN = BCM_FIRST + 0x0005
|
||||||
|
BCM_SETDROPDOWNSTATE = BCM_FIRST + 0x0006
|
||||||
|
BCM_SETSPLITINFO = BCM_FIRST + 0x0007
|
||||||
|
BCM_GETSPLITINFO = BCM_FIRST + 0x0008
|
||||||
|
BCM_SETNOTE = BCM_FIRST + 0x0009
|
||||||
|
BCM_GETNOTE = BCM_FIRST + 0x000A
|
||||||
|
BCM_GETNOTELENGTH = BCM_FIRST + 0x000B
|
||||||
|
BCM_SETSHIELD = BCM_FIRST + 0x000C
|
||||||
|
)
|
||||||
|
|
||||||
|
const (
|
||||||
|
CCM_FIRST = 0x2000
|
||||||
|
CCM_LAST = CCM_FIRST + 0x200
|
||||||
|
CCM_SETBKCOLOR = 8193
|
||||||
|
CCM_SETCOLORSCHEME = 8194
|
||||||
|
CCM_GETCOLORSCHEME = 8195
|
||||||
|
CCM_GETDROPTARGET = 8196
|
||||||
|
CCM_SETUNICODEFORMAT = 8197
|
||||||
|
CCM_GETUNICODEFORMAT = 8198
|
||||||
|
CCM_SETVERSION = 0x2007
|
||||||
|
CCM_GETVERSION = 0x2008
|
||||||
|
CCM_SETNOTIFYWINDOW = 0x2009
|
||||||
|
CCM_SETWINDOWTHEME = 0x200b
|
||||||
|
CCM_DPISCALE = 0x200c
|
||||||
|
)
|
||||||
|
|
||||||
|
// Common controls styles
|
||||||
|
const (
|
||||||
|
CCS_TOP = 1
|
||||||
|
CCS_NOMOVEY = 2
|
||||||
|
CCS_BOTTOM = 3
|
||||||
|
CCS_NORESIZE = 4
|
||||||
|
CCS_NOPARENTALIGN = 8
|
||||||
|
CCS_ADJUSTABLE = 32
|
||||||
|
CCS_NODIVIDER = 64
|
||||||
|
CCS_VERT = 128
|
||||||
|
CCS_LEFT = 129
|
||||||
|
CCS_NOMOVEX = 130
|
||||||
|
CCS_RIGHT = 131
|
||||||
|
)
|
||||||
|
|
||||||
|
// InitCommonControlsEx flags
|
||||||
|
const (
|
||||||
|
ICC_LISTVIEW_CLASSES = 1
|
||||||
|
ICC_TREEVIEW_CLASSES = 2
|
||||||
|
ICC_BAR_CLASSES = 4
|
||||||
|
ICC_TAB_CLASSES = 8
|
||||||
|
ICC_UPDOWN_CLASS = 16
|
||||||
|
ICC_PROGRESS_CLASS = 32
|
||||||
|
ICC_HOTKEY_CLASS = 64
|
||||||
|
ICC_ANIMATE_CLASS = 128
|
||||||
|
ICC_WIN95_CLASSES = 255
|
||||||
|
ICC_DATE_CLASSES = 256
|
||||||
|
ICC_USEREX_CLASSES = 512
|
||||||
|
ICC_COOL_CLASSES = 1024
|
||||||
|
ICC_INTERNET_CLASSES = 2048
|
||||||
|
ICC_PAGESCROLLER_CLASS = 4096
|
||||||
|
ICC_NATIVEFNTCTL_CLASS = 8192
|
||||||
|
INFOTIPSIZE = 1024
|
||||||
|
ICC_STANDARD_CLASSES = 0x00004000
|
||||||
|
ICC_LINK_CLASS = 0x00008000
|
||||||
|
)
|
||||||
|
|
||||||
|
// WM_NOTITY messages
|
||||||
|
const (
|
||||||
|
NM_FIRST = 0
|
||||||
|
NM_OUTOFMEMORY = ^uint32(0) // NM_FIRST - 1
|
||||||
|
NM_CLICK = ^uint32(1) // NM_FIRST - 2
|
||||||
|
NM_DBLCLK = ^uint32(2) // NM_FIRST - 3
|
||||||
|
NM_RETURN = ^uint32(3) // NM_FIRST - 4
|
||||||
|
NM_RCLICK = ^uint32(4) // NM_FIRST - 5
|
||||||
|
NM_RDBLCLK = ^uint32(5) // NM_FIRST - 6
|
||||||
|
NM_SETFOCUS = ^uint32(6) // NM_FIRST - 7
|
||||||
|
NM_KILLFOCUS = ^uint32(7) // NM_FIRST - 8
|
||||||
|
NM_CUSTOMDRAW = ^uint32(11) // NM_FIRST - 12
|
||||||
|
NM_HOVER = ^uint32(12) // NM_FIRST - 13
|
||||||
|
NM_NCHITTEST = ^uint32(13) // NM_FIRST - 14
|
||||||
|
NM_KEYDOWN = ^uint32(14) // NM_FIRST - 15
|
||||||
|
NM_RELEASEDCAPTURE = ^uint32(15) // NM_FIRST - 16
|
||||||
|
NM_SETCURSOR = ^uint32(16) // NM_FIRST - 17
|
||||||
|
NM_CHAR = ^uint32(17) // NM_FIRST - 18
|
||||||
|
NM_TOOLTIPSCREATED = ^uint32(18) // NM_FIRST - 19
|
||||||
|
NM_LAST = ^uint32(98) // NM_FIRST - 99
|
||||||
|
TRBN_THUMBPOSCHANGING = 0xfffffa22 // TRBN_FIRST - 1
|
||||||
|
)
|
||||||
|
|
||||||
|
// ProgressBar messages
|
||||||
|
const (
|
||||||
|
PBM_SETPOS = WM_USER + 2
|
||||||
|
PBM_DELTAPOS = WM_USER + 3
|
||||||
|
PBM_SETSTEP = WM_USER + 4
|
||||||
|
PBM_STEPIT = WM_USER + 5
|
||||||
|
PBM_SETMARQUEE = WM_USER + 10
|
||||||
|
PBM_SETRANGE32 = 1030
|
||||||
|
PBM_GETRANGE = 1031
|
||||||
|
PBM_GETPOS = 1032
|
||||||
|
PBM_SETBARCOLOR = 1033
|
||||||
|
PBM_SETBKCOLOR = CCM_SETBKCOLOR
|
||||||
|
)
|
||||||
|
|
||||||
|
// ProgressBar styles
|
||||||
|
const (
|
||||||
|
PBS_SMOOTH = 0x01
|
||||||
|
PBS_VERTICAL = 0x04
|
||||||
|
PBS_MARQUEE = 0x08
|
||||||
|
)
|
||||||
|
|
||||||
|
// TrackBar (Slider) messages
|
||||||
|
const (
|
||||||
|
TBM_GETPOS = WM_USER
|
||||||
|
TBM_GETRANGEMIN = WM_USER + 1
|
||||||
|
TBM_GETRANGEMAX = WM_USER + 2
|
||||||
|
TBM_SETPOS = WM_USER + 5
|
||||||
|
TBM_SETRANGEMIN = WM_USER + 7
|
||||||
|
TBM_SETRANGEMAX = WM_USER + 8
|
||||||
|
)
|
||||||
|
|
||||||
|
// TrackBar (Slider) styles
|
||||||
|
const (
|
||||||
|
TBS_VERT = 0x002
|
||||||
|
TBS_TOOLTIPS = 0x100
|
||||||
|
)
|
||||||
|
|
||||||
|
// ImageList creation flags
|
||||||
|
const (
|
||||||
|
ILC_MASK = 0x00000001
|
||||||
|
ILC_COLOR = 0x00000000
|
||||||
|
ILC_COLORDDB = 0x000000FE
|
||||||
|
ILC_COLOR4 = 0x00000004
|
||||||
|
ILC_COLOR8 = 0x00000008
|
||||||
|
ILC_COLOR16 = 0x00000010
|
||||||
|
ILC_COLOR24 = 0x00000018
|
||||||
|
ILC_COLOR32 = 0x00000020
|
||||||
|
ILC_PALETTE = 0x00000800
|
||||||
|
ILC_MIRROR = 0x00002000
|
||||||
|
ILC_PERITEMMIRROR = 0x00008000
|
||||||
|
)
|
||||||
|
|
||||||
|
// LoadIconMetric flags
|
||||||
|
const (
|
||||||
|
LIM_SMALL = 0
|
||||||
|
LIM_LARGE = 1
|
||||||
|
)
|
||||||
|
|
||||||
|
const (
|
||||||
|
CDDS_PREPAINT = 0x00000001
|
||||||
|
CDDS_POSTPAINT = 0x00000002
|
||||||
|
CDDS_PREERASE = 0x00000003
|
||||||
|
CDDS_POSTERASE = 0x00000004
|
||||||
|
CDDS_ITEM = 0x00010000
|
||||||
|
CDDS_ITEMPREPAINT = CDDS_ITEM | CDDS_PREPAINT
|
||||||
|
CDDS_ITEMPOSTPAINT = CDDS_ITEM | CDDS_POSTPAINT
|
||||||
|
CDDS_ITEMPREERASE = CDDS_ITEM | CDDS_PREERASE
|
||||||
|
CDDS_ITEMPOSTERASE = CDDS_ITEM | CDDS_POSTERASE
|
||||||
|
CDDS_SUBITEM = 0x00020000
|
||||||
|
)
|
||||||
|
|
||||||
|
const (
|
||||||
|
CDIS_SELECTED = 0x0001
|
||||||
|
CDIS_GRAYED = 0x0002
|
||||||
|
CDIS_DISABLED = 0x0004
|
||||||
|
CDIS_CHECKED = 0x0008
|
||||||
|
CDIS_FOCUS = 0x0010
|
||||||
|
CDIS_DEFAULT = 0x0020
|
||||||
|
CDIS_HOT = 0x0040
|
||||||
|
CDIS_MARKED = 0x0080
|
||||||
|
CDIS_INDETERMINATE = 0x0100
|
||||||
|
CDIS_SHOWKEYBOARDCUES = 0x0200
|
||||||
|
CDIS_NEARHOT = 0x0400
|
||||||
|
CDIS_OTHERSIDEHOT = 0x0800
|
||||||
|
CDIS_DROPHILITED = 0x1000
|
||||||
|
)
|
||||||
|
|
||||||
|
const (
|
||||||
|
CDRF_DODEFAULT = 0x00000000
|
||||||
|
CDRF_NEWFONT = 0x00000002
|
||||||
|
CDRF_SKIPDEFAULT = 0x00000004
|
||||||
|
CDRF_DOERASE = 0x00000008
|
||||||
|
CDRF_NOTIFYPOSTPAINT = 0x00000010
|
||||||
|
CDRF_NOTIFYITEMDRAW = 0x00000020
|
||||||
|
CDRF_NOTIFYSUBITEMDRAW = 0x00000020
|
||||||
|
CDRF_NOTIFYPOSTERASE = 0x00000040
|
||||||
|
CDRF_SKIPPOSTPAINT = 0x00000100
|
||||||
|
)
|
||||||
|
|
||||||
|
const (
|
||||||
|
LPSTR_TEXTCALLBACK = ^uintptr(0)
|
||||||
|
I_CHILDRENCALLBACK = -1
|
||||||
|
)
|
||||||
|
|
||||||
|
type HIMAGELIST HANDLE
|
||||||
|
|
||||||
|
type INITCOMMONCONTROLSEX struct {
|
||||||
|
DwSize, DwICC uint32
|
||||||
|
}
|
||||||
|
|
||||||
|
type NMCUSTOMDRAW struct {
|
||||||
|
Hdr NMHDR
|
||||||
|
DwDrawStage uint32
|
||||||
|
Hdc HDC
|
||||||
|
Rc RECT
|
||||||
|
DwItemSpec uintptr
|
||||||
|
UItemState uint32
|
||||||
|
LItemlParam uintptr
|
||||||
|
}
|
||||||
|
|
||||||
|
var (
|
||||||
|
// Library
|
||||||
|
libcomctl32 uintptr
|
||||||
|
|
||||||
|
// Functions
|
||||||
|
imageList_Add uintptr
|
||||||
|
imageList_AddMasked uintptr
|
||||||
|
imageList_Create uintptr
|
||||||
|
imageList_Destroy uintptr
|
||||||
|
imageList_ReplaceIcon uintptr
|
||||||
|
initCommonControlsEx uintptr
|
||||||
|
loadIconMetric uintptr
|
||||||
|
loadIconWithScaleDown uintptr
|
||||||
|
)
|
||||||
|
|
||||||
|
func init() {
|
||||||
|
// Library
|
||||||
|
libcomctl32 = MustLoadLibrary("comctl32.dll")
|
||||||
|
|
||||||
|
// Functions
|
||||||
|
imageList_Add = MustGetProcAddress(libcomctl32, "ImageList_Add")
|
||||||
|
imageList_AddMasked = MustGetProcAddress(libcomctl32, "ImageList_AddMasked")
|
||||||
|
imageList_Create = MustGetProcAddress(libcomctl32, "ImageList_Create")
|
||||||
|
imageList_Destroy = MustGetProcAddress(libcomctl32, "ImageList_Destroy")
|
||||||
|
imageList_ReplaceIcon = MustGetProcAddress(libcomctl32, "ImageList_ReplaceIcon")
|
||||||
|
initCommonControlsEx = MustGetProcAddress(libcomctl32, "InitCommonControlsEx")
|
||||||
|
loadIconMetric = MaybeGetProcAddress(libcomctl32, "LoadIconMetric")
|
||||||
|
loadIconWithScaleDown = MaybeGetProcAddress(libcomctl32, "LoadIconWithScaleDown")
|
||||||
|
|
||||||
|
// Initialize the common controls we support
|
||||||
|
var initCtrls INITCOMMONCONTROLSEX
|
||||||
|
initCtrls.DwSize = uint32(unsafe.Sizeof(initCtrls))
|
||||||
|
initCtrls.DwICC = ICC_LINK_CLASS | ICC_LISTVIEW_CLASSES | ICC_PROGRESS_CLASS | ICC_TAB_CLASSES | ICC_TREEVIEW_CLASSES
|
||||||
|
|
||||||
|
InitCommonControlsEx(&initCtrls)
|
||||||
|
}
|
||||||
|
|
||||||
|
func ImageList_Add(himl HIMAGELIST, hbmImage, hbmMask HBITMAP) int32 {
|
||||||
|
ret, _, _ := syscall.Syscall(imageList_Add, 3,
|
||||||
|
uintptr(himl),
|
||||||
|
uintptr(hbmImage),
|
||||||
|
uintptr(hbmMask))
|
||||||
|
|
||||||
|
return int32(ret)
|
||||||
|
}
|
||||||
|
|
||||||
|
func ImageList_AddMasked(himl HIMAGELIST, hbmImage HBITMAP, crMask COLORREF) int32 {
|
||||||
|
ret, _, _ := syscall.Syscall(imageList_AddMasked, 3,
|
||||||
|
uintptr(himl),
|
||||||
|
uintptr(hbmImage),
|
||||||
|
uintptr(crMask))
|
||||||
|
|
||||||
|
return int32(ret)
|
||||||
|
}
|
||||||
|
|
||||||
|
func ImageList_Create(cx, cy int32, flags uint32, cInitial, cGrow int32) HIMAGELIST {
|
||||||
|
ret, _, _ := syscall.Syscall6(imageList_Create, 5,
|
||||||
|
uintptr(cx),
|
||||||
|
uintptr(cy),
|
||||||
|
uintptr(flags),
|
||||||
|
uintptr(cInitial),
|
||||||
|
uintptr(cGrow),
|
||||||
|
0)
|
||||||
|
|
||||||
|
return HIMAGELIST(ret)
|
||||||
|
}
|
||||||
|
|
||||||
|
func ImageList_Destroy(hIml HIMAGELIST) bool {
|
||||||
|
ret, _, _ := syscall.Syscall(imageList_Destroy, 1,
|
||||||
|
uintptr(hIml),
|
||||||
|
0,
|
||||||
|
0)
|
||||||
|
|
||||||
|
return ret != 0
|
||||||
|
}
|
||||||
|
|
||||||
|
func ImageList_ReplaceIcon(himl HIMAGELIST, i int32, hicon HICON) int32 {
|
||||||
|
ret, _, _ := syscall.Syscall(imageList_ReplaceIcon, 3,
|
||||||
|
uintptr(himl),
|
||||||
|
uintptr(i),
|
||||||
|
uintptr(hicon))
|
||||||
|
|
||||||
|
return int32(ret)
|
||||||
|
}
|
||||||
|
|
||||||
|
func InitCommonControlsEx(lpInitCtrls *INITCOMMONCONTROLSEX) bool {
|
||||||
|
ret, _, _ := syscall.Syscall(initCommonControlsEx, 1,
|
||||||
|
uintptr(unsafe.Pointer(lpInitCtrls)),
|
||||||
|
0,
|
||||||
|
0)
|
||||||
|
|
||||||
|
return ret != 0
|
||||||
|
}
|
||||||
|
|
||||||
|
func LoadIconMetric(hInstance HINSTANCE, lpIconName *uint16, lims int32, hicon *HICON) HRESULT {
|
||||||
|
ret, _, _ := syscall.Syscall6(loadIconMetric, 4,
|
||||||
|
uintptr(hInstance),
|
||||||
|
uintptr(unsafe.Pointer(lpIconName)),
|
||||||
|
uintptr(lims),
|
||||||
|
uintptr(unsafe.Pointer(hicon)),
|
||||||
|
0,
|
||||||
|
0)
|
||||||
|
|
||||||
|
return HRESULT(ret)
|
||||||
|
}
|
||||||
|
|
||||||
|
func LoadIconWithScaleDown(hInstance HINSTANCE, lpIconName *uint16, w int32, h int32, hicon *HICON) HRESULT {
|
||||||
|
ret, _, _ := syscall.Syscall6(loadIconWithScaleDown, 5,
|
||||||
|
uintptr(hInstance),
|
||||||
|
uintptr(unsafe.Pointer(lpIconName)),
|
||||||
|
uintptr(w),
|
||||||
|
uintptr(h),
|
||||||
|
uintptr(unsafe.Pointer(hicon)),
|
||||||
|
0)
|
||||||
|
|
||||||
|
return HRESULT(ret)
|
||||||
|
}
|
299
vendor/github.com/lxn/win/comdlg32.go
generated
vendored
Normal file
299
vendor/github.com/lxn/win/comdlg32.go
generated
vendored
Normal file
@ -0,0 +1,299 @@
|
|||||||
|
// Copyright 2010 The win Authors. All rights reserved.
|
||||||
|
// Use of this source code is governed by a BSD-style
|
||||||
|
// license that can be found in the LICENSE file.
|
||||||
|
|
||||||
|
// +build windows
|
||||||
|
|
||||||
|
package win
|
||||||
|
|
||||||
|
import (
|
||||||
|
"syscall"
|
||||||
|
"unsafe"
|
||||||
|
)
|
||||||
|
|
||||||
|
// Common error codes
|
||||||
|
const (
|
||||||
|
CDERR_DIALOGFAILURE = 0xFFFF
|
||||||
|
CDERR_FINDRESFAILURE = 0x0006
|
||||||
|
CDERR_INITIALIZATION = 0x0002
|
||||||
|
CDERR_LOADRESFAILURE = 0x0007
|
||||||
|
CDERR_LOADSTRFAILURE = 0x0005
|
||||||
|
CDERR_LOCKRESFAILURE = 0x0008
|
||||||
|
CDERR_MEMALLOCFAILURE = 0x0009
|
||||||
|
CDERR_MEMLOCKFAILURE = 0x000A
|
||||||
|
CDERR_NOHINSTANCE = 0x0004
|
||||||
|
CDERR_NOHOOK = 0x000B
|
||||||
|
CDERR_NOTEMPLATE = 0x0003
|
||||||
|
CDERR_REGISTERMSGFAIL = 0x000C
|
||||||
|
CDERR_STRUCTSIZE = 0x0001
|
||||||
|
)
|
||||||
|
|
||||||
|
// CHOOSECOLOR flags
|
||||||
|
const (
|
||||||
|
CC_ANYCOLOR = 0x00000100
|
||||||
|
CC_ENABLEHOOK = 0x00000010
|
||||||
|
CC_ENABLETEMPLATE = 0x00000020
|
||||||
|
CC_ENABLETEMPLATEHANDLE = 0x00000040
|
||||||
|
CC_FULLOPEN = 0x00000002
|
||||||
|
CC_PREVENTFULLOPEN = 0x00000004
|
||||||
|
CC_RGBINIT = 0x00000001
|
||||||
|
CC_SHOWHELP = 0x00000008
|
||||||
|
CC_SOLIDCOLOR = 0x00000080
|
||||||
|
)
|
||||||
|
|
||||||
|
type CHOOSECOLOR struct {
|
||||||
|
LStructSize uint32
|
||||||
|
HwndOwner HWND
|
||||||
|
HInstance HWND
|
||||||
|
RgbResult COLORREF
|
||||||
|
LpCustColors *COLORREF
|
||||||
|
Flags uint32
|
||||||
|
LCustData uintptr
|
||||||
|
LpfnHook uintptr
|
||||||
|
LpTemplateName *uint16
|
||||||
|
}
|
||||||
|
|
||||||
|
// PrintDlg specific error codes
|
||||||
|
const (
|
||||||
|
PDERR_CREATEICFAILURE = 0x100A
|
||||||
|
PDERR_DEFAULTDIFFERENT = 0x100C
|
||||||
|
PDERR_DNDMMISMATCH = 0x1009
|
||||||
|
PDERR_GETDEVMODEFAIL = 0x1005
|
||||||
|
PDERR_INITFAILURE = 0x1006
|
||||||
|
PDERR_LOADDRVFAILURE = 0x1004
|
||||||
|
PDERR_NODEFAULTPRN = 0x1008
|
||||||
|
PDERR_NODEVICES = 0x1007
|
||||||
|
PDERR_PARSEFAILURE = 0x1002
|
||||||
|
PDERR_PRINTERNOTFOUND = 0x100B
|
||||||
|
PDERR_RETDEFFAILURE = 0x1003
|
||||||
|
PDERR_SETUPFAILURE = 0x1001
|
||||||
|
)
|
||||||
|
|
||||||
|
// ChooseFont specific error codes
|
||||||
|
const (
|
||||||
|
CFERR_MAXLESSTHANMIN = 0x2002
|
||||||
|
CFERR_NOFONTS = 0x2001
|
||||||
|
)
|
||||||
|
|
||||||
|
// GetOpenFileName and GetSaveFileName specific error codes
|
||||||
|
const (
|
||||||
|
FNERR_BUFFERTOOSMALL = 0x3003
|
||||||
|
FNERR_INVALIDFILENAME = 0x3002
|
||||||
|
FNERR_SUBCLASSFAILURE = 0x3001
|
||||||
|
)
|
||||||
|
|
||||||
|
// FindText and ReplaceText specific error codes
|
||||||
|
const (
|
||||||
|
FRERR_BUFFERLENGTHZERO = 0x4001
|
||||||
|
)
|
||||||
|
|
||||||
|
// GetOpenFileName and GetSaveFileName flags
|
||||||
|
const (
|
||||||
|
OFN_ALLOWMULTISELECT = 0x00000200
|
||||||
|
OFN_CREATEPROMPT = 0x00002000
|
||||||
|
OFN_DONTADDTORECENT = 0x02000000
|
||||||
|
OFN_ENABLEHOOK = 0x00000020
|
||||||
|
OFN_ENABLEINCLUDENOTIFY = 0x00400000
|
||||||
|
OFN_ENABLESIZING = 0x00800000
|
||||||
|
OFN_ENABLETEMPLATE = 0x00000040
|
||||||
|
OFN_ENABLETEMPLATEHANDLE = 0x00000080
|
||||||
|
OFN_EXPLORER = 0x00080000
|
||||||
|
OFN_EXTENSIONDIFFERENT = 0x00000400
|
||||||
|
OFN_FILEMUSTEXIST = 0x00001000
|
||||||
|
OFN_FORCESHOWHIDDEN = 0x10000000
|
||||||
|
OFN_HIDEREADONLY = 0x00000004
|
||||||
|
OFN_LONGNAMES = 0x00200000
|
||||||
|
OFN_NOCHANGEDIR = 0x00000008
|
||||||
|
OFN_NODEREFERENCELINKS = 0x00100000
|
||||||
|
OFN_NOLONGNAMES = 0x00040000
|
||||||
|
OFN_NONETWORKBUTTON = 0x00020000
|
||||||
|
OFN_NOREADONLYRETURN = 0x00008000
|
||||||
|
OFN_NOTESTFILECREATE = 0x00010000
|
||||||
|
OFN_NOVALIDATE = 0x00000100
|
||||||
|
OFN_OVERWRITEPROMPT = 0x00000002
|
||||||
|
OFN_PATHMUSTEXIST = 0x00000800
|
||||||
|
OFN_READONLY = 0x00000001
|
||||||
|
OFN_SHAREAWARE = 0x00004000
|
||||||
|
OFN_SHOWHELP = 0x00000010
|
||||||
|
)
|
||||||
|
|
||||||
|
// GetOpenFileName and GetSaveFileName extended flags
|
||||||
|
const (
|
||||||
|
OFN_EX_NOPLACESBAR = 0x00000001
|
||||||
|
)
|
||||||
|
|
||||||
|
// PrintDlg[Ex] result actions
|
||||||
|
const (
|
||||||
|
PD_RESULT_APPLY = 2
|
||||||
|
PD_RESULT_CANCEL = 0
|
||||||
|
PD_RESULT_PRINT = 1
|
||||||
|
)
|
||||||
|
|
||||||
|
// PrintDlg[Ex] flags
|
||||||
|
const (
|
||||||
|
PD_ALLPAGES = 0x00000000
|
||||||
|
PD_COLLATE = 0x00000010
|
||||||
|
PD_CURRENTPAGE = 0x00400000
|
||||||
|
PD_DISABLEPRINTTOFILE = 0x00080000
|
||||||
|
PD_ENABLEPRINTTEMPLATE = 0x00004000
|
||||||
|
PD_ENABLEPRINTTEMPLATEHANDLE = 0x00010000
|
||||||
|
PD_EXCLUSIONFLAGS = 0x01000000
|
||||||
|
PD_HIDEPRINTTOFILE = 0x00100000
|
||||||
|
PD_NOCURRENTPAGE = 0x00800000
|
||||||
|
PD_NOPAGENUMS = 0x00000008
|
||||||
|
PD_NOSELECTION = 0x00000004
|
||||||
|
PD_NOWARNING = 0x00000080
|
||||||
|
PD_PAGENUMS = 0x00000002
|
||||||
|
PD_PRINTTOFILE = 0x00000020
|
||||||
|
PD_RETURNDC = 0x00000100
|
||||||
|
PD_RETURNDEFAULT = 0x00000400
|
||||||
|
PD_RETURNIC = 0x00000200
|
||||||
|
PD_SELECTION = 0x00000001
|
||||||
|
PD_USEDEVMODECOPIES = 0x00040000
|
||||||
|
PD_USEDEVMODECOPIESANDCOLLATE = 0x00040000
|
||||||
|
PD_USELARGETEMPLATE = 0x10000000
|
||||||
|
)
|
||||||
|
|
||||||
|
// PrintDlgEx exclusion flags
|
||||||
|
const (
|
||||||
|
PD_EXCL_COPIESANDCOLLATE = DM_COPIES | DM_COLLATE
|
||||||
|
)
|
||||||
|
|
||||||
|
const START_PAGE_GENERAL = 0xffffffff
|
||||||
|
|
||||||
|
type (
|
||||||
|
LPOFNHOOKPROC uintptr
|
||||||
|
HPROPSHEETPAGE HANDLE
|
||||||
|
LPUNKNOWN uintptr
|
||||||
|
)
|
||||||
|
|
||||||
|
type OPENFILENAME struct {
|
||||||
|
LStructSize uint32
|
||||||
|
HwndOwner HWND
|
||||||
|
HInstance HINSTANCE
|
||||||
|
LpstrFilter *uint16
|
||||||
|
LpstrCustomFilter *uint16
|
||||||
|
NMaxCustFilter uint32
|
||||||
|
NFilterIndex uint32
|
||||||
|
LpstrFile *uint16
|
||||||
|
NMaxFile uint32
|
||||||
|
LpstrFileTitle *uint16
|
||||||
|
NMaxFileTitle uint32
|
||||||
|
LpstrInitialDir *uint16
|
||||||
|
LpstrTitle *uint16
|
||||||
|
Flags uint32
|
||||||
|
NFileOffset uint16
|
||||||
|
NFileExtension uint16
|
||||||
|
LpstrDefExt *uint16
|
||||||
|
LCustData uintptr
|
||||||
|
LpfnHook LPOFNHOOKPROC
|
||||||
|
LpTemplateName *uint16
|
||||||
|
PvReserved unsafe.Pointer
|
||||||
|
DwReserved uint32
|
||||||
|
FlagsEx uint32
|
||||||
|
}
|
||||||
|
|
||||||
|
type PRINTPAGERANGE struct {
|
||||||
|
NFromPage uint32
|
||||||
|
NToPage uint32
|
||||||
|
}
|
||||||
|
|
||||||
|
type DEVNAMES struct {
|
||||||
|
WDriverOffset uint16
|
||||||
|
WDeviceOffset uint16
|
||||||
|
WOutputOffset uint16
|
||||||
|
WDefault uint16
|
||||||
|
}
|
||||||
|
|
||||||
|
type PRINTDLGEX struct {
|
||||||
|
LStructSize uint32
|
||||||
|
HwndOwner HWND
|
||||||
|
HDevMode HGLOBAL
|
||||||
|
HDevNames HGLOBAL
|
||||||
|
HDC HDC
|
||||||
|
Flags uint32
|
||||||
|
Flags2 uint32
|
||||||
|
ExclusionFlags uint32
|
||||||
|
NPageRanges uint32
|
||||||
|
NMaxPageRanges uint32
|
||||||
|
LpPageRanges *PRINTPAGERANGE
|
||||||
|
NMinPage uint32
|
||||||
|
NMaxPage uint32
|
||||||
|
NCopies uint32
|
||||||
|
HInstance HINSTANCE
|
||||||
|
LpPrintTemplateName *uint16
|
||||||
|
LpCallback LPUNKNOWN
|
||||||
|
NPropertyPages uint32
|
||||||
|
LphPropertyPages *HPROPSHEETPAGE
|
||||||
|
NStartPage uint32
|
||||||
|
DwResultAction uint32
|
||||||
|
}
|
||||||
|
|
||||||
|
var (
|
||||||
|
// Library
|
||||||
|
libcomdlg32 uintptr
|
||||||
|
|
||||||
|
// Functions
|
||||||
|
chooseColor uintptr
|
||||||
|
commDlgExtendedError uintptr
|
||||||
|
getOpenFileName uintptr
|
||||||
|
getSaveFileName uintptr
|
||||||
|
printDlgEx uintptr
|
||||||
|
)
|
||||||
|
|
||||||
|
func init() {
|
||||||
|
// Library
|
||||||
|
libcomdlg32 = MustLoadLibrary("comdlg32.dll")
|
||||||
|
|
||||||
|
// Functions
|
||||||
|
chooseColor = MustGetProcAddress(libcomdlg32, "ChooseColorW")
|
||||||
|
commDlgExtendedError = MustGetProcAddress(libcomdlg32, "CommDlgExtendedError")
|
||||||
|
getOpenFileName = MustGetProcAddress(libcomdlg32, "GetOpenFileNameW")
|
||||||
|
getSaveFileName = MustGetProcAddress(libcomdlg32, "GetSaveFileNameW")
|
||||||
|
printDlgEx = MustGetProcAddress(libcomdlg32, "PrintDlgExW")
|
||||||
|
}
|
||||||
|
|
||||||
|
func ChooseColor(lpcc *CHOOSECOLOR) bool {
|
||||||
|
ret, _, _ := syscall.Syscall(chooseColor, 1,
|
||||||
|
uintptr(unsafe.Pointer(lpcc)),
|
||||||
|
0,
|
||||||
|
0)
|
||||||
|
|
||||||
|
return ret != 0
|
||||||
|
}
|
||||||
|
|
||||||
|
func CommDlgExtendedError() uint32 {
|
||||||
|
ret, _, _ := syscall.Syscall(commDlgExtendedError, 0,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0)
|
||||||
|
|
||||||
|
return uint32(ret)
|
||||||
|
}
|
||||||
|
|
||||||
|
func GetOpenFileName(lpofn *OPENFILENAME) bool {
|
||||||
|
ret, _, _ := syscall.Syscall(getOpenFileName, 1,
|
||||||
|
uintptr(unsafe.Pointer(lpofn)),
|
||||||
|
0,
|
||||||
|
0)
|
||||||
|
|
||||||
|
return ret != 0
|
||||||
|
}
|
||||||
|
|
||||||
|
func GetSaveFileName(lpofn *OPENFILENAME) bool {
|
||||||
|
ret, _, _ := syscall.Syscall(getSaveFileName, 1,
|
||||||
|
uintptr(unsafe.Pointer(lpofn)),
|
||||||
|
0,
|
||||||
|
0)
|
||||||
|
|
||||||
|
return ret != 0
|
||||||
|
}
|
||||||
|
|
||||||
|
func PrintDlgEx(lppd *PRINTDLGEX) HRESULT {
|
||||||
|
ret, _, _ := syscall.Syscall(printDlgEx, 1,
|
||||||
|
uintptr(unsafe.Pointer(lppd)),
|
||||||
|
0,
|
||||||
|
0)
|
||||||
|
|
||||||
|
return HRESULT(ret)
|
||||||
|
}
|
96
vendor/github.com/lxn/win/datetimepicker.go
generated
vendored
Normal file
96
vendor/github.com/lxn/win/datetimepicker.go
generated
vendored
Normal file
@ -0,0 +1,96 @@
|
|||||||
|
// Copyright 2011 The win Authors. All rights reserved.
|
||||||
|
// Use of this source code is governed by a BSD-style
|
||||||
|
// license that can be found in the LICENSE file.
|
||||||
|
|
||||||
|
// +build windows
|
||||||
|
|
||||||
|
package win
|
||||||
|
|
||||||
|
const DTM_FIRST = 0x1000
|
||||||
|
const DTN_FIRST = ^uint32(739) // -740
|
||||||
|
const DTN_FIRST2 = ^uint32(752) // -753
|
||||||
|
|
||||||
|
const (
|
||||||
|
GDTR_MIN = 0x0001
|
||||||
|
GDTR_MAX = 0x0002
|
||||||
|
)
|
||||||
|
|
||||||
|
const (
|
||||||
|
GDT_ERROR = -1
|
||||||
|
GDT_VALID = 0
|
||||||
|
GDT_NONE = 1
|
||||||
|
)
|
||||||
|
|
||||||
|
// Messages
|
||||||
|
const (
|
||||||
|
DTM_GETSYSTEMTIME = DTM_FIRST + 1
|
||||||
|
DTM_SETSYSTEMTIME = DTM_FIRST + 2
|
||||||
|
DTM_GETRANGE = DTM_FIRST + 3
|
||||||
|
DTM_SETRANGE = DTM_FIRST + 4
|
||||||
|
DTM_SETFORMAT = DTM_FIRST + 50
|
||||||
|
DTM_SETMCCOLOR = DTM_FIRST + 6
|
||||||
|
DTM_GETMCCOLOR = DTM_FIRST + 7
|
||||||
|
DTM_GETMONTHCAL = DTM_FIRST + 8
|
||||||
|
DTM_SETMCFONT = DTM_FIRST + 9
|
||||||
|
DTM_GETMCFONT = DTM_FIRST + 10
|
||||||
|
)
|
||||||
|
|
||||||
|
// Styles
|
||||||
|
const (
|
||||||
|
DTS_UPDOWN = 0x0001
|
||||||
|
DTS_SHOWNONE = 0x0002
|
||||||
|
DTS_SHORTDATEFORMAT = 0x0000
|
||||||
|
DTS_LONGDATEFORMAT = 0x0004
|
||||||
|
DTS_SHORTDATECENTURYFORMAT = 0x000C
|
||||||
|
DTS_TIMEFORMAT = 0x0009
|
||||||
|
DTS_APPCANPARSE = 0x0010
|
||||||
|
DTS_RIGHTALIGN = 0x0020
|
||||||
|
)
|
||||||
|
|
||||||
|
// Notifications
|
||||||
|
const (
|
||||||
|
DTN_DATETIMECHANGE = DTN_FIRST2 - 6
|
||||||
|
DTN_USERSTRING = DTN_FIRST - 5
|
||||||
|
DTN_WMKEYDOWN = DTN_FIRST - 4
|
||||||
|
DTN_FORMAT = DTN_FIRST - 3
|
||||||
|
DTN_FORMATQUERY = DTN_FIRST - 2
|
||||||
|
DTN_DROPDOWN = DTN_FIRST2 - 1
|
||||||
|
DTN_CLOSEUP = DTN_FIRST2
|
||||||
|
)
|
||||||
|
|
||||||
|
// Structs
|
||||||
|
type (
|
||||||
|
NMDATETIMECHANGE struct {
|
||||||
|
Nmhdr NMHDR
|
||||||
|
DwFlags uint32
|
||||||
|
St SYSTEMTIME
|
||||||
|
}
|
||||||
|
|
||||||
|
NMDATETIMESTRING struct {
|
||||||
|
Nmhdr NMHDR
|
||||||
|
PszUserString *uint16
|
||||||
|
St SYSTEMTIME
|
||||||
|
DwFlags uint32
|
||||||
|
}
|
||||||
|
|
||||||
|
NMDATETIMEWMKEYDOWN struct {
|
||||||
|
Nmhdr NMHDR
|
||||||
|
NVirtKey int
|
||||||
|
PszFormat *uint16
|
||||||
|
St SYSTEMTIME
|
||||||
|
}
|
||||||
|
|
||||||
|
NMDATETIMEFORMAT struct {
|
||||||
|
Nmhdr NMHDR
|
||||||
|
PszFormat *uint16
|
||||||
|
St SYSTEMTIME
|
||||||
|
PszDisplay *uint16
|
||||||
|
SzDisplay [64]uint16
|
||||||
|
}
|
||||||
|
|
||||||
|
NMDATETIMEFORMATQUERY struct {
|
||||||
|
Nmhdr NMHDR
|
||||||
|
PszFormat *uint16
|
||||||
|
SzMax SIZE
|
||||||
|
}
|
||||||
|
)
|
84
vendor/github.com/lxn/win/edit.go
generated
vendored
Normal file
84
vendor/github.com/lxn/win/edit.go
generated
vendored
Normal file
@ -0,0 +1,84 @@
|
|||||||
|
// Copyright 2010 The win Authors. All rights reserved.
|
||||||
|
// Use of this source code is governed by a BSD-style
|
||||||
|
// license that can be found in the LICENSE file.
|
||||||
|
|
||||||
|
// +build windows
|
||||||
|
|
||||||
|
package win
|
||||||
|
|
||||||
|
// Edit styles
|
||||||
|
const (
|
||||||
|
ES_LEFT = 0x0000
|
||||||
|
ES_CENTER = 0x0001
|
||||||
|
ES_RIGHT = 0x0002
|
||||||
|
ES_MULTILINE = 0x0004
|
||||||
|
ES_UPPERCASE = 0x0008
|
||||||
|
ES_LOWERCASE = 0x0010
|
||||||
|
ES_PASSWORD = 0x0020
|
||||||
|
ES_AUTOVSCROLL = 0x0040
|
||||||
|
ES_AUTOHSCROLL = 0x0080
|
||||||
|
ES_NOHIDESEL = 0x0100
|
||||||
|
ES_OEMCONVERT = 0x0400
|
||||||
|
ES_READONLY = 0x0800
|
||||||
|
ES_WANTRETURN = 0x1000
|
||||||
|
ES_NUMBER = 0x2000
|
||||||
|
)
|
||||||
|
|
||||||
|
// Edit notifications
|
||||||
|
const (
|
||||||
|
EN_SETFOCUS = 0x0100
|
||||||
|
EN_KILLFOCUS = 0x0200
|
||||||
|
EN_CHANGE = 0x0300
|
||||||
|
EN_UPDATE = 0x0400
|
||||||
|
EN_ERRSPACE = 0x0500
|
||||||
|
EN_MAXTEXT = 0x0501
|
||||||
|
EN_HSCROLL = 0x0601
|
||||||
|
EN_VSCROLL = 0x0602
|
||||||
|
EN_ALIGN_LTR_EC = 0x0700
|
||||||
|
EN_ALIGN_RTL_EC = 0x0701
|
||||||
|
)
|
||||||
|
|
||||||
|
// Edit messages
|
||||||
|
const (
|
||||||
|
EM_GETSEL = 0x00B0
|
||||||
|
EM_SETSEL = 0x00B1
|
||||||
|
EM_GETRECT = 0x00B2
|
||||||
|
EM_SETRECT = 0x00B3
|
||||||
|
EM_SETRECTNP = 0x00B4
|
||||||
|
EM_SCROLL = 0x00B5
|
||||||
|
EM_LINESCROLL = 0x00B6
|
||||||
|
EM_SCROLLCARET = 0x00B7
|
||||||
|
EM_GETMODIFY = 0x00B8
|
||||||
|
EM_SETMODIFY = 0x00B9
|
||||||
|
EM_GETLINECOUNT = 0x00BA
|
||||||
|
EM_LINEINDEX = 0x00BB
|
||||||
|
EM_SETHANDLE = 0x00BC
|
||||||
|
EM_GETHANDLE = 0x00BD
|
||||||
|
EM_GETTHUMB = 0x00BE
|
||||||
|
EM_LINELENGTH = 0x00C1
|
||||||
|
EM_REPLACESEL = 0x00C2
|
||||||
|
EM_GETLINE = 0x00C4
|
||||||
|
EM_LIMITTEXT = 0x00C5
|
||||||
|
EM_CANUNDO = 0x00C6
|
||||||
|
EM_UNDO = 0x00C7
|
||||||
|
EM_FMTLINES = 0x00C8
|
||||||
|
EM_LINEFROMCHAR = 0x00C9
|
||||||
|
EM_SETTABSTOPS = 0x00CB
|
||||||
|
EM_SETPASSWORDCHAR = 0x00CC
|
||||||
|
EM_EMPTYUNDOBUFFER = 0x00CD
|
||||||
|
EM_GETFIRSTVISIBLELINE = 0x00CE
|
||||||
|
EM_SETREADONLY = 0x00CF
|
||||||
|
EM_SETWORDBREAKPROC = 0x00D0
|
||||||
|
EM_GETWORDBREAKPROC = 0x00D1
|
||||||
|
EM_GETPASSWORDCHAR = 0x00D2
|
||||||
|
EM_SETMARGINS = 0x00D3
|
||||||
|
EM_GETMARGINS = 0x00D4
|
||||||
|
EM_SETLIMITTEXT = EM_LIMITTEXT
|
||||||
|
EM_GETLIMITTEXT = 0x00D5
|
||||||
|
EM_POSFROMCHAR = 0x00D6
|
||||||
|
EM_CHARFROMPOS = 0x00D7
|
||||||
|
EM_SETIMESTATUS = 0x00D8
|
||||||
|
EM_GETIMESTATUS = 0x00D9
|
||||||
|
EM_SETCUEBANNER = 0x1501
|
||||||
|
EM_GETCUEBANNER = 0x1502
|
||||||
|
)
|
1935
vendor/github.com/lxn/win/gdi32.go
generated
vendored
Normal file
1935
vendor/github.com/lxn/win/gdi32.go
generated
vendored
Normal file
File diff suppressed because it is too large
Load Diff
223
vendor/github.com/lxn/win/gdiplus.go
generated
vendored
Normal file
223
vendor/github.com/lxn/win/gdiplus.go
generated
vendored
Normal file
@ -0,0 +1,223 @@
|
|||||||
|
// Copyright 2010 The win Authors. All rights reserved.
|
||||||
|
// Use of this source code is governed by a BSD-style
|
||||||
|
// license that can be found in the LICENSE file.
|
||||||
|
|
||||||
|
// +build windows
|
||||||
|
|
||||||
|
package win
|
||||||
|
|
||||||
|
import (
|
||||||
|
"syscall"
|
||||||
|
"unsafe"
|
||||||
|
)
|
||||||
|
|
||||||
|
type GpStatus int32
|
||||||
|
|
||||||
|
const (
|
||||||
|
Ok GpStatus = 0
|
||||||
|
GenericError GpStatus = 1
|
||||||
|
InvalidParameter GpStatus = 2
|
||||||
|
OutOfMemory GpStatus = 3
|
||||||
|
ObjectBusy GpStatus = 4
|
||||||
|
InsufficientBuffer GpStatus = 5
|
||||||
|
NotImplemented GpStatus = 6
|
||||||
|
Win32Error GpStatus = 7
|
||||||
|
WrongState GpStatus = 8
|
||||||
|
Aborted GpStatus = 9
|
||||||
|
FileNotFound GpStatus = 10
|
||||||
|
ValueOverflow GpStatus = 11
|
||||||
|
AccessDenied GpStatus = 12
|
||||||
|
UnknownImageFormat GpStatus = 13
|
||||||
|
FontFamilyNotFound GpStatus = 14
|
||||||
|
FontStyleNotFound GpStatus = 15
|
||||||
|
NotTrueTypeFont GpStatus = 16
|
||||||
|
UnsupportedGdiplusVersion GpStatus = 17
|
||||||
|
GdiplusNotInitialized GpStatus = 18
|
||||||
|
PropertyNotFound GpStatus = 19
|
||||||
|
PropertyNotSupported GpStatus = 20
|
||||||
|
ProfileNotFound GpStatus = 21
|
||||||
|
)
|
||||||
|
|
||||||
|
func (s GpStatus) String() string {
|
||||||
|
switch s {
|
||||||
|
case Ok:
|
||||||
|
return "Ok"
|
||||||
|
|
||||||
|
case GenericError:
|
||||||
|
return "GenericError"
|
||||||
|
|
||||||
|
case InvalidParameter:
|
||||||
|
return "InvalidParameter"
|
||||||
|
|
||||||
|
case OutOfMemory:
|
||||||
|
return "OutOfMemory"
|
||||||
|
|
||||||
|
case ObjectBusy:
|
||||||
|
return "ObjectBusy"
|
||||||
|
|
||||||
|
case InsufficientBuffer:
|
||||||
|
return "InsufficientBuffer"
|
||||||
|
|
||||||
|
case NotImplemented:
|
||||||
|
return "NotImplemented"
|
||||||
|
|
||||||
|
case Win32Error:
|
||||||
|
return "Win32Error"
|
||||||
|
|
||||||
|
case WrongState:
|
||||||
|
return "WrongState"
|
||||||
|
|
||||||
|
case Aborted:
|
||||||
|
return "Aborted"
|
||||||
|
|
||||||
|
case FileNotFound:
|
||||||
|
return "FileNotFound"
|
||||||
|
|
||||||
|
case ValueOverflow:
|
||||||
|
return "ValueOverflow"
|
||||||
|
|
||||||
|
case AccessDenied:
|
||||||
|
return "AccessDenied"
|
||||||
|
|
||||||
|
case UnknownImageFormat:
|
||||||
|
return "UnknownImageFormat"
|
||||||
|
|
||||||
|
case FontFamilyNotFound:
|
||||||
|
return "FontFamilyNotFound"
|
||||||
|
|
||||||
|
case FontStyleNotFound:
|
||||||
|
return "FontStyleNotFound"
|
||||||
|
|
||||||
|
case NotTrueTypeFont:
|
||||||
|
return "NotTrueTypeFont"
|
||||||
|
|
||||||
|
case UnsupportedGdiplusVersion:
|
||||||
|
return "UnsupportedGdiplusVersion"
|
||||||
|
|
||||||
|
case GdiplusNotInitialized:
|
||||||
|
return "GdiplusNotInitialized"
|
||||||
|
|
||||||
|
case PropertyNotFound:
|
||||||
|
return "PropertyNotFound"
|
||||||
|
|
||||||
|
case PropertyNotSupported:
|
||||||
|
return "PropertyNotSupported"
|
||||||
|
|
||||||
|
case ProfileNotFound:
|
||||||
|
return "ProfileNotFound"
|
||||||
|
}
|
||||||
|
|
||||||
|
return "Unknown Status Value"
|
||||||
|
}
|
||||||
|
|
||||||
|
type GdiplusStartupInput struct {
|
||||||
|
GdiplusVersion uint32
|
||||||
|
DebugEventCallback uintptr
|
||||||
|
SuppressBackgroundThread BOOL
|
||||||
|
SuppressExternalCodecs BOOL
|
||||||
|
}
|
||||||
|
|
||||||
|
type GdiplusStartupOutput struct {
|
||||||
|
NotificationHook uintptr
|
||||||
|
NotificationUnhook uintptr
|
||||||
|
}
|
||||||
|
|
||||||
|
type GpImage struct{}
|
||||||
|
|
||||||
|
type GpBitmap GpImage
|
||||||
|
|
||||||
|
type ARGB uint32
|
||||||
|
|
||||||
|
var (
|
||||||
|
// Library
|
||||||
|
libgdiplus uintptr
|
||||||
|
|
||||||
|
// Functions
|
||||||
|
gdipCreateBitmapFromFile uintptr
|
||||||
|
gdipCreateBitmapFromHBITMAP uintptr
|
||||||
|
gdipCreateHBITMAPFromBitmap uintptr
|
||||||
|
gdipDisposeImage uintptr
|
||||||
|
gdiplusShutdown uintptr
|
||||||
|
gdiplusStartup uintptr
|
||||||
|
)
|
||||||
|
|
||||||
|
var (
|
||||||
|
token uintptr
|
||||||
|
)
|
||||||
|
|
||||||
|
func init() {
|
||||||
|
// Library
|
||||||
|
libgdiplus = MustLoadLibrary("gdiplus.dll")
|
||||||
|
|
||||||
|
// Functions
|
||||||
|
gdipCreateBitmapFromFile = MustGetProcAddress(libgdiplus, "GdipCreateBitmapFromFile")
|
||||||
|
gdipCreateBitmapFromHBITMAP = MustGetProcAddress(libgdiplus, "GdipCreateBitmapFromHBITMAP")
|
||||||
|
gdipCreateHBITMAPFromBitmap = MustGetProcAddress(libgdiplus, "GdipCreateHBITMAPFromBitmap")
|
||||||
|
gdipDisposeImage = MustGetProcAddress(libgdiplus, "GdipDisposeImage")
|
||||||
|
gdiplusShutdown = MustGetProcAddress(libgdiplus, "GdiplusShutdown")
|
||||||
|
gdiplusStartup = MustGetProcAddress(libgdiplus, "GdiplusStartup")
|
||||||
|
}
|
||||||
|
|
||||||
|
func GdipCreateBitmapFromFile(filename *uint16, bitmap **GpBitmap) GpStatus {
|
||||||
|
ret, _, _ := syscall.Syscall(gdipCreateBitmapFromFile, 2,
|
||||||
|
uintptr(unsafe.Pointer(filename)),
|
||||||
|
uintptr(unsafe.Pointer(bitmap)),
|
||||||
|
0)
|
||||||
|
|
||||||
|
return GpStatus(ret)
|
||||||
|
}
|
||||||
|
|
||||||
|
func GdipCreateBitmapFromHBITMAP(hbm HBITMAP, hpal HPALETTE, bitmap **GpBitmap) GpStatus {
|
||||||
|
ret, _, _ := syscall.Syscall(gdipCreateBitmapFromHBITMAP, 3,
|
||||||
|
uintptr(hbm),
|
||||||
|
uintptr(hpal),
|
||||||
|
uintptr(unsafe.Pointer(bitmap)))
|
||||||
|
|
||||||
|
return GpStatus(ret)
|
||||||
|
}
|
||||||
|
|
||||||
|
func GdipCreateHBITMAPFromBitmap(bitmap *GpBitmap, hbmReturn *HBITMAP, background ARGB) GpStatus {
|
||||||
|
ret, _, _ := syscall.Syscall(gdipCreateHBITMAPFromBitmap, 3,
|
||||||
|
uintptr(unsafe.Pointer(bitmap)),
|
||||||
|
uintptr(unsafe.Pointer(hbmReturn)),
|
||||||
|
uintptr(background))
|
||||||
|
|
||||||
|
return GpStatus(ret)
|
||||||
|
}
|
||||||
|
|
||||||
|
func GdipDisposeImage(image *GpImage) GpStatus {
|
||||||
|
ret, _, _ := syscall.Syscall(gdipDisposeImage, 1,
|
||||||
|
uintptr(unsafe.Pointer(image)),
|
||||||
|
0,
|
||||||
|
0)
|
||||||
|
|
||||||
|
return GpStatus(ret)
|
||||||
|
}
|
||||||
|
|
||||||
|
func GdiplusShutdown() {
|
||||||
|
syscall.Syscall(gdiplusShutdown, 1,
|
||||||
|
token,
|
||||||
|
0,
|
||||||
|
0)
|
||||||
|
}
|
||||||
|
|
||||||
|
func GdiplusStartup(input *GdiplusStartupInput, output *GdiplusStartupOutput) GpStatus {
|
||||||
|
ret, _, _ := syscall.Syscall(gdiplusStartup, 3,
|
||||||
|
uintptr(unsafe.Pointer(&token)),
|
||||||
|
uintptr(unsafe.Pointer(input)),
|
||||||
|
uintptr(unsafe.Pointer(output)))
|
||||||
|
|
||||||
|
return GpStatus(ret)
|
||||||
|
}
|
||||||
|
|
||||||
|
/*GdipSaveImageToFile(image *GpImage, filename *uint16, clsidEncoder *CLSID, encoderParams *EncoderParameters) GpStatus {
|
||||||
|
ret, _, _ := syscall.Syscall6(gdipSaveImageToFile, 4,
|
||||||
|
uintptr(unsafe.Pointer(image)),
|
||||||
|
uintptr(unsafe.Pointer(filename)),
|
||||||
|
uintptr(unsafe.Pointer(clsidEncoder)),
|
||||||
|
uintptr(unsafe.Pointer(encoderParams)),
|
||||||
|
0,
|
||||||
|
0)
|
||||||
|
|
||||||
|
return GpStatus(ret)
|
||||||
|
}*/
|
136
vendor/github.com/lxn/win/header.go
generated
vendored
Normal file
136
vendor/github.com/lxn/win/header.go
generated
vendored
Normal file
@ -0,0 +1,136 @@
|
|||||||
|
// Copyright 2012 The win Authors. All rights reserved.
|
||||||
|
// Use of this source code is governed by a BSD-style
|
||||||
|
// license that can be found in the LICENSE file.
|
||||||
|
|
||||||
|
// +build windows
|
||||||
|
|
||||||
|
package win
|
||||||
|
|
||||||
|
const (
|
||||||
|
HDS_NOSIZING = 0x0800
|
||||||
|
)
|
||||||
|
|
||||||
|
type HDITEM struct {
|
||||||
|
Mask uint32
|
||||||
|
Cxy int32
|
||||||
|
PszText *uint16
|
||||||
|
Hbm HBITMAP
|
||||||
|
CchTextMax int32
|
||||||
|
Fmt int32
|
||||||
|
LParam uintptr
|
||||||
|
IImage int32
|
||||||
|
IOrder int32
|
||||||
|
Type uint32
|
||||||
|
PvFilter uintptr
|
||||||
|
}
|
||||||
|
|
||||||
|
type HDLAYOUT struct {
|
||||||
|
Prc *RECT
|
||||||
|
Pwpos *WINDOWPOS
|
||||||
|
}
|
||||||
|
|
||||||
|
const (
|
||||||
|
HDI_WIDTH = 0x0001
|
||||||
|
HDI_HEIGHT = HDI_WIDTH
|
||||||
|
HDI_TEXT = 0x0002
|
||||||
|
HDI_FORMAT = 0x0004
|
||||||
|
HDI_LPARAM = 0x0008
|
||||||
|
HDI_BITMAP = 0x0010
|
||||||
|
HDI_IMAGE = 0x0020
|
||||||
|
HDI_DI_SETITEM = 0x0040
|
||||||
|
HDI_ORDER = 0x0080
|
||||||
|
HDI_FILTER = 0x0100
|
||||||
|
HDI_STATE = 0x0200
|
||||||
|
)
|
||||||
|
|
||||||
|
const (
|
||||||
|
HDF_LEFT = 0x0000
|
||||||
|
HDF_RIGHT = 0x0001
|
||||||
|
HDF_CENTER = 0x0002
|
||||||
|
HDF_JUSTIFYMASK = 0x0003
|
||||||
|
HDF_RTLREADING = 0x0004
|
||||||
|
HDF_CHECKBOX = 0x0040
|
||||||
|
HDF_CHECKED = 0x0080
|
||||||
|
HDF_FIXEDWIDTH = 0x0100
|
||||||
|
HDF_SORTDOWN = 0x0200
|
||||||
|
HDF_SORTUP = 0x0400
|
||||||
|
HDF_IMAGE = 0x0800
|
||||||
|
HDF_BITMAP_ON_RIGHT = 0x1000
|
||||||
|
HDF_BITMAP = 0x2000
|
||||||
|
HDF_STRING = 0x4000
|
||||||
|
HDF_OWNERDRAW = 0x8000
|
||||||
|
HDF_SPLITBUTTON = 0x1000000
|
||||||
|
)
|
||||||
|
|
||||||
|
const (
|
||||||
|
HDIS_FOCUSED = 0x00000001
|
||||||
|
)
|
||||||
|
|
||||||
|
const (
|
||||||
|
HDM_FIRST = 0x1200
|
||||||
|
HDM_GETITEMCOUNT = HDM_FIRST + 0
|
||||||
|
HDM_DELETEITEM = HDM_FIRST + 2
|
||||||
|
HDM_LAYOUT = HDM_FIRST + 5
|
||||||
|
HDM_HITTEST = HDM_FIRST + 6
|
||||||
|
HDM_GETITEMRECT = HDM_FIRST + 7
|
||||||
|
HDM_SETIMAGELIST = HDM_FIRST + 8
|
||||||
|
HDM_GETIMAGELIST = HDM_FIRST + 9
|
||||||
|
HDM_INSERTITEM = HDM_FIRST + 10
|
||||||
|
HDM_GETITEM = HDM_FIRST + 11
|
||||||
|
HDM_SETITEM = HDM_FIRST + 12
|
||||||
|
HDM_ORDERTOINDEX = HDM_FIRST + 15
|
||||||
|
HDM_CREATEDRAGIMAGE = HDM_FIRST + 16
|
||||||
|
HDM_GETORDERARRAY = HDM_FIRST + 17
|
||||||
|
HDM_SETORDERARRAY = HDM_FIRST + 18
|
||||||
|
HDM_SETHOTDIVIDER = HDM_FIRST + 19
|
||||||
|
HDM_SETBITMAPMARGIN = HDM_FIRST + 20
|
||||||
|
HDM_GETBITMAPMARGIN = HDM_FIRST + 21
|
||||||
|
HDM_SETFILTERCHANGETIMEOUT = HDM_FIRST + 22
|
||||||
|
HDM_EDITFILTER = HDM_FIRST + 23
|
||||||
|
HDM_CLEARFILTER = HDM_FIRST + 24
|
||||||
|
HDM_GETITEMDROPDOWNRECT = HDM_FIRST + 25
|
||||||
|
HDM_GETOVERFLOWRECT = HDM_FIRST + 26
|
||||||
|
HDM_GETFOCUSEDITEM = HDM_FIRST + 27
|
||||||
|
HDM_SETFOCUSEDITEM = HDM_FIRST + 28
|
||||||
|
HDM_SETUNICODEFORMAT = CCM_SETUNICODEFORMAT
|
||||||
|
HDM_GETUNICODEFORMAT = CCM_GETUNICODEFORMAT
|
||||||
|
)
|
||||||
|
|
||||||
|
const (
|
||||||
|
HHT_NOWHERE = 0x0001
|
||||||
|
HHT_ONHEADER = 0x0002
|
||||||
|
HHT_ONDIVIDER = 0x0004
|
||||||
|
HHT_ONDIVOPEN = 0x0008
|
||||||
|
HHT_ONFILTER = 0x0010
|
||||||
|
HHT_ONFILTERBUTTON = 0x0020
|
||||||
|
HHT_ABOVE = 0x0100
|
||||||
|
HHT_BELOW = 0x0200
|
||||||
|
HHT_TORIGHT = 0x0400
|
||||||
|
HHT_TOLEFT = 0x0800
|
||||||
|
HHT_ONITEMSTATEICON = 0x1000
|
||||||
|
HHT_ONDROPDOWN = 0x2000
|
||||||
|
HHT_ONOVERFLOW = 0x4000
|
||||||
|
)
|
||||||
|
|
||||||
|
const (
|
||||||
|
HDN_FIRST = ^uint32(300)
|
||||||
|
HDN_BEGINDRAG = HDN_FIRST - 10
|
||||||
|
HDN_ENDDRAG = HDN_FIRST - 11
|
||||||
|
HDN_FILTERCHANGE = HDN_FIRST - 12
|
||||||
|
HDN_FILTERBTNCLICK = HDN_FIRST - 13
|
||||||
|
HDN_BEGINFILTEREDIT = HDN_FIRST - 14
|
||||||
|
HDN_ENDFILTEREDIT = HDN_FIRST - 15
|
||||||
|
HDN_ITEMSTATEICONCLICK = HDN_FIRST - 16
|
||||||
|
HDN_ITEMKEYDOWN = HDN_FIRST - 17
|
||||||
|
HDN_DROPDOWN = HDN_FIRST - 18
|
||||||
|
HDN_OVERFLOWCLICK = HDN_FIRST - 19
|
||||||
|
HDN_ITEMCHANGING = HDN_FIRST - 20
|
||||||
|
HDN_ITEMCHANGED = HDN_FIRST - 21
|
||||||
|
HDN_ITEMCLICK = HDN_FIRST - 22
|
||||||
|
HDN_ITEMDBLCLICK = HDN_FIRST - 23
|
||||||
|
HDN_DIVIDERDBLCLICK = HDN_FIRST - 25
|
||||||
|
HDN_BEGINTRACK = HDN_FIRST - 26
|
||||||
|
HDN_ENDTRACK = HDN_FIRST - 27
|
||||||
|
HDN_TRACK = HDN_FIRST - 28
|
||||||
|
HDN_GETDISPINFO = HDN_FIRST - 29
|
||||||
|
)
|
351
vendor/github.com/lxn/win/kernel32.go
generated
vendored
Normal file
351
vendor/github.com/lxn/win/kernel32.go
generated
vendored
Normal file
@ -0,0 +1,351 @@
|
|||||||
|
// Copyright 2010 The win Authors. All rights reserved.
|
||||||
|
// Use of this source code is governed by a BSD-style
|
||||||
|
// license that can be found in the LICENSE file.
|
||||||
|
|
||||||
|
// +build windows
|
||||||
|
|
||||||
|
package win
|
||||||
|
|
||||||
|
import (
|
||||||
|
"syscall"
|
||||||
|
"unsafe"
|
||||||
|
)
|
||||||
|
|
||||||
|
const MAX_PATH = 260
|
||||||
|
|
||||||
|
// Error codes
|
||||||
|
const (
|
||||||
|
ERROR_SUCCESS = 0
|
||||||
|
ERROR_INVALID_FUNCTION = 1
|
||||||
|
ERROR_FILE_NOT_FOUND = 2
|
||||||
|
ERROR_INVALID_PARAMETER = 87
|
||||||
|
ERROR_INSUFFICIENT_BUFFER = 122
|
||||||
|
ERROR_MORE_DATA = 234
|
||||||
|
)
|
||||||
|
|
||||||
|
// GlobalAlloc flags
|
||||||
|
const (
|
||||||
|
GHND = 0x0042
|
||||||
|
GMEM_FIXED = 0x0000
|
||||||
|
GMEM_MOVEABLE = 0x0002
|
||||||
|
GMEM_ZEROINIT = 0x0040
|
||||||
|
GPTR = 0x004
|
||||||
|
)
|
||||||
|
|
||||||
|
// Predefined locale ids
|
||||||
|
const (
|
||||||
|
LOCALE_CUSTOM_DEFAULT LCID = 0x0c00
|
||||||
|
LOCALE_CUSTOM_UI_DEFAULT LCID = 0x1400
|
||||||
|
LOCALE_CUSTOM_UNSPECIFIED LCID = 0x1000
|
||||||
|
LOCALE_INVARIANT LCID = 0x007f
|
||||||
|
LOCALE_USER_DEFAULT LCID = 0x0400
|
||||||
|
LOCALE_SYSTEM_DEFAULT LCID = 0x0800
|
||||||
|
)
|
||||||
|
|
||||||
|
// LCTYPE constants
|
||||||
|
const (
|
||||||
|
LOCALE_SDECIMAL LCTYPE = 14
|
||||||
|
LOCALE_STHOUSAND LCTYPE = 15
|
||||||
|
LOCALE_SISO3166CTRYNAME LCTYPE = 0x5a
|
||||||
|
LOCALE_SISO3166CTRYNAME2 LCTYPE = 0x68
|
||||||
|
LOCALE_SISO639LANGNAME LCTYPE = 0x59
|
||||||
|
LOCALE_SISO639LANGNAME2 LCTYPE = 0x67
|
||||||
|
)
|
||||||
|
|
||||||
|
var (
|
||||||
|
// Library
|
||||||
|
libkernel32 uintptr
|
||||||
|
|
||||||
|
// Functions
|
||||||
|
closeHandle uintptr
|
||||||
|
fileTimeToSystemTime uintptr
|
||||||
|
getConsoleTitle uintptr
|
||||||
|
getConsoleWindow uintptr
|
||||||
|
getLastError uintptr
|
||||||
|
getLocaleInfo uintptr
|
||||||
|
getLogicalDriveStrings uintptr
|
||||||
|
getModuleHandle uintptr
|
||||||
|
getNumberFormat uintptr
|
||||||
|
getPhysicallyInstalledSystemMemory uintptr
|
||||||
|
getProfileString uintptr
|
||||||
|
getThreadLocale uintptr
|
||||||
|
getThreadUILanguage uintptr
|
||||||
|
getVersion uintptr
|
||||||
|
globalAlloc uintptr
|
||||||
|
globalFree uintptr
|
||||||
|
globalLock uintptr
|
||||||
|
globalUnlock uintptr
|
||||||
|
moveMemory uintptr
|
||||||
|
mulDiv uintptr
|
||||||
|
setLastError uintptr
|
||||||
|
systemTimeToFileTime uintptr
|
||||||
|
)
|
||||||
|
|
||||||
|
type (
|
||||||
|
ATOM uint16
|
||||||
|
HANDLE uintptr
|
||||||
|
HGLOBAL HANDLE
|
||||||
|
HINSTANCE HANDLE
|
||||||
|
LCID uint32
|
||||||
|
LCTYPE uint32
|
||||||
|
LANGID uint16
|
||||||
|
)
|
||||||
|
|
||||||
|
type FILETIME struct {
|
||||||
|
DwLowDateTime uint32
|
||||||
|
DwHighDateTime uint32
|
||||||
|
}
|
||||||
|
|
||||||
|
type NUMBERFMT struct {
|
||||||
|
NumDigits uint32
|
||||||
|
LeadingZero uint32
|
||||||
|
Grouping uint32
|
||||||
|
LpDecimalSep *uint16
|
||||||
|
LpThousandSep *uint16
|
||||||
|
NegativeOrder uint32
|
||||||
|
}
|
||||||
|
|
||||||
|
type SYSTEMTIME struct {
|
||||||
|
WYear uint16
|
||||||
|
WMonth uint16
|
||||||
|
WDayOfWeek uint16
|
||||||
|
WDay uint16
|
||||||
|
WHour uint16
|
||||||
|
WMinute uint16
|
||||||
|
WSecond uint16
|
||||||
|
WMilliseconds uint16
|
||||||
|
}
|
||||||
|
|
||||||
|
func init() {
|
||||||
|
// Library
|
||||||
|
libkernel32 = MustLoadLibrary("kernel32.dll")
|
||||||
|
|
||||||
|
// Functions
|
||||||
|
closeHandle = MustGetProcAddress(libkernel32, "CloseHandle")
|
||||||
|
fileTimeToSystemTime = MustGetProcAddress(libkernel32, "FileTimeToSystemTime")
|
||||||
|
getConsoleTitle = MustGetProcAddress(libkernel32, "GetConsoleTitleW")
|
||||||
|
getConsoleWindow = MustGetProcAddress(libkernel32, "GetConsoleWindow")
|
||||||
|
getLastError = MustGetProcAddress(libkernel32, "GetLastError")
|
||||||
|
getLocaleInfo = MustGetProcAddress(libkernel32, "GetLocaleInfoW")
|
||||||
|
getLogicalDriveStrings = MustGetProcAddress(libkernel32, "GetLogicalDriveStringsW")
|
||||||
|
getModuleHandle = MustGetProcAddress(libkernel32, "GetModuleHandleW")
|
||||||
|
getNumberFormat = MustGetProcAddress(libkernel32, "GetNumberFormatW")
|
||||||
|
getPhysicallyInstalledSystemMemory, _ = syscall.GetProcAddress(syscall.Handle(libkernel32), "GetPhysicallyInstalledSystemMemory")
|
||||||
|
getProfileString = MustGetProcAddress(libkernel32, "GetProfileStringW")
|
||||||
|
getThreadLocale = MustGetProcAddress(libkernel32, "GetThreadLocale")
|
||||||
|
getThreadUILanguage, _ = syscall.GetProcAddress(syscall.Handle(libkernel32), "GetThreadUILanguage")
|
||||||
|
getVersion = MustGetProcAddress(libkernel32, "GetVersion")
|
||||||
|
globalAlloc = MustGetProcAddress(libkernel32, "GlobalAlloc")
|
||||||
|
globalFree = MustGetProcAddress(libkernel32, "GlobalFree")
|
||||||
|
globalLock = MustGetProcAddress(libkernel32, "GlobalLock")
|
||||||
|
globalUnlock = MustGetProcAddress(libkernel32, "GlobalUnlock")
|
||||||
|
moveMemory = MustGetProcAddress(libkernel32, "RtlMoveMemory")
|
||||||
|
mulDiv = MustGetProcAddress(libkernel32, "MulDiv")
|
||||||
|
setLastError = MustGetProcAddress(libkernel32, "SetLastError")
|
||||||
|
systemTimeToFileTime = MustGetProcAddress(libkernel32, "SystemTimeToFileTime")
|
||||||
|
}
|
||||||
|
|
||||||
|
func CloseHandle(hObject HANDLE) bool {
|
||||||
|
ret, _, _ := syscall.Syscall(closeHandle, 1,
|
||||||
|
uintptr(hObject),
|
||||||
|
0,
|
||||||
|
0)
|
||||||
|
|
||||||
|
return ret != 0
|
||||||
|
}
|
||||||
|
|
||||||
|
func FileTimeToSystemTime(lpFileTime *FILETIME, lpSystemTime *SYSTEMTIME) bool {
|
||||||
|
ret, _, _ := syscall.Syscall(fileTimeToSystemTime, 2,
|
||||||
|
uintptr(unsafe.Pointer(lpFileTime)),
|
||||||
|
uintptr(unsafe.Pointer(lpSystemTime)),
|
||||||
|
0)
|
||||||
|
|
||||||
|
return ret != 0
|
||||||
|
}
|
||||||
|
|
||||||
|
func GetConsoleTitle(lpConsoleTitle *uint16, nSize uint32) uint32 {
|
||||||
|
ret, _, _ := syscall.Syscall(getConsoleTitle, 2,
|
||||||
|
uintptr(unsafe.Pointer(lpConsoleTitle)),
|
||||||
|
uintptr(nSize),
|
||||||
|
0)
|
||||||
|
|
||||||
|
return uint32(ret)
|
||||||
|
}
|
||||||
|
|
||||||
|
func GetConsoleWindow() HWND {
|
||||||
|
ret, _, _ := syscall.Syscall(getConsoleWindow, 0,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0)
|
||||||
|
|
||||||
|
return HWND(ret)
|
||||||
|
}
|
||||||
|
|
||||||
|
func GetLastError() uint32 {
|
||||||
|
ret, _, _ := syscall.Syscall(getLastError, 0,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0)
|
||||||
|
|
||||||
|
return uint32(ret)
|
||||||
|
}
|
||||||
|
|
||||||
|
func GetLocaleInfo(Locale LCID, LCType LCTYPE, lpLCData *uint16, cchData int32) int32 {
|
||||||
|
ret, _, _ := syscall.Syscall6(getLocaleInfo, 4,
|
||||||
|
uintptr(Locale),
|
||||||
|
uintptr(LCType),
|
||||||
|
uintptr(unsafe.Pointer(lpLCData)),
|
||||||
|
uintptr(cchData),
|
||||||
|
0,
|
||||||
|
0)
|
||||||
|
|
||||||
|
return int32(ret)
|
||||||
|
}
|
||||||
|
|
||||||
|
func GetLogicalDriveStrings(nBufferLength uint32, lpBuffer *uint16) uint32 {
|
||||||
|
ret, _, _ := syscall.Syscall(getLogicalDriveStrings, 2,
|
||||||
|
uintptr(nBufferLength),
|
||||||
|
uintptr(unsafe.Pointer(lpBuffer)),
|
||||||
|
0)
|
||||||
|
|
||||||
|
return uint32(ret)
|
||||||
|
}
|
||||||
|
|
||||||
|
func GetModuleHandle(lpModuleName *uint16) HINSTANCE {
|
||||||
|
ret, _, _ := syscall.Syscall(getModuleHandle, 1,
|
||||||
|
uintptr(unsafe.Pointer(lpModuleName)),
|
||||||
|
0,
|
||||||
|
0)
|
||||||
|
|
||||||
|
return HINSTANCE(ret)
|
||||||
|
}
|
||||||
|
|
||||||
|
func GetNumberFormat(Locale LCID, dwFlags uint32, lpValue *uint16, lpFormat *NUMBERFMT, lpNumberStr *uint16, cchNumber int32) int32 {
|
||||||
|
ret, _, _ := syscall.Syscall6(getNumberFormat, 6,
|
||||||
|
uintptr(Locale),
|
||||||
|
uintptr(dwFlags),
|
||||||
|
uintptr(unsafe.Pointer(lpValue)),
|
||||||
|
uintptr(unsafe.Pointer(lpFormat)),
|
||||||
|
uintptr(unsafe.Pointer(lpNumberStr)),
|
||||||
|
uintptr(cchNumber))
|
||||||
|
|
||||||
|
return int32(ret)
|
||||||
|
}
|
||||||
|
|
||||||
|
func GetPhysicallyInstalledSystemMemory(totalMemoryInKilobytes *uint64) bool {
|
||||||
|
ret, _, _ := syscall.Syscall(getPhysicallyInstalledSystemMemory, 1,
|
||||||
|
uintptr(unsafe.Pointer(totalMemoryInKilobytes)),
|
||||||
|
0,
|
||||||
|
0)
|
||||||
|
|
||||||
|
return ret != 0
|
||||||
|
}
|
||||||
|
|
||||||
|
func GetProfileString(lpAppName, lpKeyName, lpDefault *uint16, lpReturnedString uintptr, nSize uint32) bool {
|
||||||
|
ret, _, _ := syscall.Syscall6(getProfileString, 5,
|
||||||
|
uintptr(unsafe.Pointer(lpAppName)),
|
||||||
|
uintptr(unsafe.Pointer(lpKeyName)),
|
||||||
|
uintptr(unsafe.Pointer(lpDefault)),
|
||||||
|
lpReturnedString,
|
||||||
|
uintptr(nSize),
|
||||||
|
0)
|
||||||
|
return ret != 0
|
||||||
|
}
|
||||||
|
|
||||||
|
func GetThreadLocale() LCID {
|
||||||
|
ret, _, _ := syscall.Syscall(getThreadLocale, 0,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0)
|
||||||
|
|
||||||
|
return LCID(ret)
|
||||||
|
}
|
||||||
|
|
||||||
|
func GetThreadUILanguage() LANGID {
|
||||||
|
if getThreadUILanguage == 0 {
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
|
||||||
|
ret, _, _ := syscall.Syscall(getThreadUILanguage, 0,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0)
|
||||||
|
|
||||||
|
return LANGID(ret)
|
||||||
|
}
|
||||||
|
|
||||||
|
func GetVersion() int64 {
|
||||||
|
ret, _, _ := syscall.Syscall(getVersion, 0,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0)
|
||||||
|
return int64(ret)
|
||||||
|
}
|
||||||
|
|
||||||
|
func GlobalAlloc(uFlags uint32, dwBytes uintptr) HGLOBAL {
|
||||||
|
ret, _, _ := syscall.Syscall(globalAlloc, 2,
|
||||||
|
uintptr(uFlags),
|
||||||
|
dwBytes,
|
||||||
|
0)
|
||||||
|
|
||||||
|
return HGLOBAL(ret)
|
||||||
|
}
|
||||||
|
|
||||||
|
func GlobalFree(hMem HGLOBAL) HGLOBAL {
|
||||||
|
ret, _, _ := syscall.Syscall(globalFree, 1,
|
||||||
|
uintptr(hMem),
|
||||||
|
0,
|
||||||
|
0)
|
||||||
|
|
||||||
|
return HGLOBAL(ret)
|
||||||
|
}
|
||||||
|
|
||||||
|
func GlobalLock(hMem HGLOBAL) unsafe.Pointer {
|
||||||
|
ret, _, _ := syscall.Syscall(globalLock, 1,
|
||||||
|
uintptr(hMem),
|
||||||
|
0,
|
||||||
|
0)
|
||||||
|
|
||||||
|
return unsafe.Pointer(ret)
|
||||||
|
}
|
||||||
|
|
||||||
|
func GlobalUnlock(hMem HGLOBAL) bool {
|
||||||
|
ret, _, _ := syscall.Syscall(globalUnlock, 1,
|
||||||
|
uintptr(hMem),
|
||||||
|
0,
|
||||||
|
0)
|
||||||
|
|
||||||
|
return ret != 0
|
||||||
|
}
|
||||||
|
|
||||||
|
func MoveMemory(destination, source unsafe.Pointer, length uintptr) {
|
||||||
|
syscall.Syscall(moveMemory, 3,
|
||||||
|
uintptr(unsafe.Pointer(destination)),
|
||||||
|
uintptr(source),
|
||||||
|
uintptr(length))
|
||||||
|
}
|
||||||
|
|
||||||
|
func MulDiv(nNumber, nNumerator, nDenominator int32) int32 {
|
||||||
|
ret, _, _ := syscall.Syscall(mulDiv, 3,
|
||||||
|
uintptr(nNumber),
|
||||||
|
uintptr(nNumerator),
|
||||||
|
uintptr(nDenominator))
|
||||||
|
|
||||||
|
return int32(ret)
|
||||||
|
}
|
||||||
|
|
||||||
|
func SetLastError(dwErrorCode uint32) {
|
||||||
|
syscall.Syscall(setLastError, 1,
|
||||||
|
uintptr(dwErrorCode),
|
||||||
|
0,
|
||||||
|
0)
|
||||||
|
}
|
||||||
|
|
||||||
|
func SystemTimeToFileTime(lpSystemTime *SYSTEMTIME, lpFileTime *FILETIME) bool {
|
||||||
|
ret, _, _ := syscall.Syscall(systemTimeToFileTime, 2,
|
||||||
|
uintptr(unsafe.Pointer(lpSystemTime)),
|
||||||
|
uintptr(unsafe.Pointer(lpFileTime)),
|
||||||
|
0)
|
||||||
|
|
||||||
|
return ret != 0
|
||||||
|
}
|
87
vendor/github.com/lxn/win/listbox.go
generated
vendored
Normal file
87
vendor/github.com/lxn/win/listbox.go
generated
vendored
Normal file
@ -0,0 +1,87 @@
|
|||||||
|
// Copyright 2012 The win Authors. All rights reserved.
|
||||||
|
// Use of this source code is governed by a BSD-style
|
||||||
|
// license that can be found in the LICENSE file.
|
||||||
|
|
||||||
|
// +build windows
|
||||||
|
|
||||||
|
package win
|
||||||
|
|
||||||
|
// ListBox style
|
||||||
|
const (
|
||||||
|
LBS_NOTIFY = 0x0001
|
||||||
|
LBS_SORT = 0x0002
|
||||||
|
LBS_NOREDRAW = 0x0004
|
||||||
|
LBS_MULTIPLESEL = 0x0008
|
||||||
|
LBS_OWNERDRAWFIXED = 0x0010
|
||||||
|
LBS_OWNERDRAWVARIABLE = 0x0020
|
||||||
|
LBS_HASSTRINGS = 0x0040
|
||||||
|
LBS_USETABSTOPS = 0x0080
|
||||||
|
LBS_NOINTEGRALHEIGHT = 0x0100
|
||||||
|
LBS_MULTICOLUMN = 0x0200
|
||||||
|
LBS_WANTKEYBOARDINPUT = 0x0400
|
||||||
|
LBS_EXTENDEDSEL = 0x0800
|
||||||
|
LBS_DISABLENOSCROLL = 0x1000
|
||||||
|
LBS_NODATA = 0x2000
|
||||||
|
LBS_NOSEL = 0x4000
|
||||||
|
LBS_COMBOBOX = 0x8000
|
||||||
|
LBS_STANDARD = LBS_NOTIFY | LBS_SORT | WS_BORDER | WS_VSCROLL
|
||||||
|
)
|
||||||
|
|
||||||
|
// ListBox messages
|
||||||
|
const (
|
||||||
|
LB_ADDSTRING = 0x0180
|
||||||
|
LB_INSERTSTRING = 0x0181
|
||||||
|
LB_DELETESTRING = 0x0182
|
||||||
|
LB_SELITEMRANGEEX = 0x0183
|
||||||
|
LB_RESETCONTENT = 0x0184
|
||||||
|
LB_SETSEL = 0x0185
|
||||||
|
LB_SETCURSEL = 0x0186
|
||||||
|
LB_GETSEL = 0x0187
|
||||||
|
LB_GETCURSEL = 0x0188
|
||||||
|
LB_GETTEXT = 0x0189
|
||||||
|
LB_GETTEXTLEN = 0x018A
|
||||||
|
LB_GETCOUNT = 0x018B
|
||||||
|
LB_SELECTSTRING = 0x018C
|
||||||
|
LB_DIR = 0x018D
|
||||||
|
LB_GETTOPINDEX = 0x018E
|
||||||
|
LB_FINDSTRING = 0x018F
|
||||||
|
LB_GETSELCOUNT = 0x0190
|
||||||
|
LB_GETSELITEMS = 0x0191
|
||||||
|
LB_SETTABSTOPS = 0x0192
|
||||||
|
LB_GETHORIZONTALEXTENT = 0x0193
|
||||||
|
LB_SETHORIZONTALEXTENT = 0x0194
|
||||||
|
LB_SETCOLUMNWIDTH = 0x0195
|
||||||
|
LB_ADDFILE = 0x0196
|
||||||
|
LB_SETTOPINDEX = 0x0197
|
||||||
|
LB_GETITEMRECT = 0x0198
|
||||||
|
LB_GETITEMDATA = 0x0199
|
||||||
|
LB_SETITEMDATA = 0x019A
|
||||||
|
LB_SELITEMRANGE = 0x019B
|
||||||
|
LB_SETANCHORINDEX = 0x019C
|
||||||
|
LB_GETANCHORINDEX = 0x019D
|
||||||
|
LB_SETCARETINDEX = 0x019E
|
||||||
|
LB_GETCARETINDEX = 0x019F
|
||||||
|
LB_SETITEMHEIGHT = 0x01A0
|
||||||
|
LB_GETITEMHEIGHT = 0x01A1
|
||||||
|
LB_FINDSTRINGEXACT = 0x01A2
|
||||||
|
LB_SETLOCALE = 0x01A5
|
||||||
|
LB_GETLOCALE = 0x01A6
|
||||||
|
LB_SETCOUNT = 0x01A7
|
||||||
|
LB_INITSTORAGE = 0x01A8
|
||||||
|
LB_ITEMFROMPOINT = 0x01A9
|
||||||
|
LB_MULTIPLEADDSTRING = 0x01B1
|
||||||
|
)
|
||||||
|
|
||||||
|
//Listbox Notification Codes
|
||||||
|
const (
|
||||||
|
LBN_ERRSPACE = -2
|
||||||
|
LBN_SELCHANGE = 1
|
||||||
|
LBN_DBLCLK = 2
|
||||||
|
LBN_SELCANCEL = 3
|
||||||
|
LBN_SETFOCUS = 4
|
||||||
|
LBN_KILLFOCUS = 5
|
||||||
|
)
|
||||||
|
const (
|
||||||
|
LB_ERR = -1
|
||||||
|
LB_ERRSPACE = -2
|
||||||
|
)
|
376
vendor/github.com/lxn/win/listview.go
generated
vendored
Normal file
376
vendor/github.com/lxn/win/listview.go
generated
vendored
Normal file
@ -0,0 +1,376 @@
|
|||||||
|
// Copyright 2010 The win Authors. All rights reserved.
|
||||||
|
// Use of this source code is governed by a BSD-style
|
||||||
|
// license that can be found in the LICENSE file.
|
||||||
|
|
||||||
|
// +build windows
|
||||||
|
|
||||||
|
package win
|
||||||
|
|
||||||
|
const (
|
||||||
|
LVSCW_AUTOSIZE = ^uintptr(0)
|
||||||
|
LVSCW_AUTOSIZE_USEHEADER = ^uintptr(1)
|
||||||
|
)
|
||||||
|
|
||||||
|
// LVM_SETITEMCOUNT flags
|
||||||
|
const (
|
||||||
|
LVSICF_NOINVALIDATEALL = 0x0001
|
||||||
|
LVSICF_NOSCROLL = 0x0002
|
||||||
|
)
|
||||||
|
|
||||||
|
// ListView messages
|
||||||
|
const (
|
||||||
|
LVM_FIRST = 0x1000
|
||||||
|
LVM_SETIMAGELIST = LVM_FIRST + 3
|
||||||
|
LVM_GETITEM = LVM_FIRST + 75
|
||||||
|
LVM_SETITEM = LVM_FIRST + 76
|
||||||
|
LVM_INSERTITEM = LVM_FIRST + 77
|
||||||
|
LVM_DELETEITEM = LVM_FIRST + 8
|
||||||
|
LVM_DELETEALLITEMS = LVM_FIRST + 9
|
||||||
|
LVM_GETCALLBACKMASK = LVM_FIRST + 10
|
||||||
|
LVM_SETCALLBACKMASK = LVM_FIRST + 11
|
||||||
|
LVM_GETNEXTITEM = LVM_FIRST + 12
|
||||||
|
LVM_FINDITEM = LVM_FIRST + 83
|
||||||
|
LVM_GETITEMRECT = LVM_FIRST + 14
|
||||||
|
LVM_GETSTRINGWIDTH = LVM_FIRST + 87
|
||||||
|
LVM_HITTEST = LVM_FIRST + 18
|
||||||
|
LVM_ENSUREVISIBLE = LVM_FIRST + 19
|
||||||
|
LVM_SCROLL = LVM_FIRST + 20
|
||||||
|
LVM_REDRAWITEMS = LVM_FIRST + 21
|
||||||
|
LVM_ARRANGE = LVM_FIRST + 22
|
||||||
|
LVM_EDITLABEL = LVM_FIRST + 118
|
||||||
|
LVM_GETEDITCONTROL = LVM_FIRST + 24
|
||||||
|
LVM_GETCOLUMN = LVM_FIRST + 95
|
||||||
|
LVM_SETCOLUMN = LVM_FIRST + 96
|
||||||
|
LVM_INSERTCOLUMN = LVM_FIRST + 97
|
||||||
|
LVM_DELETECOLUMN = LVM_FIRST + 28
|
||||||
|
LVM_GETCOLUMNWIDTH = LVM_FIRST + 29
|
||||||
|
LVM_SETCOLUMNWIDTH = LVM_FIRST + 30
|
||||||
|
LVM_GETHEADER = LVM_FIRST + 31
|
||||||
|
LVM_CREATEDRAGIMAGE = LVM_FIRST + 33
|
||||||
|
LVM_GETVIEWRECT = LVM_FIRST + 34
|
||||||
|
LVM_GETTEXTCOLOR = LVM_FIRST + 35
|
||||||
|
LVM_SETTEXTCOLOR = LVM_FIRST + 36
|
||||||
|
LVM_GETTEXTBKCOLOR = LVM_FIRST + 37
|
||||||
|
LVM_SETTEXTBKCOLOR = LVM_FIRST + 38
|
||||||
|
LVM_GETTOPINDEX = LVM_FIRST + 39
|
||||||
|
LVM_GETCOUNTPERPAGE = LVM_FIRST + 40
|
||||||
|
LVM_GETORIGIN = LVM_FIRST + 41
|
||||||
|
LVM_UPDATE = LVM_FIRST + 42
|
||||||
|
LVM_SETITEMSTATE = LVM_FIRST + 43
|
||||||
|
LVM_GETITEMSTATE = LVM_FIRST + 44
|
||||||
|
LVM_GETITEMTEXT = LVM_FIRST + 115
|
||||||
|
LVM_SETITEMTEXT = LVM_FIRST + 116
|
||||||
|
LVM_SETITEMCOUNT = LVM_FIRST + 47
|
||||||
|
LVM_SORTITEMS = LVM_FIRST + 48
|
||||||
|
LVM_SETITEMPOSITION32 = LVM_FIRST + 49
|
||||||
|
LVM_GETSELECTEDCOUNT = LVM_FIRST + 50
|
||||||
|
LVM_GETITEMSPACING = LVM_FIRST + 51
|
||||||
|
LVM_GETISEARCHSTRING = LVM_FIRST + 117
|
||||||
|
LVM_SETICONSPACING = LVM_FIRST + 53
|
||||||
|
LVM_SETEXTENDEDLISTVIEWSTYLE = LVM_FIRST + 54
|
||||||
|
LVM_GETEXTENDEDLISTVIEWSTYLE = LVM_FIRST + 55
|
||||||
|
LVM_GETSUBITEMRECT = LVM_FIRST + 56
|
||||||
|
LVM_SUBITEMHITTEST = LVM_FIRST + 57
|
||||||
|
LVM_SETCOLUMNORDERARRAY = LVM_FIRST + 58
|
||||||
|
LVM_GETCOLUMNORDERARRAY = LVM_FIRST + 59
|
||||||
|
LVM_SETHOTITEM = LVM_FIRST + 60
|
||||||
|
LVM_GETHOTITEM = LVM_FIRST + 61
|
||||||
|
LVM_SETHOTCURSOR = LVM_FIRST + 62
|
||||||
|
LVM_GETHOTCURSOR = LVM_FIRST + 63
|
||||||
|
LVM_APPROXIMATEVIEWRECT = LVM_FIRST + 64
|
||||||
|
LVM_SETWORKAREAS = LVM_FIRST + 65
|
||||||
|
LVM_GETWORKAREAS = LVM_FIRST + 70
|
||||||
|
LVM_GETNUMBEROFWORKAREAS = LVM_FIRST + 73
|
||||||
|
LVM_GETSELECTIONMARK = LVM_FIRST + 66
|
||||||
|
LVM_SETSELECTIONMARK = LVM_FIRST + 67
|
||||||
|
LVM_SETHOVERTIME = LVM_FIRST + 71
|
||||||
|
LVM_GETHOVERTIME = LVM_FIRST + 72
|
||||||
|
LVM_SETTOOLTIPS = LVM_FIRST + 74
|
||||||
|
LVM_GETTOOLTIPS = LVM_FIRST + 78
|
||||||
|
LVM_SORTITEMSEX = LVM_FIRST + 81
|
||||||
|
LVM_SETBKIMAGE = LVM_FIRST + 138
|
||||||
|
LVM_GETBKIMAGE = LVM_FIRST + 139
|
||||||
|
LVM_SETSELECTEDCOLUMN = LVM_FIRST + 140
|
||||||
|
LVM_SETVIEW = LVM_FIRST + 142
|
||||||
|
LVM_GETVIEW = LVM_FIRST + 143
|
||||||
|
LVM_INSERTGROUP = LVM_FIRST + 145
|
||||||
|
LVM_SETGROUPINFO = LVM_FIRST + 147
|
||||||
|
LVM_GETGROUPINFO = LVM_FIRST + 149
|
||||||
|
LVM_REMOVEGROUP = LVM_FIRST + 150
|
||||||
|
LVM_MOVEGROUP = LVM_FIRST + 151
|
||||||
|
LVM_GETGROUPCOUNT = LVM_FIRST + 152
|
||||||
|
LVM_GETGROUPINFOBYINDEX = LVM_FIRST + 153
|
||||||
|
LVM_MOVEITEMTOGROUP = LVM_FIRST + 154
|
||||||
|
LVM_GETGROUPRECT = LVM_FIRST + 98
|
||||||
|
LVM_SETGROUPMETRICS = LVM_FIRST + 155
|
||||||
|
LVM_GETGROUPMETRICS = LVM_FIRST + 156
|
||||||
|
LVM_ENABLEGROUPVIEW = LVM_FIRST + 157
|
||||||
|
LVM_SORTGROUPS = LVM_FIRST + 158
|
||||||
|
LVM_INSERTGROUPSORTED = LVM_FIRST + 159
|
||||||
|
LVM_REMOVEALLGROUPS = LVM_FIRST + 160
|
||||||
|
LVM_HASGROUP = LVM_FIRST + 161
|
||||||
|
LVM_GETGROUPSTATE = LVM_FIRST + 92
|
||||||
|
LVM_GETFOCUSEDGROUP = LVM_FIRST + 93
|
||||||
|
LVM_SETTILEVIEWINFO = LVM_FIRST + 162
|
||||||
|
LVM_GETTILEVIEWINFO = LVM_FIRST + 163
|
||||||
|
LVM_SETTILEINFO = LVM_FIRST + 164
|
||||||
|
LVM_GETTILEINFO = LVM_FIRST + 165
|
||||||
|
LVM_SETINSERTMARK = LVM_FIRST + 166
|
||||||
|
LVM_GETINSERTMARK = LVM_FIRST + 167
|
||||||
|
LVM_INSERTMARKHITTEST = LVM_FIRST + 168
|
||||||
|
LVM_GETINSERTMARKRECT = LVM_FIRST + 169
|
||||||
|
LVM_SETINSERTMARKCOLOR = LVM_FIRST + 170
|
||||||
|
LVM_GETINSERTMARKCOLOR = LVM_FIRST + 171
|
||||||
|
LVM_SETINFOTIP = LVM_FIRST + 173
|
||||||
|
LVM_GETSELECTEDCOLUMN = LVM_FIRST + 174
|
||||||
|
LVM_ISGROUPVIEWENABLED = LVM_FIRST + 175
|
||||||
|
LVM_GETOUTLINECOLOR = LVM_FIRST + 176
|
||||||
|
LVM_SETOUTLINECOLOR = LVM_FIRST + 177
|
||||||
|
LVM_CANCELEDITLABEL = LVM_FIRST + 179
|
||||||
|
LVM_MAPINDEXTOID = LVM_FIRST + 180
|
||||||
|
LVM_MAPIDTOINDEX = LVM_FIRST + 181
|
||||||
|
LVM_ISITEMVISIBLE = LVM_FIRST + 182
|
||||||
|
LVM_GETNEXTITEMINDEX = LVM_FIRST + 211
|
||||||
|
)
|
||||||
|
|
||||||
|
// ListView notifications
|
||||||
|
const (
|
||||||
|
LVN_FIRST = ^uint32(99) // -100
|
||||||
|
|
||||||
|
LVN_ITEMCHANGING = LVN_FIRST - 0
|
||||||
|
LVN_ITEMCHANGED = LVN_FIRST - 1
|
||||||
|
LVN_INSERTITEM = LVN_FIRST - 2
|
||||||
|
LVN_DELETEITEM = LVN_FIRST - 3
|
||||||
|
LVN_DELETEALLITEMS = LVN_FIRST - 4
|
||||||
|
LVN_BEGINLABELEDIT = LVN_FIRST - 75
|
||||||
|
LVN_ENDLABELEDIT = LVN_FIRST - 76
|
||||||
|
LVN_COLUMNCLICK = LVN_FIRST - 8
|
||||||
|
LVN_BEGINDRAG = LVN_FIRST - 9
|
||||||
|
LVN_BEGINRDRAG = LVN_FIRST - 11
|
||||||
|
LVN_ODCACHEHINT = LVN_FIRST - 13
|
||||||
|
LVN_ODFINDITEM = LVN_FIRST - 79
|
||||||
|
LVN_ITEMACTIVATE = LVN_FIRST - 14
|
||||||
|
LVN_ODSTATECHANGED = LVN_FIRST - 15
|
||||||
|
LVN_HOTTRACK = LVN_FIRST - 21
|
||||||
|
LVN_GETDISPINFO = LVN_FIRST - 77
|
||||||
|
LVN_SETDISPINFO = LVN_FIRST - 78
|
||||||
|
LVN_KEYDOWN = LVN_FIRST - 55
|
||||||
|
LVN_MARQUEEBEGIN = LVN_FIRST - 56
|
||||||
|
LVN_GETINFOTIP = LVN_FIRST - 58
|
||||||
|
LVN_INCREMENTALSEARCH = LVN_FIRST - 63
|
||||||
|
LVN_BEGINSCROLL = LVN_FIRST - 80
|
||||||
|
LVN_ENDSCROLL = LVN_FIRST - 81
|
||||||
|
)
|
||||||
|
|
||||||
|
// ListView LVNI constants
|
||||||
|
const (
|
||||||
|
LVNI_ALL = 0
|
||||||
|
LVNI_FOCUSED = 1
|
||||||
|
LVNI_SELECTED = 2
|
||||||
|
LVNI_CUT = 4
|
||||||
|
LVNI_DROPHILITED = 8
|
||||||
|
LVNI_ABOVE = 256
|
||||||
|
LVNI_BELOW = 512
|
||||||
|
LVNI_TOLEFT = 1024
|
||||||
|
LVNI_TORIGHT = 2048
|
||||||
|
)
|
||||||
|
|
||||||
|
// ListView styles
|
||||||
|
const (
|
||||||
|
LVS_ICON = 0x0000
|
||||||
|
LVS_REPORT = 0x0001
|
||||||
|
LVS_SMALLICON = 0x0002
|
||||||
|
LVS_LIST = 0x0003
|
||||||
|
LVS_TYPEMASK = 0x0003
|
||||||
|
LVS_SINGLESEL = 0x0004
|
||||||
|
LVS_SHOWSELALWAYS = 0x0008
|
||||||
|
LVS_SORTASCENDING = 0x0010
|
||||||
|
LVS_SORTDESCENDING = 0x0020
|
||||||
|
LVS_SHAREIMAGELISTS = 0x0040
|
||||||
|
LVS_NOLABELWRAP = 0x0080
|
||||||
|
LVS_AUTOARRANGE = 0x0100
|
||||||
|
LVS_EDITLABELS = 0x0200
|
||||||
|
LVS_OWNERDATA = 0x1000
|
||||||
|
LVS_NOSCROLL = 0x2000
|
||||||
|
LVS_TYPESTYLEMASK = 0xfc00
|
||||||
|
LVS_ALIGNTOP = 0x0000
|
||||||
|
LVS_ALIGNLEFT = 0x0800
|
||||||
|
LVS_ALIGNMASK = 0x0c00
|
||||||
|
LVS_OWNERDRAWFIXED = 0x0400
|
||||||
|
LVS_NOCOLUMNHEADER = 0x4000
|
||||||
|
LVS_NOSORTHEADER = 0x8000
|
||||||
|
)
|
||||||
|
|
||||||
|
// ListView extended styles
|
||||||
|
const (
|
||||||
|
LVS_EX_GRIDLINES = 0x00000001
|
||||||
|
LVS_EX_SUBITEMIMAGES = 0x00000002
|
||||||
|
LVS_EX_CHECKBOXES = 0x00000004
|
||||||
|
LVS_EX_TRACKSELECT = 0x00000008
|
||||||
|
LVS_EX_HEADERDRAGDROP = 0x00000010
|
||||||
|
LVS_EX_FULLROWSELECT = 0x00000020
|
||||||
|
LVS_EX_ONECLICKACTIVATE = 0x00000040
|
||||||
|
LVS_EX_TWOCLICKACTIVATE = 0x00000080
|
||||||
|
LVS_EX_FLATSB = 0x00000100
|
||||||
|
LVS_EX_REGIONAL = 0x00000200
|
||||||
|
LVS_EX_INFOTIP = 0x00000400
|
||||||
|
LVS_EX_UNDERLINEHOT = 0x00000800
|
||||||
|
LVS_EX_UNDERLINECOLD = 0x00001000
|
||||||
|
LVS_EX_MULTIWORKAREAS = 0x00002000
|
||||||
|
LVS_EX_LABELTIP = 0x00004000
|
||||||
|
LVS_EX_BORDERSELECT = 0x00008000
|
||||||
|
LVS_EX_DOUBLEBUFFER = 0x00010000
|
||||||
|
LVS_EX_HIDELABELS = 0x00020000
|
||||||
|
LVS_EX_SINGLEROW = 0x00040000
|
||||||
|
LVS_EX_SNAPTOGRID = 0x00080000
|
||||||
|
LVS_EX_SIMPLESELECT = 0x00100000
|
||||||
|
)
|
||||||
|
|
||||||
|
// ListView column flags
|
||||||
|
const (
|
||||||
|
LVCF_FMT = 0x0001
|
||||||
|
LVCF_WIDTH = 0x0002
|
||||||
|
LVCF_TEXT = 0x0004
|
||||||
|
LVCF_SUBITEM = 0x0008
|
||||||
|
LVCF_IMAGE = 0x0010
|
||||||
|
LVCF_ORDER = 0x0020
|
||||||
|
)
|
||||||
|
|
||||||
|
// ListView column format constants
|
||||||
|
const (
|
||||||
|
LVCFMT_LEFT = 0x0000
|
||||||
|
LVCFMT_RIGHT = 0x0001
|
||||||
|
LVCFMT_CENTER = 0x0002
|
||||||
|
LVCFMT_JUSTIFYMASK = 0x0003
|
||||||
|
LVCFMT_IMAGE = 0x0800
|
||||||
|
LVCFMT_BITMAP_ON_RIGHT = 0x1000
|
||||||
|
LVCFMT_COL_HAS_IMAGES = 0x8000
|
||||||
|
)
|
||||||
|
|
||||||
|
// ListView item flags
|
||||||
|
const (
|
||||||
|
LVIF_TEXT = 0x00000001
|
||||||
|
LVIF_IMAGE = 0x00000002
|
||||||
|
LVIF_PARAM = 0x00000004
|
||||||
|
LVIF_STATE = 0x00000008
|
||||||
|
LVIF_INDENT = 0x00000010
|
||||||
|
LVIF_NORECOMPUTE = 0x00000800
|
||||||
|
LVIF_GROUPID = 0x00000100
|
||||||
|
LVIF_COLUMNS = 0x00000200
|
||||||
|
)
|
||||||
|
|
||||||
|
// ListView item states
|
||||||
|
const (
|
||||||
|
LVIS_FOCUSED = 1
|
||||||
|
LVIS_SELECTED = 2
|
||||||
|
LVIS_CUT = 4
|
||||||
|
LVIS_DROPHILITED = 8
|
||||||
|
LVIS_OVERLAYMASK = 0xF00
|
||||||
|
LVIS_STATEIMAGEMASK = 0xF000
|
||||||
|
)
|
||||||
|
|
||||||
|
// ListView hit test constants
|
||||||
|
const (
|
||||||
|
LVHT_NOWHERE = 0x00000001
|
||||||
|
LVHT_ONITEMICON = 0x00000002
|
||||||
|
LVHT_ONITEMLABEL = 0x00000004
|
||||||
|
LVHT_ONITEMSTATEICON = 0x00000008
|
||||||
|
LVHT_ONITEM = LVHT_ONITEMICON | LVHT_ONITEMLABEL | LVHT_ONITEMSTATEICON
|
||||||
|
|
||||||
|
LVHT_ABOVE = 0x00000008
|
||||||
|
LVHT_BELOW = 0x00000010
|
||||||
|
LVHT_TORIGHT = 0x00000020
|
||||||
|
LVHT_TOLEFT = 0x00000040
|
||||||
|
)
|
||||||
|
|
||||||
|
// ListView image list types
|
||||||
|
const (
|
||||||
|
LVSIL_NORMAL = 0
|
||||||
|
LVSIL_SMALL = 1
|
||||||
|
LVSIL_STATE = 2
|
||||||
|
LVSIL_GROUPHEADER = 3
|
||||||
|
)
|
||||||
|
|
||||||
|
type LVCOLUMN struct {
|
||||||
|
Mask uint32
|
||||||
|
Fmt int32
|
||||||
|
Cx int32
|
||||||
|
PszText *uint16
|
||||||
|
CchTextMax int32
|
||||||
|
ISubItem int32
|
||||||
|
IImage int32
|
||||||
|
IOrder int32
|
||||||
|
}
|
||||||
|
|
||||||
|
type LVITEM struct {
|
||||||
|
Mask uint32
|
||||||
|
IItem int32
|
||||||
|
ISubItem int32
|
||||||
|
State uint32
|
||||||
|
StateMask uint32
|
||||||
|
PszText *uint16
|
||||||
|
CchTextMax int32
|
||||||
|
IImage int32
|
||||||
|
LParam uintptr
|
||||||
|
IIndent int32
|
||||||
|
IGroupId int32
|
||||||
|
CColumns uint32
|
||||||
|
PuColumns uint32
|
||||||
|
}
|
||||||
|
|
||||||
|
type LVHITTESTINFO struct {
|
||||||
|
Pt POINT
|
||||||
|
Flags uint32
|
||||||
|
IItem int32
|
||||||
|
ISubItem int32
|
||||||
|
IGroup int32
|
||||||
|
}
|
||||||
|
|
||||||
|
type NMITEMACTIVATE struct {
|
||||||
|
Hdr NMHDR
|
||||||
|
IItem int32
|
||||||
|
ISubItem int32
|
||||||
|
UNewState uint32
|
||||||
|
UOldState uint32
|
||||||
|
UChanged uint32
|
||||||
|
PtAction POINT
|
||||||
|
LParam uintptr
|
||||||
|
UKeyFlags uint32
|
||||||
|
}
|
||||||
|
|
||||||
|
type NMLISTVIEW struct {
|
||||||
|
Hdr NMHDR
|
||||||
|
IItem int32
|
||||||
|
ISubItem int32
|
||||||
|
UNewState uint32
|
||||||
|
UOldState uint32
|
||||||
|
UChanged uint32
|
||||||
|
PtAction POINT
|
||||||
|
LParam uintptr
|
||||||
|
}
|
||||||
|
|
||||||
|
type NMLVCUSTOMDRAW struct {
|
||||||
|
Nmcd NMCUSTOMDRAW
|
||||||
|
ClrText COLORREF
|
||||||
|
ClrTextBk COLORREF
|
||||||
|
ISubItem int32
|
||||||
|
DwItemType uint32
|
||||||
|
ClrFace COLORREF
|
||||||
|
IIconEffect int32
|
||||||
|
IIconPhase int32
|
||||||
|
IPartId int32
|
||||||
|
IStateId int32
|
||||||
|
RcText RECT
|
||||||
|
UAlign uint32
|
||||||
|
}
|
||||||
|
|
||||||
|
type NMLVDISPINFO struct {
|
||||||
|
Hdr NMHDR
|
||||||
|
Item LVITEM
|
||||||
|
}
|
||||||
|
|
||||||
|
type NMLVSCROLL struct {
|
||||||
|
Hdr NMHDR
|
||||||
|
Dx int32
|
||||||
|
Dy int32
|
||||||
|
}
|
110
vendor/github.com/lxn/win/menu.go
generated
vendored
Normal file
110
vendor/github.com/lxn/win/menu.go
generated
vendored
Normal file
@ -0,0 +1,110 @@
|
|||||||
|
// Copyright 2010 The win Authors. All rights reserved.
|
||||||
|
// Use of this source code is governed by a BSD-style
|
||||||
|
// license that can be found in the LICENSE file.
|
||||||
|
|
||||||
|
// +build windows
|
||||||
|
|
||||||
|
package win
|
||||||
|
|
||||||
|
// Constants for MENUITEMINFO.fMask
|
||||||
|
const (
|
||||||
|
MIIM_STATE = 1
|
||||||
|
MIIM_ID = 2
|
||||||
|
MIIM_SUBMENU = 4
|
||||||
|
MIIM_CHECKMARKS = 8
|
||||||
|
MIIM_TYPE = 16
|
||||||
|
MIIM_DATA = 32
|
||||||
|
MIIM_STRING = 64
|
||||||
|
MIIM_BITMAP = 128
|
||||||
|
MIIM_FTYPE = 256
|
||||||
|
)
|
||||||
|
|
||||||
|
// Constants for MENUITEMINFO.fType
|
||||||
|
const (
|
||||||
|
MFT_BITMAP = 4
|
||||||
|
MFT_MENUBARBREAK = 32
|
||||||
|
MFT_MENUBREAK = 64
|
||||||
|
MFT_OWNERDRAW = 256
|
||||||
|
MFT_RADIOCHECK = 512
|
||||||
|
MFT_RIGHTJUSTIFY = 0x4000
|
||||||
|
MFT_SEPARATOR = 0x800
|
||||||
|
MFT_RIGHTORDER = 0x2000
|
||||||
|
MFT_STRING = 0
|
||||||
|
)
|
||||||
|
|
||||||
|
// Constants for MENUITEMINFO.fState
|
||||||
|
const (
|
||||||
|
MFS_CHECKED = 8
|
||||||
|
MFS_DEFAULT = 4096
|
||||||
|
MFS_DISABLED = 3
|
||||||
|
MFS_ENABLED = 0
|
||||||
|
MFS_GRAYED = 3
|
||||||
|
MFS_HILITE = 128
|
||||||
|
MFS_UNCHECKED = 0
|
||||||
|
MFS_UNHILITE = 0
|
||||||
|
)
|
||||||
|
|
||||||
|
// Constants for MENUITEMINFO.hbmp*
|
||||||
|
const (
|
||||||
|
HBMMENU_CALLBACK = -1
|
||||||
|
HBMMENU_SYSTEM = 1
|
||||||
|
HBMMENU_MBAR_RESTORE = 2
|
||||||
|
HBMMENU_MBAR_MINIMIZE = 3
|
||||||
|
HBMMENU_MBAR_CLOSE = 5
|
||||||
|
HBMMENU_MBAR_CLOSE_D = 6
|
||||||
|
HBMMENU_MBAR_MINIMIZE_D = 7
|
||||||
|
HBMMENU_POPUP_CLOSE = 8
|
||||||
|
HBMMENU_POPUP_RESTORE = 9
|
||||||
|
HBMMENU_POPUP_MAXIMIZE = 10
|
||||||
|
HBMMENU_POPUP_MINIMIZE = 11
|
||||||
|
)
|
||||||
|
|
||||||
|
// MENUINFO mask constants
|
||||||
|
const (
|
||||||
|
MIM_APPLYTOSUBMENUS = 0x80000000
|
||||||
|
MIM_BACKGROUND = 0x00000002
|
||||||
|
MIM_HELPID = 0x00000004
|
||||||
|
MIM_MAXHEIGHT = 0x00000001
|
||||||
|
MIM_MENUDATA = 0x00000008
|
||||||
|
MIM_STYLE = 0x00000010
|
||||||
|
)
|
||||||
|
|
||||||
|
// MENUINFO style constants
|
||||||
|
const (
|
||||||
|
MNS_AUTODISMISS = 0x10000000
|
||||||
|
MNS_CHECKORBMP = 0x04000000
|
||||||
|
MNS_DRAGDROP = 0x20000000
|
||||||
|
MNS_MODELESS = 0x40000000
|
||||||
|
MNS_NOCHECK = 0x80000000
|
||||||
|
MNS_NOTIFYBYPOS = 0x08000000
|
||||||
|
)
|
||||||
|
|
||||||
|
const (
|
||||||
|
MF_BYCOMMAND = 0x00000000
|
||||||
|
MF_BYPOSITION = 0x00000400
|
||||||
|
)
|
||||||
|
|
||||||
|
type MENUITEMINFO struct {
|
||||||
|
CbSize uint32
|
||||||
|
FMask uint32
|
||||||
|
FType uint32
|
||||||
|
FState uint32
|
||||||
|
WID uint32
|
||||||
|
HSubMenu HMENU
|
||||||
|
HbmpChecked HBITMAP
|
||||||
|
HbmpUnchecked HBITMAP
|
||||||
|
DwItemData uintptr
|
||||||
|
DwTypeData *uint16
|
||||||
|
Cch uint32
|
||||||
|
HbmpItem HBITMAP
|
||||||
|
}
|
||||||
|
|
||||||
|
type MENUINFO struct {
|
||||||
|
CbSize uint32
|
||||||
|
FMask uint32
|
||||||
|
DwStyle uint32
|
||||||
|
CyMax uint32
|
||||||
|
HbrBack HBRUSH
|
||||||
|
DwContextHelpID uint32
|
||||||
|
DwMenuData uintptr
|
||||||
|
}
|
500
vendor/github.com/lxn/win/ole32.go
generated
vendored
Normal file
500
vendor/github.com/lxn/win/ole32.go
generated
vendored
Normal file
@ -0,0 +1,500 @@
|
|||||||
|
// Copyright 2010 The win Authors. All rights reserved.
|
||||||
|
// Use of this source code is governed by a BSD-style
|
||||||
|
// license that can be found in the LICENSE file.
|
||||||
|
|
||||||
|
// +build windows
|
||||||
|
|
||||||
|
package win
|
||||||
|
|
||||||
|
import (
|
||||||
|
"syscall"
|
||||||
|
"unsafe"
|
||||||
|
)
|
||||||
|
|
||||||
|
const (
|
||||||
|
CLSCTX_INPROC_SERVER = 0x1
|
||||||
|
CLSCTX_INPROC_HANDLER = 0x2
|
||||||
|
CLSCTX_LOCAL_SERVER = 0x4
|
||||||
|
CLSCTX_INPROC_SERVER16 = 0x8
|
||||||
|
CLSCTX_REMOTE_SERVER = 0x10
|
||||||
|
CLSCTX_INPROC_HANDLER16 = 0x20
|
||||||
|
CLSCTX_RESERVED1 = 0x40
|
||||||
|
CLSCTX_RESERVED2 = 0x80
|
||||||
|
CLSCTX_RESERVED3 = 0x100
|
||||||
|
CLSCTX_RESERVED4 = 0x200
|
||||||
|
CLSCTX_NO_CODE_DOWNLOAD = 0x400
|
||||||
|
CLSCTX_RESERVED5 = 0x800
|
||||||
|
CLSCTX_NO_CUSTOM_MARSHAL = 0x1000
|
||||||
|
CLSCTX_ENABLE_CODE_DOWNLOAD = 0x2000
|
||||||
|
CLSCTX_NO_FAILURE_LOG = 0x4000
|
||||||
|
CLSCTX_DISABLE_AAA = 0x8000
|
||||||
|
CLSCTX_ENABLE_AAA = 0x10000
|
||||||
|
CLSCTX_FROM_DEFAULT_CONTEXT = 0x20000
|
||||||
|
CLSCTX_ACTIVATE_32_BIT_SERVER = 0x40000
|
||||||
|
CLSCTX_ACTIVATE_64_BIT_SERVER = 0x80000
|
||||||
|
CLSCTX_ENABLE_CLOAKING = 0x100000
|
||||||
|
CLSCTX_PS_DLL = 0x80000000
|
||||||
|
CLSCTX_ALL = CLSCTX_INPROC_SERVER | CLSCTX_INPROC_HANDLER | CLSCTX_LOCAL_SERVER | CLSCTX_REMOTE_SERVER
|
||||||
|
)
|
||||||
|
|
||||||
|
// Verbs for IOleObject.DoVerb
|
||||||
|
const (
|
||||||
|
OLEIVERB_PRIMARY = 0
|
||||||
|
OLEIVERB_SHOW = -1
|
||||||
|
OLEIVERB_OPEN = -2
|
||||||
|
OLEIVERB_HIDE = -3
|
||||||
|
OLEIVERB_UIACTIVATE = -4
|
||||||
|
OLEIVERB_INPLACEACTIVATE = -5
|
||||||
|
OLEIVERB_DISCARDUNDOSTATE = -6
|
||||||
|
)
|
||||||
|
|
||||||
|
// OLECLOSE constants
|
||||||
|
const (
|
||||||
|
OLECLOSE_SAVEIFDIRTY = 0
|
||||||
|
OLECLOSE_NOSAVE = 1
|
||||||
|
OLECLOSE_PROMPTSAVE = 2
|
||||||
|
)
|
||||||
|
|
||||||
|
type IID syscall.GUID
|
||||||
|
type CLSID syscall.GUID
|
||||||
|
type REFIID *IID
|
||||||
|
type REFCLSID *CLSID
|
||||||
|
|
||||||
|
var (
|
||||||
|
IID_IClassFactory = IID{0x00000001, 0x0000, 0x0000, [8]byte{0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46}}
|
||||||
|
IID_IConnectionPointContainer = IID{0xB196B284, 0xBAB4, 0x101A, [8]byte{0xB6, 0x9C, 0x00, 0xAA, 0x00, 0x34, 0x1D, 0x07}}
|
||||||
|
IID_IOleClientSite = IID{0x00000118, 0x0000, 0x0000, [8]byte{0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46}}
|
||||||
|
IID_IOleInPlaceObject = IID{0x00000113, 0x0000, 0x0000, [8]byte{0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46}}
|
||||||
|
IID_IOleInPlaceSite = IID{0x00000119, 0x0000, 0x0000, [8]byte{0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46}}
|
||||||
|
IID_IOleObject = IID{0x00000112, 0x0000, 0x0000, [8]byte{0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46}}
|
||||||
|
IID_IUnknown = IID{0x00000000, 0x0000, 0x0000, [8]byte{0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46}}
|
||||||
|
)
|
||||||
|
|
||||||
|
func EqualREFIID(a, b REFIID) bool {
|
||||||
|
if a == b {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
if a == nil || b == nil {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
if a.Data1 != b.Data1 || a.Data2 != b.Data2 || a.Data3 != b.Data3 {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
for i := 0; i < 8; i++ {
|
||||||
|
if a.Data4[i] != b.Data4[i] {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
|
||||||
|
type IClassFactoryVtbl struct {
|
||||||
|
QueryInterface uintptr
|
||||||
|
AddRef uintptr
|
||||||
|
Release uintptr
|
||||||
|
CreateInstance uintptr
|
||||||
|
LockServer uintptr
|
||||||
|
}
|
||||||
|
|
||||||
|
type IClassFactory struct {
|
||||||
|
LpVtbl *IClassFactoryVtbl
|
||||||
|
}
|
||||||
|
|
||||||
|
func (cf *IClassFactory) Release() uint32 {
|
||||||
|
ret, _, _ := syscall.Syscall(cf.LpVtbl.Release, 1,
|
||||||
|
uintptr(unsafe.Pointer(cf)),
|
||||||
|
0,
|
||||||
|
0)
|
||||||
|
|
||||||
|
return uint32(ret)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (cf *IClassFactory) CreateInstance(pUnkOuter *IUnknown, riid REFIID, ppvObject *unsafe.Pointer) HRESULT {
|
||||||
|
ret, _, _ := syscall.Syscall6(cf.LpVtbl.CreateInstance, 4,
|
||||||
|
uintptr(unsafe.Pointer(cf)),
|
||||||
|
uintptr(unsafe.Pointer(pUnkOuter)),
|
||||||
|
uintptr(unsafe.Pointer(riid)),
|
||||||
|
uintptr(unsafe.Pointer(ppvObject)),
|
||||||
|
0,
|
||||||
|
0)
|
||||||
|
|
||||||
|
return HRESULT(ret)
|
||||||
|
}
|
||||||
|
|
||||||
|
type IConnectionPointVtbl struct {
|
||||||
|
QueryInterface uintptr
|
||||||
|
AddRef uintptr
|
||||||
|
Release uintptr
|
||||||
|
GetConnectionInterface uintptr
|
||||||
|
GetConnectionPointContainer uintptr
|
||||||
|
Advise uintptr
|
||||||
|
Unadvise uintptr
|
||||||
|
EnumConnections uintptr
|
||||||
|
}
|
||||||
|
|
||||||
|
type IConnectionPoint struct {
|
||||||
|
LpVtbl *IConnectionPointVtbl
|
||||||
|
}
|
||||||
|
|
||||||
|
func (cp *IConnectionPoint) Release() uint32 {
|
||||||
|
ret, _, _ := syscall.Syscall(cp.LpVtbl.Release, 1,
|
||||||
|
uintptr(unsafe.Pointer(cp)),
|
||||||
|
0,
|
||||||
|
0)
|
||||||
|
|
||||||
|
return uint32(ret)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (cp *IConnectionPoint) Advise(pUnkSink unsafe.Pointer, pdwCookie *uint32) HRESULT {
|
||||||
|
ret, _, _ := syscall.Syscall(cp.LpVtbl.Advise, 3,
|
||||||
|
uintptr(unsafe.Pointer(cp)),
|
||||||
|
uintptr(pUnkSink),
|
||||||
|
uintptr(unsafe.Pointer(pdwCookie)))
|
||||||
|
|
||||||
|
return HRESULT(ret)
|
||||||
|
}
|
||||||
|
|
||||||
|
type IConnectionPointContainerVtbl struct {
|
||||||
|
QueryInterface uintptr
|
||||||
|
AddRef uintptr
|
||||||
|
Release uintptr
|
||||||
|
EnumConnectionPoints uintptr
|
||||||
|
FindConnectionPoint uintptr
|
||||||
|
}
|
||||||
|
|
||||||
|
type IConnectionPointContainer struct {
|
||||||
|
LpVtbl *IConnectionPointContainerVtbl
|
||||||
|
}
|
||||||
|
|
||||||
|
func (cpc *IConnectionPointContainer) Release() uint32 {
|
||||||
|
ret, _, _ := syscall.Syscall(cpc.LpVtbl.Release, 1,
|
||||||
|
uintptr(unsafe.Pointer(cpc)),
|
||||||
|
0,
|
||||||
|
0)
|
||||||
|
|
||||||
|
return uint32(ret)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (cpc *IConnectionPointContainer) FindConnectionPoint(riid REFIID, ppCP **IConnectionPoint) HRESULT {
|
||||||
|
ret, _, _ := syscall.Syscall(cpc.LpVtbl.FindConnectionPoint, 3,
|
||||||
|
uintptr(unsafe.Pointer(cpc)),
|
||||||
|
uintptr(unsafe.Pointer(riid)),
|
||||||
|
uintptr(unsafe.Pointer(ppCP)))
|
||||||
|
|
||||||
|
return HRESULT(ret)
|
||||||
|
}
|
||||||
|
|
||||||
|
type IOleClientSiteVtbl struct {
|
||||||
|
QueryInterface uintptr
|
||||||
|
AddRef uintptr
|
||||||
|
Release uintptr
|
||||||
|
SaveObject uintptr
|
||||||
|
GetMoniker uintptr
|
||||||
|
GetContainer uintptr
|
||||||
|
ShowObject uintptr
|
||||||
|
OnShowWindow uintptr
|
||||||
|
RequestNewObjectLayout uintptr
|
||||||
|
}
|
||||||
|
|
||||||
|
type IOleClientSite struct {
|
||||||
|
LpVtbl *IOleClientSiteVtbl
|
||||||
|
}
|
||||||
|
|
||||||
|
type IOleInPlaceFrameVtbl struct {
|
||||||
|
QueryInterface uintptr
|
||||||
|
AddRef uintptr
|
||||||
|
Release uintptr
|
||||||
|
GetWindow uintptr
|
||||||
|
ContextSensitiveHelp uintptr
|
||||||
|
GetBorder uintptr
|
||||||
|
RequestBorderSpace uintptr
|
||||||
|
SetBorderSpace uintptr
|
||||||
|
SetActiveObject uintptr
|
||||||
|
InsertMenus uintptr
|
||||||
|
SetMenu uintptr
|
||||||
|
RemoveMenus uintptr
|
||||||
|
SetStatusText uintptr
|
||||||
|
EnableModeless uintptr
|
||||||
|
TranslateAccelerator uintptr
|
||||||
|
}
|
||||||
|
|
||||||
|
type IOleInPlaceFrame struct {
|
||||||
|
LpVtbl *IOleInPlaceFrameVtbl
|
||||||
|
}
|
||||||
|
|
||||||
|
type IOleInPlaceObjectVtbl struct {
|
||||||
|
QueryInterface uintptr
|
||||||
|
AddRef uintptr
|
||||||
|
Release uintptr
|
||||||
|
GetWindow uintptr
|
||||||
|
ContextSensitiveHelp uintptr
|
||||||
|
InPlaceDeactivate uintptr
|
||||||
|
UIDeactivate uintptr
|
||||||
|
SetObjectRects uintptr
|
||||||
|
ReactivateAndUndo uintptr
|
||||||
|
}
|
||||||
|
|
||||||
|
type IOleInPlaceObject struct {
|
||||||
|
LpVtbl *IOleInPlaceObjectVtbl
|
||||||
|
}
|
||||||
|
|
||||||
|
func (obj *IOleInPlaceObject) Release() uint32 {
|
||||||
|
ret, _, _ := syscall.Syscall(obj.LpVtbl.Release, 1,
|
||||||
|
uintptr(unsafe.Pointer(obj)),
|
||||||
|
0,
|
||||||
|
0)
|
||||||
|
|
||||||
|
return uint32(ret)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (obj *IOleInPlaceObject) SetObjectRects(lprcPosRect, lprcClipRect *RECT) HRESULT {
|
||||||
|
ret, _, _ := syscall.Syscall(obj.LpVtbl.SetObjectRects, 3,
|
||||||
|
uintptr(unsafe.Pointer(obj)),
|
||||||
|
uintptr(unsafe.Pointer(lprcPosRect)),
|
||||||
|
uintptr(unsafe.Pointer(lprcClipRect)))
|
||||||
|
|
||||||
|
return HRESULT(ret)
|
||||||
|
}
|
||||||
|
|
||||||
|
type IOleInPlaceSiteVtbl struct {
|
||||||
|
QueryInterface uintptr
|
||||||
|
AddRef uintptr
|
||||||
|
Release uintptr
|
||||||
|
GetWindow uintptr
|
||||||
|
ContextSensitiveHelp uintptr
|
||||||
|
CanInPlaceActivate uintptr
|
||||||
|
OnInPlaceActivate uintptr
|
||||||
|
OnUIActivate uintptr
|
||||||
|
GetWindowContext uintptr
|
||||||
|
Scroll uintptr
|
||||||
|
OnUIDeactivate uintptr
|
||||||
|
OnInPlaceDeactivate uintptr
|
||||||
|
DiscardUndoState uintptr
|
||||||
|
DeactivateAndUndo uintptr
|
||||||
|
OnPosRectChange uintptr
|
||||||
|
}
|
||||||
|
|
||||||
|
type IOleInPlaceSite struct {
|
||||||
|
LpVtbl *IOleInPlaceSiteVtbl
|
||||||
|
}
|
||||||
|
|
||||||
|
type IOleObjectVtbl struct {
|
||||||
|
QueryInterface uintptr
|
||||||
|
AddRef uintptr
|
||||||
|
Release uintptr
|
||||||
|
SetClientSite uintptr
|
||||||
|
GetClientSite uintptr
|
||||||
|
SetHostNames uintptr
|
||||||
|
Close uintptr
|
||||||
|
SetMoniker uintptr
|
||||||
|
GetMoniker uintptr
|
||||||
|
InitFromData uintptr
|
||||||
|
GetClipboardData uintptr
|
||||||
|
DoVerb uintptr
|
||||||
|
EnumVerbs uintptr
|
||||||
|
Update uintptr
|
||||||
|
IsUpToDate uintptr
|
||||||
|
GetUserClassID uintptr
|
||||||
|
GetUserType uintptr
|
||||||
|
SetExtent uintptr
|
||||||
|
GetExtent uintptr
|
||||||
|
Advise uintptr
|
||||||
|
Unadvise uintptr
|
||||||
|
EnumAdvise uintptr
|
||||||
|
GetMiscStatus uintptr
|
||||||
|
SetColorScheme uintptr
|
||||||
|
}
|
||||||
|
|
||||||
|
type IOleObject struct {
|
||||||
|
LpVtbl *IOleObjectVtbl
|
||||||
|
}
|
||||||
|
|
||||||
|
func (obj *IOleObject) QueryInterface(riid REFIID, ppvObject *unsafe.Pointer) HRESULT {
|
||||||
|
ret, _, _ := syscall.Syscall(obj.LpVtbl.QueryInterface, 3,
|
||||||
|
uintptr(unsafe.Pointer(obj)),
|
||||||
|
uintptr(unsafe.Pointer(riid)),
|
||||||
|
uintptr(unsafe.Pointer(ppvObject)))
|
||||||
|
|
||||||
|
return HRESULT(ret)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (obj *IOleObject) Release() uint32 {
|
||||||
|
ret, _, _ := syscall.Syscall(obj.LpVtbl.Release, 1,
|
||||||
|
uintptr(unsafe.Pointer(obj)),
|
||||||
|
0,
|
||||||
|
0)
|
||||||
|
|
||||||
|
return uint32(ret)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (obj *IOleObject) SetClientSite(pClientSite *IOleClientSite) HRESULT {
|
||||||
|
ret, _, _ := syscall.Syscall(obj.LpVtbl.SetClientSite, 2,
|
||||||
|
uintptr(unsafe.Pointer(obj)),
|
||||||
|
uintptr(unsafe.Pointer(pClientSite)),
|
||||||
|
0)
|
||||||
|
|
||||||
|
return HRESULT(ret)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (obj *IOleObject) SetHostNames(szContainerApp, szContainerObj *uint16) HRESULT {
|
||||||
|
ret, _, _ := syscall.Syscall(obj.LpVtbl.SetHostNames, 3,
|
||||||
|
uintptr(unsafe.Pointer(obj)),
|
||||||
|
uintptr(unsafe.Pointer(szContainerApp)),
|
||||||
|
uintptr(unsafe.Pointer(szContainerObj)))
|
||||||
|
|
||||||
|
return HRESULT(ret)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (obj *IOleObject) Close(dwSaveOption uint32) HRESULT {
|
||||||
|
ret, _, _ := syscall.Syscall(obj.LpVtbl.Close, 2,
|
||||||
|
uintptr(unsafe.Pointer(obj)),
|
||||||
|
uintptr(dwSaveOption),
|
||||||
|
0)
|
||||||
|
|
||||||
|
return HRESULT(ret)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (obj *IOleObject) DoVerb(iVerb int32, lpmsg *MSG, pActiveSite *IOleClientSite, lindex int32, hwndParent HWND, lprcPosRect *RECT) HRESULT {
|
||||||
|
ret, _, _ := syscall.Syscall9(obj.LpVtbl.DoVerb, 7,
|
||||||
|
uintptr(unsafe.Pointer(obj)),
|
||||||
|
uintptr(iVerb),
|
||||||
|
uintptr(unsafe.Pointer(lpmsg)),
|
||||||
|
uintptr(unsafe.Pointer(pActiveSite)),
|
||||||
|
uintptr(lindex),
|
||||||
|
uintptr(hwndParent),
|
||||||
|
uintptr(unsafe.Pointer(lprcPosRect)),
|
||||||
|
0,
|
||||||
|
0)
|
||||||
|
|
||||||
|
return HRESULT(ret)
|
||||||
|
}
|
||||||
|
|
||||||
|
type IUnknownVtbl struct {
|
||||||
|
QueryInterface uintptr
|
||||||
|
AddRef uintptr
|
||||||
|
Release uintptr
|
||||||
|
}
|
||||||
|
|
||||||
|
type IUnknown struct {
|
||||||
|
LpVtbl *IUnknownVtbl
|
||||||
|
}
|
||||||
|
|
||||||
|
type OLEINPLACEFRAMEINFO struct {
|
||||||
|
Cb uint32
|
||||||
|
FMDIApp BOOL
|
||||||
|
HwndFrame HWND
|
||||||
|
Haccel HACCEL
|
||||||
|
CAccelEntries uint32
|
||||||
|
}
|
||||||
|
|
||||||
|
type COAUTHIDENTITY struct {
|
||||||
|
User *uint16
|
||||||
|
UserLength uint32
|
||||||
|
Domain *uint16
|
||||||
|
DomainLength uint32
|
||||||
|
Password *uint16
|
||||||
|
PasswordLength uint32
|
||||||
|
Flags uint32
|
||||||
|
}
|
||||||
|
|
||||||
|
type COAUTHINFO struct {
|
||||||
|
dwAuthnSvc uint32
|
||||||
|
dwAuthzSvc uint32
|
||||||
|
pwszServerPrincName *uint16
|
||||||
|
dwAuthnLevel uint32
|
||||||
|
dwImpersonationLevel uint32
|
||||||
|
pAuthIdentityData *COAUTHIDENTITY
|
||||||
|
dwCapabilities uint32
|
||||||
|
}
|
||||||
|
|
||||||
|
type COSERVERINFO struct {
|
||||||
|
dwReserved1 uint32
|
||||||
|
pwszName *uint16
|
||||||
|
pAuthInfo *COAUTHINFO
|
||||||
|
dwReserved2 uint32
|
||||||
|
}
|
||||||
|
|
||||||
|
var (
|
||||||
|
// Library
|
||||||
|
libole32 uintptr
|
||||||
|
|
||||||
|
// Functions
|
||||||
|
coCreateInstance uintptr
|
||||||
|
coGetClassObject uintptr
|
||||||
|
coTaskMemFree uintptr
|
||||||
|
oleInitialize uintptr
|
||||||
|
oleSetContainedObject uintptr
|
||||||
|
oleUninitialize uintptr
|
||||||
|
)
|
||||||
|
|
||||||
|
func init() {
|
||||||
|
// Library
|
||||||
|
libole32 = MustLoadLibrary("ole32.dll")
|
||||||
|
|
||||||
|
// Functions
|
||||||
|
coCreateInstance = MustGetProcAddress(libole32, "CoCreateInstance")
|
||||||
|
coGetClassObject = MustGetProcAddress(libole32, "CoGetClassObject")
|
||||||
|
coTaskMemFree = MustGetProcAddress(libole32, "CoTaskMemFree")
|
||||||
|
oleInitialize = MustGetProcAddress(libole32, "OleInitialize")
|
||||||
|
oleSetContainedObject = MustGetProcAddress(libole32, "OleSetContainedObject")
|
||||||
|
oleUninitialize = MustGetProcAddress(libole32, "OleUninitialize")
|
||||||
|
}
|
||||||
|
|
||||||
|
func CoCreateInstance(rclsid REFCLSID, pUnkOuter *IUnknown, dwClsContext uint32, riid REFIID, ppv *unsafe.Pointer) HRESULT {
|
||||||
|
ret, _, _ := syscall.Syscall6(coCreateInstance, 5,
|
||||||
|
uintptr(unsafe.Pointer(rclsid)),
|
||||||
|
uintptr(unsafe.Pointer(pUnkOuter)),
|
||||||
|
uintptr(dwClsContext),
|
||||||
|
uintptr(unsafe.Pointer(riid)),
|
||||||
|
uintptr(unsafe.Pointer(ppv)),
|
||||||
|
0)
|
||||||
|
|
||||||
|
return HRESULT(ret)
|
||||||
|
}
|
||||||
|
|
||||||
|
func CoGetClassObject(rclsid REFCLSID, dwClsContext uint32, pServerInfo *COSERVERINFO, riid REFIID, ppv *unsafe.Pointer) HRESULT {
|
||||||
|
ret, _, _ := syscall.Syscall6(coGetClassObject, 5,
|
||||||
|
uintptr(unsafe.Pointer(rclsid)),
|
||||||
|
uintptr(dwClsContext),
|
||||||
|
uintptr(unsafe.Pointer(pServerInfo)),
|
||||||
|
uintptr(unsafe.Pointer(riid)),
|
||||||
|
uintptr(unsafe.Pointer(ppv)),
|
||||||
|
0)
|
||||||
|
|
||||||
|
return HRESULT(ret)
|
||||||
|
}
|
||||||
|
|
||||||
|
func CoTaskMemFree(pv uintptr) {
|
||||||
|
syscall.Syscall(coTaskMemFree, 1,
|
||||||
|
pv,
|
||||||
|
0,
|
||||||
|
0)
|
||||||
|
}
|
||||||
|
|
||||||
|
func OleInitialize() HRESULT {
|
||||||
|
ret, _, _ := syscall.Syscall(oleInitialize, 1, // WTF, why does 0 not work here?
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0)
|
||||||
|
|
||||||
|
return HRESULT(ret)
|
||||||
|
}
|
||||||
|
|
||||||
|
func OleSetContainedObject(pUnknown *IUnknown, fContained bool) HRESULT {
|
||||||
|
ret, _, _ := syscall.Syscall(oleSetContainedObject, 2,
|
||||||
|
uintptr(unsafe.Pointer(pUnknown)),
|
||||||
|
uintptr(BoolToBOOL(fContained)),
|
||||||
|
0)
|
||||||
|
|
||||||
|
return HRESULT(ret)
|
||||||
|
}
|
||||||
|
|
||||||
|
func OleUninitialize() {
|
||||||
|
syscall.Syscall(oleUninitialize, 0,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0)
|
||||||
|
}
|
462
vendor/github.com/lxn/win/oleaut32.go
generated
vendored
Normal file
462
vendor/github.com/lxn/win/oleaut32.go
generated
vendored
Normal file
@ -0,0 +1,462 @@
|
|||||||
|
// Copyright 2010 The win Authors. All rights reserved.
|
||||||
|
// Use of this source code is governed by a BSD-style
|
||||||
|
// license that can be found in the LICENSE file.
|
||||||
|
|
||||||
|
// +build windows
|
||||||
|
|
||||||
|
package win
|
||||||
|
|
||||||
|
import (
|
||||||
|
"fmt"
|
||||||
|
"syscall"
|
||||||
|
"unsafe"
|
||||||
|
)
|
||||||
|
|
||||||
|
type DISPID int32
|
||||||
|
|
||||||
|
const (
|
||||||
|
DISPID_BEFORENAVIGATE DISPID = 100
|
||||||
|
DISPID_NAVIGATECOMPLETE DISPID = 101
|
||||||
|
DISPID_STATUSTEXTCHANGE DISPID = 102
|
||||||
|
DISPID_QUIT DISPID = 103
|
||||||
|
DISPID_DOWNLOADCOMPLETE DISPID = 104
|
||||||
|
DISPID_COMMANDSTATECHANGE DISPID = 105
|
||||||
|
DISPID_DOWNLOADBEGIN DISPID = 106
|
||||||
|
DISPID_NEWWINDOW DISPID = 107
|
||||||
|
DISPID_PROGRESSCHANGE DISPID = 108
|
||||||
|
DISPID_WINDOWMOVE DISPID = 109
|
||||||
|
DISPID_WINDOWRESIZE DISPID = 110
|
||||||
|
DISPID_WINDOWACTIVATE DISPID = 111
|
||||||
|
DISPID_PROPERTYCHANGE DISPID = 112
|
||||||
|
DISPID_TITLECHANGE DISPID = 113
|
||||||
|
DISPID_TITLEICONCHANGE DISPID = 114
|
||||||
|
DISPID_FRAMEBEFORENAVIGATE DISPID = 200
|
||||||
|
DISPID_FRAMENAVIGATECOMPLETE DISPID = 201
|
||||||
|
DISPID_FRAMENEWWINDOW DISPID = 204
|
||||||
|
DISPID_BEFORENAVIGATE2 DISPID = 250
|
||||||
|
DISPID_NEWWINDOW2 DISPID = 251
|
||||||
|
DISPID_NAVIGATECOMPLETE2 DISPID = 252
|
||||||
|
DISPID_ONQUIT DISPID = 253
|
||||||
|
DISPID_ONVISIBLE DISPID = 254
|
||||||
|
DISPID_ONTOOLBAR DISPID = 255
|
||||||
|
DISPID_ONMENUBAR DISPID = 256
|
||||||
|
DISPID_ONSTATUSBAR DISPID = 257
|
||||||
|
DISPID_ONFULLSCREEN DISPID = 258
|
||||||
|
DISPID_DOCUMENTCOMPLETE DISPID = 259
|
||||||
|
DISPID_ONTHEATERMODE DISPID = 260
|
||||||
|
DISPID_ONADDRESSBAR DISPID = 261
|
||||||
|
DISPID_WINDOWSETRESIZABLE DISPID = 262
|
||||||
|
DISPID_WINDOWCLOSING DISPID = 263
|
||||||
|
DISPID_WINDOWSETLEFT DISPID = 264
|
||||||
|
DISPID_WINDOWSETTOP DISPID = 265
|
||||||
|
DISPID_WINDOWSETWIDTH DISPID = 266
|
||||||
|
DISPID_WINDOWSETHEIGHT DISPID = 267
|
||||||
|
DISPID_CLIENTTOHOSTWINDOW DISPID = 268
|
||||||
|
DISPID_SETSECURELOCKICON DISPID = 269
|
||||||
|
DISPID_FILEDOWNLOAD DISPID = 270
|
||||||
|
DISPID_NAVIGATEERROR DISPID = 271
|
||||||
|
DISPID_PRIVACYIMPACTEDSTATECHANGE DISPID = 272
|
||||||
|
DISPID_NEWWINDOW3 DISPID = 273
|
||||||
|
)
|
||||||
|
|
||||||
|
var (
|
||||||
|
IID_IDispatch = IID{0x00020400, 0x0000, 0x0000, [8]byte{0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46}}
|
||||||
|
)
|
||||||
|
|
||||||
|
const (
|
||||||
|
DISP_E_MEMBERNOTFOUND = 0x80020003
|
||||||
|
)
|
||||||
|
|
||||||
|
const (
|
||||||
|
CSC_UPDATECOMMANDS = ^0x0
|
||||||
|
CSC_NAVIGATEFORWARD = 0x1
|
||||||
|
CSC_NAVIGATEBACK = 0x2
|
||||||
|
)
|
||||||
|
|
||||||
|
type IDispatchVtbl struct {
|
||||||
|
QueryInterface uintptr
|
||||||
|
AddRef uintptr
|
||||||
|
Release uintptr
|
||||||
|
GetTypeInfoCount uintptr
|
||||||
|
GetTypeInfo uintptr
|
||||||
|
GetIDsOfNames uintptr
|
||||||
|
Invoke uintptr
|
||||||
|
}
|
||||||
|
|
||||||
|
type IDispatch struct {
|
||||||
|
LpVtbl *IDispatchVtbl
|
||||||
|
}
|
||||||
|
|
||||||
|
type VARTYPE uint16
|
||||||
|
|
||||||
|
const (
|
||||||
|
VT_EMPTY VARTYPE = 0
|
||||||
|
VT_NULL VARTYPE = 1
|
||||||
|
VT_I2 VARTYPE = 2
|
||||||
|
VT_I4 VARTYPE = 3
|
||||||
|
VT_R4 VARTYPE = 4
|
||||||
|
VT_R8 VARTYPE = 5
|
||||||
|
VT_CY VARTYPE = 6
|
||||||
|
VT_DATE VARTYPE = 7
|
||||||
|
VT_BSTR VARTYPE = 8
|
||||||
|
VT_DISPATCH VARTYPE = 9
|
||||||
|
VT_ERROR VARTYPE = 10
|
||||||
|
VT_BOOL VARTYPE = 11
|
||||||
|
VT_VARIANT VARTYPE = 12
|
||||||
|
VT_UNKNOWN VARTYPE = 13
|
||||||
|
VT_DECIMAL VARTYPE = 14
|
||||||
|
VT_I1 VARTYPE = 16
|
||||||
|
VT_UI1 VARTYPE = 17
|
||||||
|
VT_UI2 VARTYPE = 18
|
||||||
|
VT_UI4 VARTYPE = 19
|
||||||
|
VT_I8 VARTYPE = 20
|
||||||
|
VT_UI8 VARTYPE = 21
|
||||||
|
VT_INT VARTYPE = 22
|
||||||
|
VT_UINT VARTYPE = 23
|
||||||
|
VT_VOID VARTYPE = 24
|
||||||
|
VT_HRESULT VARTYPE = 25
|
||||||
|
VT_PTR VARTYPE = 26
|
||||||
|
VT_SAFEARRAY VARTYPE = 27
|
||||||
|
VT_CARRAY VARTYPE = 28
|
||||||
|
VT_USERDEFINED VARTYPE = 29
|
||||||
|
VT_LPSTR VARTYPE = 30
|
||||||
|
VT_LPWSTR VARTYPE = 31
|
||||||
|
VT_RECORD VARTYPE = 36
|
||||||
|
VT_INT_PTR VARTYPE = 37
|
||||||
|
VT_UINT_PTR VARTYPE = 38
|
||||||
|
VT_FILETIME VARTYPE = 64
|
||||||
|
VT_BLOB VARTYPE = 65
|
||||||
|
VT_STREAM VARTYPE = 66
|
||||||
|
VT_STORAGE VARTYPE = 67
|
||||||
|
VT_STREAMED_OBJECT VARTYPE = 68
|
||||||
|
VT_STORED_OBJECT VARTYPE = 69
|
||||||
|
VT_BLOB_OBJECT VARTYPE = 70
|
||||||
|
VT_CF VARTYPE = 71
|
||||||
|
VT_CLSID VARTYPE = 72
|
||||||
|
VT_VERSIONED_STREAM VARTYPE = 73
|
||||||
|
VT_BSTR_BLOB VARTYPE = 0xfff
|
||||||
|
VT_VECTOR VARTYPE = 0x1000
|
||||||
|
VT_ARRAY VARTYPE = 0x2000
|
||||||
|
VT_BYREF VARTYPE = 0x4000
|
||||||
|
VT_RESERVED VARTYPE = 0x8000
|
||||||
|
VT_ILLEGAL VARTYPE = 0xffff
|
||||||
|
VT_ILLEGALMASKED VARTYPE = 0xfff
|
||||||
|
VT_TYPEMASK VARTYPE = 0xfff
|
||||||
|
)
|
||||||
|
|
||||||
|
type VARIANTARG struct {
|
||||||
|
VARIANT
|
||||||
|
}
|
||||||
|
|
||||||
|
type VARIANT_BOOL int16
|
||||||
|
|
||||||
|
const (
|
||||||
|
VARIANT_TRUE VARIANT_BOOL = -1
|
||||||
|
VARIANT_FALSE VARIANT_BOOL = 0
|
||||||
|
)
|
||||||
|
|
||||||
|
type SAFEARRAYBOUND struct {
|
||||||
|
CElements uint32
|
||||||
|
LLbound int32
|
||||||
|
}
|
||||||
|
|
||||||
|
type SAFEARRAY struct {
|
||||||
|
CDims uint16
|
||||||
|
FFeatures uint16
|
||||||
|
CbElements uint32
|
||||||
|
CLocks uint32
|
||||||
|
PvData uintptr
|
||||||
|
Rgsabound [1]SAFEARRAYBOUND
|
||||||
|
}
|
||||||
|
|
||||||
|
//type BSTR *uint16
|
||||||
|
|
||||||
|
func StringToBSTR(value string) *uint16 /*BSTR*/ {
|
||||||
|
// IMPORTANT: Don't forget to free the BSTR value when no longer needed!
|
||||||
|
return SysAllocString(value)
|
||||||
|
}
|
||||||
|
|
||||||
|
func BSTRToString(value *uint16 /*BSTR*/) string {
|
||||||
|
// ISSUE: Is this really ok?
|
||||||
|
bstrArrPtr := (*[200000000]uint16)(unsafe.Pointer(value))
|
||||||
|
|
||||||
|
bstrSlice := make([]uint16, SysStringLen(value))
|
||||||
|
copy(bstrSlice, bstrArrPtr[:])
|
||||||
|
|
||||||
|
return syscall.UTF16ToString(bstrSlice)
|
||||||
|
}
|
||||||
|
|
||||||
|
func IntToVariantI4(value int32) *VAR_I4 {
|
||||||
|
return &VAR_I4{vt: VT_I4, lVal: value}
|
||||||
|
}
|
||||||
|
|
||||||
|
func VariantI4ToInt(value *VAR_I4) int32 {
|
||||||
|
return value.lVal
|
||||||
|
}
|
||||||
|
|
||||||
|
func BoolToVariantBool(value bool) *VAR_BOOL {
|
||||||
|
return &VAR_BOOL{vt: VT_BOOL, boolVal: VARIANT_BOOL(BoolToBOOL(value))}
|
||||||
|
}
|
||||||
|
|
||||||
|
func VariantBoolToBool(value *VAR_BOOL) bool {
|
||||||
|
return value.boolVal != 0
|
||||||
|
}
|
||||||
|
|
||||||
|
func StringToVariantBSTR(value string) *VAR_BSTR {
|
||||||
|
// IMPORTANT: Don't forget to free the BSTR value when no longer needed!
|
||||||
|
return &VAR_BSTR{vt: VT_BSTR, bstrVal: StringToBSTR(value)}
|
||||||
|
}
|
||||||
|
|
||||||
|
func VariantBSTRToString(value *VAR_BSTR) string {
|
||||||
|
return BSTRToString(value.bstrVal)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (v *VARIANT) MustLong() int32 {
|
||||||
|
value, err := v.Long()
|
||||||
|
if err != nil {
|
||||||
|
panic(err)
|
||||||
|
}
|
||||||
|
return value
|
||||||
|
}
|
||||||
|
|
||||||
|
func (v *VARIANT) Long() (int32, error) {
|
||||||
|
if v.Vt != VT_I4 {
|
||||||
|
return 0, fmt.Errorf("Error: Long() v.Vt != VT_I4, ptr=%p, value=%+v", v, v)
|
||||||
|
}
|
||||||
|
p := (*VAR_I4)(unsafe.Pointer(v))
|
||||||
|
return p.lVal, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (v *VARIANT) SetLong(value int32) {
|
||||||
|
v.Vt = VT_I4
|
||||||
|
p := (*VAR_I4)(unsafe.Pointer(v))
|
||||||
|
p.lVal = value
|
||||||
|
}
|
||||||
|
|
||||||
|
func (v *VARIANT) MustULong() uint32 {
|
||||||
|
value, err := v.ULong()
|
||||||
|
if err != nil {
|
||||||
|
panic(err)
|
||||||
|
}
|
||||||
|
return value
|
||||||
|
}
|
||||||
|
|
||||||
|
func (v *VARIANT) ULong() (uint32, error) {
|
||||||
|
if v.Vt != VT_UI4 {
|
||||||
|
return 0, fmt.Errorf("Error: ULong() v.Vt != VT_UI4, ptr=%p, value=%+v", v, v)
|
||||||
|
}
|
||||||
|
p := (*VAR_UI4)(unsafe.Pointer(v))
|
||||||
|
return p.ulVal, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (v *VARIANT) SetULong(value uint32) {
|
||||||
|
v.Vt = VT_UI4
|
||||||
|
p := (*VAR_UI4)(unsafe.Pointer(v))
|
||||||
|
p.ulVal = value
|
||||||
|
}
|
||||||
|
|
||||||
|
func (v *VARIANT) MustBool() VARIANT_BOOL {
|
||||||
|
value, err := v.Bool()
|
||||||
|
if err != nil {
|
||||||
|
panic(err)
|
||||||
|
}
|
||||||
|
return value
|
||||||
|
}
|
||||||
|
|
||||||
|
func (v *VARIANT) Bool() (VARIANT_BOOL, error) {
|
||||||
|
if v.Vt != VT_BOOL {
|
||||||
|
return VARIANT_FALSE, fmt.Errorf("Error: Bool() v.Vt != VT_BOOL, ptr=%p, value=%+v", v, v)
|
||||||
|
}
|
||||||
|
p := (*VAR_BOOL)(unsafe.Pointer(v))
|
||||||
|
return p.boolVal, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (v *VARIANT) SetBool(value VARIANT_BOOL) {
|
||||||
|
v.Vt = VT_BOOL
|
||||||
|
p := (*VAR_BOOL)(unsafe.Pointer(v))
|
||||||
|
p.boolVal = value
|
||||||
|
}
|
||||||
|
|
||||||
|
func (v *VARIANT) MustBSTR() *uint16 {
|
||||||
|
value, err := v.BSTR()
|
||||||
|
if err != nil {
|
||||||
|
panic(err)
|
||||||
|
}
|
||||||
|
return value
|
||||||
|
}
|
||||||
|
|
||||||
|
func (v *VARIANT) BSTR() (*uint16, error) {
|
||||||
|
if v.Vt != VT_BSTR {
|
||||||
|
return nil, fmt.Errorf("Error: BSTR() v.Vt != VT_BSTR, ptr=%p, value=%+v", v, v)
|
||||||
|
}
|
||||||
|
p := (*VAR_BSTR)(unsafe.Pointer(v))
|
||||||
|
return p.bstrVal, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (v *VARIANT) SetBSTR(value *uint16) {
|
||||||
|
v.Vt = VT_BSTR
|
||||||
|
p := (*VAR_BSTR)(unsafe.Pointer(v))
|
||||||
|
p.bstrVal = value
|
||||||
|
}
|
||||||
|
|
||||||
|
func (v *VARIANT) MustPDispatch() *IDispatch {
|
||||||
|
value, err := v.PDispatch()
|
||||||
|
if err != nil {
|
||||||
|
panic(err)
|
||||||
|
}
|
||||||
|
return value
|
||||||
|
}
|
||||||
|
|
||||||
|
func (v *VARIANT) PDispatch() (*IDispatch, error) {
|
||||||
|
if v.Vt != VT_DISPATCH {
|
||||||
|
return nil, fmt.Errorf("Error: PDispatch() v.Vt != VT_DISPATCH, ptr=%p, value=%+v", v, v)
|
||||||
|
}
|
||||||
|
p := (*VAR_PDISP)(unsafe.Pointer(v))
|
||||||
|
return p.pdispVal, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (v *VARIANT) SetPDispatch(value *IDispatch) {
|
||||||
|
v.Vt = VT_DISPATCH
|
||||||
|
p := (*VAR_PDISP)(unsafe.Pointer(v))
|
||||||
|
p.pdispVal = value
|
||||||
|
}
|
||||||
|
|
||||||
|
func (v *VARIANT) MustPVariant() *VARIANT {
|
||||||
|
value, err := v.PVariant()
|
||||||
|
if err != nil {
|
||||||
|
panic(err)
|
||||||
|
}
|
||||||
|
return value
|
||||||
|
}
|
||||||
|
|
||||||
|
func (v *VARIANT) PVariant() (*VARIANT, error) {
|
||||||
|
if v.Vt != VT_BYREF|VT_VARIANT {
|
||||||
|
return nil, fmt.Errorf("Error: PVariant() v.Vt != VT_BYREF|VT_VARIANT, ptr=%p, value=%+v", v, v)
|
||||||
|
}
|
||||||
|
p := (*VAR_PVAR)(unsafe.Pointer(v))
|
||||||
|
return p.pvarVal, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (v *VARIANT) SetPVariant(value *VARIANT) {
|
||||||
|
v.Vt = VT_BYREF | VT_VARIANT
|
||||||
|
p := (*VAR_PVAR)(unsafe.Pointer(v))
|
||||||
|
p.pvarVal = value
|
||||||
|
}
|
||||||
|
|
||||||
|
func (v *VARIANT) MustPBool() *VARIANT_BOOL {
|
||||||
|
value, err := v.PBool()
|
||||||
|
if err != nil {
|
||||||
|
panic(err)
|
||||||
|
}
|
||||||
|
return value
|
||||||
|
}
|
||||||
|
|
||||||
|
func (v *VARIANT) PBool() (*VARIANT_BOOL, error) {
|
||||||
|
if v.Vt != VT_BYREF|VT_BOOL {
|
||||||
|
return nil, fmt.Errorf("Error: PBool() v.Vt != VT_BYREF|VT_BOOL, ptr=%p, value=%+v", v, v)
|
||||||
|
}
|
||||||
|
p := (*VAR_PBOOL)(unsafe.Pointer(v))
|
||||||
|
return p.pboolVal, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (v *VARIANT) SetPBool(value *VARIANT_BOOL) {
|
||||||
|
v.Vt = VT_BYREF | VT_BOOL
|
||||||
|
p := (*VAR_PBOOL)(unsafe.Pointer(v))
|
||||||
|
p.pboolVal = value
|
||||||
|
}
|
||||||
|
|
||||||
|
func (v *VARIANT) MustPPDispatch() **IDispatch {
|
||||||
|
value, err := v.PPDispatch()
|
||||||
|
if err != nil {
|
||||||
|
panic(err)
|
||||||
|
}
|
||||||
|
return value
|
||||||
|
}
|
||||||
|
|
||||||
|
func (v *VARIANT) PPDispatch() (**IDispatch, error) {
|
||||||
|
if v.Vt != VT_BYREF|VT_DISPATCH {
|
||||||
|
return nil, fmt.Errorf("PPDispatch() v.Vt != VT_BYREF|VT_DISPATCH, ptr=%p, value=%+v", v, v)
|
||||||
|
}
|
||||||
|
p := (*VAR_PPDISP)(unsafe.Pointer(v))
|
||||||
|
return p.ppdispVal, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (v *VARIANT) SetPPDispatch(value **IDispatch) {
|
||||||
|
v.Vt = VT_BYREF | VT_DISPATCH
|
||||||
|
p := (*VAR_PPDISP)(unsafe.Pointer(v))
|
||||||
|
p.ppdispVal = value
|
||||||
|
}
|
||||||
|
|
||||||
|
func (v *VARIANT) MustPSafeArray() *SAFEARRAY {
|
||||||
|
value, err := v.PSafeArray()
|
||||||
|
if err != nil {
|
||||||
|
panic(err)
|
||||||
|
}
|
||||||
|
return value
|
||||||
|
}
|
||||||
|
|
||||||
|
func (v *VARIANT) PSafeArray() (*SAFEARRAY, error) {
|
||||||
|
if (v.Vt & VT_ARRAY) != VT_ARRAY {
|
||||||
|
return nil, fmt.Errorf("Error: PSafeArray() (v.Vt & VT_ARRAY) != VT_ARRAY, ptr=%p, value=%+v", v, v)
|
||||||
|
}
|
||||||
|
p := (*VAR_PSAFEARRAY)(unsafe.Pointer(v))
|
||||||
|
return p.parray, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (v *VARIANT) SetPSafeArray(value *SAFEARRAY, elementVt VARTYPE) {
|
||||||
|
v.Vt = VT_ARRAY | elementVt
|
||||||
|
p := (*VAR_PSAFEARRAY)(unsafe.Pointer(v))
|
||||||
|
p.parray = value
|
||||||
|
}
|
||||||
|
|
||||||
|
type DISPPARAMS struct {
|
||||||
|
Rgvarg *VARIANTARG
|
||||||
|
RgdispidNamedArgs *DISPID
|
||||||
|
CArgs int32
|
||||||
|
CNamedArgs int32
|
||||||
|
}
|
||||||
|
|
||||||
|
var (
|
||||||
|
// Library
|
||||||
|
liboleaut32 uintptr
|
||||||
|
|
||||||
|
// Functions
|
||||||
|
sysAllocString uintptr
|
||||||
|
sysFreeString uintptr
|
||||||
|
sysStringLen uintptr
|
||||||
|
)
|
||||||
|
|
||||||
|
func init() {
|
||||||
|
// Library
|
||||||
|
liboleaut32 = MustLoadLibrary("oleaut32.dll")
|
||||||
|
|
||||||
|
// Functions
|
||||||
|
sysAllocString = MustGetProcAddress(liboleaut32, "SysAllocString")
|
||||||
|
sysFreeString = MustGetProcAddress(liboleaut32, "SysFreeString")
|
||||||
|
sysStringLen = MustGetProcAddress(liboleaut32, "SysStringLen")
|
||||||
|
}
|
||||||
|
|
||||||
|
func SysAllocString(s string) *uint16 /*BSTR*/ {
|
||||||
|
ret, _, _ := syscall.Syscall(sysAllocString, 1,
|
||||||
|
uintptr(unsafe.Pointer(syscall.StringToUTF16Ptr(s))),
|
||||||
|
0,
|
||||||
|
0)
|
||||||
|
|
||||||
|
return (*uint16) /*BSTR*/ (unsafe.Pointer(ret))
|
||||||
|
}
|
||||||
|
|
||||||
|
func SysFreeString(bstr *uint16 /*BSTR*/) {
|
||||||
|
syscall.Syscall(sysFreeString, 1,
|
||||||
|
uintptr(unsafe.Pointer(bstr)),
|
||||||
|
0,
|
||||||
|
0)
|
||||||
|
}
|
||||||
|
|
||||||
|
func SysStringLen(bstr *uint16 /*BSTR*/) uint32 {
|
||||||
|
ret, _, _ := syscall.Syscall(sysStringLen, 1,
|
||||||
|
uintptr(unsafe.Pointer(bstr)),
|
||||||
|
0,
|
||||||
|
0)
|
||||||
|
|
||||||
|
return uint32(ret)
|
||||||
|
}
|
75
vendor/github.com/lxn/win/oleaut32_386.go
generated
vendored
Normal file
75
vendor/github.com/lxn/win/oleaut32_386.go
generated
vendored
Normal file
@ -0,0 +1,75 @@
|
|||||||
|
// Copyright 2012 The win Authors. All rights reserved.
|
||||||
|
// Use of this source code is governed by a BSD-style
|
||||||
|
// license that can be found in the LICENSE file.
|
||||||
|
|
||||||
|
// +build windows
|
||||||
|
|
||||||
|
package win
|
||||||
|
|
||||||
|
type VARIANT struct {
|
||||||
|
Vt VARTYPE
|
||||||
|
reserved [14]byte
|
||||||
|
}
|
||||||
|
|
||||||
|
type VAR_I4 struct {
|
||||||
|
vt VARTYPE
|
||||||
|
reserved1 [6]byte
|
||||||
|
lVal int32
|
||||||
|
reserved2 [4]byte
|
||||||
|
}
|
||||||
|
|
||||||
|
type VAR_UI4 struct {
|
||||||
|
vt VARTYPE
|
||||||
|
reserved1 [6]byte
|
||||||
|
ulVal uint32
|
||||||
|
reserved2 [4]byte
|
||||||
|
}
|
||||||
|
|
||||||
|
type VAR_BOOL struct {
|
||||||
|
vt VARTYPE
|
||||||
|
reserved1 [6]byte
|
||||||
|
boolVal VARIANT_BOOL
|
||||||
|
reserved2 [6]byte
|
||||||
|
}
|
||||||
|
|
||||||
|
type VAR_BSTR struct {
|
||||||
|
vt VARTYPE
|
||||||
|
reserved1 [6]byte
|
||||||
|
bstrVal *uint16 /*BSTR*/
|
||||||
|
reserved2 [4]byte
|
||||||
|
}
|
||||||
|
|
||||||
|
type VAR_PDISP struct {
|
||||||
|
vt VARTYPE
|
||||||
|
reserved1 [6]byte
|
||||||
|
pdispVal *IDispatch
|
||||||
|
reserved2 [4]byte
|
||||||
|
}
|
||||||
|
|
||||||
|
type VAR_PSAFEARRAY struct {
|
||||||
|
vt VARTYPE
|
||||||
|
reserved1 [6]byte
|
||||||
|
parray *SAFEARRAY
|
||||||
|
reserved2 [4]byte
|
||||||
|
}
|
||||||
|
|
||||||
|
type VAR_PVAR struct {
|
||||||
|
vt VARTYPE
|
||||||
|
reserved1 [6]byte
|
||||||
|
pvarVal *VARIANT
|
||||||
|
reserved2 [4]byte
|
||||||
|
}
|
||||||
|
|
||||||
|
type VAR_PBOOL struct {
|
||||||
|
vt VARTYPE
|
||||||
|
reserved1 [6]byte
|
||||||
|
pboolVal *VARIANT_BOOL
|
||||||
|
reserved2 [4]byte
|
||||||
|
}
|
||||||
|
|
||||||
|
type VAR_PPDISP struct {
|
||||||
|
vt VARTYPE
|
||||||
|
reserved1 [6]byte
|
||||||
|
ppdispVal **IDispatch
|
||||||
|
reserved2 [4]byte
|
||||||
|
}
|
75
vendor/github.com/lxn/win/oleaut32_amd64.go
generated
vendored
Normal file
75
vendor/github.com/lxn/win/oleaut32_amd64.go
generated
vendored
Normal file
@ -0,0 +1,75 @@
|
|||||||
|
// Copyright 2012 The win Authors. All rights reserved.
|
||||||
|
// Use of this source code is governed by a BSD-style
|
||||||
|
// license that can be found in the LICENSE file.
|
||||||
|
|
||||||
|
// +build windows
|
||||||
|
|
||||||
|
package win
|
||||||
|
|
||||||
|
type VARIANT struct {
|
||||||
|
Vt VARTYPE
|
||||||
|
reserved [22]byte
|
||||||
|
}
|
||||||
|
|
||||||
|
type VAR_I4 struct {
|
||||||
|
vt VARTYPE
|
||||||
|
reserved1 [6]byte
|
||||||
|
lVal int32
|
||||||
|
reserved2 [12]byte
|
||||||
|
}
|
||||||
|
|
||||||
|
type VAR_UI4 struct {
|
||||||
|
vt VARTYPE
|
||||||
|
reserved1 [6]byte
|
||||||
|
ulVal uint32
|
||||||
|
reserved2 [12]byte
|
||||||
|
}
|
||||||
|
|
||||||
|
type VAR_BOOL struct {
|
||||||
|
vt VARTYPE
|
||||||
|
reserved1 [6]byte
|
||||||
|
boolVal VARIANT_BOOL
|
||||||
|
reserved2 [14]byte
|
||||||
|
}
|
||||||
|
|
||||||
|
type VAR_BSTR struct {
|
||||||
|
vt VARTYPE
|
||||||
|
reserved1 [6]byte
|
||||||
|
bstrVal *uint16 /*BSTR*/
|
||||||
|
reserved2 [8]byte
|
||||||
|
}
|
||||||
|
|
||||||
|
type VAR_PDISP struct {
|
||||||
|
vt VARTYPE
|
||||||
|
reserved1 [6]byte
|
||||||
|
pdispVal *IDispatch
|
||||||
|
reserved2 [8]byte
|
||||||
|
}
|
||||||
|
|
||||||
|
type VAR_PSAFEARRAY struct {
|
||||||
|
vt VARTYPE
|
||||||
|
reserved1 [6]byte
|
||||||
|
parray *SAFEARRAY
|
||||||
|
reserved2 [8]byte
|
||||||
|
}
|
||||||
|
|
||||||
|
type VAR_PVAR struct {
|
||||||
|
vt VARTYPE
|
||||||
|
reserved1 [6]byte
|
||||||
|
pvarVal *VARIANT
|
||||||
|
reserved2 [8]byte
|
||||||
|
}
|
||||||
|
|
||||||
|
type VAR_PBOOL struct {
|
||||||
|
vt VARTYPE
|
||||||
|
reserved1 [6]byte
|
||||||
|
pboolVal *VARIANT_BOOL
|
||||||
|
reserved2 [8]byte
|
||||||
|
}
|
||||||
|
|
||||||
|
type VAR_PPDISP struct {
|
||||||
|
vt VARTYPE
|
||||||
|
reserved1 [6]byte
|
||||||
|
ppdispVal **IDispatch
|
||||||
|
reserved2 [8]byte
|
||||||
|
}
|
301
vendor/github.com/lxn/win/opengl32.go
generated
vendored
Normal file
301
vendor/github.com/lxn/win/opengl32.go
generated
vendored
Normal file
@ -0,0 +1,301 @@
|
|||||||
|
// Copyright 2011 The win Authors. All rights reserved.
|
||||||
|
// Use of this source code is governed by a BSD-style
|
||||||
|
// license that can be found in the LICENSE file.
|
||||||
|
|
||||||
|
// +build windows
|
||||||
|
|
||||||
|
package win
|
||||||
|
|
||||||
|
import (
|
||||||
|
"syscall"
|
||||||
|
"unsafe"
|
||||||
|
)
|
||||||
|
|
||||||
|
// for second parameter of WglSwapLayerBuffers
|
||||||
|
const (
|
||||||
|
WGL_SWAP_MAIN_PLANE = (1 << 0)
|
||||||
|
WGL_SWAP_OVERLAY1 = (1 << 1)
|
||||||
|
WGL_SWAP_OVERLAY2 = (1 << 2)
|
||||||
|
WGL_SWAP_OVERLAY3 = (1 << 3)
|
||||||
|
WGL_SWAP_OVERLAY4 = (1 << 4)
|
||||||
|
WGL_SWAP_OVERLAY5 = (1 << 5)
|
||||||
|
WGL_SWAP_OVERLAY6 = (1 << 6)
|
||||||
|
WGL_SWAP_OVERLAY7 = (1 << 7)
|
||||||
|
WGL_SWAP_OVERLAY8 = (1 << 8)
|
||||||
|
WGL_SWAP_OVERLAY9 = (1 << 9)
|
||||||
|
WGL_SWAP_OVERLAY10 = (1 << 10)
|
||||||
|
WGL_SWAP_OVERLAY11 = (1 << 11)
|
||||||
|
WGL_SWAP_OVERLAY12 = (1 << 12)
|
||||||
|
WGL_SWAP_OVERLAY13 = (1 << 13)
|
||||||
|
WGL_SWAP_OVERLAY14 = (1 << 14)
|
||||||
|
WGL_SWAP_OVERLAY15 = (1 << 15)
|
||||||
|
WGL_SWAP_UNDERLAY1 = (1 << 16)
|
||||||
|
WGL_SWAP_UNDERLAY2 = (1 << 17)
|
||||||
|
WGL_SWAP_UNDERLAY3 = (1 << 18)
|
||||||
|
WGL_SWAP_UNDERLAY4 = (1 << 19)
|
||||||
|
WGL_SWAP_UNDERLAY5 = (1 << 20)
|
||||||
|
WGL_SWAP_UNDERLAY6 = (1 << 21)
|
||||||
|
WGL_SWAP_UNDERLAY7 = (1 << 22)
|
||||||
|
WGL_SWAP_UNDERLAY8 = (1 << 23)
|
||||||
|
WGL_SWAP_UNDERLAY9 = (1 << 24)
|
||||||
|
WGL_SWAP_UNDERLAY10 = (1 << 25)
|
||||||
|
WGL_SWAP_UNDERLAY11 = (1 << 26)
|
||||||
|
WGL_SWAP_UNDERLAY12 = (1 << 27)
|
||||||
|
WGL_SWAP_UNDERLAY13 = (1 << 28)
|
||||||
|
WGL_SWAP_UNDERLAY14 = (1 << 29)
|
||||||
|
WGL_SWAP_UNDERLAY15 = (1 << 30)
|
||||||
|
)
|
||||||
|
|
||||||
|
type (
|
||||||
|
HGLRC HANDLE
|
||||||
|
)
|
||||||
|
|
||||||
|
type LAYERPLANEDESCRIPTOR struct {
|
||||||
|
NSize uint16
|
||||||
|
NVersion uint16
|
||||||
|
DwFlags uint32
|
||||||
|
IPixelType uint8
|
||||||
|
CColorBits uint8
|
||||||
|
CRedBits uint8
|
||||||
|
CRedShift uint8
|
||||||
|
CGreenBits uint8
|
||||||
|
CGreenShift uint8
|
||||||
|
CBlueBits uint8
|
||||||
|
CBlueShift uint8
|
||||||
|
CAlphaBits uint8
|
||||||
|
CAlphaShift uint8
|
||||||
|
CAccumBits uint8
|
||||||
|
CAccumRedBits uint8
|
||||||
|
CAccumGreenBits uint8
|
||||||
|
CAccumBlueBits uint8
|
||||||
|
CAccumAlphaBits uint8
|
||||||
|
CDepthBits uint8
|
||||||
|
CStencilBits uint8
|
||||||
|
CAuxBuffers uint8
|
||||||
|
ILayerType uint8
|
||||||
|
BReserved uint8
|
||||||
|
CrTransparent COLORREF
|
||||||
|
}
|
||||||
|
|
||||||
|
type POINTFLOAT struct {
|
||||||
|
X, Y float32
|
||||||
|
}
|
||||||
|
|
||||||
|
type GLYPHMETRICSFLOAT struct {
|
||||||
|
GmfBlackBoxX float32
|
||||||
|
GmfBlackBoxY float32
|
||||||
|
GmfptGlyphOrigin POINTFLOAT
|
||||||
|
GmfCellIncX float32
|
||||||
|
GmfCellIncY float32
|
||||||
|
}
|
||||||
|
|
||||||
|
var (
|
||||||
|
// Library
|
||||||
|
lib uintptr
|
||||||
|
|
||||||
|
// Functions
|
||||||
|
wglCopyContext uintptr
|
||||||
|
wglCreateContext uintptr
|
||||||
|
wglCreateLayerContext uintptr
|
||||||
|
wglDeleteContext uintptr
|
||||||
|
wglDescribeLayerPlane uintptr
|
||||||
|
wglGetCurrentContext uintptr
|
||||||
|
wglGetCurrentDC uintptr
|
||||||
|
wglGetLayerPaletteEntries uintptr
|
||||||
|
wglGetProcAddress uintptr
|
||||||
|
wglMakeCurrent uintptr
|
||||||
|
wglRealizeLayerPalette uintptr
|
||||||
|
wglSetLayerPaletteEntries uintptr
|
||||||
|
wglShareLists uintptr
|
||||||
|
wglSwapLayerBuffers uintptr
|
||||||
|
wglUseFontBitmaps uintptr
|
||||||
|
wglUseFontOutlines uintptr
|
||||||
|
)
|
||||||
|
|
||||||
|
func init() {
|
||||||
|
// Library
|
||||||
|
lib = MustLoadLibrary("opengl32.dll")
|
||||||
|
|
||||||
|
// Functions
|
||||||
|
wglCopyContext = MustGetProcAddress(lib, "wglCopyContext")
|
||||||
|
wglCreateContext = MustGetProcAddress(lib, "wglCreateContext")
|
||||||
|
wglCreateLayerContext = MustGetProcAddress(lib, "wglCreateLayerContext")
|
||||||
|
wglDeleteContext = MustGetProcAddress(lib, "wglDeleteContext")
|
||||||
|
wglDescribeLayerPlane = MustGetProcAddress(lib, "wglDescribeLayerPlane")
|
||||||
|
wglGetCurrentContext = MustGetProcAddress(lib, "wglGetCurrentContext")
|
||||||
|
wglGetCurrentDC = MustGetProcAddress(lib, "wglGetCurrentDC")
|
||||||
|
wglGetLayerPaletteEntries = MustGetProcAddress(lib, "wglGetLayerPaletteEntries")
|
||||||
|
wglGetProcAddress = MustGetProcAddress(lib, "wglGetProcAddress")
|
||||||
|
wglMakeCurrent = MustGetProcAddress(lib, "wglMakeCurrent")
|
||||||
|
wglRealizeLayerPalette = MustGetProcAddress(lib, "wglRealizeLayerPalette")
|
||||||
|
wglSetLayerPaletteEntries = MustGetProcAddress(lib, "wglSetLayerPaletteEntries")
|
||||||
|
wglShareLists = MustGetProcAddress(lib, "wglShareLists")
|
||||||
|
wglSwapLayerBuffers = MustGetProcAddress(lib, "wglSwapLayerBuffers")
|
||||||
|
wglUseFontBitmaps = MustGetProcAddress(lib, "wglUseFontBitmapsW")
|
||||||
|
wglUseFontOutlines = MustGetProcAddress(lib, "wglUseFontOutlinesW")
|
||||||
|
}
|
||||||
|
|
||||||
|
func WglCopyContext(hglrcSrc, hglrcDst HGLRC, mask uint) bool {
|
||||||
|
ret, _, _ := syscall.Syscall(wglCopyContext, 3,
|
||||||
|
uintptr(hglrcSrc),
|
||||||
|
uintptr(hglrcDst),
|
||||||
|
uintptr(mask))
|
||||||
|
|
||||||
|
return ret != 0
|
||||||
|
}
|
||||||
|
|
||||||
|
func WglCreateContext(hdc HDC) HGLRC {
|
||||||
|
ret, _, _ := syscall.Syscall(wglCreateContext, 1,
|
||||||
|
uintptr(hdc),
|
||||||
|
0,
|
||||||
|
0)
|
||||||
|
|
||||||
|
return HGLRC(ret)
|
||||||
|
}
|
||||||
|
|
||||||
|
func WglCreateLayerContext(hdc HDC, iLayerPlane int) HGLRC {
|
||||||
|
ret, _, _ := syscall.Syscall(wglCreateLayerContext, 2,
|
||||||
|
uintptr(hdc),
|
||||||
|
uintptr(iLayerPlane),
|
||||||
|
0)
|
||||||
|
|
||||||
|
return HGLRC(ret)
|
||||||
|
}
|
||||||
|
|
||||||
|
func WglDeleteContext(hglrc HGLRC) bool {
|
||||||
|
ret, _, _ := syscall.Syscall(wglDeleteContext, 1,
|
||||||
|
uintptr(hglrc),
|
||||||
|
0,
|
||||||
|
0)
|
||||||
|
|
||||||
|
return ret != 0
|
||||||
|
}
|
||||||
|
|
||||||
|
func WglDescribeLayerPlane(hdc HDC, iPixelFormat, iLayerPlane int, nBytes uint8, plpd *LAYERPLANEDESCRIPTOR) bool {
|
||||||
|
ret, _, _ := syscall.Syscall6(wglDescribeLayerPlane, 5,
|
||||||
|
uintptr(hdc),
|
||||||
|
uintptr(iPixelFormat),
|
||||||
|
uintptr(iLayerPlane),
|
||||||
|
uintptr(nBytes),
|
||||||
|
uintptr(unsafe.Pointer(plpd)),
|
||||||
|
0)
|
||||||
|
|
||||||
|
return ret != 0
|
||||||
|
}
|
||||||
|
|
||||||
|
func WglGetCurrentContext() HGLRC {
|
||||||
|
ret, _, _ := syscall.Syscall(wglGetCurrentContext, 0,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0)
|
||||||
|
|
||||||
|
return HGLRC(ret)
|
||||||
|
}
|
||||||
|
|
||||||
|
func WglGetCurrentDC() HDC {
|
||||||
|
ret, _, _ := syscall.Syscall(wglGetCurrentDC, 0,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0)
|
||||||
|
|
||||||
|
return HDC(ret)
|
||||||
|
}
|
||||||
|
|
||||||
|
func WglGetLayerPaletteEntries(hdc HDC, iLayerPlane, iStart, cEntries int, pcr *COLORREF) int {
|
||||||
|
ret, _, _ := syscall.Syscall6(wglGetLayerPaletteEntries, 5,
|
||||||
|
uintptr(hdc),
|
||||||
|
uintptr(iLayerPlane),
|
||||||
|
uintptr(iStart),
|
||||||
|
uintptr(cEntries),
|
||||||
|
uintptr(unsafe.Pointer(pcr)),
|
||||||
|
0)
|
||||||
|
|
||||||
|
return int(ret)
|
||||||
|
}
|
||||||
|
|
||||||
|
func WglGetProcAddress(lpszProc *byte) uintptr {
|
||||||
|
ret, _, _ := syscall.Syscall(wglGetProcAddress, 1,
|
||||||
|
uintptr(unsafe.Pointer(lpszProc)),
|
||||||
|
0,
|
||||||
|
0)
|
||||||
|
|
||||||
|
return uintptr(ret)
|
||||||
|
}
|
||||||
|
|
||||||
|
func WglMakeCurrent(hdc HDC, hglrc HGLRC) bool {
|
||||||
|
ret, _, _ := syscall.Syscall(wglMakeCurrent, 2,
|
||||||
|
uintptr(hdc),
|
||||||
|
uintptr(hglrc),
|
||||||
|
0)
|
||||||
|
|
||||||
|
return ret != 0
|
||||||
|
}
|
||||||
|
|
||||||
|
func WglRealizeLayerPalette(hdc HDC, iLayerPlane int, bRealize bool) bool {
|
||||||
|
ret, _, _ := syscall.Syscall(wglRealizeLayerPalette, 3,
|
||||||
|
uintptr(hdc),
|
||||||
|
uintptr(iLayerPlane),
|
||||||
|
uintptr(BoolToBOOL(bRealize)))
|
||||||
|
|
||||||
|
return ret != 0
|
||||||
|
}
|
||||||
|
|
||||||
|
func WglSetLayerPaletteEntries(hdc HDC, iLayerPlane, iStart, cEntries int, pcr *COLORREF) int {
|
||||||
|
ret, _, _ := syscall.Syscall6(wglSetLayerPaletteEntries, 5,
|
||||||
|
uintptr(hdc),
|
||||||
|
uintptr(iLayerPlane),
|
||||||
|
uintptr(iStart),
|
||||||
|
uintptr(cEntries),
|
||||||
|
uintptr(unsafe.Pointer(pcr)),
|
||||||
|
0)
|
||||||
|
|
||||||
|
return int(ret)
|
||||||
|
}
|
||||||
|
|
||||||
|
func WglShareLists(hglrc1, hglrc2 HGLRC) bool {
|
||||||
|
ret, _, _ := syscall.Syscall(wglShareLists, 2,
|
||||||
|
uintptr(hglrc1),
|
||||||
|
uintptr(hglrc2),
|
||||||
|
0)
|
||||||
|
|
||||||
|
return ret != 0
|
||||||
|
}
|
||||||
|
|
||||||
|
func WglSwapLayerBuffers(hdc HDC, fuPlanes uint) bool {
|
||||||
|
ret, _, _ := syscall.Syscall(wglSwapLayerBuffers, 2,
|
||||||
|
uintptr(hdc),
|
||||||
|
uintptr(fuPlanes),
|
||||||
|
0)
|
||||||
|
|
||||||
|
return ret != 0
|
||||||
|
}
|
||||||
|
|
||||||
|
func WglUseFontBitmaps(hdc HDC, first, count, listbase uint32) bool {
|
||||||
|
ret, _, _ := syscall.Syscall6(wglUseFontBitmaps, 4,
|
||||||
|
uintptr(hdc),
|
||||||
|
uintptr(first),
|
||||||
|
uintptr(count),
|
||||||
|
uintptr(listbase),
|
||||||
|
0,
|
||||||
|
0)
|
||||||
|
|
||||||
|
return ret != 0
|
||||||
|
}
|
||||||
|
|
||||||
|
func WglUseFontOutlines(hdc HDC, first, count, listbase uint32, deviation, extrusion float32, format int, pgmf *GLYPHMETRICSFLOAT) bool {
|
||||||
|
ret, _, _ := syscall.Syscall12(wglUseFontBitmaps, 8,
|
||||||
|
uintptr(hdc),
|
||||||
|
uintptr(first),
|
||||||
|
uintptr(count),
|
||||||
|
uintptr(listbase),
|
||||||
|
uintptr(deviation),
|
||||||
|
uintptr(extrusion),
|
||||||
|
uintptr(format),
|
||||||
|
uintptr(unsafe.Pointer(pgmf)),
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0)
|
||||||
|
|
||||||
|
return ret != 0
|
||||||
|
}
|
436
vendor/github.com/lxn/win/pdh.go
generated
vendored
Normal file
436
vendor/github.com/lxn/win/pdh.go
generated
vendored
Normal file
@ -0,0 +1,436 @@
|
|||||||
|
// Copyright 2013 The win Authors. All rights reserved.
|
||||||
|
// Use of this source code is governed by a BSD-style
|
||||||
|
// license that can be found in the LICENSE file.
|
||||||
|
|
||||||
|
// +build windows
|
||||||
|
|
||||||
|
package win
|
||||||
|
|
||||||
|
import (
|
||||||
|
"syscall"
|
||||||
|
"unsafe"
|
||||||
|
)
|
||||||
|
|
||||||
|
// PDH error codes, which can be returned by all Pdh* functions. Taken from mingw-w64 pdhmsg.h
|
||||||
|
const (
|
||||||
|
PDH_CSTATUS_VALID_DATA = 0x00000000 // The returned data is valid.
|
||||||
|
PDH_CSTATUS_NEW_DATA = 0x00000001 // The return data value is valid and different from the last sample.
|
||||||
|
PDH_CSTATUS_NO_MACHINE = 0x800007D0 // Unable to connect to the specified computer, or the computer is offline.
|
||||||
|
PDH_CSTATUS_NO_INSTANCE = 0x800007D1
|
||||||
|
PDH_MORE_DATA = 0x800007D2 // The PdhGetFormattedCounterArray* function can return this if there's 'more data to be displayed'.
|
||||||
|
PDH_CSTATUS_ITEM_NOT_VALIDATED = 0x800007D3
|
||||||
|
PDH_RETRY = 0x800007D4
|
||||||
|
PDH_NO_DATA = 0x800007D5 // The query does not currently contain any counters (for example, limited access)
|
||||||
|
PDH_CALC_NEGATIVE_DENOMINATOR = 0x800007D6
|
||||||
|
PDH_CALC_NEGATIVE_TIMEBASE = 0x800007D7
|
||||||
|
PDH_CALC_NEGATIVE_VALUE = 0x800007D8
|
||||||
|
PDH_DIALOG_CANCELLED = 0x800007D9
|
||||||
|
PDH_END_OF_LOG_FILE = 0x800007DA
|
||||||
|
PDH_ASYNC_QUERY_TIMEOUT = 0x800007DB
|
||||||
|
PDH_CANNOT_SET_DEFAULT_REALTIME_DATASOURCE = 0x800007DC
|
||||||
|
PDH_CSTATUS_NO_OBJECT = 0xC0000BB8
|
||||||
|
PDH_CSTATUS_NO_COUNTER = 0xC0000BB9 // The specified counter could not be found.
|
||||||
|
PDH_CSTATUS_INVALID_DATA = 0xC0000BBA // The counter was successfully found, but the data returned is not valid.
|
||||||
|
PDH_MEMORY_ALLOCATION_FAILURE = 0xC0000BBB
|
||||||
|
PDH_INVALID_HANDLE = 0xC0000BBC
|
||||||
|
PDH_INVALID_ARGUMENT = 0xC0000BBD // Required argument is missing or incorrect.
|
||||||
|
PDH_FUNCTION_NOT_FOUND = 0xC0000BBE
|
||||||
|
PDH_CSTATUS_NO_COUNTERNAME = 0xC0000BBF
|
||||||
|
PDH_CSTATUS_BAD_COUNTERNAME = 0xC0000BC0 // Unable to parse the counter path. Check the format and syntax of the specified path.
|
||||||
|
PDH_INVALID_BUFFER = 0xC0000BC1
|
||||||
|
PDH_INSUFFICIENT_BUFFER = 0xC0000BC2
|
||||||
|
PDH_CANNOT_CONNECT_MACHINE = 0xC0000BC3
|
||||||
|
PDH_INVALID_PATH = 0xC0000BC4
|
||||||
|
PDH_INVALID_INSTANCE = 0xC0000BC5
|
||||||
|
PDH_INVALID_DATA = 0xC0000BC6 // specified counter does not contain valid data or a successful status code.
|
||||||
|
PDH_NO_DIALOG_DATA = 0xC0000BC7
|
||||||
|
PDH_CANNOT_READ_NAME_STRINGS = 0xC0000BC8
|
||||||
|
PDH_LOG_FILE_CREATE_ERROR = 0xC0000BC9
|
||||||
|
PDH_LOG_FILE_OPEN_ERROR = 0xC0000BCA
|
||||||
|
PDH_LOG_TYPE_NOT_FOUND = 0xC0000BCB
|
||||||
|
PDH_NO_MORE_DATA = 0xC0000BCC
|
||||||
|
PDH_ENTRY_NOT_IN_LOG_FILE = 0xC0000BCD
|
||||||
|
PDH_DATA_SOURCE_IS_LOG_FILE = 0xC0000BCE
|
||||||
|
PDH_DATA_SOURCE_IS_REAL_TIME = 0xC0000BCF
|
||||||
|
PDH_UNABLE_READ_LOG_HEADER = 0xC0000BD0
|
||||||
|
PDH_FILE_NOT_FOUND = 0xC0000BD1
|
||||||
|
PDH_FILE_ALREADY_EXISTS = 0xC0000BD2
|
||||||
|
PDH_NOT_IMPLEMENTED = 0xC0000BD3
|
||||||
|
PDH_STRING_NOT_FOUND = 0xC0000BD4
|
||||||
|
PDH_UNABLE_MAP_NAME_FILES = 0x80000BD5
|
||||||
|
PDH_UNKNOWN_LOG_FORMAT = 0xC0000BD6
|
||||||
|
PDH_UNKNOWN_LOGSVC_COMMAND = 0xC0000BD7
|
||||||
|
PDH_LOGSVC_QUERY_NOT_FOUND = 0xC0000BD8
|
||||||
|
PDH_LOGSVC_NOT_OPENED = 0xC0000BD9
|
||||||
|
PDH_WBEM_ERROR = 0xC0000BDA
|
||||||
|
PDH_ACCESS_DENIED = 0xC0000BDB
|
||||||
|
PDH_LOG_FILE_TOO_SMALL = 0xC0000BDC
|
||||||
|
PDH_INVALID_DATASOURCE = 0xC0000BDD
|
||||||
|
PDH_INVALID_SQLDB = 0xC0000BDE
|
||||||
|
PDH_NO_COUNTERS = 0xC0000BDF
|
||||||
|
PDH_SQL_ALLOC_FAILED = 0xC0000BE0
|
||||||
|
PDH_SQL_ALLOCCON_FAILED = 0xC0000BE1
|
||||||
|
PDH_SQL_EXEC_DIRECT_FAILED = 0xC0000BE2
|
||||||
|
PDH_SQL_FETCH_FAILED = 0xC0000BE3
|
||||||
|
PDH_SQL_ROWCOUNT_FAILED = 0xC0000BE4
|
||||||
|
PDH_SQL_MORE_RESULTS_FAILED = 0xC0000BE5
|
||||||
|
PDH_SQL_CONNECT_FAILED = 0xC0000BE6
|
||||||
|
PDH_SQL_BIND_FAILED = 0xC0000BE7
|
||||||
|
PDH_CANNOT_CONNECT_WMI_SERVER = 0xC0000BE8
|
||||||
|
PDH_PLA_COLLECTION_ALREADY_RUNNING = 0xC0000BE9
|
||||||
|
PDH_PLA_ERROR_SCHEDULE_OVERLAP = 0xC0000BEA
|
||||||
|
PDH_PLA_COLLECTION_NOT_FOUND = 0xC0000BEB
|
||||||
|
PDH_PLA_ERROR_SCHEDULE_ELAPSED = 0xC0000BEC
|
||||||
|
PDH_PLA_ERROR_NOSTART = 0xC0000BED
|
||||||
|
PDH_PLA_ERROR_ALREADY_EXISTS = 0xC0000BEE
|
||||||
|
PDH_PLA_ERROR_TYPE_MISMATCH = 0xC0000BEF
|
||||||
|
PDH_PLA_ERROR_FILEPATH = 0xC0000BF0
|
||||||
|
PDH_PLA_SERVICE_ERROR = 0xC0000BF1
|
||||||
|
PDH_PLA_VALIDATION_ERROR = 0xC0000BF2
|
||||||
|
PDH_PLA_VALIDATION_WARNING = 0x80000BF3
|
||||||
|
PDH_PLA_ERROR_NAME_TOO_LONG = 0xC0000BF4
|
||||||
|
PDH_INVALID_SQL_LOG_FORMAT = 0xC0000BF5
|
||||||
|
PDH_COUNTER_ALREADY_IN_QUERY = 0xC0000BF6
|
||||||
|
PDH_BINARY_LOG_CORRUPT = 0xC0000BF7
|
||||||
|
PDH_LOG_SAMPLE_TOO_SMALL = 0xC0000BF8
|
||||||
|
PDH_OS_LATER_VERSION = 0xC0000BF9
|
||||||
|
PDH_OS_EARLIER_VERSION = 0xC0000BFA
|
||||||
|
PDH_INCORRECT_APPEND_TIME = 0xC0000BFB
|
||||||
|
PDH_UNMATCHED_APPEND_COUNTER = 0xC0000BFC
|
||||||
|
PDH_SQL_ALTER_DETAIL_FAILED = 0xC0000BFD
|
||||||
|
PDH_QUERY_PERF_DATA_TIMEOUT = 0xC0000BFE
|
||||||
|
)
|
||||||
|
|
||||||
|
// Formatting options for GetFormattedCounterValue().
|
||||||
|
const (
|
||||||
|
PDH_FMT_RAW = 0x00000010
|
||||||
|
PDH_FMT_ANSI = 0x00000020
|
||||||
|
PDH_FMT_UNICODE = 0x00000040
|
||||||
|
PDH_FMT_LONG = 0x00000100 // Return data as a long int.
|
||||||
|
PDH_FMT_DOUBLE = 0x00000200 // Return data as a double precision floating point real.
|
||||||
|
PDH_FMT_LARGE = 0x00000400 // Return data as a 64 bit integer.
|
||||||
|
PDH_FMT_NOSCALE = 0x00001000 // can be OR-ed: Do not apply the counter's default scaling factor.
|
||||||
|
PDH_FMT_1000 = 0x00002000 // can be OR-ed: multiply the actual value by 1,000.
|
||||||
|
PDH_FMT_NODATA = 0x00004000 // can be OR-ed: unknown what this is for, MSDN says nothing.
|
||||||
|
PDH_FMT_NOCAP100 = 0x00008000 // can be OR-ed: do not cap values > 100.
|
||||||
|
PERF_DETAIL_COSTLY = 0x00010000
|
||||||
|
PERF_DETAIL_STANDARD = 0x0000FFFF
|
||||||
|
)
|
||||||
|
|
||||||
|
type (
|
||||||
|
PDH_HQUERY HANDLE // query handle
|
||||||
|
PDH_HCOUNTER HANDLE // counter handle
|
||||||
|
)
|
||||||
|
|
||||||
|
// Union specialization for double values
|
||||||
|
type PDH_FMT_COUNTERVALUE_DOUBLE struct {
|
||||||
|
CStatus uint32
|
||||||
|
DoubleValue float64
|
||||||
|
}
|
||||||
|
|
||||||
|
// Union specialization for 64 bit integer values
|
||||||
|
type PDH_FMT_COUNTERVALUE_LARGE struct {
|
||||||
|
CStatus uint32
|
||||||
|
LargeValue int64
|
||||||
|
}
|
||||||
|
|
||||||
|
// Union specialization for long values
|
||||||
|
type PDH_FMT_COUNTERVALUE_LONG struct {
|
||||||
|
CStatus uint32
|
||||||
|
LongValue int32
|
||||||
|
padding [4]byte
|
||||||
|
}
|
||||||
|
|
||||||
|
// Union specialization for double values, used by PdhGetFormattedCounterArrayDouble()
|
||||||
|
type PDH_FMT_COUNTERVALUE_ITEM_DOUBLE struct {
|
||||||
|
SzName *uint16 // pointer to a string
|
||||||
|
FmtValue PDH_FMT_COUNTERVALUE_DOUBLE
|
||||||
|
}
|
||||||
|
|
||||||
|
// Union specialization for 'large' values, used by PdhGetFormattedCounterArrayLarge()
|
||||||
|
type PDH_FMT_COUNTERVALUE_ITEM_LARGE struct {
|
||||||
|
SzName *uint16 // pointer to a string
|
||||||
|
FmtValue PDH_FMT_COUNTERVALUE_LARGE
|
||||||
|
}
|
||||||
|
|
||||||
|
// Union specialization for long values, used by PdhGetFormattedCounterArrayLong()
|
||||||
|
type PDH_FMT_COUNTERVALUE_ITEM_LONG struct {
|
||||||
|
SzName *uint16 // pointer to a string
|
||||||
|
FmtValue PDH_FMT_COUNTERVALUE_LONG
|
||||||
|
}
|
||||||
|
|
||||||
|
var (
|
||||||
|
// Library
|
||||||
|
libpdhDll *syscall.DLL
|
||||||
|
|
||||||
|
// Functions
|
||||||
|
pdh_AddCounterW *syscall.Proc
|
||||||
|
pdh_AddEnglishCounterW *syscall.Proc
|
||||||
|
pdh_CloseQuery *syscall.Proc
|
||||||
|
pdh_CollectQueryData *syscall.Proc
|
||||||
|
pdh_GetFormattedCounterValue *syscall.Proc
|
||||||
|
pdh_GetFormattedCounterArrayW *syscall.Proc
|
||||||
|
pdh_OpenQuery *syscall.Proc
|
||||||
|
pdh_ValidatePathW *syscall.Proc
|
||||||
|
)
|
||||||
|
|
||||||
|
func init() {
|
||||||
|
// Library
|
||||||
|
libpdhDll = syscall.MustLoadDLL("pdh.dll")
|
||||||
|
|
||||||
|
// Functions
|
||||||
|
pdh_AddCounterW = libpdhDll.MustFindProc("PdhAddCounterW")
|
||||||
|
pdh_AddEnglishCounterW, _ = libpdhDll.FindProc("PdhAddEnglishCounterW") // XXX: only supported on versions > Vista.
|
||||||
|
pdh_CloseQuery = libpdhDll.MustFindProc("PdhCloseQuery")
|
||||||
|
pdh_CollectQueryData = libpdhDll.MustFindProc("PdhCollectQueryData")
|
||||||
|
pdh_GetFormattedCounterValue = libpdhDll.MustFindProc("PdhGetFormattedCounterValue")
|
||||||
|
pdh_GetFormattedCounterArrayW = libpdhDll.MustFindProc("PdhGetFormattedCounterArrayW")
|
||||||
|
pdh_OpenQuery = libpdhDll.MustFindProc("PdhOpenQuery")
|
||||||
|
pdh_ValidatePathW = libpdhDll.MustFindProc("PdhValidatePathW")
|
||||||
|
}
|
||||||
|
|
||||||
|
// Adds the specified counter to the query. This is the internationalized version. Preferably, use the
|
||||||
|
// function PdhAddEnglishCounter instead. hQuery is the query handle, which has been fetched by PdhOpenQuery.
|
||||||
|
// szFullCounterPath is a full, internationalized counter path (this will differ per Windows language version).
|
||||||
|
// dwUserData is a 'user-defined value', which becomes part of the counter information. To retrieve this value
|
||||||
|
// later, call PdhGetCounterInfo() and access dwQueryUserData of the PDH_COUNTER_INFO structure.
|
||||||
|
//
|
||||||
|
// Examples of szFullCounterPath (in an English version of Windows):
|
||||||
|
//
|
||||||
|
// \\Processor(_Total)\\% Idle Time
|
||||||
|
// \\Processor(_Total)\\% Processor Time
|
||||||
|
// \\LogicalDisk(C:)\% Free Space
|
||||||
|
//
|
||||||
|
// To view all (internationalized...) counters on a system, there are three non-programmatic ways: perfmon utility,
|
||||||
|
// the typeperf command, and the the registry editor. perfmon.exe is perhaps the easiest way, because it's basically a
|
||||||
|
// full implemention of the pdh.dll API, except with a GUI and all that. The registry setting also provides an
|
||||||
|
// interface to the available counters, and can be found at the following key:
|
||||||
|
//
|
||||||
|
// HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Perflib\CurrentLanguage
|
||||||
|
//
|
||||||
|
// This registry key contains several values as follows:
|
||||||
|
//
|
||||||
|
// 1
|
||||||
|
// 1847
|
||||||
|
// 2
|
||||||
|
// System
|
||||||
|
// 4
|
||||||
|
// Memory
|
||||||
|
// 6
|
||||||
|
// % Processor Time
|
||||||
|
// ... many, many more
|
||||||
|
//
|
||||||
|
// Somehow, these numeric values can be used as szFullCounterPath too:
|
||||||
|
//
|
||||||
|
// \2\6 will correspond to \\System\% Processor Time
|
||||||
|
//
|
||||||
|
// The typeperf command may also be pretty easy. To find all performance counters, simply execute:
|
||||||
|
//
|
||||||
|
// typeperf -qx
|
||||||
|
func PdhAddCounter(hQuery PDH_HQUERY, szFullCounterPath string, dwUserData uintptr, phCounter *PDH_HCOUNTER) uint32 {
|
||||||
|
ptxt, _ := syscall.UTF16PtrFromString(szFullCounterPath)
|
||||||
|
ret, _, _ := pdh_AddCounterW.Call(
|
||||||
|
uintptr(hQuery),
|
||||||
|
uintptr(unsafe.Pointer(ptxt)),
|
||||||
|
dwUserData,
|
||||||
|
uintptr(unsafe.Pointer(phCounter)))
|
||||||
|
|
||||||
|
return uint32(ret)
|
||||||
|
}
|
||||||
|
|
||||||
|
// Adds the specified language-neutral counter to the query. See the PdhAddCounter function. This function only exists on
|
||||||
|
// Windows versions higher than Vista.
|
||||||
|
func PdhAddEnglishCounter(hQuery PDH_HQUERY, szFullCounterPath string, dwUserData uintptr, phCounter *PDH_HCOUNTER) uint32 {
|
||||||
|
if pdh_AddEnglishCounterW == nil {
|
||||||
|
return ERROR_INVALID_FUNCTION
|
||||||
|
}
|
||||||
|
|
||||||
|
ptxt, _ := syscall.UTF16PtrFromString(szFullCounterPath)
|
||||||
|
ret, _, _ := pdh_AddEnglishCounterW.Call(
|
||||||
|
uintptr(hQuery),
|
||||||
|
uintptr(unsafe.Pointer(ptxt)),
|
||||||
|
dwUserData,
|
||||||
|
uintptr(unsafe.Pointer(phCounter)))
|
||||||
|
|
||||||
|
return uint32(ret)
|
||||||
|
}
|
||||||
|
|
||||||
|
// Closes all counters contained in the specified query, closes all handles related to the query,
|
||||||
|
// and frees all memory associated with the query.
|
||||||
|
func PdhCloseQuery(hQuery PDH_HQUERY) uint32 {
|
||||||
|
ret, _, _ := pdh_CloseQuery.Call(uintptr(hQuery))
|
||||||
|
|
||||||
|
return uint32(ret)
|
||||||
|
}
|
||||||
|
|
||||||
|
// Collects the current raw data value for all counters in the specified query and updates the status
|
||||||
|
// code of each counter. With some counters, this function needs to be repeatedly called before the value
|
||||||
|
// of the counter can be extracted with PdhGetFormattedCounterValue(). For example, the following code
|
||||||
|
// requires at least two calls:
|
||||||
|
//
|
||||||
|
// var handle win.PDH_HQUERY
|
||||||
|
// var counterHandle win.PDH_HCOUNTER
|
||||||
|
// ret := win.PdhOpenQuery(0, 0, &handle)
|
||||||
|
// ret = win.PdhAddEnglishCounter(handle, "\\Processor(_Total)\\% Idle Time", 0, &counterHandle)
|
||||||
|
// var derp win.PDH_FMT_COUNTERVALUE_DOUBLE
|
||||||
|
//
|
||||||
|
// ret = win.PdhCollectQueryData(handle)
|
||||||
|
// fmt.Printf("Collect return code is %x\n", ret) // return code will be PDH_CSTATUS_INVALID_DATA
|
||||||
|
// ret = win.PdhGetFormattedCounterValueDouble(counterHandle, 0, &derp)
|
||||||
|
//
|
||||||
|
// ret = win.PdhCollectQueryData(handle)
|
||||||
|
// fmt.Printf("Collect return code is %x\n", ret) // return code will be ERROR_SUCCESS
|
||||||
|
// ret = win.PdhGetFormattedCounterValueDouble(counterHandle, 0, &derp)
|
||||||
|
//
|
||||||
|
// The PdhCollectQueryData will return an error in the first call because it needs two values for
|
||||||
|
// displaying the correct data for the processor idle time. The second call will have a 0 return code.
|
||||||
|
func PdhCollectQueryData(hQuery PDH_HQUERY) uint32 {
|
||||||
|
ret, _, _ := pdh_CollectQueryData.Call(uintptr(hQuery))
|
||||||
|
|
||||||
|
return uint32(ret)
|
||||||
|
}
|
||||||
|
|
||||||
|
// Formats the given hCounter using a 'double'. The result is set into the specialized union struct pValue.
|
||||||
|
// This function does not directly translate to a Windows counterpart due to union specialization tricks.
|
||||||
|
func PdhGetFormattedCounterValueDouble(hCounter PDH_HCOUNTER, lpdwType *uint32, pValue *PDH_FMT_COUNTERVALUE_DOUBLE) uint32 {
|
||||||
|
ret, _, _ := pdh_GetFormattedCounterValue.Call(
|
||||||
|
uintptr(hCounter),
|
||||||
|
uintptr(PDH_FMT_DOUBLE),
|
||||||
|
uintptr(unsafe.Pointer(lpdwType)),
|
||||||
|
uintptr(unsafe.Pointer(pValue)))
|
||||||
|
|
||||||
|
return uint32(ret)
|
||||||
|
}
|
||||||
|
|
||||||
|
// Formats the given hCounter using a large int (int64). The result is set into the specialized union struct pValue.
|
||||||
|
// This function does not directly translate to a Windows counterpart due to union specialization tricks.
|
||||||
|
func PdhGetFormattedCounterValueLarge(hCounter PDH_HCOUNTER, lpdwType *uint32, pValue *PDH_FMT_COUNTERVALUE_LARGE) uint32 {
|
||||||
|
ret, _, _ := pdh_GetFormattedCounterValue.Call(
|
||||||
|
uintptr(hCounter),
|
||||||
|
uintptr(PDH_FMT_LARGE),
|
||||||
|
uintptr(unsafe.Pointer(lpdwType)),
|
||||||
|
uintptr(unsafe.Pointer(pValue)))
|
||||||
|
|
||||||
|
return uint32(ret)
|
||||||
|
}
|
||||||
|
|
||||||
|
// Formats the given hCounter using a 'long'. The result is set into the specialized union struct pValue.
|
||||||
|
// This function does not directly translate to a Windows counterpart due to union specialization tricks.
|
||||||
|
//
|
||||||
|
// BUG(krpors): Testing this function on multiple systems yielded inconsistent results. For instance,
|
||||||
|
// the pValue.LongValue kept the value '192' on test system A, but on B this was '0', while the padding
|
||||||
|
// bytes of the struct got the correct value. Until someone can figure out this behaviour, prefer to use
|
||||||
|
// the Double or Large counterparts instead. These functions provide actually the same data, except in
|
||||||
|
// a different, working format.
|
||||||
|
func PdhGetFormattedCounterValueLong(hCounter PDH_HCOUNTER, lpdwType *uint32, pValue *PDH_FMT_COUNTERVALUE_LONG) uint32 {
|
||||||
|
ret, _, _ := pdh_GetFormattedCounterValue.Call(
|
||||||
|
uintptr(hCounter),
|
||||||
|
uintptr(PDH_FMT_LONG),
|
||||||
|
uintptr(unsafe.Pointer(lpdwType)),
|
||||||
|
uintptr(unsafe.Pointer(pValue)))
|
||||||
|
|
||||||
|
return uint32(ret)
|
||||||
|
}
|
||||||
|
|
||||||
|
// Returns an array of formatted counter values. Use this function when you want to format the counter values of a
|
||||||
|
// counter that contains a wildcard character for the instance name. The itemBuffer must a slice of type PDH_FMT_COUNTERVALUE_ITEM_DOUBLE.
|
||||||
|
// An example of how this function can be used:
|
||||||
|
//
|
||||||
|
// okPath := "\\Process(*)\\% Processor Time" // notice the wildcard * character
|
||||||
|
//
|
||||||
|
// // ommitted all necessary stuff ...
|
||||||
|
//
|
||||||
|
// var bufSize uint32
|
||||||
|
// var bufCount uint32
|
||||||
|
// var size uint32 = uint32(unsafe.Sizeof(win.PDH_FMT_COUNTERVALUE_ITEM_DOUBLE{}))
|
||||||
|
// var emptyBuf [1]win.PDH_FMT_COUNTERVALUE_ITEM_DOUBLE // need at least 1 addressable null ptr.
|
||||||
|
//
|
||||||
|
// for {
|
||||||
|
// // collect
|
||||||
|
// ret := win.PdhCollectQueryData(queryHandle)
|
||||||
|
// if ret == win.ERROR_SUCCESS {
|
||||||
|
// ret = win.PdhGetFormattedCounterArrayDouble(counterHandle, &bufSize, &bufCount, &emptyBuf[0]) // uses null ptr here according to MSDN.
|
||||||
|
// if ret == win.PDH_MORE_DATA {
|
||||||
|
// filledBuf := make([]win.PDH_FMT_COUNTERVALUE_ITEM_DOUBLE, bufCount*size)
|
||||||
|
// ret = win.PdhGetFormattedCounterArrayDouble(counterHandle, &bufSize, &bufCount, &filledBuf[0])
|
||||||
|
// for i := 0; i < int(bufCount); i++ {
|
||||||
|
// c := filledBuf[i]
|
||||||
|
// var s string = win.UTF16PtrToString(c.SzName)
|
||||||
|
// fmt.Printf("Index %d -> %s, value %v\n", i, s, c.FmtValue.DoubleValue)
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// filledBuf = nil
|
||||||
|
// // Need to at least set bufSize to zero, because if not, the function will not
|
||||||
|
// // return PDH_MORE_DATA and will not set the bufSize.
|
||||||
|
// bufCount = 0
|
||||||
|
// bufSize = 0
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// time.Sleep(2000 * time.Millisecond)
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
func PdhGetFormattedCounterArrayDouble(hCounter PDH_HCOUNTER, lpdwBufferSize *uint32, lpdwBufferCount *uint32, itemBuffer *PDH_FMT_COUNTERVALUE_ITEM_DOUBLE) uint32 {
|
||||||
|
ret, _, _ := pdh_GetFormattedCounterArrayW.Call(
|
||||||
|
uintptr(hCounter),
|
||||||
|
uintptr(PDH_FMT_DOUBLE),
|
||||||
|
uintptr(unsafe.Pointer(lpdwBufferSize)),
|
||||||
|
uintptr(unsafe.Pointer(lpdwBufferCount)),
|
||||||
|
uintptr(unsafe.Pointer(itemBuffer)))
|
||||||
|
|
||||||
|
return uint32(ret)
|
||||||
|
}
|
||||||
|
|
||||||
|
// Returns an array of formatted counter values. Use this function when you want to format the counter values of a
|
||||||
|
// counter that contains a wildcard character for the instance name. The itemBuffer must a slice of type PDH_FMT_COUNTERVALUE_ITEM_LARGE.
|
||||||
|
// For an example usage, see PdhGetFormattedCounterArrayDouble.
|
||||||
|
func PdhGetFormattedCounterArrayLarge(hCounter PDH_HCOUNTER, lpdwBufferSize *uint32, lpdwBufferCount *uint32, itemBuffer *PDH_FMT_COUNTERVALUE_ITEM_LARGE) uint32 {
|
||||||
|
ret, _, _ := pdh_GetFormattedCounterArrayW.Call(
|
||||||
|
uintptr(hCounter),
|
||||||
|
uintptr(PDH_FMT_LARGE),
|
||||||
|
uintptr(unsafe.Pointer(lpdwBufferSize)),
|
||||||
|
uintptr(unsafe.Pointer(lpdwBufferCount)),
|
||||||
|
uintptr(unsafe.Pointer(itemBuffer)))
|
||||||
|
|
||||||
|
return uint32(ret)
|
||||||
|
}
|
||||||
|
|
||||||
|
// Returns an array of formatted counter values. Use this function when you want to format the counter values of a
|
||||||
|
// counter that contains a wildcard character for the instance name. The itemBuffer must a slice of type PDH_FMT_COUNTERVALUE_ITEM_LONG.
|
||||||
|
// For an example usage, see PdhGetFormattedCounterArrayDouble.
|
||||||
|
//
|
||||||
|
// BUG(krpors): See description of PdhGetFormattedCounterValueLong().
|
||||||
|
func PdhGetFormattedCounterArrayLong(hCounter PDH_HCOUNTER, lpdwBufferSize *uint32, lpdwBufferCount *uint32, itemBuffer *PDH_FMT_COUNTERVALUE_ITEM_LONG) uint32 {
|
||||||
|
ret, _, _ := pdh_GetFormattedCounterArrayW.Call(
|
||||||
|
uintptr(hCounter),
|
||||||
|
uintptr(PDH_FMT_LONG),
|
||||||
|
uintptr(unsafe.Pointer(lpdwBufferSize)),
|
||||||
|
uintptr(unsafe.Pointer(lpdwBufferCount)),
|
||||||
|
uintptr(unsafe.Pointer(itemBuffer)))
|
||||||
|
|
||||||
|
return uint32(ret)
|
||||||
|
}
|
||||||
|
|
||||||
|
// Creates a new query that is used to manage the collection of performance data.
|
||||||
|
// szDataSource is a null terminated string that specifies the name of the log file from which to
|
||||||
|
// retrieve the performance data. If 0, performance data is collected from a real-time data source.
|
||||||
|
// dwUserData is a user-defined value to associate with this query. To retrieve the user data later,
|
||||||
|
// call PdhGetCounterInfo and access dwQueryUserData of the PDH_COUNTER_INFO structure. phQuery is
|
||||||
|
// the handle to the query, and must be used in subsequent calls. This function returns a PDH_
|
||||||
|
// constant error code, or ERROR_SUCCESS if the call succeeded.
|
||||||
|
func PdhOpenQuery(szDataSource uintptr, dwUserData uintptr, phQuery *PDH_HQUERY) uint32 {
|
||||||
|
ret, _, _ := pdh_OpenQuery.Call(
|
||||||
|
szDataSource,
|
||||||
|
dwUserData,
|
||||||
|
uintptr(unsafe.Pointer(phQuery)))
|
||||||
|
|
||||||
|
return uint32(ret)
|
||||||
|
}
|
||||||
|
|
||||||
|
// Validates a path. Will return ERROR_SUCCESS when ok, or PDH_CSTATUS_BAD_COUNTERNAME when the path is
|
||||||
|
// erroneous.
|
||||||
|
func PdhValidatePath(path string) uint32 {
|
||||||
|
ptxt, _ := syscall.UTF16PtrFromString(path)
|
||||||
|
ret, _, _ := pdh_ValidatePathW.Call(uintptr(unsafe.Pointer(ptxt)))
|
||||||
|
|
||||||
|
return uint32(ret)
|
||||||
|
}
|
327
vendor/github.com/lxn/win/shdocvw.go
generated
vendored
Normal file
327
vendor/github.com/lxn/win/shdocvw.go
generated
vendored
Normal file
@ -0,0 +1,327 @@
|
|||||||
|
// Copyright 2010 The win Authors. All rights reserved.
|
||||||
|
// Use of this source code is governed by a BSD-style
|
||||||
|
// license that can be found in the LICENSE file.
|
||||||
|
|
||||||
|
// +build windows
|
||||||
|
|
||||||
|
package win
|
||||||
|
|
||||||
|
import (
|
||||||
|
"syscall"
|
||||||
|
"unsafe"
|
||||||
|
)
|
||||||
|
|
||||||
|
const (
|
||||||
|
DOCHOSTUIDBLCLK_DEFAULT = 0
|
||||||
|
DOCHOSTUIDBLCLK_SHOWPROPERTIES = 1
|
||||||
|
DOCHOSTUIDBLCLK_SHOWCODE = 2
|
||||||
|
)
|
||||||
|
|
||||||
|
const (
|
||||||
|
DOCHOSTUIFLAG_DIALOG = 0x1
|
||||||
|
DOCHOSTUIFLAG_DISABLE_HELP_MENU = 0x2
|
||||||
|
DOCHOSTUIFLAG_NO3DBORDER = 0x4
|
||||||
|
DOCHOSTUIFLAG_SCROLL_NO = 0x8
|
||||||
|
DOCHOSTUIFLAG_DISABLE_SCRIPT_INACTIVE = 0x10
|
||||||
|
DOCHOSTUIFLAG_OPENNEWWIN = 0x20
|
||||||
|
DOCHOSTUIFLAG_DISABLE_OFFSCREEN = 0x40
|
||||||
|
DOCHOSTUIFLAG_FLAT_SCROLLBAR = 0x80
|
||||||
|
DOCHOSTUIFLAG_DIV_BLOCKDEFAULT = 0x100
|
||||||
|
DOCHOSTUIFLAG_ACTIVATE_CLIENTHIT_ONLY = 0x200
|
||||||
|
DOCHOSTUIFLAG_OVERRIDEBEHAVIORFACTORY = 0x400
|
||||||
|
DOCHOSTUIFLAG_CODEPAGELINKEDFONTS = 0x800
|
||||||
|
DOCHOSTUIFLAG_URL_ENCODING_DISABLE_UTF8 = 0x1000
|
||||||
|
DOCHOSTUIFLAG_URL_ENCODING_ENABLE_UTF8 = 0x2000
|
||||||
|
DOCHOSTUIFLAG_ENABLE_FORMS_AUTOCOMPLETE = 0x4000
|
||||||
|
DOCHOSTUIFLAG_ENABLE_INPLACE_NAVIGATION = 0x10000
|
||||||
|
DOCHOSTUIFLAG_IME_ENABLE_RECONVERSION = 0x20000
|
||||||
|
DOCHOSTUIFLAG_THEME = 0x40000
|
||||||
|
DOCHOSTUIFLAG_NOTHEME = 0x80000
|
||||||
|
DOCHOSTUIFLAG_NOPICS = 0x100000
|
||||||
|
DOCHOSTUIFLAG_NO3DOUTERBORDER = 0x200000
|
||||||
|
DOCHOSTUIFLAG_DISABLE_EDIT_NS_FIXUP = 0x400000
|
||||||
|
DOCHOSTUIFLAG_LOCAL_MACHINE_ACCESS_CHECK = 0x800000
|
||||||
|
DOCHOSTUIFLAG_DISABLE_UNTRUSTEDPROTOCOL = 0x1000000
|
||||||
|
)
|
||||||
|
|
||||||
|
// BrowserNavConstants
|
||||||
|
const (
|
||||||
|
NavOpenInNewWindow = 0x1
|
||||||
|
NavNoHistory = 0x2
|
||||||
|
NavNoReadFromCache = 0x4
|
||||||
|
NavNoWriteToCache = 0x8
|
||||||
|
NavAllowAutosearch = 0x10
|
||||||
|
NavBrowserBar = 0x20
|
||||||
|
NavHyperlink = 0x40
|
||||||
|
NavEnforceRestricted = 0x80
|
||||||
|
NavNewWindowsManaged = 0x0100
|
||||||
|
NavUntrustedForDownload = 0x0200
|
||||||
|
NavTrustedForActiveX = 0x0400
|
||||||
|
NavOpenInNewTab = 0x0800
|
||||||
|
NavOpenInBackgroundTab = 0x1000
|
||||||
|
NavKeepWordWheelText = 0x2000
|
||||||
|
NavVirtualTab = 0x4000
|
||||||
|
NavBlockRedirectsXDomain = 0x8000
|
||||||
|
NavOpenNewForegroundTab = 0x10000
|
||||||
|
)
|
||||||
|
|
||||||
|
var (
|
||||||
|
CLSID_WebBrowser = CLSID{0x8856F961, 0x340A, 0x11D0, [8]byte{0xA9, 0x6B, 0x00, 0xC0, 0x4F, 0xD7, 0x05, 0xA2}}
|
||||||
|
DIID_DWebBrowserEvents2 = IID{0x34A715A0, 0x6587, 0x11D0, [8]byte{0x92, 0x4A, 0x00, 0x20, 0xAF, 0xC7, 0xAC, 0x4D}}
|
||||||
|
IID_IWebBrowser2 = IID{0xD30C1661, 0xCDAF, 0x11D0, [8]byte{0x8A, 0x3E, 0x00, 0xC0, 0x4F, 0xC9, 0xE2, 0x6E}}
|
||||||
|
IID_IDocHostUIHandler = IID{0xBD3F23C0, 0xD43E, 0x11CF, [8]byte{0x89, 0x3B, 0x00, 0xAA, 0x00, 0xBD, 0xCE, 0x1A}}
|
||||||
|
IID_IOleInPlaceActiveObject = IID{0x00000117, 0x0000, 0x0000, [8]byte{0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46}}
|
||||||
|
)
|
||||||
|
|
||||||
|
type DWebBrowserEvents2Vtbl struct {
|
||||||
|
QueryInterface uintptr
|
||||||
|
AddRef uintptr
|
||||||
|
Release uintptr
|
||||||
|
GetTypeInfoCount uintptr
|
||||||
|
GetTypeInfo uintptr
|
||||||
|
GetIDsOfNames uintptr
|
||||||
|
Invoke uintptr
|
||||||
|
}
|
||||||
|
|
||||||
|
type DWebBrowserEvents2 struct {
|
||||||
|
LpVtbl *DWebBrowserEvents2Vtbl
|
||||||
|
}
|
||||||
|
|
||||||
|
type IWebBrowser2Vtbl struct {
|
||||||
|
QueryInterface uintptr
|
||||||
|
AddRef uintptr
|
||||||
|
Release uintptr
|
||||||
|
GetTypeInfoCount uintptr
|
||||||
|
GetTypeInfo uintptr
|
||||||
|
GetIDsOfNames uintptr
|
||||||
|
Invoke uintptr
|
||||||
|
GoBack uintptr
|
||||||
|
GoForward uintptr
|
||||||
|
GoHome uintptr
|
||||||
|
GoSearch uintptr
|
||||||
|
Navigate uintptr
|
||||||
|
Refresh uintptr
|
||||||
|
Refresh2 uintptr
|
||||||
|
Stop uintptr
|
||||||
|
Get_Application uintptr
|
||||||
|
Get_Parent uintptr
|
||||||
|
Get_Container uintptr
|
||||||
|
Get_Document uintptr
|
||||||
|
Get_TopLevelContainer uintptr
|
||||||
|
Get_Type uintptr
|
||||||
|
Get_Left uintptr
|
||||||
|
Put_Left uintptr
|
||||||
|
Get_Top uintptr
|
||||||
|
Put_Top uintptr
|
||||||
|
Get_Width uintptr
|
||||||
|
Put_Width uintptr
|
||||||
|
Get_Height uintptr
|
||||||
|
Put_Height uintptr
|
||||||
|
Get_LocationName uintptr
|
||||||
|
Get_LocationURL uintptr
|
||||||
|
Get_Busy uintptr
|
||||||
|
Quit uintptr
|
||||||
|
ClientToWindow uintptr
|
||||||
|
PutProperty uintptr
|
||||||
|
GetProperty uintptr
|
||||||
|
Get_Name uintptr
|
||||||
|
Get_HWND uintptr
|
||||||
|
Get_FullName uintptr
|
||||||
|
Get_Path uintptr
|
||||||
|
Get_Visible uintptr
|
||||||
|
Put_Visible uintptr
|
||||||
|
Get_StatusBar uintptr
|
||||||
|
Put_StatusBar uintptr
|
||||||
|
Get_StatusText uintptr
|
||||||
|
Put_StatusText uintptr
|
||||||
|
Get_ToolBar uintptr
|
||||||
|
Put_ToolBar uintptr
|
||||||
|
Get_MenuBar uintptr
|
||||||
|
Put_MenuBar uintptr
|
||||||
|
Get_FullScreen uintptr
|
||||||
|
Put_FullScreen uintptr
|
||||||
|
Navigate2 uintptr
|
||||||
|
QueryStatusWB uintptr
|
||||||
|
ExecWB uintptr
|
||||||
|
ShowBrowserBar uintptr
|
||||||
|
Get_ReadyState uintptr
|
||||||
|
Get_Offline uintptr
|
||||||
|
Put_Offline uintptr
|
||||||
|
Get_Silent uintptr
|
||||||
|
Put_Silent uintptr
|
||||||
|
Get_RegisterAsBrowser uintptr
|
||||||
|
Put_RegisterAsBrowser uintptr
|
||||||
|
Get_RegisterAsDropTarget uintptr
|
||||||
|
Put_RegisterAsDropTarget uintptr
|
||||||
|
Get_TheaterMode uintptr
|
||||||
|
Put_TheaterMode uintptr
|
||||||
|
Get_AddressBar uintptr
|
||||||
|
Put_AddressBar uintptr
|
||||||
|
Get_Resizable uintptr
|
||||||
|
Put_Resizable uintptr
|
||||||
|
}
|
||||||
|
|
||||||
|
type IWebBrowser2 struct {
|
||||||
|
LpVtbl *IWebBrowser2Vtbl
|
||||||
|
}
|
||||||
|
|
||||||
|
func (wb2 *IWebBrowser2) QueryInterface(riid REFIID, ppvObject *unsafe.Pointer) HRESULT {
|
||||||
|
ret, _, _ := syscall.Syscall(wb2.LpVtbl.QueryInterface, 3,
|
||||||
|
uintptr(unsafe.Pointer(wb2)),
|
||||||
|
uintptr(unsafe.Pointer(riid)),
|
||||||
|
uintptr(unsafe.Pointer(ppvObject)))
|
||||||
|
|
||||||
|
return HRESULT(ret)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (wb2 *IWebBrowser2) Release() HRESULT {
|
||||||
|
ret, _, _ := syscall.Syscall(wb2.LpVtbl.Release, 1,
|
||||||
|
uintptr(unsafe.Pointer(wb2)),
|
||||||
|
0,
|
||||||
|
0)
|
||||||
|
|
||||||
|
return HRESULT(ret)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (wb2 *IWebBrowser2) Refresh() HRESULT {
|
||||||
|
ret, _, _ := syscall.Syscall(wb2.LpVtbl.Refresh, 1,
|
||||||
|
uintptr(unsafe.Pointer(wb2)),
|
||||||
|
0,
|
||||||
|
0)
|
||||||
|
|
||||||
|
return HRESULT(ret)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (wb2 *IWebBrowser2) Put_Left(Left int32) HRESULT {
|
||||||
|
ret, _, _ := syscall.Syscall(wb2.LpVtbl.Put_Left, 2,
|
||||||
|
uintptr(unsafe.Pointer(wb2)),
|
||||||
|
uintptr(Left),
|
||||||
|
0)
|
||||||
|
|
||||||
|
return HRESULT(ret)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (wb2 *IWebBrowser2) Put_Top(Top int32) HRESULT {
|
||||||
|
ret, _, _ := syscall.Syscall(wb2.LpVtbl.Put_Top, 2,
|
||||||
|
uintptr(unsafe.Pointer(wb2)),
|
||||||
|
uintptr(Top),
|
||||||
|
0)
|
||||||
|
|
||||||
|
return HRESULT(ret)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (wb2 *IWebBrowser2) Put_Width(Width int32) HRESULT {
|
||||||
|
ret, _, _ := syscall.Syscall(wb2.LpVtbl.Put_Width, 2,
|
||||||
|
uintptr(unsafe.Pointer(wb2)),
|
||||||
|
uintptr(Width),
|
||||||
|
0)
|
||||||
|
|
||||||
|
return HRESULT(ret)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (wb2 *IWebBrowser2) Put_Height(Height int32) HRESULT {
|
||||||
|
ret, _, _ := syscall.Syscall(wb2.LpVtbl.Put_Height, 2,
|
||||||
|
uintptr(unsafe.Pointer(wb2)),
|
||||||
|
uintptr(Height),
|
||||||
|
0)
|
||||||
|
|
||||||
|
return HRESULT(ret)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (wb2 *IWebBrowser2) Get_LocationURL(pbstrLocationURL **uint16 /*BSTR*/) HRESULT {
|
||||||
|
ret, _, _ := syscall.Syscall(wb2.LpVtbl.Get_LocationURL, 2,
|
||||||
|
uintptr(unsafe.Pointer(wb2)),
|
||||||
|
uintptr(unsafe.Pointer(pbstrLocationURL)),
|
||||||
|
0)
|
||||||
|
|
||||||
|
return HRESULT(ret)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (wb2 *IWebBrowser2) Navigate2(URL *VAR_BSTR, Flags *VAR_I4, TargetFrameName *VAR_BSTR, PostData unsafe.Pointer, Headers *VAR_BSTR) HRESULT {
|
||||||
|
ret, _, _ := syscall.Syscall6(wb2.LpVtbl.Navigate2, 6,
|
||||||
|
uintptr(unsafe.Pointer(wb2)),
|
||||||
|
uintptr(unsafe.Pointer(URL)),
|
||||||
|
uintptr(unsafe.Pointer(Flags)),
|
||||||
|
uintptr(unsafe.Pointer(TargetFrameName)),
|
||||||
|
uintptr(PostData),
|
||||||
|
uintptr(unsafe.Pointer(Headers)))
|
||||||
|
|
||||||
|
return HRESULT(ret)
|
||||||
|
}
|
||||||
|
|
||||||
|
type IDocHostUIHandlerVtbl struct {
|
||||||
|
QueryInterface uintptr
|
||||||
|
AddRef uintptr
|
||||||
|
Release uintptr
|
||||||
|
ShowContextMenu uintptr
|
||||||
|
GetHostInfo uintptr
|
||||||
|
ShowUI uintptr
|
||||||
|
HideUI uintptr
|
||||||
|
UpdateUI uintptr
|
||||||
|
EnableModeless uintptr
|
||||||
|
OnDocWindowActivate uintptr
|
||||||
|
OnFrameWindowActivate uintptr
|
||||||
|
ResizeBorder uintptr
|
||||||
|
TranslateAccelerator uintptr
|
||||||
|
GetOptionKeyPath uintptr
|
||||||
|
GetDropTarget uintptr
|
||||||
|
GetExternal uintptr
|
||||||
|
TranslateUrl uintptr
|
||||||
|
FilterDataObject uintptr
|
||||||
|
}
|
||||||
|
|
||||||
|
type IDocHostUIHandler struct {
|
||||||
|
LpVtbl *IDocHostUIHandlerVtbl
|
||||||
|
}
|
||||||
|
|
||||||
|
type DOCHOSTUIINFO struct {
|
||||||
|
CbSize uint32
|
||||||
|
DwFlags uint32
|
||||||
|
DwDoubleClick uint32
|
||||||
|
PchHostCss *uint16
|
||||||
|
PchHostNS *uint16
|
||||||
|
}
|
||||||
|
|
||||||
|
type IOleInPlaceActiveObjectVtbl struct {
|
||||||
|
QueryInterface uintptr
|
||||||
|
AddRef uintptr
|
||||||
|
Release uintptr
|
||||||
|
GetWindow uintptr
|
||||||
|
ContextSensitiveHelp uintptr
|
||||||
|
TranslateAccelerator uintptr
|
||||||
|
OnFrameWindowActivate uintptr
|
||||||
|
OnDocWindowActivate uintptr
|
||||||
|
ResizeBorder uintptr
|
||||||
|
EnableModeless uintptr
|
||||||
|
}
|
||||||
|
|
||||||
|
type IOleInPlaceActiveObject struct {
|
||||||
|
LpVtbl *IOleInPlaceActiveObjectVtbl
|
||||||
|
}
|
||||||
|
|
||||||
|
func (activeObj *IOleInPlaceActiveObject) Release() HRESULT {
|
||||||
|
ret, _, _ := syscall.Syscall(activeObj.LpVtbl.Release, 1,
|
||||||
|
uintptr(unsafe.Pointer(activeObj)),
|
||||||
|
0,
|
||||||
|
0)
|
||||||
|
|
||||||
|
return HRESULT(ret)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (activeObj *IOleInPlaceActiveObject) GetWindow(hWndPtr *HWND) HRESULT {
|
||||||
|
ret, _, _ := syscall.Syscall(activeObj.LpVtbl.GetWindow, 2,
|
||||||
|
uintptr(unsafe.Pointer(activeObj)),
|
||||||
|
uintptr(unsafe.Pointer(hWndPtr)),
|
||||||
|
0)
|
||||||
|
|
||||||
|
return HRESULT(ret)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (activeObj *IOleInPlaceActiveObject) TranslateAccelerator(msg *MSG) HRESULT {
|
||||||
|
ret, _, _ := syscall.Syscall(activeObj.LpVtbl.TranslateAccelerator, 2,
|
||||||
|
uintptr(unsafe.Pointer(activeObj)),
|
||||||
|
uintptr(unsafe.Pointer(msg)),
|
||||||
|
0)
|
||||||
|
|
||||||
|
return HRESULT(ret)
|
||||||
|
}
|
429
vendor/github.com/lxn/win/shell32.go
generated
vendored
Normal file
429
vendor/github.com/lxn/win/shell32.go
generated
vendored
Normal file
@ -0,0 +1,429 @@
|
|||||||
|
// Copyright 2010 The win Authors. All rights reserved.
|
||||||
|
// Use of this source code is governed by a BSD-style
|
||||||
|
// license that can be found in the LICENSE file.
|
||||||
|
|
||||||
|
// +build windows
|
||||||
|
|
||||||
|
package win
|
||||||
|
|
||||||
|
import (
|
||||||
|
"syscall"
|
||||||
|
"unsafe"
|
||||||
|
)
|
||||||
|
|
||||||
|
type CSIDL uint32
|
||||||
|
type HDROP HANDLE
|
||||||
|
|
||||||
|
const (
|
||||||
|
CSIDL_DESKTOP = 0x00
|
||||||
|
CSIDL_INTERNET = 0x01
|
||||||
|
CSIDL_PROGRAMS = 0x02
|
||||||
|
CSIDL_CONTROLS = 0x03
|
||||||
|
CSIDL_PRINTERS = 0x04
|
||||||
|
CSIDL_PERSONAL = 0x05
|
||||||
|
CSIDL_FAVORITES = 0x06
|
||||||
|
CSIDL_STARTUP = 0x07
|
||||||
|
CSIDL_RECENT = 0x08
|
||||||
|
CSIDL_SENDTO = 0x09
|
||||||
|
CSIDL_BITBUCKET = 0x0A
|
||||||
|
CSIDL_STARTMENU = 0x0B
|
||||||
|
CSIDL_MYDOCUMENTS = 0x0C
|
||||||
|
CSIDL_MYMUSIC = 0x0D
|
||||||
|
CSIDL_MYVIDEO = 0x0E
|
||||||
|
CSIDL_DESKTOPDIRECTORY = 0x10
|
||||||
|
CSIDL_DRIVES = 0x11
|
||||||
|
CSIDL_NETWORK = 0x12
|
||||||
|
CSIDL_NETHOOD = 0x13
|
||||||
|
CSIDL_FONTS = 0x14
|
||||||
|
CSIDL_TEMPLATES = 0x15
|
||||||
|
CSIDL_COMMON_STARTMENU = 0x16
|
||||||
|
CSIDL_COMMON_PROGRAMS = 0x17
|
||||||
|
CSIDL_COMMON_STARTUP = 0x18
|
||||||
|
CSIDL_COMMON_DESKTOPDIRECTORY = 0x19
|
||||||
|
CSIDL_APPDATA = 0x1A
|
||||||
|
CSIDL_PRINTHOOD = 0x1B
|
||||||
|
CSIDL_LOCAL_APPDATA = 0x1C
|
||||||
|
CSIDL_ALTSTARTUP = 0x1D
|
||||||
|
CSIDL_COMMON_ALTSTARTUP = 0x1E
|
||||||
|
CSIDL_COMMON_FAVORITES = 0x1F
|
||||||
|
CSIDL_INTERNET_CACHE = 0x20
|
||||||
|
CSIDL_COOKIES = 0x21
|
||||||
|
CSIDL_HISTORY = 0x22
|
||||||
|
CSIDL_COMMON_APPDATA = 0x23
|
||||||
|
CSIDL_WINDOWS = 0x24
|
||||||
|
CSIDL_SYSTEM = 0x25
|
||||||
|
CSIDL_PROGRAM_FILES = 0x26
|
||||||
|
CSIDL_MYPICTURES = 0x27
|
||||||
|
CSIDL_PROFILE = 0x28
|
||||||
|
CSIDL_SYSTEMX86 = 0x29
|
||||||
|
CSIDL_PROGRAM_FILESX86 = 0x2A
|
||||||
|
CSIDL_PROGRAM_FILES_COMMON = 0x2B
|
||||||
|
CSIDL_PROGRAM_FILES_COMMONX86 = 0x2C
|
||||||
|
CSIDL_COMMON_TEMPLATES = 0x2D
|
||||||
|
CSIDL_COMMON_DOCUMENTS = 0x2E
|
||||||
|
CSIDL_COMMON_ADMINTOOLS = 0x2F
|
||||||
|
CSIDL_ADMINTOOLS = 0x30
|
||||||
|
CSIDL_CONNECTIONS = 0x31
|
||||||
|
CSIDL_COMMON_MUSIC = 0x35
|
||||||
|
CSIDL_COMMON_PICTURES = 0x36
|
||||||
|
CSIDL_COMMON_VIDEO = 0x37
|
||||||
|
CSIDL_RESOURCES = 0x38
|
||||||
|
CSIDL_RESOURCES_LOCALIZED = 0x39
|
||||||
|
CSIDL_COMMON_OEM_LINKS = 0x3A
|
||||||
|
CSIDL_CDBURN_AREA = 0x3B
|
||||||
|
CSIDL_COMPUTERSNEARME = 0x3D
|
||||||
|
CSIDL_FLAG_CREATE = 0x8000
|
||||||
|
CSIDL_FLAG_DONT_VERIFY = 0x4000
|
||||||
|
CSIDL_FLAG_NO_ALIAS = 0x1000
|
||||||
|
CSIDL_FLAG_PER_USER_INIT = 0x8000
|
||||||
|
CSIDL_FLAG_MASK = 0xFF00
|
||||||
|
)
|
||||||
|
|
||||||
|
// NotifyIcon flags
|
||||||
|
const (
|
||||||
|
NIF_MESSAGE = 0x00000001
|
||||||
|
NIF_ICON = 0x00000002
|
||||||
|
NIF_TIP = 0x00000004
|
||||||
|
NIF_STATE = 0x00000008
|
||||||
|
NIF_INFO = 0x00000010
|
||||||
|
)
|
||||||
|
|
||||||
|
// NotifyIcon messages
|
||||||
|
const (
|
||||||
|
NIM_ADD = 0x00000000
|
||||||
|
NIM_MODIFY = 0x00000001
|
||||||
|
NIM_DELETE = 0x00000002
|
||||||
|
NIM_SETFOCUS = 0x00000003
|
||||||
|
NIM_SETVERSION = 0x00000004
|
||||||
|
)
|
||||||
|
|
||||||
|
// NotifyIcon states
|
||||||
|
const (
|
||||||
|
NIS_HIDDEN = 0x00000001
|
||||||
|
NIS_SHAREDICON = 0x00000002
|
||||||
|
)
|
||||||
|
|
||||||
|
// NotifyIcon info flags
|
||||||
|
const (
|
||||||
|
NIIF_NONE = 0x00000000
|
||||||
|
NIIF_INFO = 0x00000001
|
||||||
|
NIIF_WARNING = 0x00000002
|
||||||
|
NIIF_ERROR = 0x00000003
|
||||||
|
NIIF_USER = 0x00000004
|
||||||
|
NIIF_NOSOUND = 0x00000010
|
||||||
|
)
|
||||||
|
|
||||||
|
const NOTIFYICON_VERSION = 3
|
||||||
|
|
||||||
|
// SHGetFileInfo flags
|
||||||
|
const (
|
||||||
|
SHGFI_LARGEICON = 0x000000000
|
||||||
|
SHGFI_SMALLICON = 0x000000001
|
||||||
|
SHGFI_OPENICON = 0x000000002
|
||||||
|
SHGFI_SHELLICONSIZE = 0x000000004
|
||||||
|
SHGFI_PIDL = 0x000000008
|
||||||
|
SHGFI_USEFILEATTRIBUTES = 0x000000010
|
||||||
|
SHGFI_ADDOVERLAYS = 0x000000020
|
||||||
|
SHGFI_OVERLAYINDEX = 0x000000040
|
||||||
|
SHGFI_ICON = 0x000000100
|
||||||
|
SHGFI_DISPLAYNAME = 0x000000200
|
||||||
|
SHGFI_TYPENAME = 0x000000400
|
||||||
|
SHGFI_ATTRIBUTES = 0x000000800
|
||||||
|
SHGFI_ICONLOCATION = 0x000001000
|
||||||
|
SHGFI_EXETYPE = 0x000002000
|
||||||
|
SHGFI_SYSICONINDEX = 0x000004000
|
||||||
|
SHGFI_LINKOVERLAY = 0x000008000
|
||||||
|
SHGFI_SELECTED = 0x000010000
|
||||||
|
SHGFI_ATTR_SPECIFIED = 0x000020000
|
||||||
|
)
|
||||||
|
|
||||||
|
// SHGetStockIconInfo flags
|
||||||
|
const (
|
||||||
|
SHGSI_ICONLOCATION = 0
|
||||||
|
SHGSI_ICON = 0x000000100
|
||||||
|
SHGSI_SYSICONINDEX = 0x000004000
|
||||||
|
SHGSI_LINKOVERLAY = 0x000008000
|
||||||
|
SHGSI_SELECTED = 0x000010000
|
||||||
|
SHGSI_LARGEICON = 0x000000000
|
||||||
|
SHGSI_SMALLICON = 0x000000001
|
||||||
|
SHGSI_SHELLICONSIZE = 0x000000004
|
||||||
|
)
|
||||||
|
|
||||||
|
// SHSTOCKICONID values
|
||||||
|
const (
|
||||||
|
SIID_DOCNOASSOC = 0
|
||||||
|
SIID_DOCASSOC = 1
|
||||||
|
SIID_APPLICATION = 2
|
||||||
|
SIID_FOLDER = 3
|
||||||
|
SIID_FOLDEROPEN = 4
|
||||||
|
SIID_DRIVE525 = 5
|
||||||
|
SIID_DRIVE35 = 6
|
||||||
|
SIID_DRIVEREMOVE = 7
|
||||||
|
SIID_DRIVEFIXED = 8
|
||||||
|
SIID_DRIVENET = 9
|
||||||
|
SIID_DRIVENETDISABLED = 10
|
||||||
|
SIID_DRIVECD = 11
|
||||||
|
SIID_DRIVERAM = 12
|
||||||
|
SIID_WORLD = 13
|
||||||
|
SIID_SERVER = 15
|
||||||
|
SIID_PRINTER = 16
|
||||||
|
SIID_MYNETWORK = 17
|
||||||
|
SIID_FIND = 22
|
||||||
|
SIID_HELP = 23
|
||||||
|
SIID_SHARE = 28
|
||||||
|
SIID_LINK = 29
|
||||||
|
SIID_SLOWFILE = 30
|
||||||
|
SIID_RECYCLER = 31
|
||||||
|
SIID_RECYCLERFULL = 32
|
||||||
|
SIID_MEDIACDAUDIO = 40
|
||||||
|
SIID_LOCK = 47
|
||||||
|
SIID_AUTOLIST = 49
|
||||||
|
SIID_PRINTERNET = 50
|
||||||
|
SIID_SERVERSHARE = 51
|
||||||
|
SIID_PRINTERFAX = 52
|
||||||
|
SIID_PRINTERFAXNET = 53
|
||||||
|
SIID_PRINTERFILE = 54
|
||||||
|
SIID_STACK = 55
|
||||||
|
SIID_MEDIASVCD = 56
|
||||||
|
SIID_STUFFEDFOLDER = 57
|
||||||
|
SIID_DRIVEUNKNOWN = 58
|
||||||
|
SIID_DRIVEDVD = 59
|
||||||
|
SIID_MEDIADVD = 60
|
||||||
|
SIID_MEDIADVDRAM = 61
|
||||||
|
SIID_MEDIADVDRW = 62
|
||||||
|
SIID_MEDIADVDR = 63
|
||||||
|
SIID_MEDIADVDROM = 64
|
||||||
|
SIID_MEDIACDAUDIOPLUS = 65
|
||||||
|
SIID_MEDIACDRW = 66
|
||||||
|
SIID_MEDIACDR = 67
|
||||||
|
SIID_MEDIACDBURN = 68
|
||||||
|
SIID_MEDIABLANKCD = 69
|
||||||
|
SIID_MEDIACDROM = 70
|
||||||
|
SIID_AUDIOFILES = 71
|
||||||
|
SIID_IMAGEFILES = 72
|
||||||
|
SIID_VIDEOFILES = 73
|
||||||
|
SIID_MIXEDFILES = 74
|
||||||
|
SIID_FOLDERBACK = 75
|
||||||
|
SIID_FOLDERFRONT = 76
|
||||||
|
SIID_SHIELD = 77
|
||||||
|
SIID_WARNING = 78
|
||||||
|
SIID_INFO = 79
|
||||||
|
SIID_ERROR = 80
|
||||||
|
SIID_KEY = 81
|
||||||
|
SIID_SOFTWARE = 82
|
||||||
|
SIID_RENAME = 83
|
||||||
|
SIID_DELETE = 84
|
||||||
|
SIID_MEDIAAUDIODVD = 85
|
||||||
|
SIID_MEDIAMOVIEDVD = 86
|
||||||
|
SIID_MEDIAENHANCEDCD = 87
|
||||||
|
SIID_MEDIAENHANCEDDVD = 88
|
||||||
|
SIID_MEDIAHDDVD = 89
|
||||||
|
SIID_MEDIABLURAY = 90
|
||||||
|
SIID_MEDIAVCD = 91
|
||||||
|
SIID_MEDIADVDPLUSR = 92
|
||||||
|
SIID_MEDIADVDPLUSRW = 93
|
||||||
|
SIID_DESKTOPPC = 94
|
||||||
|
SIID_MOBILEPC = 95
|
||||||
|
SIID_USERS = 96
|
||||||
|
SIID_MEDIASMARTMEDIA = 97
|
||||||
|
SIID_MEDIACOMPACTFLASH = 98
|
||||||
|
SIID_DEVICECELLPHONE = 99
|
||||||
|
SIID_DEVICECAMERA = 100
|
||||||
|
SIID_DEVICEVIDEOCAMERA = 101
|
||||||
|
SIID_DEVICEAUDIOPLAYER = 102
|
||||||
|
SIID_NETWORKCONNECT = 103
|
||||||
|
SIID_INTERNET = 104
|
||||||
|
SIID_ZIPFILE = 105
|
||||||
|
SIID_SETTINGS = 106
|
||||||
|
SIID_DRIVEHDDVD = 132
|
||||||
|
SIID_DRIVEBD = 133
|
||||||
|
SIID_MEDIAHDDVDROM = 134
|
||||||
|
SIID_MEDIAHDDVDR = 135
|
||||||
|
SIID_MEDIAHDDVDRAM = 136
|
||||||
|
SIID_MEDIABDROM = 137
|
||||||
|
SIID_MEDIABDR = 138
|
||||||
|
SIID_MEDIABDRE = 139
|
||||||
|
SIID_CLUSTEREDDRIVE = 140
|
||||||
|
SIID_MAX_ICONS = 175
|
||||||
|
)
|
||||||
|
|
||||||
|
type NOTIFYICONDATA struct {
|
||||||
|
CbSize uint32
|
||||||
|
HWnd HWND
|
||||||
|
UID uint32
|
||||||
|
UFlags uint32
|
||||||
|
UCallbackMessage uint32
|
||||||
|
HIcon HICON
|
||||||
|
SzTip [128]uint16
|
||||||
|
DwState uint32
|
||||||
|
DwStateMask uint32
|
||||||
|
SzInfo [256]uint16
|
||||||
|
UVersion uint32
|
||||||
|
SzInfoTitle [64]uint16
|
||||||
|
DwInfoFlags uint32
|
||||||
|
GuidItem syscall.GUID
|
||||||
|
}
|
||||||
|
|
||||||
|
type SHFILEINFO struct {
|
||||||
|
HIcon HICON
|
||||||
|
IIcon int32
|
||||||
|
DwAttributes uint32
|
||||||
|
SzDisplayName [MAX_PATH]uint16
|
||||||
|
SzTypeName [80]uint16
|
||||||
|
}
|
||||||
|
|
||||||
|
type BROWSEINFO struct {
|
||||||
|
HwndOwner HWND
|
||||||
|
PidlRoot uintptr
|
||||||
|
PszDisplayName *uint16
|
||||||
|
LpszTitle *uint16
|
||||||
|
UlFlags uint32
|
||||||
|
Lpfn uintptr
|
||||||
|
LParam uintptr
|
||||||
|
IImage int32
|
||||||
|
}
|
||||||
|
|
||||||
|
type SHSTOCKICONINFO struct {
|
||||||
|
CbSize uint32
|
||||||
|
HIcon HICON
|
||||||
|
ISysImageIndex int32
|
||||||
|
IIcon int32
|
||||||
|
SzPath [MAX_PATH]uint16
|
||||||
|
}
|
||||||
|
|
||||||
|
var (
|
||||||
|
// Library
|
||||||
|
libshell32 uintptr
|
||||||
|
|
||||||
|
// Functions
|
||||||
|
dragAcceptFiles uintptr
|
||||||
|
dragFinish uintptr
|
||||||
|
dragQueryFile uintptr
|
||||||
|
shBrowseForFolder uintptr
|
||||||
|
shGetFileInfo uintptr
|
||||||
|
shGetPathFromIDList uintptr
|
||||||
|
shGetSpecialFolderPath uintptr
|
||||||
|
shParseDisplayName uintptr
|
||||||
|
shGetStockIconInfo uintptr
|
||||||
|
shell_NotifyIcon uintptr
|
||||||
|
)
|
||||||
|
|
||||||
|
func init() {
|
||||||
|
// Library
|
||||||
|
libshell32 = MustLoadLibrary("shell32.dll")
|
||||||
|
|
||||||
|
// Functions
|
||||||
|
dragAcceptFiles = MustGetProcAddress(libshell32, "DragAcceptFiles")
|
||||||
|
dragFinish = MustGetProcAddress(libshell32, "DragFinish")
|
||||||
|
dragQueryFile = MustGetProcAddress(libshell32, "DragQueryFileW")
|
||||||
|
shBrowseForFolder = MustGetProcAddress(libshell32, "SHBrowseForFolderW")
|
||||||
|
shGetFileInfo = MustGetProcAddress(libshell32, "SHGetFileInfoW")
|
||||||
|
shGetPathFromIDList = MustGetProcAddress(libshell32, "SHGetPathFromIDListW")
|
||||||
|
shGetSpecialFolderPath = MustGetProcAddress(libshell32, "SHGetSpecialFolderPathW")
|
||||||
|
shGetStockIconInfo = MaybeGetProcAddress(libshell32, "SHGetStockIconInfo")
|
||||||
|
shell_NotifyIcon = MustGetProcAddress(libshell32, "Shell_NotifyIconW")
|
||||||
|
shParseDisplayName = MustGetProcAddress(libshell32, "SHParseDisplayName")
|
||||||
|
}
|
||||||
|
|
||||||
|
func DragAcceptFiles(hWnd HWND, fAccept bool) bool {
|
||||||
|
ret, _, _ := syscall.Syscall(dragAcceptFiles, 2,
|
||||||
|
uintptr(hWnd),
|
||||||
|
uintptr(BoolToBOOL(fAccept)),
|
||||||
|
0)
|
||||||
|
|
||||||
|
return ret != 0
|
||||||
|
}
|
||||||
|
|
||||||
|
func DragQueryFile(hDrop HDROP, iFile uint, lpszFile *uint16, cch uint) uint {
|
||||||
|
ret, _, _ := syscall.Syscall6(dragQueryFile, 4,
|
||||||
|
uintptr(hDrop),
|
||||||
|
uintptr(iFile),
|
||||||
|
uintptr(unsafe.Pointer(lpszFile)),
|
||||||
|
uintptr(cch),
|
||||||
|
0,
|
||||||
|
0)
|
||||||
|
|
||||||
|
return uint(ret)
|
||||||
|
}
|
||||||
|
|
||||||
|
func DragFinish(hDrop HDROP) {
|
||||||
|
syscall.Syscall(dragAcceptFiles, 1,
|
||||||
|
uintptr(hDrop),
|
||||||
|
0,
|
||||||
|
0)
|
||||||
|
}
|
||||||
|
|
||||||
|
func SHBrowseForFolder(lpbi *BROWSEINFO) uintptr {
|
||||||
|
ret, _, _ := syscall.Syscall(shBrowseForFolder, 1,
|
||||||
|
uintptr(unsafe.Pointer(lpbi)),
|
||||||
|
0,
|
||||||
|
0)
|
||||||
|
|
||||||
|
return ret
|
||||||
|
}
|
||||||
|
|
||||||
|
func SHGetFileInfo(pszPath *uint16, dwFileAttributes uint32, psfi *SHFILEINFO, cbFileInfo, uFlags uint32) uintptr {
|
||||||
|
ret, _, _ := syscall.Syscall6(shGetFileInfo, 5,
|
||||||
|
uintptr(unsafe.Pointer(pszPath)),
|
||||||
|
uintptr(dwFileAttributes),
|
||||||
|
uintptr(unsafe.Pointer(psfi)),
|
||||||
|
uintptr(cbFileInfo),
|
||||||
|
uintptr(uFlags),
|
||||||
|
0)
|
||||||
|
|
||||||
|
return ret
|
||||||
|
}
|
||||||
|
|
||||||
|
func SHGetPathFromIDList(pidl uintptr, pszPath *uint16) bool {
|
||||||
|
ret, _, _ := syscall.Syscall(shGetPathFromIDList, 2,
|
||||||
|
pidl,
|
||||||
|
uintptr(unsafe.Pointer(pszPath)),
|
||||||
|
0)
|
||||||
|
|
||||||
|
return ret != 0
|
||||||
|
}
|
||||||
|
|
||||||
|
func SHGetSpecialFolderPath(hwndOwner HWND, lpszPath *uint16, csidl CSIDL, fCreate bool) bool {
|
||||||
|
ret, _, _ := syscall.Syscall6(shGetSpecialFolderPath, 4,
|
||||||
|
uintptr(hwndOwner),
|
||||||
|
uintptr(unsafe.Pointer(lpszPath)),
|
||||||
|
uintptr(csidl),
|
||||||
|
uintptr(BoolToBOOL(fCreate)),
|
||||||
|
0,
|
||||||
|
0)
|
||||||
|
|
||||||
|
return ret != 0
|
||||||
|
}
|
||||||
|
|
||||||
|
func SHParseDisplayName(pszName *uint16, pbc uintptr, ppidl *uintptr, sfgaoIn uint32, psfgaoOut *uint32) HRESULT {
|
||||||
|
ret, _, _ := syscall.Syscall6(shParseDisplayName, 5,
|
||||||
|
uintptr(unsafe.Pointer(pszName)),
|
||||||
|
pbc,
|
||||||
|
uintptr(unsafe.Pointer(ppidl)),
|
||||||
|
0,
|
||||||
|
uintptr(unsafe.Pointer(psfgaoOut)),
|
||||||
|
0)
|
||||||
|
|
||||||
|
return HRESULT(ret)
|
||||||
|
}
|
||||||
|
|
||||||
|
func SHGetStockIconInfo(stockIconId int32, uFlags uint32, stockIcon *SHSTOCKICONINFO) HRESULT {
|
||||||
|
ret, _, _ := syscall.Syscall6(shGetStockIconInfo, 3,
|
||||||
|
uintptr(stockIconId),
|
||||||
|
uintptr(uFlags),
|
||||||
|
uintptr(unsafe.Pointer(stockIcon)),
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
)
|
||||||
|
return HRESULT(ret)
|
||||||
|
}
|
||||||
|
|
||||||
|
func Shell_NotifyIcon(dwMessage uint32, lpdata *NOTIFYICONDATA) bool {
|
||||||
|
ret, _, _ := syscall.Syscall(shell_NotifyIcon, 2,
|
||||||
|
uintptr(dwMessage),
|
||||||
|
uintptr(unsafe.Pointer(lpdata)),
|
||||||
|
0)
|
||||||
|
|
||||||
|
return ret != 0
|
||||||
|
}
|
62
vendor/github.com/lxn/win/shobj.go
generated
vendored
Normal file
62
vendor/github.com/lxn/win/shobj.go
generated
vendored
Normal file
@ -0,0 +1,62 @@
|
|||||||
|
// Copyright 2012 The win Authors. All rights reserved.
|
||||||
|
// Use of this source code is governed by a BSD-style
|
||||||
|
// license that can be found in the LICENSE file.
|
||||||
|
|
||||||
|
// +build windows
|
||||||
|
|
||||||
|
package win
|
||||||
|
|
||||||
|
import (
|
||||||
|
"syscall"
|
||||||
|
"unsafe"
|
||||||
|
)
|
||||||
|
|
||||||
|
var (
|
||||||
|
CLSID_TaskbarList = CLSID{0x56FDF344, 0xFD6D, 0x11d0, [8]byte{0x95, 0x8A, 0x00, 0x60, 0x97, 0xC9, 0xA0, 0x90}}
|
||||||
|
IID_ITaskbarList3 = IID{0xea1afb91, 0x9e28, 0x4b86, [8]byte{0x90, 0xe9, 0x9e, 0x9f, 0x8a, 0x5e, 0xef, 0xaf}}
|
||||||
|
)
|
||||||
|
|
||||||
|
//TBPFLAG
|
||||||
|
const (
|
||||||
|
TBPF_NOPROGRESS = 0
|
||||||
|
TBPF_INDETERMINATE = 0x1
|
||||||
|
TBPF_NORMAL = 0x2
|
||||||
|
TBPF_ERROR = 0x4
|
||||||
|
TBPF_PAUSED = 0x8
|
||||||
|
)
|
||||||
|
|
||||||
|
type ITaskbarList3Vtbl struct {
|
||||||
|
QueryInterface uintptr
|
||||||
|
AddRef uintptr
|
||||||
|
Release uintptr
|
||||||
|
HrInit uintptr
|
||||||
|
AddTab uintptr
|
||||||
|
DeleteTab uintptr
|
||||||
|
ActivateTab uintptr
|
||||||
|
SetActiveAlt uintptr
|
||||||
|
MarkFullscreenWindow uintptr
|
||||||
|
SetProgressValue uintptr
|
||||||
|
SetProgressState uintptr
|
||||||
|
RegisterTab uintptr
|
||||||
|
UnregisterTab uintptr
|
||||||
|
SetTabOrder uintptr
|
||||||
|
SetTabActive uintptr
|
||||||
|
ThumbBarAddButtons uintptr
|
||||||
|
ThumbBarUpdateButtons uintptr
|
||||||
|
ThumbBarSetImageList uintptr
|
||||||
|
SetOverlayIcon uintptr
|
||||||
|
SetThumbnailTooltip uintptr
|
||||||
|
SetThumbnailClip uintptr
|
||||||
|
}
|
||||||
|
|
||||||
|
type ITaskbarList3 struct {
|
||||||
|
LpVtbl *ITaskbarList3Vtbl
|
||||||
|
}
|
||||||
|
|
||||||
|
func (obj *ITaskbarList3) SetProgressState(hwnd HWND, state int) HRESULT {
|
||||||
|
ret, _, _ := syscall.Syscall(obj.LpVtbl.SetProgressState, 3,
|
||||||
|
uintptr(unsafe.Pointer(obj)),
|
||||||
|
uintptr(hwnd),
|
||||||
|
uintptr(state))
|
||||||
|
return HRESULT(ret)
|
||||||
|
}
|
24
vendor/github.com/lxn/win/shobj_386.go
generated
vendored
Normal file
24
vendor/github.com/lxn/win/shobj_386.go
generated
vendored
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
// Copyright 2012 The win Authors. All rights reserved.
|
||||||
|
// Use of this source code is governed by a BSD-style
|
||||||
|
// license that can be found in the LICENSE file.
|
||||||
|
|
||||||
|
// +build windows
|
||||||
|
|
||||||
|
package win
|
||||||
|
|
||||||
|
import (
|
||||||
|
"syscall"
|
||||||
|
"unsafe"
|
||||||
|
)
|
||||||
|
|
||||||
|
func (obj *ITaskbarList3) SetProgressValue(hwnd HWND, current uint32, length uint32) HRESULT {
|
||||||
|
ret, _, _ := syscall.Syscall6(obj.LpVtbl.SetProgressValue, 6,
|
||||||
|
uintptr(unsafe.Pointer(obj)),
|
||||||
|
uintptr(hwnd),
|
||||||
|
uintptr(current),
|
||||||
|
0,
|
||||||
|
uintptr(length),
|
||||||
|
0)
|
||||||
|
|
||||||
|
return HRESULT(ret)
|
||||||
|
}
|
24
vendor/github.com/lxn/win/shobj_amd64.go
generated
vendored
Normal file
24
vendor/github.com/lxn/win/shobj_amd64.go
generated
vendored
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
// Copyright 2012 The win Authors. All rights reserved.
|
||||||
|
// Use of this source code is governed by a BSD-style
|
||||||
|
// license that can be found in the LICENSE file.
|
||||||
|
|
||||||
|
// +build windows
|
||||||
|
|
||||||
|
package win
|
||||||
|
|
||||||
|
import (
|
||||||
|
"syscall"
|
||||||
|
"unsafe"
|
||||||
|
)
|
||||||
|
|
||||||
|
func (obj *ITaskbarList3) SetProgressValue(hwnd HWND, current uint32, length uint32) HRESULT {
|
||||||
|
ret, _, _ := syscall.Syscall6(obj.LpVtbl.SetProgressValue, 4,
|
||||||
|
uintptr(unsafe.Pointer(obj)),
|
||||||
|
uintptr(hwnd),
|
||||||
|
uintptr(current),
|
||||||
|
uintptr(length),
|
||||||
|
0,
|
||||||
|
0)
|
||||||
|
|
||||||
|
return HRESULT(ret)
|
||||||
|
}
|
50
vendor/github.com/lxn/win/statusbar.go
generated
vendored
Normal file
50
vendor/github.com/lxn/win/statusbar.go
generated
vendored
Normal file
@ -0,0 +1,50 @@
|
|||||||
|
// Copyright 2013 The win Authors. All rights reserved.
|
||||||
|
// Use of this source code is governed by a BSD-style
|
||||||
|
// license that can be found in the LICENSE file.
|
||||||
|
|
||||||
|
// +build windows
|
||||||
|
|
||||||
|
package win
|
||||||
|
|
||||||
|
// Styles
|
||||||
|
const (
|
||||||
|
SBARS_SIZEGRIP = 0x100
|
||||||
|
SBARS_TOOLTIPS = 0x800
|
||||||
|
)
|
||||||
|
|
||||||
|
// Messages
|
||||||
|
const (
|
||||||
|
SB_SETPARTS = WM_USER + 4
|
||||||
|
SB_GETPARTS = WM_USER + 6
|
||||||
|
SB_GETBORDERS = WM_USER + 7
|
||||||
|
SB_SETMINHEIGHT = WM_USER + 8
|
||||||
|
SB_SIMPLE = WM_USER + 9
|
||||||
|
SB_GETRECT = WM_USER + 10
|
||||||
|
SB_SETTEXT = WM_USER + 11
|
||||||
|
SB_GETTEXTLENGTH = WM_USER + 12
|
||||||
|
SB_GETTEXT = WM_USER + 13
|
||||||
|
SB_ISSIMPLE = WM_USER + 14
|
||||||
|
SB_SETICON = WM_USER + 15
|
||||||
|
SB_SETTIPTEXT = WM_USER + 17
|
||||||
|
SB_GETTIPTEXT = WM_USER + 19
|
||||||
|
SB_GETICON = WM_USER + 20
|
||||||
|
SB_SETUNICODEFORMAT = CCM_SETUNICODEFORMAT
|
||||||
|
SB_GETUNICODEFORMAT = CCM_GETUNICODEFORMAT
|
||||||
|
SB_SETBKCOLOR = CCM_SETBKCOLOR
|
||||||
|
)
|
||||||
|
|
||||||
|
// SB_SETTEXT options
|
||||||
|
const (
|
||||||
|
SBT_NOBORDERS = 0x100
|
||||||
|
SBT_POPOUT = 0x200
|
||||||
|
SBT_RTLREADING = 0x400
|
||||||
|
SBT_NOTABPARSING = 0x800
|
||||||
|
SBT_OWNERDRAW = 0x1000
|
||||||
|
)
|
||||||
|
|
||||||
|
const (
|
||||||
|
SBN_FIRST = -880
|
||||||
|
SBN_SIMPLEMODECHANGE = SBN_FIRST - 0
|
||||||
|
)
|
||||||
|
|
||||||
|
const SB_SIMPLEID = 0xff
|
65
vendor/github.com/lxn/win/syslink.go
generated
vendored
Normal file
65
vendor/github.com/lxn/win/syslink.go
generated
vendored
Normal file
@ -0,0 +1,65 @@
|
|||||||
|
// Copyright 2017 The win Authors. All rights reserved.
|
||||||
|
// Use of this source code is governed by a BSD-style
|
||||||
|
// license that can be found in the LICENSE file.
|
||||||
|
|
||||||
|
// +build windows
|
||||||
|
|
||||||
|
package win
|
||||||
|
|
||||||
|
const (
|
||||||
|
INVALID_LINK_INDEX = -1
|
||||||
|
MAX_LINKID_TEXT = 48
|
||||||
|
L_MAX_URL_LENGTH = 2048 + 32 + len("://")
|
||||||
|
WC_LINK = "SysLink"
|
||||||
|
)
|
||||||
|
|
||||||
|
const (
|
||||||
|
LWS_TRANSPARENT = 0x0001
|
||||||
|
LWS_IGNORERETURN = 0x0002
|
||||||
|
LWS_NOPREFIX = 0x0004
|
||||||
|
LWS_USEVISUALSTYLE = 0x0008
|
||||||
|
LWS_USECUSTOMTEXT = 0x0010
|
||||||
|
LWS_RIGHT = 0x0020
|
||||||
|
)
|
||||||
|
|
||||||
|
const (
|
||||||
|
LIF_ITEMINDEX = 0x00000001
|
||||||
|
LIF_STATE = 0x00000002
|
||||||
|
LIF_ITEMID = 0x00000004
|
||||||
|
LIF_URL = 0x00000008
|
||||||
|
)
|
||||||
|
|
||||||
|
const (
|
||||||
|
LIS_FOCUSED = 0x00000001
|
||||||
|
LIS_ENABLED = 0x00000002
|
||||||
|
LIS_VISITED = 0x00000004
|
||||||
|
LIS_HOTTRACK = 0x00000008
|
||||||
|
LIS_DEFAULTCOLORS = 0x00000010
|
||||||
|
)
|
||||||
|
|
||||||
|
const (
|
||||||
|
LM_HITTEST = WM_USER + 0x300
|
||||||
|
LM_GETIDEALHEIGHT = WM_USER + 0x301
|
||||||
|
LM_SETITEM = WM_USER + 0x302
|
||||||
|
LM_GETITEM = WM_USER + 0x303
|
||||||
|
LM_GETIDEALSIZE = LM_GETIDEALHEIGHT
|
||||||
|
)
|
||||||
|
|
||||||
|
type LITEM struct {
|
||||||
|
Mask uint32
|
||||||
|
ILink int32
|
||||||
|
State uint32
|
||||||
|
StateMask uint32
|
||||||
|
SzID [MAX_LINKID_TEXT]uint16
|
||||||
|
SzUrl [L_MAX_URL_LENGTH]uint16
|
||||||
|
}
|
||||||
|
|
||||||
|
type LHITTESTINFO struct {
|
||||||
|
Pt POINT
|
||||||
|
Item LITEM
|
||||||
|
}
|
||||||
|
|
||||||
|
type NMLINK struct {
|
||||||
|
Hdr NMHDR
|
||||||
|
Item LITEM
|
||||||
|
}
|
128
vendor/github.com/lxn/win/tab.go
generated
vendored
Normal file
128
vendor/github.com/lxn/win/tab.go
generated
vendored
Normal file
@ -0,0 +1,128 @@
|
|||||||
|
// Copyright 2011 The win Authors. All rights reserved.
|
||||||
|
// Use of this source code is governed by a BSD-style
|
||||||
|
// license that can be found in the LICENSE file.
|
||||||
|
|
||||||
|
// +build windows
|
||||||
|
|
||||||
|
package win
|
||||||
|
|
||||||
|
const TCM_FIRST = 0x1300
|
||||||
|
const TCN_FIRST = -550
|
||||||
|
|
||||||
|
const (
|
||||||
|
TCS_SCROLLOPPOSITE = 0x0001
|
||||||
|
TCS_BOTTOM = 0x0002
|
||||||
|
TCS_RIGHT = 0x0002
|
||||||
|
TCS_MULTISELECT = 0x0004
|
||||||
|
TCS_FLATBUTTONS = 0x0008
|
||||||
|
TCS_FORCEICONLEFT = 0x0010
|
||||||
|
TCS_FORCELABELLEFT = 0x0020
|
||||||
|
TCS_HOTTRACK = 0x0040
|
||||||
|
TCS_VERTICAL = 0x0080
|
||||||
|
TCS_TABS = 0x0000
|
||||||
|
TCS_BUTTONS = 0x0100
|
||||||
|
TCS_SINGLELINE = 0x0000
|
||||||
|
TCS_MULTILINE = 0x0200
|
||||||
|
TCS_RIGHTJUSTIFY = 0x0000
|
||||||
|
TCS_FIXEDWIDTH = 0x0400
|
||||||
|
TCS_RAGGEDRIGHT = 0x0800
|
||||||
|
TCS_FOCUSONBUTTONDOWN = 0x1000
|
||||||
|
TCS_OWNERDRAWFIXED = 0x2000
|
||||||
|
TCS_TOOLTIPS = 0x4000
|
||||||
|
TCS_FOCUSNEVER = 0x8000
|
||||||
|
)
|
||||||
|
|
||||||
|
const (
|
||||||
|
TCS_EX_FLATSEPARATORS = 0x00000001
|
||||||
|
TCS_EX_REGISTERDROP = 0x00000002
|
||||||
|
)
|
||||||
|
|
||||||
|
const (
|
||||||
|
TCM_GETIMAGELIST = TCM_FIRST + 2
|
||||||
|
TCM_SETIMAGELIST = TCM_FIRST + 3
|
||||||
|
TCM_GETITEMCOUNT = TCM_FIRST + 4
|
||||||
|
TCM_GETITEM = TCM_FIRST + 60
|
||||||
|
TCM_SETITEM = TCM_FIRST + 61
|
||||||
|
TCM_INSERTITEM = TCM_FIRST + 62
|
||||||
|
TCM_DELETEITEM = TCM_FIRST + 8
|
||||||
|
TCM_DELETEALLITEMS = TCM_FIRST + 9
|
||||||
|
TCM_GETITEMRECT = TCM_FIRST + 10
|
||||||
|
TCM_GETCURSEL = TCM_FIRST + 11
|
||||||
|
TCM_SETCURSEL = TCM_FIRST + 12
|
||||||
|
TCM_HITTEST = TCM_FIRST + 13
|
||||||
|
TCM_SETITEMEXTRA = TCM_FIRST + 14
|
||||||
|
TCM_ADJUSTRECT = TCM_FIRST + 40
|
||||||
|
TCM_SETITEMSIZE = TCM_FIRST + 41
|
||||||
|
TCM_REMOVEIMAGE = TCM_FIRST + 42
|
||||||
|
TCM_SETPADDING = TCM_FIRST + 43
|
||||||
|
TCM_GETROWCOUNT = TCM_FIRST + 44
|
||||||
|
TCM_GETTOOLTIPS = TCM_FIRST + 45
|
||||||
|
TCM_SETTOOLTIPS = TCM_FIRST + 46
|
||||||
|
TCM_GETCURFOCUS = TCM_FIRST + 47
|
||||||
|
TCM_SETCURFOCUS = TCM_FIRST + 48
|
||||||
|
TCM_SETMINTABWIDTH = TCM_FIRST + 49
|
||||||
|
TCM_DESELECTALL = TCM_FIRST + 50
|
||||||
|
TCM_HIGHLIGHTITEM = TCM_FIRST + 51
|
||||||
|
TCM_SETEXTENDEDSTYLE = TCM_FIRST + 52
|
||||||
|
TCM_GETEXTENDEDSTYLE = TCM_FIRST + 53
|
||||||
|
TCM_SETUNICODEFORMAT = CCM_SETUNICODEFORMAT
|
||||||
|
TCM_GETUNICODEFORMAT = CCM_GETUNICODEFORMAT
|
||||||
|
)
|
||||||
|
|
||||||
|
const (
|
||||||
|
TCIF_TEXT = 0x0001
|
||||||
|
TCIF_IMAGE = 0x0002
|
||||||
|
TCIF_RTLREADING = 0x0004
|
||||||
|
TCIF_PARAM = 0x0008
|
||||||
|
TCIF_STATE = 0x0010
|
||||||
|
)
|
||||||
|
|
||||||
|
const (
|
||||||
|
TCIS_BUTTONPRESSED = 0x0001
|
||||||
|
TCIS_HIGHLIGHTED = 0x0002
|
||||||
|
)
|
||||||
|
|
||||||
|
const (
|
||||||
|
TCHT_NOWHERE = 0x0001
|
||||||
|
TCHT_ONITEMICON = 0x0002
|
||||||
|
TCHT_ONITEMLABEL = 0x0004
|
||||||
|
TCHT_ONITEM = TCHT_ONITEMICON | TCHT_ONITEMLABEL
|
||||||
|
)
|
||||||
|
|
||||||
|
const (
|
||||||
|
TCN_KEYDOWN = TCN_FIRST - 0
|
||||||
|
TCN_SELCHANGE = TCN_FIRST - 1
|
||||||
|
TCN_SELCHANGING = TCN_FIRST - 2
|
||||||
|
TCN_GETOBJECT = TCN_FIRST - 3
|
||||||
|
TCN_FOCUSCHANGE = TCN_FIRST - 4
|
||||||
|
)
|
||||||
|
|
||||||
|
type TCITEMHEADER struct {
|
||||||
|
Mask uint32
|
||||||
|
LpReserved1 uint32
|
||||||
|
LpReserved2 uint32
|
||||||
|
PszText *uint16
|
||||||
|
CchTextMax int32
|
||||||
|
IImage int32
|
||||||
|
}
|
||||||
|
|
||||||
|
type TCITEM struct {
|
||||||
|
Mask uint32
|
||||||
|
DwState uint32
|
||||||
|
DwStateMask uint32
|
||||||
|
PszText *uint16
|
||||||
|
CchTextMax int32
|
||||||
|
IImage int32
|
||||||
|
LParam uintptr
|
||||||
|
}
|
||||||
|
|
||||||
|
type TCHITTESTINFO struct {
|
||||||
|
Pt POINT
|
||||||
|
flags uint32
|
||||||
|
}
|
||||||
|
|
||||||
|
type NMTCKEYDOWN struct {
|
||||||
|
Hdr NMHDR
|
||||||
|
WVKey uint16
|
||||||
|
Flags uint32
|
||||||
|
}
|
219
vendor/github.com/lxn/win/toolbar.go
generated
vendored
Normal file
219
vendor/github.com/lxn/win/toolbar.go
generated
vendored
Normal file
@ -0,0 +1,219 @@
|
|||||||
|
// Copyright 2010 The win Authors. All rights reserved.
|
||||||
|
// Use of this source code is governed by a BSD-style
|
||||||
|
// license that can be found in the LICENSE file.
|
||||||
|
|
||||||
|
// +build windows
|
||||||
|
|
||||||
|
package win
|
||||||
|
|
||||||
|
// ToolBar messages
|
||||||
|
const (
|
||||||
|
TB_THUMBPOSITION = 4
|
||||||
|
TB_THUMBTRACK = 5
|
||||||
|
TB_ENDTRACK = 8
|
||||||
|
TB_ENABLEBUTTON = WM_USER + 1
|
||||||
|
TB_CHECKBUTTON = WM_USER + 2
|
||||||
|
TB_PRESSBUTTON = WM_USER + 3
|
||||||
|
TB_HIDEBUTTON = WM_USER + 4
|
||||||
|
TB_INDETERMINATE = WM_USER + 5
|
||||||
|
TB_MARKBUTTON = WM_USER + 6
|
||||||
|
TB_ISBUTTONENABLED = WM_USER + 9
|
||||||
|
TB_ISBUTTONCHECKED = WM_USER + 10
|
||||||
|
TB_ISBUTTONPRESSED = WM_USER + 11
|
||||||
|
TB_ISBUTTONHIDDEN = WM_USER + 12
|
||||||
|
TB_ISBUTTONINDETERMINATE = WM_USER + 13
|
||||||
|
TB_ISBUTTONHIGHLIGHTED = WM_USER + 14
|
||||||
|
TB_SETSTATE = WM_USER + 17
|
||||||
|
TB_GETSTATE = WM_USER + 18
|
||||||
|
TB_ADDBITMAP = WM_USER + 19
|
||||||
|
TB_DELETEBUTTON = WM_USER + 22
|
||||||
|
TB_GETBUTTON = WM_USER + 23
|
||||||
|
TB_BUTTONCOUNT = WM_USER + 24
|
||||||
|
TB_COMMANDTOINDEX = WM_USER + 25
|
||||||
|
TB_SAVERESTORE = WM_USER + 76
|
||||||
|
TB_CUSTOMIZE = WM_USER + 27
|
||||||
|
TB_ADDSTRING = WM_USER + 77
|
||||||
|
TB_GETITEMRECT = WM_USER + 29
|
||||||
|
TB_BUTTONSTRUCTSIZE = WM_USER + 30
|
||||||
|
TB_SETBUTTONSIZE = WM_USER + 31
|
||||||
|
TB_SETBITMAPSIZE = WM_USER + 32
|
||||||
|
TB_AUTOSIZE = WM_USER + 33
|
||||||
|
TB_GETTOOLTIPS = WM_USER + 35
|
||||||
|
TB_SETTOOLTIPS = WM_USER + 36
|
||||||
|
TB_SETPARENT = WM_USER + 37
|
||||||
|
TB_SETROWS = WM_USER + 39
|
||||||
|
TB_GETROWS = WM_USER + 40
|
||||||
|
TB_GETBITMAPFLAGS = WM_USER + 41
|
||||||
|
TB_SETCMDID = WM_USER + 42
|
||||||
|
TB_CHANGEBITMAP = WM_USER + 43
|
||||||
|
TB_GETBITMAP = WM_USER + 44
|
||||||
|
TB_GETBUTTONTEXT = WM_USER + 75
|
||||||
|
TB_REPLACEBITMAP = WM_USER + 46
|
||||||
|
TB_GETBUTTONSIZE = WM_USER + 58
|
||||||
|
TB_SETBUTTONWIDTH = WM_USER + 59
|
||||||
|
TB_SETINDENT = WM_USER + 47
|
||||||
|
TB_SETIMAGELIST = WM_USER + 48
|
||||||
|
TB_GETIMAGELIST = WM_USER + 49
|
||||||
|
TB_LOADIMAGES = WM_USER + 50
|
||||||
|
TB_GETRECT = WM_USER + 51
|
||||||
|
TB_SETHOTIMAGELIST = WM_USER + 52
|
||||||
|
TB_GETHOTIMAGELIST = WM_USER + 53
|
||||||
|
TB_SETDISABLEDIMAGELIST = WM_USER + 54
|
||||||
|
TB_GETDISABLEDIMAGELIST = WM_USER + 55
|
||||||
|
TB_SETSTYLE = WM_USER + 56
|
||||||
|
TB_GETSTYLE = WM_USER + 57
|
||||||
|
TB_SETMAXTEXTROWS = WM_USER + 60
|
||||||
|
TB_GETTEXTROWS = WM_USER + 61
|
||||||
|
TB_GETOBJECT = WM_USER + 62
|
||||||
|
TB_GETBUTTONINFO = WM_USER + 63
|
||||||
|
TB_SETBUTTONINFO = WM_USER + 64
|
||||||
|
TB_INSERTBUTTON = WM_USER + 67
|
||||||
|
TB_ADDBUTTONS = WM_USER + 68
|
||||||
|
TB_HITTEST = WM_USER + 69
|
||||||
|
TB_SETDRAWTEXTFLAGS = WM_USER + 70
|
||||||
|
TB_GETHOTITEM = WM_USER + 71
|
||||||
|
TB_SETHOTITEM = WM_USER + 72
|
||||||
|
TB_SETANCHORHIGHLIGHT = WM_USER + 73
|
||||||
|
TB_GETANCHORHIGHLIGHT = WM_USER + 74
|
||||||
|
TB_GETINSERTMARK = WM_USER + 79
|
||||||
|
TB_SETINSERTMARK = WM_USER + 80
|
||||||
|
TB_INSERTMARKHITTEST = WM_USER + 81
|
||||||
|
TB_MOVEBUTTON = WM_USER + 82
|
||||||
|
TB_GETMAXSIZE = WM_USER + 83
|
||||||
|
TB_SETEXTENDEDSTYLE = WM_USER + 84
|
||||||
|
TB_GETEXTENDEDSTYLE = WM_USER + 85
|
||||||
|
TB_GETPADDING = WM_USER + 86
|
||||||
|
TB_SETPADDING = WM_USER + 87
|
||||||
|
TB_SETINSERTMARKCOLOR = WM_USER + 88
|
||||||
|
TB_GETINSERTMARKCOLOR = WM_USER + 89
|
||||||
|
TB_MAPACCELERATOR = WM_USER + 90
|
||||||
|
TB_GETSTRING = WM_USER + 91
|
||||||
|
TB_GETIDEALSIZE = WM_USER + 99
|
||||||
|
TB_SETCOLORSCHEME = CCM_SETCOLORSCHEME
|
||||||
|
TB_GETCOLORSCHEME = CCM_GETCOLORSCHEME
|
||||||
|
TB_SETUNICODEFORMAT = CCM_SETUNICODEFORMAT
|
||||||
|
TB_GETUNICODEFORMAT = CCM_GETUNICODEFORMAT
|
||||||
|
)
|
||||||
|
|
||||||
|
// ToolBar notifications
|
||||||
|
const (
|
||||||
|
TBN_FIRST = -700
|
||||||
|
TBN_DROPDOWN = TBN_FIRST - 10
|
||||||
|
)
|
||||||
|
|
||||||
|
// TBN_DROPDOWN return codes
|
||||||
|
const (
|
||||||
|
TBDDRET_DEFAULT = 0
|
||||||
|
TBDDRET_NODEFAULT = 1
|
||||||
|
TBDDRET_TREATPRESSED = 2
|
||||||
|
)
|
||||||
|
|
||||||
|
// ToolBar state constants
|
||||||
|
const (
|
||||||
|
TBSTATE_CHECKED = 1
|
||||||
|
TBSTATE_PRESSED = 2
|
||||||
|
TBSTATE_ENABLED = 4
|
||||||
|
TBSTATE_HIDDEN = 8
|
||||||
|
TBSTATE_INDETERMINATE = 16
|
||||||
|
TBSTATE_WRAP = 32
|
||||||
|
TBSTATE_ELLIPSES = 0x40
|
||||||
|
TBSTATE_MARKED = 0x0080
|
||||||
|
)
|
||||||
|
|
||||||
|
// ToolBar style constants
|
||||||
|
const (
|
||||||
|
TBSTYLE_BUTTON = 0
|
||||||
|
TBSTYLE_SEP = 1
|
||||||
|
TBSTYLE_CHECK = 2
|
||||||
|
TBSTYLE_GROUP = 4
|
||||||
|
TBSTYLE_CHECKGROUP = TBSTYLE_GROUP | TBSTYLE_CHECK
|
||||||
|
TBSTYLE_DROPDOWN = 8
|
||||||
|
TBSTYLE_AUTOSIZE = 16
|
||||||
|
TBSTYLE_NOPREFIX = 32
|
||||||
|
TBSTYLE_TOOLTIPS = 256
|
||||||
|
TBSTYLE_WRAPABLE = 512
|
||||||
|
TBSTYLE_ALTDRAG = 1024
|
||||||
|
TBSTYLE_FLAT = 2048
|
||||||
|
TBSTYLE_LIST = 4096
|
||||||
|
TBSTYLE_CUSTOMERASE = 8192
|
||||||
|
TBSTYLE_REGISTERDROP = 0x4000
|
||||||
|
TBSTYLE_TRANSPARENT = 0x8000
|
||||||
|
)
|
||||||
|
|
||||||
|
// ToolBar extended style constants
|
||||||
|
const (
|
||||||
|
TBSTYLE_EX_DRAWDDARROWS = 0x00000001
|
||||||
|
TBSTYLE_EX_MIXEDBUTTONS = 8
|
||||||
|
TBSTYLE_EX_HIDECLIPPEDBUTTONS = 16
|
||||||
|
TBSTYLE_EX_DOUBLEBUFFER = 0x80
|
||||||
|
)
|
||||||
|
|
||||||
|
// ToolBar button style constants
|
||||||
|
const (
|
||||||
|
BTNS_BUTTON = TBSTYLE_BUTTON
|
||||||
|
BTNS_SEP = TBSTYLE_SEP
|
||||||
|
BTNS_CHECK = TBSTYLE_CHECK
|
||||||
|
BTNS_GROUP = TBSTYLE_GROUP
|
||||||
|
BTNS_CHECKGROUP = TBSTYLE_CHECKGROUP
|
||||||
|
BTNS_DROPDOWN = TBSTYLE_DROPDOWN
|
||||||
|
BTNS_AUTOSIZE = TBSTYLE_AUTOSIZE
|
||||||
|
BTNS_NOPREFIX = TBSTYLE_NOPREFIX
|
||||||
|
BTNS_WHOLEDROPDOWN = 0x0080
|
||||||
|
BTNS_SHOWTEXT = 0x0040
|
||||||
|
)
|
||||||
|
|
||||||
|
// TBBUTTONINFO mask flags
|
||||||
|
const (
|
||||||
|
TBIF_IMAGE = 0x00000001
|
||||||
|
TBIF_TEXT = 0x00000002
|
||||||
|
TBIF_STATE = 0x00000004
|
||||||
|
TBIF_STYLE = 0x00000008
|
||||||
|
TBIF_LPARAM = 0x00000010
|
||||||
|
TBIF_COMMAND = 0x00000020
|
||||||
|
TBIF_SIZE = 0x00000040
|
||||||
|
TBIF_BYINDEX = 0x80000000
|
||||||
|
)
|
||||||
|
|
||||||
|
type NMMOUSE struct {
|
||||||
|
Hdr NMHDR
|
||||||
|
DwItemSpec uintptr
|
||||||
|
DwItemData uintptr
|
||||||
|
Pt POINT
|
||||||
|
DwHitInfo uintptr
|
||||||
|
}
|
||||||
|
|
||||||
|
type NMTOOLBAR struct {
|
||||||
|
Hdr NMHDR
|
||||||
|
IItem int32
|
||||||
|
TbButton TBBUTTON
|
||||||
|
CchText int32
|
||||||
|
PszText *uint16
|
||||||
|
RcButton RECT
|
||||||
|
}
|
||||||
|
|
||||||
|
type TBBUTTON struct {
|
||||||
|
IBitmap int32
|
||||||
|
IdCommand int32
|
||||||
|
FsState byte
|
||||||
|
FsStyle byte
|
||||||
|
//#ifdef _WIN64
|
||||||
|
// BYTE bReserved[6] // padding for alignment
|
||||||
|
//#elif defined(_WIN32)
|
||||||
|
BReserved [2]byte // padding for alignment
|
||||||
|
//#endif
|
||||||
|
DwData uintptr
|
||||||
|
IString uintptr
|
||||||
|
}
|
||||||
|
|
||||||
|
type TBBUTTONINFO struct {
|
||||||
|
CbSize uint32
|
||||||
|
DwMask uint32
|
||||||
|
IdCommand int32
|
||||||
|
IImage int32
|
||||||
|
FsState byte
|
||||||
|
FsStyle byte
|
||||||
|
Cx uint16
|
||||||
|
LParam uintptr
|
||||||
|
PszText uintptr
|
||||||
|
CchText int32
|
||||||
|
}
|
97
vendor/github.com/lxn/win/tooltip.go
generated
vendored
Normal file
97
vendor/github.com/lxn/win/tooltip.go
generated
vendored
Normal file
@ -0,0 +1,97 @@
|
|||||||
|
// Copyright 2010 The win Authors. All rights reserved.
|
||||||
|
// Use of this source code is governed by a BSD-style
|
||||||
|
// license that can be found in the LICENSE file.
|
||||||
|
|
||||||
|
// +build windows
|
||||||
|
|
||||||
|
package win
|
||||||
|
|
||||||
|
import (
|
||||||
|
"unsafe"
|
||||||
|
)
|
||||||
|
|
||||||
|
// ToolTip styles
|
||||||
|
const (
|
||||||
|
TTS_ALWAYSTIP = 0x01
|
||||||
|
TTS_NOPREFIX = 0x02
|
||||||
|
TTS_NOANIMATE = 0x10
|
||||||
|
TTS_NOFADE = 0x20
|
||||||
|
TTS_BALLOON = 0x40
|
||||||
|
TTS_CLOSE = 0x80
|
||||||
|
)
|
||||||
|
|
||||||
|
// ToolTip messages
|
||||||
|
const (
|
||||||
|
TTM_ACTIVATE = WM_USER + 1
|
||||||
|
TTM_SETDELAYTIME = WM_USER + 3
|
||||||
|
TTM_ADDTOOL = WM_USER + 50
|
||||||
|
TTM_DELTOOL = WM_USER + 51
|
||||||
|
TTM_NEWTOOLRECT = WM_USER + 52
|
||||||
|
TTM_RELAYEVENT = WM_USER + 7
|
||||||
|
TTM_GETTOOLINFO = WM_USER + 53
|
||||||
|
TTM_SETTOOLINFO = WM_USER + 54
|
||||||
|
TTM_HITTEST = WM_USER + 55
|
||||||
|
TTM_GETTEXT = WM_USER + 56
|
||||||
|
TTM_UPDATETIPTEXT = WM_USER + 57
|
||||||
|
TTM_GETTOOLCOUNT = WM_USER + 13
|
||||||
|
TTM_ENUMTOOLS = WM_USER + 58
|
||||||
|
TTM_GETCURRENTTOOL = WM_USER + 59
|
||||||
|
TTM_WINDOWFROMPOINT = WM_USER + 16
|
||||||
|
TTM_TRACKACTIVATE = WM_USER + 17
|
||||||
|
TTM_TRACKPOSITION = WM_USER + 18
|
||||||
|
TTM_SETTIPBKCOLOR = WM_USER + 19
|
||||||
|
TTM_SETTIPTEXTCOLOR = WM_USER + 20
|
||||||
|
TTM_GETDELAYTIME = WM_USER + 21
|
||||||
|
TTM_GETTIPBKCOLOR = WM_USER + 22
|
||||||
|
TTM_GETTIPTEXTCOLOR = WM_USER + 23
|
||||||
|
TTM_SETMAXTIPWIDTH = WM_USER + 24
|
||||||
|
TTM_GETMAXTIPWIDTH = WM_USER + 25
|
||||||
|
TTM_SETMARGIN = WM_USER + 26
|
||||||
|
TTM_GETMARGIN = WM_USER + 27
|
||||||
|
TTM_POP = WM_USER + 28
|
||||||
|
TTM_UPDATE = WM_USER + 29
|
||||||
|
TTM_GETBUBBLESIZE = WM_USER + 30
|
||||||
|
TTM_ADJUSTRECT = WM_USER + 31
|
||||||
|
TTM_SETTITLE = WM_USER + 33
|
||||||
|
TTM_POPUP = WM_USER + 34
|
||||||
|
TTM_GETTITLE = WM_USER + 35
|
||||||
|
)
|
||||||
|
|
||||||
|
// ToolTip flags
|
||||||
|
const (
|
||||||
|
TTF_IDISHWND = 0x0001
|
||||||
|
TTF_CENTERTIP = 0x0002
|
||||||
|
TTF_RTLREADING = 0x0004
|
||||||
|
TTF_SUBCLASS = 0x0010
|
||||||
|
TTF_TRACK = 0x0020
|
||||||
|
TTF_ABSOLUTE = 0x0080
|
||||||
|
TTF_TRANSPARENT = 0x0100
|
||||||
|
TTF_DI_SETITEM = 0x8000
|
||||||
|
)
|
||||||
|
|
||||||
|
// ToolTip icons
|
||||||
|
const (
|
||||||
|
TTI_NONE = 0
|
||||||
|
TTI_INFO = 1
|
||||||
|
TTI_WARNING = 2
|
||||||
|
TTI_ERROR = 3
|
||||||
|
)
|
||||||
|
|
||||||
|
type TOOLINFO struct {
|
||||||
|
CbSize uint32
|
||||||
|
UFlags uint32
|
||||||
|
Hwnd HWND
|
||||||
|
UId uintptr
|
||||||
|
Rect RECT
|
||||||
|
Hinst HINSTANCE
|
||||||
|
LpszText *uint16
|
||||||
|
LParam uintptr
|
||||||
|
LpReserved unsafe.Pointer
|
||||||
|
}
|
||||||
|
|
||||||
|
type TTGETTITLE struct {
|
||||||
|
DwSize uint32
|
||||||
|
UTitleBitmap uint32
|
||||||
|
Cch uint32
|
||||||
|
PszTitle *uint16
|
||||||
|
}
|
247
vendor/github.com/lxn/win/treeview.go
generated
vendored
Normal file
247
vendor/github.com/lxn/win/treeview.go
generated
vendored
Normal file
@ -0,0 +1,247 @@
|
|||||||
|
// Copyright 2010 The win Authors. All rights reserved.
|
||||||
|
// Use of this source code is governed by a BSD-style
|
||||||
|
// license that can be found in the LICENSE file.
|
||||||
|
|
||||||
|
// +build windows
|
||||||
|
|
||||||
|
package win
|
||||||
|
|
||||||
|
// TreeView styles
|
||||||
|
const (
|
||||||
|
TVS_HASBUTTONS = 0x0001
|
||||||
|
TVS_HASLINES = 0x0002
|
||||||
|
TVS_LINESATROOT = 0x0004
|
||||||
|
TVS_EDITLABELS = 0x0008
|
||||||
|
TVS_DISABLEDRAGDROP = 0x0010
|
||||||
|
TVS_SHOWSELALWAYS = 0x0020
|
||||||
|
TVS_RTLREADING = 0x0040
|
||||||
|
TVS_NOTOOLTIPS = 0x0080
|
||||||
|
TVS_CHECKBOXES = 0x0100
|
||||||
|
TVS_TRACKSELECT = 0x0200
|
||||||
|
TVS_SINGLEEXPAND = 0x0400
|
||||||
|
TVS_INFOTIP = 0x0800
|
||||||
|
TVS_FULLROWSELECT = 0x1000
|
||||||
|
TVS_NOSCROLL = 0x2000
|
||||||
|
TVS_NONEVENHEIGHT = 0x4000
|
||||||
|
TVS_NOHSCROLL = 0x8000
|
||||||
|
)
|
||||||
|
|
||||||
|
const (
|
||||||
|
TVS_EX_NOSINGLECOLLAPSE = 0x0001
|
||||||
|
TVS_EX_MULTISELECT = 0x0002
|
||||||
|
TVS_EX_DOUBLEBUFFER = 0x0004
|
||||||
|
TVS_EX_NOINDENTSTATE = 0x0008
|
||||||
|
TVS_EX_RICHTOOLTIP = 0x0010
|
||||||
|
TVS_EX_AUTOHSCROLL = 0x0020
|
||||||
|
TVS_EX_FADEINOUTEXPANDOS = 0x0040
|
||||||
|
TVS_EX_PARTIALCHECKBOXES = 0x0080
|
||||||
|
TVS_EX_EXCLUSIONCHECKBOXES = 0x0100
|
||||||
|
TVS_EX_DIMMEDCHECKBOXES = 0x0200
|
||||||
|
TVS_EX_DRAWIMAGEASYNC = 0x0400
|
||||||
|
)
|
||||||
|
|
||||||
|
const (
|
||||||
|
TVIF_TEXT = 0x0001
|
||||||
|
TVIF_IMAGE = 0x0002
|
||||||
|
TVIF_PARAM = 0x0004
|
||||||
|
TVIF_STATE = 0x0008
|
||||||
|
TVIF_HANDLE = 0x0010
|
||||||
|
TVIF_SELECTEDIMAGE = 0x0020
|
||||||
|
TVIF_CHILDREN = 0x0040
|
||||||
|
TVIF_INTEGRAL = 0x0080
|
||||||
|
TVIF_STATEEX = 0x0100
|
||||||
|
TVIF_EXPANDEDIMAGE = 0x0200
|
||||||
|
)
|
||||||
|
|
||||||
|
const (
|
||||||
|
TVIS_SELECTED = 0x0002
|
||||||
|
TVIS_CUT = 0x0004
|
||||||
|
TVIS_DROPHILITED = 0x0008
|
||||||
|
TVIS_BOLD = 0x0010
|
||||||
|
TVIS_EXPANDED = 0x0020
|
||||||
|
TVIS_EXPANDEDONCE = 0x0040
|
||||||
|
TVIS_EXPANDPARTIAL = 0x0080
|
||||||
|
TVIS_OVERLAYMASK = 0x0F00
|
||||||
|
TVIS_STATEIMAGEMASK = 0xF000
|
||||||
|
TVIS_USERMASK = 0xF000
|
||||||
|
)
|
||||||
|
|
||||||
|
const (
|
||||||
|
TVIS_EX_FLAT = 0x0001
|
||||||
|
TVIS_EX_DISABLED = 0x0002
|
||||||
|
TVIS_EX_ALL = 0x0002
|
||||||
|
)
|
||||||
|
|
||||||
|
const (
|
||||||
|
TVI_ROOT = ^HTREEITEM(0xffff)
|
||||||
|
TVI_FIRST = ^HTREEITEM(0xfffe)
|
||||||
|
TVI_LAST = ^HTREEITEM(0xfffd)
|
||||||
|
TVI_SORT = ^HTREEITEM(0xfffc)
|
||||||
|
)
|
||||||
|
|
||||||
|
// TVM_EXPAND action flags
|
||||||
|
const (
|
||||||
|
TVE_COLLAPSE = 0x0001
|
||||||
|
TVE_EXPAND = 0x0002
|
||||||
|
TVE_TOGGLE = 0x0003
|
||||||
|
TVE_EXPANDPARTIAL = 0x4000
|
||||||
|
TVE_COLLAPSERESET = 0x8000
|
||||||
|
)
|
||||||
|
|
||||||
|
const (
|
||||||
|
TVGN_CARET = 9
|
||||||
|
)
|
||||||
|
|
||||||
|
// TreeView messages
|
||||||
|
const (
|
||||||
|
TV_FIRST = 0x1100
|
||||||
|
|
||||||
|
TVM_INSERTITEM = TV_FIRST + 50
|
||||||
|
TVM_DELETEITEM = TV_FIRST + 1
|
||||||
|
TVM_EXPAND = TV_FIRST + 2
|
||||||
|
TVM_GETITEMRECT = TV_FIRST + 4
|
||||||
|
TVM_GETCOUNT = TV_FIRST + 5
|
||||||
|
TVM_GETINDENT = TV_FIRST + 6
|
||||||
|
TVM_SETINDENT = TV_FIRST + 7
|
||||||
|
TVM_GETIMAGELIST = TV_FIRST + 8
|
||||||
|
TVM_SETIMAGELIST = TV_FIRST + 9
|
||||||
|
TVM_GETNEXTITEM = TV_FIRST + 10
|
||||||
|
TVM_SELECTITEM = TV_FIRST + 11
|
||||||
|
TVM_GETITEM = TV_FIRST + 62
|
||||||
|
TVM_SETITEM = TV_FIRST + 63
|
||||||
|
TVM_EDITLABEL = TV_FIRST + 65
|
||||||
|
TVM_GETEDITCONTROL = TV_FIRST + 15
|
||||||
|
TVM_GETVISIBLECOUNT = TV_FIRST + 16
|
||||||
|
TVM_HITTEST = TV_FIRST + 17
|
||||||
|
TVM_CREATEDRAGIMAGE = TV_FIRST + 18
|
||||||
|
TVM_SORTCHILDREN = TV_FIRST + 19
|
||||||
|
TVM_ENSUREVISIBLE = TV_FIRST + 20
|
||||||
|
TVM_SORTCHILDRENCB = TV_FIRST + 21
|
||||||
|
TVM_ENDEDITLABELNOW = TV_FIRST + 22
|
||||||
|
TVM_GETISEARCHSTRING = TV_FIRST + 64
|
||||||
|
TVM_SETTOOLTIPS = TV_FIRST + 24
|
||||||
|
TVM_GETTOOLTIPS = TV_FIRST + 25
|
||||||
|
TVM_SETINSERTMARK = TV_FIRST + 26
|
||||||
|
TVM_SETUNICODEFORMAT = CCM_SETUNICODEFORMAT
|
||||||
|
TVM_GETUNICODEFORMAT = CCM_GETUNICODEFORMAT
|
||||||
|
TVM_SETITEMHEIGHT = TV_FIRST + 27
|
||||||
|
TVM_GETITEMHEIGHT = TV_FIRST + 28
|
||||||
|
TVM_SETBKCOLOR = TV_FIRST + 29
|
||||||
|
TVM_SETTEXTCOLOR = TV_FIRST + 30
|
||||||
|
TVM_GETBKCOLOR = TV_FIRST + 31
|
||||||
|
TVM_GETTEXTCOLOR = TV_FIRST + 32
|
||||||
|
TVM_SETSCROLLTIME = TV_FIRST + 33
|
||||||
|
TVM_GETSCROLLTIME = TV_FIRST + 34
|
||||||
|
TVM_SETINSERTMARKCOLOR = TV_FIRST + 37
|
||||||
|
TVM_GETINSERTMARKCOLOR = TV_FIRST + 38
|
||||||
|
TVM_GETITEMSTATE = TV_FIRST + 39
|
||||||
|
TVM_SETLINECOLOR = TV_FIRST + 40
|
||||||
|
TVM_GETLINECOLOR = TV_FIRST + 41
|
||||||
|
TVM_MAPACCIDTOHTREEITEM = TV_FIRST + 42
|
||||||
|
TVM_MAPHTREEITEMTOACCID = TV_FIRST + 43
|
||||||
|
TVM_SETEXTENDEDSTYLE = TV_FIRST + 44
|
||||||
|
TVM_GETEXTENDEDSTYLE = TV_FIRST + 45
|
||||||
|
TVM_SETAUTOSCROLLINFO = TV_FIRST + 59
|
||||||
|
)
|
||||||
|
|
||||||
|
// TreeView notifications
|
||||||
|
const (
|
||||||
|
TVN_FIRST = ^uint32(399)
|
||||||
|
|
||||||
|
TVN_SELCHANGING = TVN_FIRST - 50
|
||||||
|
TVN_SELCHANGED = TVN_FIRST - 51
|
||||||
|
TVN_GETDISPINFO = TVN_FIRST - 52
|
||||||
|
TVN_ITEMEXPANDING = TVN_FIRST - 54
|
||||||
|
TVN_ITEMEXPANDED = TVN_FIRST - 55
|
||||||
|
TVN_BEGINDRAG = TVN_FIRST - 56
|
||||||
|
TVN_BEGINRDRAG = TVN_FIRST - 57
|
||||||
|
TVN_DELETEITEM = TVN_FIRST - 58
|
||||||
|
TVN_BEGINLABELEDIT = TVN_FIRST - 59
|
||||||
|
TVN_ENDLABELEDIT = TVN_FIRST - 60
|
||||||
|
TVN_KEYDOWN = TVN_FIRST - 12
|
||||||
|
TVN_GETINFOTIP = TVN_FIRST - 14
|
||||||
|
TVN_SINGLEEXPAND = TVN_FIRST - 15
|
||||||
|
TVN_ITEMCHANGING = TVN_FIRST - 17
|
||||||
|
TVN_ITEMCHANGED = TVN_FIRST - 19
|
||||||
|
TVN_ASYNCDRAW = TVN_FIRST - 20
|
||||||
|
)
|
||||||
|
|
||||||
|
// TreeView hit test constants
|
||||||
|
const (
|
||||||
|
TVHT_NOWHERE = 1
|
||||||
|
TVHT_ONITEMICON = 2
|
||||||
|
TVHT_ONITEMLABEL = 4
|
||||||
|
TVHT_ONITEM = TVHT_ONITEMICON | TVHT_ONITEMLABEL | TVHT_ONITEMSTATEICON
|
||||||
|
TVHT_ONITEMINDENT = 8
|
||||||
|
TVHT_ONITEMBUTTON = 16
|
||||||
|
TVHT_ONITEMRIGHT = 32
|
||||||
|
TVHT_ONITEMSTATEICON = 64
|
||||||
|
TVHT_ABOVE = 256
|
||||||
|
TVHT_BELOW = 512
|
||||||
|
TVHT_TORIGHT = 1024
|
||||||
|
TVHT_TOLEFT = 2048
|
||||||
|
)
|
||||||
|
|
||||||
|
type HTREEITEM HANDLE
|
||||||
|
|
||||||
|
type TVITEM struct {
|
||||||
|
Mask uint32
|
||||||
|
HItem HTREEITEM
|
||||||
|
State uint32
|
||||||
|
StateMask uint32
|
||||||
|
PszText uintptr
|
||||||
|
CchTextMax int32
|
||||||
|
IImage int32
|
||||||
|
ISelectedImage int32
|
||||||
|
CChildren int32
|
||||||
|
LParam uintptr
|
||||||
|
}
|
||||||
|
|
||||||
|
/*type TVITEMEX struct {
|
||||||
|
mask UINT
|
||||||
|
hItem HTREEITEM
|
||||||
|
state UINT
|
||||||
|
stateMask UINT
|
||||||
|
pszText LPWSTR
|
||||||
|
cchTextMax int
|
||||||
|
iImage int
|
||||||
|
iSelectedImage int
|
||||||
|
cChildren int
|
||||||
|
lParam LPARAM
|
||||||
|
iIntegral int
|
||||||
|
uStateEx UINT
|
||||||
|
hwnd HWND
|
||||||
|
iExpandedImage int
|
||||||
|
}*/
|
||||||
|
|
||||||
|
type TVINSERTSTRUCT struct {
|
||||||
|
HParent HTREEITEM
|
||||||
|
HInsertAfter HTREEITEM
|
||||||
|
Item TVITEM
|
||||||
|
// itemex TVITEMEX
|
||||||
|
}
|
||||||
|
|
||||||
|
type NMTREEVIEW struct {
|
||||||
|
Hdr NMHDR
|
||||||
|
Action uint32
|
||||||
|
ItemOld TVITEM
|
||||||
|
ItemNew TVITEM
|
||||||
|
PtDrag POINT
|
||||||
|
}
|
||||||
|
|
||||||
|
type NMTVDISPINFO struct {
|
||||||
|
Hdr NMHDR
|
||||||
|
Item TVITEM
|
||||||
|
}
|
||||||
|
|
||||||
|
type NMTVKEYDOWN struct {
|
||||||
|
Hdr NMHDR
|
||||||
|
WVKey uint16
|
||||||
|
Flags uint32
|
||||||
|
}
|
||||||
|
|
||||||
|
type TVHITTESTINFO struct {
|
||||||
|
Pt POINT
|
||||||
|
Flags uint32
|
||||||
|
HItem HTREEITEM
|
||||||
|
}
|
58
vendor/github.com/lxn/win/updown.go
generated
vendored
Normal file
58
vendor/github.com/lxn/win/updown.go
generated
vendored
Normal file
@ -0,0 +1,58 @@
|
|||||||
|
// Copyright 2011 The win Authors. All rights reserved.
|
||||||
|
// Use of this source code is governed by a BSD-style
|
||||||
|
// license that can be found in the LICENSE file.
|
||||||
|
|
||||||
|
// +build windows
|
||||||
|
|
||||||
|
package win
|
||||||
|
|
||||||
|
const UDN_FIRST = ^uint32(720)
|
||||||
|
|
||||||
|
const (
|
||||||
|
UD_MAXVAL = 0x7fff
|
||||||
|
UD_MINVAL = ^uintptr(UD_MAXVAL - 1)
|
||||||
|
)
|
||||||
|
|
||||||
|
const (
|
||||||
|
UDS_WRAP = 0x0001
|
||||||
|
UDS_SETBUDDYINT = 0x0002
|
||||||
|
UDS_ALIGNRIGHT = 0x0004
|
||||||
|
UDS_ALIGNLEFT = 0x0008
|
||||||
|
UDS_AUTOBUDDY = 0x0010
|
||||||
|
UDS_ARROWKEYS = 0x0020
|
||||||
|
UDS_HORZ = 0x0040
|
||||||
|
UDS_NOTHOUSANDS = 0x0080
|
||||||
|
UDS_HOTTRACK = 0x0100
|
||||||
|
)
|
||||||
|
|
||||||
|
const (
|
||||||
|
UDM_SETRANGE = WM_USER + 101
|
||||||
|
UDM_GETRANGE = WM_USER + 102
|
||||||
|
UDM_SETPOS = WM_USER + 103
|
||||||
|
UDM_GETPOS = WM_USER + 104
|
||||||
|
UDM_SETBUDDY = WM_USER + 105
|
||||||
|
UDM_GETBUDDY = WM_USER + 106
|
||||||
|
UDM_SETACCEL = WM_USER + 107
|
||||||
|
UDM_GETACCEL = WM_USER + 108
|
||||||
|
UDM_SETBASE = WM_USER + 109
|
||||||
|
UDM_GETBASE = WM_USER + 110
|
||||||
|
UDM_SETRANGE32 = WM_USER + 111
|
||||||
|
UDM_GETRANGE32 = WM_USER + 112
|
||||||
|
UDM_SETUNICODEFORMAT = CCM_SETUNICODEFORMAT
|
||||||
|
UDM_GETUNICODEFORMAT = CCM_GETUNICODEFORMAT
|
||||||
|
UDM_SETPOS32 = WM_USER + 113
|
||||||
|
UDM_GETPOS32 = WM_USER + 114
|
||||||
|
)
|
||||||
|
|
||||||
|
const UDN_DELTAPOS = UDN_FIRST - 1
|
||||||
|
|
||||||
|
type UDACCEL struct {
|
||||||
|
NSec uint32
|
||||||
|
NInc uint32
|
||||||
|
}
|
||||||
|
|
||||||
|
type NMUPDOWN struct {
|
||||||
|
Hdr NMHDR
|
||||||
|
IPos int32
|
||||||
|
IDelta int32
|
||||||
|
}
|
2911
vendor/github.com/lxn/win/user32.go
generated
vendored
Normal file
2911
vendor/github.com/lxn/win/user32.go
generated
vendored
Normal file
File diff suppressed because it is too large
Load Diff
260
vendor/github.com/lxn/win/uxtheme.go
generated
vendored
Normal file
260
vendor/github.com/lxn/win/uxtheme.go
generated
vendored
Normal file
@ -0,0 +1,260 @@
|
|||||||
|
// Copyright 2010 The win Authors. All rights reserved.
|
||||||
|
// Use of this source code is governed by a BSD-style
|
||||||
|
// license that can be found in the LICENSE file.
|
||||||
|
|
||||||
|
// +build windows
|
||||||
|
|
||||||
|
package win
|
||||||
|
|
||||||
|
import (
|
||||||
|
"syscall"
|
||||||
|
"unsafe"
|
||||||
|
)
|
||||||
|
|
||||||
|
// CheckBox parts
|
||||||
|
const (
|
||||||
|
BP_CHECKBOX = 3
|
||||||
|
)
|
||||||
|
|
||||||
|
// CheckBox states
|
||||||
|
const (
|
||||||
|
CBS_UNCHECKEDNORMAL = 1
|
||||||
|
)
|
||||||
|
|
||||||
|
// LISTVIEW parts
|
||||||
|
const (
|
||||||
|
LVP_LISTITEM = 1
|
||||||
|
LVP_LISTGROUP = 2
|
||||||
|
LVP_LISTDETAIL = 3
|
||||||
|
LVP_LISTSORTEDDETAIL = 4
|
||||||
|
LVP_EMPTYTEXT = 5
|
||||||
|
LVP_GROUPHEADER = 6
|
||||||
|
LVP_GROUPHEADERLINE = 7
|
||||||
|
LVP_EXPANDBUTTON = 8
|
||||||
|
LVP_COLLAPSEBUTTON = 9
|
||||||
|
LVP_COLUMNDETAIL = 10
|
||||||
|
)
|
||||||
|
|
||||||
|
// LVP_LISTITEM states
|
||||||
|
const (
|
||||||
|
LISS_NORMAL = 1
|
||||||
|
LISS_HOT = 2
|
||||||
|
LISS_SELECTED = 3
|
||||||
|
LISS_DISABLED = 4
|
||||||
|
LISS_SELECTEDNOTFOCUS = 5
|
||||||
|
LISS_HOTSELECTED = 6
|
||||||
|
)
|
||||||
|
|
||||||
|
// TAB parts
|
||||||
|
const (
|
||||||
|
TABP_TABITEM = 1
|
||||||
|
)
|
||||||
|
|
||||||
|
// TABP_TABITEM states
|
||||||
|
const (
|
||||||
|
TIS_NORMAL = 1
|
||||||
|
TIS_HOT = 2
|
||||||
|
TIS_SELECTED = 3
|
||||||
|
TIS_DISABLED = 4
|
||||||
|
TIS_FOCUSED = 5
|
||||||
|
)
|
||||||
|
|
||||||
|
// TREEVIEW parts
|
||||||
|
const (
|
||||||
|
TVP_TREEITEM = 1
|
||||||
|
TVP_GLYPH = 2
|
||||||
|
TVP_BRANCH = 3
|
||||||
|
TVP_HOTGLYPH = 4
|
||||||
|
)
|
||||||
|
|
||||||
|
// TVP_TREEITEM states
|
||||||
|
const (
|
||||||
|
TREIS_NORMAL = 1
|
||||||
|
TREIS_HOT = 2
|
||||||
|
TREIS_SELECTED = 3
|
||||||
|
TREIS_DISABLED = 4
|
||||||
|
TREIS_SELECTEDNOTFOCUS = 5
|
||||||
|
TREIS_HOTSELECTED = 6
|
||||||
|
)
|
||||||
|
|
||||||
|
// DTTOPTS flags
|
||||||
|
const (
|
||||||
|
DTT_TEXTCOLOR = 1 << 0
|
||||||
|
DTT_BORDERCOLOR = 1 << 1
|
||||||
|
DTT_SHADOWCOLOR = 1 << 2
|
||||||
|
DTT_SHADOWTYPE = 1 << 3
|
||||||
|
DTT_SHADOWOFFSET = 1 << 4
|
||||||
|
DTT_BORDERSIZE = 1 << 5
|
||||||
|
DTT_FONTPROP = 1 << 6
|
||||||
|
DTT_COLORPROP = 1 << 7
|
||||||
|
DTT_STATEID = 1 << 8
|
||||||
|
DTT_CALCRECT = 1 << 9
|
||||||
|
DTT_APPLYOVERLAY = 1 << 10
|
||||||
|
DTT_GLOWSIZE = 1 << 11
|
||||||
|
DTT_CALLBACK = 1 << 12
|
||||||
|
DTT_COMPOSITED = 1 << 13
|
||||||
|
DTT_VALIDBITS = DTT_TEXTCOLOR |
|
||||||
|
DTT_BORDERCOLOR |
|
||||||
|
DTT_SHADOWCOLOR |
|
||||||
|
DTT_SHADOWTYPE |
|
||||||
|
DTT_SHADOWOFFSET |
|
||||||
|
DTT_BORDERSIZE |
|
||||||
|
DTT_FONTPROP |
|
||||||
|
DTT_COLORPROP |
|
||||||
|
DTT_STATEID |
|
||||||
|
DTT_CALCRECT |
|
||||||
|
DTT_APPLYOVERLAY |
|
||||||
|
DTT_GLOWSIZE |
|
||||||
|
DTT_COMPOSITED
|
||||||
|
)
|
||||||
|
|
||||||
|
type HTHEME HANDLE
|
||||||
|
|
||||||
|
type THEMESIZE int
|
||||||
|
|
||||||
|
const (
|
||||||
|
TS_MIN THEMESIZE = iota
|
||||||
|
TS_TRUE
|
||||||
|
TS_DRAW
|
||||||
|
)
|
||||||
|
|
||||||
|
type DTTOPTS struct {
|
||||||
|
DwSize uint32
|
||||||
|
DwFlags uint32
|
||||||
|
CrText COLORREF
|
||||||
|
CrBorder COLORREF
|
||||||
|
CrShadow COLORREF
|
||||||
|
ITextShadowType int32
|
||||||
|
PtShadowOffset POINT
|
||||||
|
IBorderSize int32
|
||||||
|
IFontPropId int32
|
||||||
|
IColorPropId int32
|
||||||
|
IStateId int32
|
||||||
|
FApplyOverlay BOOL
|
||||||
|
IGlowSize int32
|
||||||
|
PfnDrawTextCallback uintptr
|
||||||
|
LParam uintptr
|
||||||
|
}
|
||||||
|
|
||||||
|
var (
|
||||||
|
// Library
|
||||||
|
libuxtheme uintptr
|
||||||
|
|
||||||
|
// Functions
|
||||||
|
closeThemeData uintptr
|
||||||
|
drawThemeBackground uintptr
|
||||||
|
drawThemeTextEx uintptr
|
||||||
|
getThemePartSize uintptr
|
||||||
|
getThemeTextExtent uintptr
|
||||||
|
isAppThemed uintptr
|
||||||
|
openThemeData uintptr
|
||||||
|
setWindowTheme uintptr
|
||||||
|
)
|
||||||
|
|
||||||
|
func init() {
|
||||||
|
// Library
|
||||||
|
libuxtheme = MustLoadLibrary("uxtheme.dll")
|
||||||
|
|
||||||
|
// Functions
|
||||||
|
closeThemeData = MustGetProcAddress(libuxtheme, "CloseThemeData")
|
||||||
|
drawThemeBackground = MustGetProcAddress(libuxtheme, "DrawThemeBackground")
|
||||||
|
drawThemeTextEx, _ = syscall.GetProcAddress(syscall.Handle(libuxtheme), "DrawThemeTextEx")
|
||||||
|
getThemePartSize = MustGetProcAddress(libuxtheme, "GetThemePartSize")
|
||||||
|
getThemeTextExtent = MustGetProcAddress(libuxtheme, "GetThemeTextExtent")
|
||||||
|
isAppThemed = MustGetProcAddress(libuxtheme, "IsAppThemed")
|
||||||
|
openThemeData = MustGetProcAddress(libuxtheme, "OpenThemeData")
|
||||||
|
setWindowTheme = MustGetProcAddress(libuxtheme, "SetWindowTheme")
|
||||||
|
}
|
||||||
|
|
||||||
|
func CloseThemeData(hTheme HTHEME) HRESULT {
|
||||||
|
ret, _, _ := syscall.Syscall(closeThemeData, 1,
|
||||||
|
uintptr(hTheme),
|
||||||
|
0,
|
||||||
|
0)
|
||||||
|
|
||||||
|
return HRESULT(ret)
|
||||||
|
}
|
||||||
|
|
||||||
|
func DrawThemeBackground(hTheme HTHEME, hdc HDC, iPartId, iStateId int32, pRect, pClipRect *RECT) HRESULT {
|
||||||
|
ret, _, _ := syscall.Syscall6(drawThemeBackground, 6,
|
||||||
|
uintptr(hTheme),
|
||||||
|
uintptr(hdc),
|
||||||
|
uintptr(iPartId),
|
||||||
|
uintptr(iStateId),
|
||||||
|
uintptr(unsafe.Pointer(pRect)),
|
||||||
|
uintptr(unsafe.Pointer(pClipRect)))
|
||||||
|
|
||||||
|
return HRESULT(ret)
|
||||||
|
}
|
||||||
|
|
||||||
|
func DrawThemeTextEx(hTheme HTHEME, hdc HDC, iPartId, iStateId int32, pszText *uint16, iCharCount int32, dwFlags uint32, pRect *RECT, pOptions *DTTOPTS) HRESULT {
|
||||||
|
ret, _, _ := syscall.Syscall9(drawThemeTextEx, 9,
|
||||||
|
uintptr(hTheme),
|
||||||
|
uintptr(hdc),
|
||||||
|
uintptr(iPartId),
|
||||||
|
uintptr(iStateId),
|
||||||
|
uintptr(unsafe.Pointer(pszText)),
|
||||||
|
uintptr(iCharCount),
|
||||||
|
uintptr(dwFlags),
|
||||||
|
uintptr(unsafe.Pointer(pRect)),
|
||||||
|
uintptr(unsafe.Pointer(pOptions)))
|
||||||
|
|
||||||
|
return HRESULT(ret)
|
||||||
|
}
|
||||||
|
|
||||||
|
func GetThemePartSize(hTheme HTHEME, hdc HDC, iPartId, iStateId int32, prc *RECT, eSize THEMESIZE, psz *SIZE) HRESULT {
|
||||||
|
ret, _, _ := syscall.Syscall9(getThemePartSize, 7,
|
||||||
|
uintptr(hTheme),
|
||||||
|
uintptr(hdc),
|
||||||
|
uintptr(iPartId),
|
||||||
|
uintptr(iStateId),
|
||||||
|
uintptr(unsafe.Pointer(prc)),
|
||||||
|
uintptr(eSize),
|
||||||
|
uintptr(unsafe.Pointer(psz)),
|
||||||
|
0,
|
||||||
|
0)
|
||||||
|
|
||||||
|
return HRESULT(ret)
|
||||||
|
}
|
||||||
|
|
||||||
|
func GetThemeTextExtent(hTheme HTHEME, hdc HDC, iPartId, iStateId int32, pszText *uint16, iCharCount int32, dwTextFlags uint32, pBoundingRect, pExtentRect *RECT) HRESULT {
|
||||||
|
ret, _, _ := syscall.Syscall9(getThemeTextExtent, 9,
|
||||||
|
uintptr(hTheme),
|
||||||
|
uintptr(hdc),
|
||||||
|
uintptr(iPartId),
|
||||||
|
uintptr(iStateId),
|
||||||
|
uintptr(unsafe.Pointer(pszText)),
|
||||||
|
uintptr(iCharCount),
|
||||||
|
uintptr(dwTextFlags),
|
||||||
|
uintptr(unsafe.Pointer(pBoundingRect)),
|
||||||
|
uintptr(unsafe.Pointer(pExtentRect)))
|
||||||
|
|
||||||
|
return HRESULT(ret)
|
||||||
|
}
|
||||||
|
|
||||||
|
func IsAppThemed() bool {
|
||||||
|
ret, _, _ := syscall.Syscall(isAppThemed, 0,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0)
|
||||||
|
|
||||||
|
return ret != 0
|
||||||
|
}
|
||||||
|
|
||||||
|
func OpenThemeData(hwnd HWND, pszClassList *uint16) HTHEME {
|
||||||
|
ret, _, _ := syscall.Syscall(openThemeData, 2,
|
||||||
|
uintptr(hwnd),
|
||||||
|
uintptr(unsafe.Pointer(pszClassList)),
|
||||||
|
0)
|
||||||
|
|
||||||
|
return HTHEME(ret)
|
||||||
|
}
|
||||||
|
|
||||||
|
func SetWindowTheme(hwnd HWND, pszSubAppName, pszSubIdList *uint16) HRESULT {
|
||||||
|
ret, _, _ := syscall.Syscall(setWindowTheme, 3,
|
||||||
|
uintptr(hwnd),
|
||||||
|
uintptr(unsafe.Pointer(pszSubAppName)),
|
||||||
|
uintptr(unsafe.Pointer(pszSubIdList)))
|
||||||
|
|
||||||
|
return HRESULT(ret)
|
||||||
|
}
|
118
vendor/github.com/lxn/win/win.go
generated
vendored
Normal file
118
vendor/github.com/lxn/win/win.go
generated
vendored
Normal file
@ -0,0 +1,118 @@
|
|||||||
|
// Copyright 2010 The win Authors. All rights reserved.
|
||||||
|
// Use of this source code is governed by a BSD-style
|
||||||
|
// license that can be found in the LICENSE file.
|
||||||
|
|
||||||
|
// +build windows
|
||||||
|
|
||||||
|
package win
|
||||||
|
|
||||||
|
import (
|
||||||
|
"runtime"
|
||||||
|
"syscall"
|
||||||
|
"unsafe"
|
||||||
|
)
|
||||||
|
|
||||||
|
func init() {
|
||||||
|
runtime.LockOSThread()
|
||||||
|
}
|
||||||
|
|
||||||
|
const (
|
||||||
|
S_OK = 0x00000000
|
||||||
|
S_FALSE = 0x00000001
|
||||||
|
E_UNEXPECTED = 0x8000FFFF
|
||||||
|
E_NOTIMPL = 0x80004001
|
||||||
|
E_OUTOFMEMORY = 0x8007000E
|
||||||
|
E_INVALIDARG = 0x80070057
|
||||||
|
E_NOINTERFACE = 0x80004002
|
||||||
|
E_POINTER = 0x80004003
|
||||||
|
E_HANDLE = 0x80070006
|
||||||
|
E_ABORT = 0x80004004
|
||||||
|
E_FAIL = 0x80004005
|
||||||
|
E_ACCESSDENIED = 0x80070005
|
||||||
|
E_PENDING = 0x8000000A
|
||||||
|
)
|
||||||
|
|
||||||
|
const (
|
||||||
|
FALSE = 0
|
||||||
|
TRUE = 1
|
||||||
|
)
|
||||||
|
|
||||||
|
type (
|
||||||
|
BOOL int32
|
||||||
|
HRESULT int32
|
||||||
|
)
|
||||||
|
|
||||||
|
func MustLoadLibrary(name string) uintptr {
|
||||||
|
lib, err := syscall.LoadLibrary(name)
|
||||||
|
if err != nil {
|
||||||
|
panic(err)
|
||||||
|
}
|
||||||
|
|
||||||
|
return uintptr(lib)
|
||||||
|
}
|
||||||
|
|
||||||
|
func MustGetProcAddress(lib uintptr, name string) uintptr {
|
||||||
|
addr, err := syscall.GetProcAddress(syscall.Handle(lib), name)
|
||||||
|
if err != nil {
|
||||||
|
panic(err)
|
||||||
|
}
|
||||||
|
|
||||||
|
return uintptr(addr)
|
||||||
|
}
|
||||||
|
|
||||||
|
func MaybeGetProcAddress(lib uintptr, name string) uintptr {
|
||||||
|
addr, _ := syscall.GetProcAddress(syscall.Handle(lib), name)
|
||||||
|
|
||||||
|
return uintptr(addr)
|
||||||
|
}
|
||||||
|
|
||||||
|
func SUCCEEDED(hr HRESULT) bool {
|
||||||
|
return hr >= 0
|
||||||
|
}
|
||||||
|
|
||||||
|
func FAILED(hr HRESULT) bool {
|
||||||
|
return hr < 0
|
||||||
|
}
|
||||||
|
|
||||||
|
func MAKEWORD(lo, hi byte) uint16 {
|
||||||
|
return uint16(uint16(lo) | ((uint16(hi)) << 8))
|
||||||
|
}
|
||||||
|
|
||||||
|
func LOBYTE(w uint16) byte {
|
||||||
|
return byte(w)
|
||||||
|
}
|
||||||
|
|
||||||
|
func HIBYTE(w uint16) byte {
|
||||||
|
return byte(w >> 8 & 0xff)
|
||||||
|
}
|
||||||
|
|
||||||
|
func MAKELONG(lo, hi uint16) uint32 {
|
||||||
|
return uint32(uint32(lo) | ((uint32(hi)) << 16))
|
||||||
|
}
|
||||||
|
|
||||||
|
func LOWORD(dw uint32) uint16 {
|
||||||
|
return uint16(dw)
|
||||||
|
}
|
||||||
|
|
||||||
|
func HIWORD(dw uint32) uint16 {
|
||||||
|
return uint16(dw >> 16 & 0xffff)
|
||||||
|
}
|
||||||
|
|
||||||
|
func UTF16PtrToString(s *uint16) string {
|
||||||
|
if s == nil {
|
||||||
|
return ""
|
||||||
|
}
|
||||||
|
return syscall.UTF16ToString((*[1 << 29]uint16)(unsafe.Pointer(s))[0:])
|
||||||
|
}
|
||||||
|
|
||||||
|
func MAKEINTRESOURCE(id uintptr) *uint16 {
|
||||||
|
return (*uint16)(unsafe.Pointer(id))
|
||||||
|
}
|
||||||
|
|
||||||
|
func BoolToBOOL(value bool) BOOL {
|
||||||
|
if value {
|
||||||
|
return 1
|
||||||
|
}
|
||||||
|
|
||||||
|
return 0
|
||||||
|
}
|
100
vendor/github.com/lxn/win/winspool.go
generated
vendored
Normal file
100
vendor/github.com/lxn/win/winspool.go
generated
vendored
Normal file
@ -0,0 +1,100 @@
|
|||||||
|
// Copyright 2010 The win Authors. All rights reserved.
|
||||||
|
// Use of this source code is governed by a BSD-style
|
||||||
|
// license that can be found in the LICENSE file.
|
||||||
|
|
||||||
|
// +build windows
|
||||||
|
|
||||||
|
package win
|
||||||
|
|
||||||
|
import (
|
||||||
|
"syscall"
|
||||||
|
"unsafe"
|
||||||
|
)
|
||||||
|
|
||||||
|
// EnumPrinters flags
|
||||||
|
const (
|
||||||
|
PRINTER_ENUM_DEFAULT = 0x00000001
|
||||||
|
PRINTER_ENUM_LOCAL = 0x00000002
|
||||||
|
PRINTER_ENUM_CONNECTIONS = 0x00000004
|
||||||
|
PRINTER_ENUM_FAVORITE = 0x00000004
|
||||||
|
PRINTER_ENUM_NAME = 0x00000008
|
||||||
|
PRINTER_ENUM_REMOTE = 0x00000010
|
||||||
|
PRINTER_ENUM_SHARED = 0x00000020
|
||||||
|
PRINTER_ENUM_NETWORK = 0x00000040
|
||||||
|
)
|
||||||
|
|
||||||
|
type PRINTER_INFO_4 struct {
|
||||||
|
PPrinterName *uint16
|
||||||
|
PServerName *uint16
|
||||||
|
Attributes uint32
|
||||||
|
}
|
||||||
|
|
||||||
|
var (
|
||||||
|
// Library
|
||||||
|
libwinspool uintptr
|
||||||
|
|
||||||
|
// Functions
|
||||||
|
deviceCapabilities uintptr
|
||||||
|
documentProperties uintptr
|
||||||
|
enumPrinters uintptr
|
||||||
|
getDefaultPrinter uintptr
|
||||||
|
)
|
||||||
|
|
||||||
|
func init() {
|
||||||
|
// Library
|
||||||
|
libwinspool = MustLoadLibrary("winspool.drv")
|
||||||
|
|
||||||
|
// Functions
|
||||||
|
deviceCapabilities = MustGetProcAddress(libwinspool, "DeviceCapabilitiesW")
|
||||||
|
documentProperties = MustGetProcAddress(libwinspool, "DocumentPropertiesW")
|
||||||
|
enumPrinters = MustGetProcAddress(libwinspool, "EnumPrintersW")
|
||||||
|
getDefaultPrinter = MustGetProcAddress(libwinspool, "GetDefaultPrinterW")
|
||||||
|
}
|
||||||
|
|
||||||
|
func DeviceCapabilities(pDevice, pPort *uint16, fwCapability uint16, pOutput *uint16, pDevMode *DEVMODE) uint32 {
|
||||||
|
ret, _, _ := syscall.Syscall6(deviceCapabilities, 5,
|
||||||
|
uintptr(unsafe.Pointer(pDevice)),
|
||||||
|
uintptr(unsafe.Pointer(pPort)),
|
||||||
|
uintptr(fwCapability),
|
||||||
|
uintptr(unsafe.Pointer(pOutput)),
|
||||||
|
uintptr(unsafe.Pointer(pDevMode)),
|
||||||
|
0)
|
||||||
|
|
||||||
|
return uint32(ret)
|
||||||
|
}
|
||||||
|
|
||||||
|
func DocumentProperties(hWnd HWND, hPrinter HANDLE, pDeviceName *uint16, pDevModeOutput, pDevModeInput *DEVMODE, fMode uint32) int32 {
|
||||||
|
ret, _, _ := syscall.Syscall6(documentProperties, 6,
|
||||||
|
uintptr(hWnd),
|
||||||
|
uintptr(hPrinter),
|
||||||
|
uintptr(unsafe.Pointer(pDeviceName)),
|
||||||
|
uintptr(unsafe.Pointer(pDevModeOutput)),
|
||||||
|
uintptr(unsafe.Pointer(pDevModeInput)),
|
||||||
|
uintptr(fMode))
|
||||||
|
|
||||||
|
return int32(ret)
|
||||||
|
}
|
||||||
|
|
||||||
|
func EnumPrinters(Flags uint32, Name *uint16, Level uint32, pPrinterEnum *byte, cbBuf uint32, pcbNeeded, pcReturned *uint32) bool {
|
||||||
|
ret, _, _ := syscall.Syscall9(enumPrinters, 7,
|
||||||
|
uintptr(Flags),
|
||||||
|
uintptr(unsafe.Pointer(Name)),
|
||||||
|
uintptr(Level),
|
||||||
|
uintptr(unsafe.Pointer(pPrinterEnum)),
|
||||||
|
uintptr(cbBuf),
|
||||||
|
uintptr(unsafe.Pointer(pcbNeeded)),
|
||||||
|
uintptr(unsafe.Pointer(pcReturned)),
|
||||||
|
0,
|
||||||
|
0)
|
||||||
|
|
||||||
|
return ret != 0
|
||||||
|
}
|
||||||
|
|
||||||
|
func GetDefaultPrinter(pszBuffer *uint16, pcchBuffer *uint32) bool {
|
||||||
|
ret, _, _ := syscall.Syscall(getDefaultPrinter, 2,
|
||||||
|
uintptr(unsafe.Pointer(pszBuffer)),
|
||||||
|
uintptr(unsafe.Pointer(pcchBuffer)),
|
||||||
|
0)
|
||||||
|
|
||||||
|
return ret != 0
|
||||||
|
}
|
109
vendor/github.com/shirou/gopsutil/host/host_windows.go
generated
vendored
109
vendor/github.com/shirou/gopsutil/host/host_windows.go
generated
vendored
@ -9,10 +9,10 @@ import (
|
|||||||
"runtime"
|
"runtime"
|
||||||
"strings"
|
"strings"
|
||||||
"sync/atomic"
|
"sync/atomic"
|
||||||
|
"syscall"
|
||||||
"time"
|
"time"
|
||||||
"unsafe"
|
"unsafe"
|
||||||
|
|
||||||
"github.com/StackExchange/wmi"
|
|
||||||
"github.com/shirou/gopsutil/internal/common"
|
"github.com/shirou/gopsutil/internal/common"
|
||||||
process "github.com/shirou/gopsutil/process"
|
process "github.com/shirou/gopsutil/process"
|
||||||
"golang.org/x/sys/windows"
|
"golang.org/x/sys/windows"
|
||||||
@ -20,15 +20,24 @@ import (
|
|||||||
|
|
||||||
var (
|
var (
|
||||||
procGetSystemTimeAsFileTime = common.Modkernel32.NewProc("GetSystemTimeAsFileTime")
|
procGetSystemTimeAsFileTime = common.Modkernel32.NewProc("GetSystemTimeAsFileTime")
|
||||||
osInfo *Win32_OperatingSystem
|
procGetTickCount32 = common.Modkernel32.NewProc("GetTickCount")
|
||||||
|
procGetTickCount64 = common.Modkernel32.NewProc("GetTickCount64")
|
||||||
|
procRtlGetVersion = common.ModNt.NewProc("RtlGetVersion")
|
||||||
)
|
)
|
||||||
|
|
||||||
type Win32_OperatingSystem struct {
|
// https://docs.microsoft.com/en-us/windows-hardware/drivers/ddi/content/wdm/ns-wdm-_osversioninfoexw
|
||||||
Version string
|
type osVersionInfoExW struct {
|
||||||
Caption string
|
dwOSVersionInfoSize uint32
|
||||||
ProductType uint32
|
dwMajorVersion uint32
|
||||||
BuildNumber string
|
dwMinorVersion uint32
|
||||||
LastBootUpTime time.Time
|
dwBuildNumber uint32
|
||||||
|
dwPlatformId uint32
|
||||||
|
szCSDVersion [128]uint16
|
||||||
|
wServicePackMajor uint16
|
||||||
|
wServicePackMinor uint16
|
||||||
|
wSuiteMask uint16
|
||||||
|
wProductType uint8
|
||||||
|
wReserved uint8
|
||||||
}
|
}
|
||||||
|
|
||||||
func Info() (*InfoStat, error) {
|
func Info() (*InfoStat, error) {
|
||||||
@ -84,6 +93,8 @@ func InfoWithContext(ctx context.Context) (*InfoStat, error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func getMachineGuid() (string, error) {
|
func getMachineGuid() (string, error) {
|
||||||
|
// there has been reports of issues on 32bit using golang.org/x/sys/windows/registry, see https://github.com/shirou/gopsutil/pull/312#issuecomment-277422612
|
||||||
|
// for rationale of using windows.RegOpenKeyEx/RegQueryValueEx instead of registry.OpenKey/GetStringValue
|
||||||
var h windows.Handle
|
var h windows.Handle
|
||||||
err := windows.RegOpenKeyEx(windows.HKEY_LOCAL_MACHINE, windows.StringToUTF16Ptr(`SOFTWARE\Microsoft\Cryptography`), 0, windows.KEY_READ|windows.KEY_WOW64_64KEY, &h)
|
err := windows.RegOpenKeyEx(windows.HKEY_LOCAL_MACHINE, windows.StringToUTF16Ptr(`SOFTWARE\Microsoft\Cryptography`), 0, windows.KEY_READ|windows.KEY_WOW64_64KEY, &h)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@ -111,40 +122,24 @@ func getMachineGuid() (string, error) {
|
|||||||
return hostID, nil
|
return hostID, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func GetOSInfo() (Win32_OperatingSystem, error) {
|
|
||||||
return GetOSInfoWithContext(context.Background())
|
|
||||||
}
|
|
||||||
|
|
||||||
func GetOSInfoWithContext(ctx context.Context) (Win32_OperatingSystem, error) {
|
|
||||||
var dst []Win32_OperatingSystem
|
|
||||||
q := wmi.CreateQuery(&dst, "")
|
|
||||||
err := common.WMIQueryWithContext(ctx, q, &dst)
|
|
||||||
if err != nil {
|
|
||||||
return Win32_OperatingSystem{}, err
|
|
||||||
}
|
|
||||||
|
|
||||||
osInfo = &dst[0]
|
|
||||||
|
|
||||||
return dst[0], nil
|
|
||||||
}
|
|
||||||
|
|
||||||
func Uptime() (uint64, error) {
|
func Uptime() (uint64, error) {
|
||||||
return UptimeWithContext(context.Background())
|
return UptimeWithContext(context.Background())
|
||||||
}
|
}
|
||||||
|
|
||||||
func UptimeWithContext(ctx context.Context) (uint64, error) {
|
func UptimeWithContext(ctx context.Context) (uint64, error) {
|
||||||
if osInfo == nil {
|
procGetTickCount := procGetTickCount64
|
||||||
_, err := GetOSInfoWithContext(ctx)
|
err := procGetTickCount64.Find()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return 0, err
|
procGetTickCount = procGetTickCount32 // handle WinXP, but keep in mind that "the time will wrap around to zero if the system is run continuously for 49.7 days." from MSDN
|
||||||
}
|
}
|
||||||
|
r1, _, lastErr := syscall.Syscall(procGetTickCount.Addr(), 0, 0, 0, 0)
|
||||||
|
if lastErr != 0 {
|
||||||
|
return 0, lastErr
|
||||||
}
|
}
|
||||||
now := time.Now()
|
return uint64((time.Duration(r1) * time.Millisecond).Seconds()), nil
|
||||||
t := osInfo.LastBootUpTime.Local()
|
|
||||||
return uint64(now.Sub(t).Seconds()), nil
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func bootTime(up uint64) uint64 {
|
func bootTimeFromUptime(up uint64) uint64 {
|
||||||
return uint64(time.Now().Unix()) - up
|
return uint64(time.Now().Unix()) - up
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -164,7 +159,7 @@ func BootTimeWithContext(ctx context.Context) (uint64, error) {
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return 0, err
|
return 0, err
|
||||||
}
|
}
|
||||||
t = bootTime(up)
|
t = bootTimeFromUptime(up)
|
||||||
atomic.StoreUint64(&cachedBootTime, t)
|
atomic.StoreUint64(&cachedBootTime, t)
|
||||||
return t, nil
|
return t, nil
|
||||||
}
|
}
|
||||||
@ -174,18 +169,50 @@ func PlatformInformation() (platform string, family string, version string, err
|
|||||||
}
|
}
|
||||||
|
|
||||||
func PlatformInformationWithContext(ctx context.Context) (platform string, family string, version string, err error) {
|
func PlatformInformationWithContext(ctx context.Context) (platform string, family string, version string, err error) {
|
||||||
if osInfo == nil {
|
// GetVersionEx lies on Windows 8.1 and returns as Windows 8 if we don't declare compatibility in manifest
|
||||||
_, err = GetOSInfoWithContext(ctx)
|
// RtlGetVersion bypasses this lying layer and returns the true Windows version
|
||||||
if err != nil {
|
// https://docs.microsoft.com/en-us/windows-hardware/drivers/ddi/content/wdm/nf-wdm-rtlgetversion
|
||||||
|
// https://docs.microsoft.com/en-us/windows-hardware/drivers/ddi/content/wdm/ns-wdm-_osversioninfoexw
|
||||||
|
var osInfo osVersionInfoExW
|
||||||
|
osInfo.dwOSVersionInfoSize = uint32(unsafe.Sizeof(osInfo))
|
||||||
|
ret, _, err := procRtlGetVersion.Call(uintptr(unsafe.Pointer(&osInfo)))
|
||||||
|
if ret != 0 {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
// Platform
|
// Platform
|
||||||
platform = strings.Trim(osInfo.Caption, " ")
|
var h windows.Handle // like getMachineGuid(), we query the registry using the raw windows.RegOpenKeyEx/RegQueryValueEx
|
||||||
|
err = windows.RegOpenKeyEx(windows.HKEY_LOCAL_MACHINE, windows.StringToUTF16Ptr(`SOFTWARE\Microsoft\Windows NT\CurrentVersion`), 0, windows.KEY_READ|windows.KEY_WOW64_64KEY, &h)
|
||||||
|
if err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
defer windows.RegCloseKey(h)
|
||||||
|
var bufLen uint32
|
||||||
|
var valType uint32
|
||||||
|
err = windows.RegQueryValueEx(h, windows.StringToUTF16Ptr(`ProductName`), nil, &valType, nil, &bufLen)
|
||||||
|
if err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
regBuf := make([]uint16, bufLen/2+1)
|
||||||
|
err = windows.RegQueryValueEx(h, windows.StringToUTF16Ptr(`ProductName`), nil, &valType, (*byte)(unsafe.Pointer(®Buf[0])), &bufLen)
|
||||||
|
if err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
platform = windows.UTF16ToString(regBuf[:])
|
||||||
|
if !strings.HasPrefix(platform, "Microsoft") {
|
||||||
|
platform = "Microsoft " + platform
|
||||||
|
}
|
||||||
|
err = windows.RegQueryValueEx(h, windows.StringToUTF16Ptr(`CSDVersion`), nil, &valType, nil, &bufLen) // append Service Pack number, only on success
|
||||||
|
if err == nil { // don't return an error if only the Service Pack retrieval fails
|
||||||
|
regBuf = make([]uint16, bufLen/2+1)
|
||||||
|
err = windows.RegQueryValueEx(h, windows.StringToUTF16Ptr(`CSDVersion`), nil, &valType, (*byte)(unsafe.Pointer(®Buf[0])), &bufLen)
|
||||||
|
if err == nil {
|
||||||
|
platform += " " + windows.UTF16ToString(regBuf[:])
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// PlatformFamily
|
// PlatformFamily
|
||||||
switch osInfo.ProductType {
|
switch osInfo.wProductType {
|
||||||
case 1:
|
case 1:
|
||||||
family = "Standalone Workstation"
|
family = "Standalone Workstation"
|
||||||
case 2:
|
case 2:
|
||||||
@ -195,9 +222,9 @@ func PlatformInformationWithContext(ctx context.Context) (platform string, famil
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Platform Version
|
// Platform Version
|
||||||
version = fmt.Sprintf("%s Build %s", osInfo.Version, osInfo.BuildNumber)
|
version = fmt.Sprintf("%d.%d.%d Build %d", osInfo.dwMajorVersion, osInfo.dwMinorVersion, osInfo.dwBuildNumber, osInfo.dwBuildNumber)
|
||||||
|
|
||||||
return
|
return platform, family, version, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func Users() ([]UserStat, error) {
|
func Users() ([]UserStat, error) {
|
||||||
|
13
vendor/github.com/shirou/gopsutil/mem/mem.go
generated
vendored
13
vendor/github.com/shirou/gopsutil/mem/mem.go
generated
vendored
@ -57,6 +57,19 @@ type VirtualMemoryStat struct {
|
|||||||
SwapCached uint64 `json:"swapcached"`
|
SwapCached uint64 `json:"swapcached"`
|
||||||
CommitLimit uint64 `json:"commitlimit"`
|
CommitLimit uint64 `json:"commitlimit"`
|
||||||
CommittedAS uint64 `json:"committedas"`
|
CommittedAS uint64 `json:"committedas"`
|
||||||
|
HighTotal uint64 `json:"hightotal"`
|
||||||
|
HighFree uint64 `json:"highfree"`
|
||||||
|
LowTotal uint64 `json:"lowtotal"`
|
||||||
|
LowFree uint64 `json:"lowfree"`
|
||||||
|
SwapTotal uint64 `json:"swaptotal"`
|
||||||
|
SwapFree uint64 `json:"swapfree"`
|
||||||
|
Mapped uint64 `json:"mapped"`
|
||||||
|
VMallocTotal uint64 `json:"vmalloctotal"`
|
||||||
|
VMallocUsed uint64 `json:"vmallocused"`
|
||||||
|
VMallocChunk uint64 `json:"vmallocchunk"`
|
||||||
|
HugePagesTotal uint64 `json:"hugepagestotal"`
|
||||||
|
HugePagesFree uint64 `json:"hugepagesfree"`
|
||||||
|
HugePageSize uint64 `json:"hugepagesize"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type SwapMemoryStat struct {
|
type SwapMemoryStat struct {
|
||||||
|
26
vendor/github.com/shirou/gopsutil/mem/mem_linux.go
generated
vendored
26
vendor/github.com/shirou/gopsutil/mem/mem_linux.go
generated
vendored
@ -69,6 +69,32 @@ func VirtualMemoryWithContext(ctx context.Context) (*VirtualMemoryStat, error) {
|
|||||||
ret.CommitLimit = t * 1024
|
ret.CommitLimit = t * 1024
|
||||||
case "Committed_AS":
|
case "Committed_AS":
|
||||||
ret.CommittedAS = t * 1024
|
ret.CommittedAS = t * 1024
|
||||||
|
case "HighTotal":
|
||||||
|
ret.HighTotal = t * 1024
|
||||||
|
case "HighFree":
|
||||||
|
ret.HighFree = t * 1024
|
||||||
|
case "LowTotal":
|
||||||
|
ret.LowTotal = t * 1024
|
||||||
|
case "LowFree":
|
||||||
|
ret.LowFree = t * 1024
|
||||||
|
case "SwapTotal":
|
||||||
|
ret.SwapTotal = t * 1024
|
||||||
|
case "SwapFree":
|
||||||
|
ret.SwapFree = t * 1024
|
||||||
|
case "Mapped":
|
||||||
|
ret.Mapped = t * 1024
|
||||||
|
case "VmallocTotal":
|
||||||
|
ret.VMallocTotal = t * 1024
|
||||||
|
case "VmallocUsed":
|
||||||
|
ret.VMallocUsed = t * 1024
|
||||||
|
case "VmallocChunk":
|
||||||
|
ret.VMallocChunk = t * 1024
|
||||||
|
case "HugePages_Total":
|
||||||
|
ret.HugePagesTotal = t
|
||||||
|
case "HugePages_Free":
|
||||||
|
ret.HugePagesFree = t
|
||||||
|
case "Hugepagesize":
|
||||||
|
ret.HugePageSize = t * 1024
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if !memavail {
|
if !memavail {
|
||||||
|
3
vendor/github.com/shirou/gopsutil/process/process_linux.go
generated
vendored
3
vendor/github.com/shirou/gopsutil/process/process_linux.go
generated
vendored
@ -1175,6 +1175,9 @@ func (p *Process) fillFromTIDStatWithContext(ctx context.Context, tid int32) (ui
|
|||||||
createTime := int64(ctime * 1000)
|
createTime := int64(ctime * 1000)
|
||||||
|
|
||||||
rtpriority, err := strconv.ParseInt(fields[i+16], 10, 32)
|
rtpriority, err := strconv.ParseInt(fields[i+16], 10, 32)
|
||||||
|
if err != nil {
|
||||||
|
return 0, 0, nil, 0, 0, 0, err
|
||||||
|
}
|
||||||
if rtpriority < 0 {
|
if rtpriority < 0 {
|
||||||
rtpriority = rtpriority*-1 - 1
|
rtpriority = rtpriority*-1 - 1
|
||||||
} else {
|
} else {
|
||||||
|
6
vendor/github.com/shirou/gopsutil/process/process_posix.go
generated
vendored
6
vendor/github.com/shirou/gopsutil/process/process_posix.go
generated
vendored
@ -26,6 +26,9 @@ func getTerminalMap() (map[uint64]string, error) {
|
|||||||
defer d.Close()
|
defer d.Close()
|
||||||
|
|
||||||
devnames, err := d.Readdirnames(-1)
|
devnames, err := d.Readdirnames(-1)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
for _, devname := range devnames {
|
for _, devname := range devnames {
|
||||||
if strings.HasPrefix(devname, "/dev/tty") {
|
if strings.HasPrefix(devname, "/dev/tty") {
|
||||||
termfiles = append(termfiles, "/dev/tty/"+devname)
|
termfiles = append(termfiles, "/dev/tty/"+devname)
|
||||||
@ -45,6 +48,9 @@ func getTerminalMap() (map[uint64]string, error) {
|
|||||||
if ptsnames == nil {
|
if ptsnames == nil {
|
||||||
defer ptsd.Close()
|
defer ptsd.Close()
|
||||||
ptsnames, err = ptsd.Readdirnames(-1)
|
ptsnames, err = ptsd.Readdirnames(-1)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
for _, ptsname := range ptsnames {
|
for _, ptsname := range ptsnames {
|
||||||
termfiles = append(termfiles, "/dev/pts/"+ptsname)
|
termfiles = append(termfiles, "/dev/pts/"+ptsname)
|
||||||
}
|
}
|
||||||
|
3
vendor/github.com/shirou/gopsutil/process/process_windows.go
generated
vendored
3
vendor/github.com/shirou/gopsutil/process/process_windows.go
generated
vendored
@ -270,6 +270,9 @@ func (p *Process) UsernameWithContext(ctx context.Context) (string, error) {
|
|||||||
}
|
}
|
||||||
defer token.Close()
|
defer token.Close()
|
||||||
tokenUser, err := token.GetTokenUser()
|
tokenUser, err := token.GetTokenUser()
|
||||||
|
if err != nil {
|
||||||
|
return "", err
|
||||||
|
}
|
||||||
|
|
||||||
user, domain, _, err := tokenUser.User.Sid.LookupAccount("")
|
user, domain, _, err := tokenUser.User.Sid.LookupAccount("")
|
||||||
return domain + "\\" + user, err
|
return domain + "\\" + user, err
|
||||||
|
6
vendor/golang.org/x/sys/unix/fcntl.go
generated
vendored
6
vendor/golang.org/x/sys/unix/fcntl.go
generated
vendored
@ -14,7 +14,11 @@ var fcntl64Syscall uintptr = SYS_FCNTL
|
|||||||
|
|
||||||
// FcntlInt performs a fcntl syscall on fd with the provided command and argument.
|
// FcntlInt performs a fcntl syscall on fd with the provided command and argument.
|
||||||
func FcntlInt(fd uintptr, cmd, arg int) (int, error) {
|
func FcntlInt(fd uintptr, cmd, arg int) (int, error) {
|
||||||
valptr, _, err := Syscall(fcntl64Syscall, fd, uintptr(cmd), uintptr(arg))
|
valptr, _, errno := Syscall(fcntl64Syscall, fd, uintptr(cmd), uintptr(arg))
|
||||||
|
var err error
|
||||||
|
if errno != 0 {
|
||||||
|
err = errno
|
||||||
|
}
|
||||||
return int(valptr), err
|
return int(valptr), err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
26
vendor/golang.org/x/sys/unix/syscall_linux.go
generated
vendored
26
vendor/golang.org/x/sys/unix/syscall_linux.go
generated
vendored
@ -148,8 +148,6 @@ func Unlink(path string) error {
|
|||||||
|
|
||||||
//sys Unlinkat(dirfd int, path string, flags int) (err error)
|
//sys Unlinkat(dirfd int, path string, flags int) (err error)
|
||||||
|
|
||||||
//sys utimes(path string, times *[2]Timeval) (err error)
|
|
||||||
|
|
||||||
func Utimes(path string, tv []Timeval) error {
|
func Utimes(path string, tv []Timeval) error {
|
||||||
if tv == nil {
|
if tv == nil {
|
||||||
err := utimensat(AT_FDCWD, path, nil, 0)
|
err := utimensat(AT_FDCWD, path, nil, 0)
|
||||||
@ -207,20 +205,14 @@ func UtimesNanoAt(dirfd int, path string, ts []Timespec, flags int) error {
|
|||||||
return utimensat(dirfd, path, (*[2]Timespec)(unsafe.Pointer(&ts[0])), flags)
|
return utimensat(dirfd, path, (*[2]Timespec)(unsafe.Pointer(&ts[0])), flags)
|
||||||
}
|
}
|
||||||
|
|
||||||
//sys futimesat(dirfd int, path *byte, times *[2]Timeval) (err error)
|
|
||||||
|
|
||||||
func Futimesat(dirfd int, path string, tv []Timeval) error {
|
func Futimesat(dirfd int, path string, tv []Timeval) error {
|
||||||
pathp, err := BytePtrFromString(path)
|
|
||||||
if err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
if tv == nil {
|
if tv == nil {
|
||||||
return futimesat(dirfd, pathp, nil)
|
return futimesat(dirfd, path, nil)
|
||||||
}
|
}
|
||||||
if len(tv) != 2 {
|
if len(tv) != 2 {
|
||||||
return EINVAL
|
return EINVAL
|
||||||
}
|
}
|
||||||
return futimesat(dirfd, pathp, (*[2]Timeval)(unsafe.Pointer(&tv[0])))
|
return futimesat(dirfd, path, (*[2]Timeval)(unsafe.Pointer(&tv[0])))
|
||||||
}
|
}
|
||||||
|
|
||||||
func Futimes(fd int, tv []Timeval) (err error) {
|
func Futimes(fd int, tv []Timeval) (err error) {
|
||||||
@ -1221,12 +1213,10 @@ func Mount(source string, target string, fstype string, flags uintptr, data stri
|
|||||||
//sys CopyFileRange(rfd int, roff *int64, wfd int, woff *int64, len int, flags int) (n int, err error)
|
//sys CopyFileRange(rfd int, roff *int64, wfd int, woff *int64, len int, flags int) (n int, err error)
|
||||||
//sys Dup(oldfd int) (fd int, err error)
|
//sys Dup(oldfd int) (fd int, err error)
|
||||||
//sys Dup3(oldfd int, newfd int, flags int) (err error)
|
//sys Dup3(oldfd int, newfd int, flags int) (err error)
|
||||||
//sysnb EpollCreate(size int) (fd int, err error)
|
|
||||||
//sysnb EpollCreate1(flag int) (fd int, err error)
|
//sysnb EpollCreate1(flag int) (fd int, err error)
|
||||||
//sysnb EpollCtl(epfd int, op int, fd int, event *EpollEvent) (err error)
|
//sysnb EpollCtl(epfd int, op int, fd int, event *EpollEvent) (err error)
|
||||||
//sys Eventfd(initval uint, flags int) (fd int, err error) = SYS_EVENTFD2
|
//sys Eventfd(initval uint, flags int) (fd int, err error) = SYS_EVENTFD2
|
||||||
//sys Exit(code int) = SYS_EXIT_GROUP
|
//sys Exit(code int) = SYS_EXIT_GROUP
|
||||||
//sys Faccessat(dirfd int, path string, mode uint32, flags int) (err error)
|
|
||||||
//sys Fallocate(fd int, mode uint32, off int64, len int64) (err error)
|
//sys Fallocate(fd int, mode uint32, off int64, len int64) (err error)
|
||||||
//sys Fchdir(fd int) (err error)
|
//sys Fchdir(fd int) (err error)
|
||||||
//sys Fchmod(fd int, mode uint32) (err error)
|
//sys Fchmod(fd int, mode uint32) (err error)
|
||||||
@ -1306,7 +1296,6 @@ func Setgid(uid int) (err error) {
|
|||||||
//sysnb Uname(buf *Utsname) (err error)
|
//sysnb Uname(buf *Utsname) (err error)
|
||||||
//sys Unmount(target string, flags int) (err error) = SYS_UMOUNT2
|
//sys Unmount(target string, flags int) (err error) = SYS_UMOUNT2
|
||||||
//sys Unshare(flags int) (err error)
|
//sys Unshare(flags int) (err error)
|
||||||
//sys Ustat(dev int, ubuf *Ustat_t) (err error)
|
|
||||||
//sys write(fd int, p []byte) (n int, err error)
|
//sys write(fd int, p []byte) (n int, err error)
|
||||||
//sys exitThread(code int) (err error) = SYS_EXIT
|
//sys exitThread(code int) (err error) = SYS_EXIT
|
||||||
//sys readlen(fd int, p *byte, np int) (n int, err error) = SYS_READ
|
//sys readlen(fd int, p *byte, np int) (n int, err error) = SYS_READ
|
||||||
@ -1356,6 +1345,17 @@ func Vmsplice(fd int, iovs []Iovec, flags int) (int, error) {
|
|||||||
return int(n), nil
|
return int(n), nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//sys faccessat(dirfd int, path string, mode uint32) (err error)
|
||||||
|
|
||||||
|
func Faccessat(dirfd int, path string, mode uint32, flags int) (err error) {
|
||||||
|
if flags & ^(AT_SYMLINK_NOFOLLOW|AT_EACCESS) != 0 {
|
||||||
|
return EINVAL
|
||||||
|
} else if flags&(AT_SYMLINK_NOFOLLOW|AT_EACCESS) != 0 {
|
||||||
|
return EOPNOTSUPP
|
||||||
|
}
|
||||||
|
return faccessat(dirfd, path, mode)
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Unimplemented
|
* Unimplemented
|
||||||
*/
|
*/
|
||||||
|
8
vendor/golang.org/x/sys/unix/syscall_linux_386.go
generated
vendored
8
vendor/golang.org/x/sys/unix/syscall_linux_386.go
generated
vendored
@ -50,6 +50,8 @@ func Pipe2(p []int, flags int) (err error) {
|
|||||||
// 64-bit file system and 32-bit uid calls
|
// 64-bit file system and 32-bit uid calls
|
||||||
// (386 default is 32-bit file system and 16-bit uid).
|
// (386 default is 32-bit file system and 16-bit uid).
|
||||||
//sys Dup2(oldfd int, newfd int) (err error)
|
//sys Dup2(oldfd int, newfd int) (err error)
|
||||||
|
//sysnb EpollCreate(size int) (fd int, err error)
|
||||||
|
//sys EpollWait(epfd int, events []EpollEvent, msec int) (n int, err error)
|
||||||
//sys Fadvise(fd int, offset int64, length int64, advice int) (err error) = SYS_FADVISE64_64
|
//sys Fadvise(fd int, offset int64, length int64, advice int) (err error) = SYS_FADVISE64_64
|
||||||
//sys Fchown(fd int, uid int, gid int) (err error) = SYS_FCHOWN32
|
//sys Fchown(fd int, uid int, gid int) (err error) = SYS_FCHOWN32
|
||||||
//sys Fstat(fd int, stat *Stat_t) (err error) = SYS_FSTAT64
|
//sys Fstat(fd int, stat *Stat_t) (err error) = SYS_FSTAT64
|
||||||
@ -77,12 +79,12 @@ func Pipe2(p []int, flags int) (err error) {
|
|||||||
//sys Stat(path string, stat *Stat_t) (err error) = SYS_STAT64
|
//sys Stat(path string, stat *Stat_t) (err error) = SYS_STAT64
|
||||||
//sys SyncFileRange(fd int, off int64, n int64, flags int) (err error)
|
//sys SyncFileRange(fd int, off int64, n int64, flags int) (err error)
|
||||||
//sys Truncate(path string, length int64) (err error) = SYS_TRUNCATE64
|
//sys Truncate(path string, length int64) (err error) = SYS_TRUNCATE64
|
||||||
|
//sys Ustat(dev int, ubuf *Ustat_t) (err error)
|
||||||
//sysnb getgroups(n int, list *_Gid_t) (nn int, err error) = SYS_GETGROUPS32
|
//sysnb getgroups(n int, list *_Gid_t) (nn int, err error) = SYS_GETGROUPS32
|
||||||
//sysnb setgroups(n int, list *_Gid_t) (err error) = SYS_SETGROUPS32
|
//sysnb setgroups(n int, list *_Gid_t) (err error) = SYS_SETGROUPS32
|
||||||
//sys Select(nfd int, r *FdSet, w *FdSet, e *FdSet, timeout *Timeval) (n int, err error) = SYS__NEWSELECT
|
//sys Select(nfd int, r *FdSet, w *FdSet, e *FdSet, timeout *Timeval) (n int, err error) = SYS__NEWSELECT
|
||||||
|
|
||||||
//sys mmap2(addr uintptr, length uintptr, prot int, flags int, fd int, pageOffset uintptr) (xaddr uintptr, err error)
|
//sys mmap2(addr uintptr, length uintptr, prot int, flags int, fd int, pageOffset uintptr) (xaddr uintptr, err error)
|
||||||
//sys EpollWait(epfd int, events []EpollEvent, msec int) (n int, err error)
|
|
||||||
//sys Pause() (err error)
|
//sys Pause() (err error)
|
||||||
|
|
||||||
func mmap(addr uintptr, length uintptr, prot int, flags int, fd int, offset int64) (xaddr uintptr, err error) {
|
func mmap(addr uintptr, length uintptr, prot int, flags int, fd int, offset int64) (xaddr uintptr, err error) {
|
||||||
@ -164,11 +166,11 @@ func Seek(fd int, offset int64, whence int) (newoffset int64, err error) {
|
|||||||
return newoffset, nil
|
return newoffset, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// Vsyscalls on amd64.
|
//sys futimesat(dirfd int, path string, times *[2]Timeval) (err error)
|
||||||
//sysnb Gettimeofday(tv *Timeval) (err error)
|
//sysnb Gettimeofday(tv *Timeval) (err error)
|
||||||
//sysnb Time(t *Time_t) (tt Time_t, err error)
|
//sysnb Time(t *Time_t) (tt Time_t, err error)
|
||||||
|
|
||||||
//sys Utime(path string, buf *Utimbuf) (err error)
|
//sys Utime(path string, buf *Utimbuf) (err error)
|
||||||
|
//sys utimes(path string, times *[2]Timeval) (err error)
|
||||||
|
|
||||||
// On x86 Linux, all the socket calls go through an extra indirection,
|
// On x86 Linux, all the socket calls go through an extra indirection,
|
||||||
// I think because the 5-register system call interface can't handle
|
// I think because the 5-register system call interface can't handle
|
||||||
|
5
vendor/golang.org/x/sys/unix/syscall_linux_amd64.go
generated
vendored
5
vendor/golang.org/x/sys/unix/syscall_linux_amd64.go
generated
vendored
@ -7,6 +7,7 @@
|
|||||||
package unix
|
package unix
|
||||||
|
|
||||||
//sys Dup2(oldfd int, newfd int) (err error)
|
//sys Dup2(oldfd int, newfd int) (err error)
|
||||||
|
//sysnb EpollCreate(size int) (fd int, err error)
|
||||||
//sys EpollWait(epfd int, events []EpollEvent, msec int) (n int, err error)
|
//sys EpollWait(epfd int, events []EpollEvent, msec int) (n int, err error)
|
||||||
//sys Fadvise(fd int, offset int64, length int64, advice int) (err error) = SYS_FADVISE64
|
//sys Fadvise(fd int, offset int64, length int64, advice int) (err error) = SYS_FADVISE64
|
||||||
//sys Fchown(fd int, uid int, gid int) (err error)
|
//sys Fchown(fd int, uid int, gid int) (err error)
|
||||||
@ -57,6 +58,7 @@ func Stat(path string, stat *Stat_t) (err error) {
|
|||||||
//sys Statfs(path string, buf *Statfs_t) (err error)
|
//sys Statfs(path string, buf *Statfs_t) (err error)
|
||||||
//sys SyncFileRange(fd int, off int64, n int64, flags int) (err error)
|
//sys SyncFileRange(fd int, off int64, n int64, flags int) (err error)
|
||||||
//sys Truncate(path string, length int64) (err error)
|
//sys Truncate(path string, length int64) (err error)
|
||||||
|
//sys Ustat(dev int, ubuf *Ustat_t) (err error)
|
||||||
//sys accept(s int, rsa *RawSockaddrAny, addrlen *_Socklen) (fd int, err error)
|
//sys accept(s int, rsa *RawSockaddrAny, addrlen *_Socklen) (fd int, err error)
|
||||||
//sys accept4(s int, rsa *RawSockaddrAny, addrlen *_Socklen, flags int) (fd int, err error)
|
//sys accept4(s int, rsa *RawSockaddrAny, addrlen *_Socklen, flags int) (fd int, err error)
|
||||||
//sys bind(s int, addr unsafe.Pointer, addrlen _Socklen) (err error)
|
//sys bind(s int, addr unsafe.Pointer, addrlen _Socklen) (err error)
|
||||||
@ -75,6 +77,8 @@ func Stat(path string, stat *Stat_t) (err error) {
|
|||||||
//sys sendmsg(s int, msg *Msghdr, flags int) (n int, err error)
|
//sys sendmsg(s int, msg *Msghdr, flags int) (n int, err error)
|
||||||
//sys mmap(addr uintptr, length uintptr, prot int, flags int, fd int, offset int64) (xaddr uintptr, err error)
|
//sys mmap(addr uintptr, length uintptr, prot int, flags int, fd int, offset int64) (xaddr uintptr, err error)
|
||||||
|
|
||||||
|
//sys futimesat(dirfd int, path string, times *[2]Timeval) (err error)
|
||||||
|
|
||||||
func Gettimeofday(tv *Timeval) (err error) {
|
func Gettimeofday(tv *Timeval) (err error) {
|
||||||
errno := gettimeofday(tv)
|
errno := gettimeofday(tv)
|
||||||
if errno != 0 {
|
if errno != 0 {
|
||||||
@ -96,6 +100,7 @@ func Time(t *Time_t) (tt Time_t, err error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
//sys Utime(path string, buf *Utimbuf) (err error)
|
//sys Utime(path string, buf *Utimbuf) (err error)
|
||||||
|
//sys utimes(path string, times *[2]Timeval) (err error)
|
||||||
|
|
||||||
func setTimespec(sec, nsec int64) Timespec {
|
func setTimespec(sec, nsec int64) Timespec {
|
||||||
return Timespec{Sec: sec, Nsec: nsec}
|
return Timespec{Sec: sec, Nsec: nsec}
|
||||||
|
10
vendor/golang.org/x/sys/unix/syscall_linux_arm.go
generated
vendored
10
vendor/golang.org/x/sys/unix/syscall_linux_arm.go
generated
vendored
@ -75,6 +75,8 @@ func Seek(fd int, offset int64, whence int) (newoffset int64, err error) {
|
|||||||
// 64-bit file system and 32-bit uid calls
|
// 64-bit file system and 32-bit uid calls
|
||||||
// (16-bit uid calls are not always supported in newer kernels)
|
// (16-bit uid calls are not always supported in newer kernels)
|
||||||
//sys Dup2(oldfd int, newfd int) (err error)
|
//sys Dup2(oldfd int, newfd int) (err error)
|
||||||
|
//sysnb EpollCreate(size int) (fd int, err error)
|
||||||
|
//sys EpollWait(epfd int, events []EpollEvent, msec int) (n int, err error)
|
||||||
//sys Fchown(fd int, uid int, gid int) (err error) = SYS_FCHOWN32
|
//sys Fchown(fd int, uid int, gid int) (err error) = SYS_FCHOWN32
|
||||||
//sys Fstat(fd int, stat *Stat_t) (err error) = SYS_FSTAT64
|
//sys Fstat(fd int, stat *Stat_t) (err error) = SYS_FSTAT64
|
||||||
//sys Fstatat(dirfd int, path string, stat *Stat_t, flags int) (err error) = SYS_FSTATAT64
|
//sys Fstatat(dirfd int, path string, stat *Stat_t, flags int) (err error) = SYS_FSTATAT64
|
||||||
@ -86,6 +88,7 @@ func Seek(fd int, offset int64, whence int) (newoffset int64, err error) {
|
|||||||
//sys Lchown(path string, uid int, gid int) (err error) = SYS_LCHOWN32
|
//sys Lchown(path string, uid int, gid int) (err error) = SYS_LCHOWN32
|
||||||
//sys Listen(s int, n int) (err error)
|
//sys Listen(s int, n int) (err error)
|
||||||
//sys Lstat(path string, stat *Stat_t) (err error) = SYS_LSTAT64
|
//sys Lstat(path string, stat *Stat_t) (err error) = SYS_LSTAT64
|
||||||
|
//sys Pause() (err error)
|
||||||
//sys sendfile(outfd int, infd int, offset *int64, count int) (written int, err error) = SYS_SENDFILE64
|
//sys sendfile(outfd int, infd int, offset *int64, count int) (written int, err error) = SYS_SENDFILE64
|
||||||
//sys Select(nfd int, r *FdSet, w *FdSet, e *FdSet, timeout *Timeval) (n int, err error) = SYS__NEWSELECT
|
//sys Select(nfd int, r *FdSet, w *FdSet, e *FdSet, timeout *Timeval) (n int, err error) = SYS__NEWSELECT
|
||||||
//sys Setfsgid(gid int) (err error) = SYS_SETFSGID32
|
//sys Setfsgid(gid int) (err error) = SYS_SETFSGID32
|
||||||
@ -97,11 +100,10 @@ func Seek(fd int, offset int64, whence int) (newoffset int64, err error) {
|
|||||||
//sys Shutdown(fd int, how int) (err error)
|
//sys Shutdown(fd int, how int) (err error)
|
||||||
//sys Splice(rfd int, roff *int64, wfd int, woff *int64, len int, flags int) (n int, err error)
|
//sys Splice(rfd int, roff *int64, wfd int, woff *int64, len int, flags int) (n int, err error)
|
||||||
//sys Stat(path string, stat *Stat_t) (err error) = SYS_STAT64
|
//sys Stat(path string, stat *Stat_t) (err error) = SYS_STAT64
|
||||||
|
//sys Ustat(dev int, ubuf *Ustat_t) (err error)
|
||||||
|
|
||||||
// Vsyscalls on amd64.
|
//sys futimesat(dirfd int, path string, times *[2]Timeval) (err error)
|
||||||
//sysnb Gettimeofday(tv *Timeval) (err error)
|
//sysnb Gettimeofday(tv *Timeval) (err error)
|
||||||
//sys EpollWait(epfd int, events []EpollEvent, msec int) (n int, err error)
|
|
||||||
//sys Pause() (err error)
|
|
||||||
|
|
||||||
func Time(t *Time_t) (Time_t, error) {
|
func Time(t *Time_t) (Time_t, error) {
|
||||||
var tv Timeval
|
var tv Timeval
|
||||||
@ -123,6 +125,8 @@ func Utime(path string, buf *Utimbuf) error {
|
|||||||
return Utimes(path, tv)
|
return Utimes(path, tv)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//sys utimes(path string, times *[2]Timeval) (err error)
|
||||||
|
|
||||||
//sys Pread(fd int, p []byte, offset int64) (n int, err error) = SYS_PREAD64
|
//sys Pread(fd int, p []byte, offset int64) (n int, err error) = SYS_PREAD64
|
||||||
//sys Pwrite(fd int, p []byte, offset int64) (n int, err error) = SYS_PWRITE64
|
//sys Pwrite(fd int, p []byte, offset int64) (n int, err error) = SYS_PWRITE64
|
||||||
//sys Truncate(path string, length int64) (err error) = SYS_TRUNCATE64
|
//sys Truncate(path string, length int64) (err error) = SYS_TRUNCATE64
|
||||||
|
54
vendor/golang.org/x/sys/unix/syscall_linux_arm64.go
generated
vendored
54
vendor/golang.org/x/sys/unix/syscall_linux_arm64.go
generated
vendored
@ -6,6 +6,15 @@
|
|||||||
|
|
||||||
package unix
|
package unix
|
||||||
|
|
||||||
|
import "unsafe"
|
||||||
|
|
||||||
|
func EpollCreate(size int) (fd int, err error) {
|
||||||
|
if size <= 0 {
|
||||||
|
return -1, EINVAL
|
||||||
|
}
|
||||||
|
return EpollCreate1(0)
|
||||||
|
}
|
||||||
|
|
||||||
//sys EpollWait(epfd int, events []EpollEvent, msec int) (n int, err error) = SYS_EPOLL_PWAIT
|
//sys EpollWait(epfd int, events []EpollEvent, msec int) (n int, err error) = SYS_EPOLL_PWAIT
|
||||||
//sys Fadvise(fd int, offset int64, length int64, advice int) (err error) = SYS_FADVISE64
|
//sys Fadvise(fd int, offset int64, length int64, advice int) (err error) = SYS_FADVISE64
|
||||||
//sys Fchown(fd int, uid int, gid int) (err error)
|
//sys Fchown(fd int, uid int, gid int) (err error)
|
||||||
@ -57,6 +66,11 @@ func Lstat(path string, stat *Stat_t) (err error) {
|
|||||||
//sys Statfs(path string, buf *Statfs_t) (err error)
|
//sys Statfs(path string, buf *Statfs_t) (err error)
|
||||||
//sys SyncFileRange(fd int, off int64, n int64, flags int) (err error)
|
//sys SyncFileRange(fd int, off int64, n int64, flags int) (err error)
|
||||||
//sys Truncate(path string, length int64) (err error)
|
//sys Truncate(path string, length int64) (err error)
|
||||||
|
|
||||||
|
func Ustat(dev int, ubuf *Ustat_t) (err error) {
|
||||||
|
return ENOSYS
|
||||||
|
}
|
||||||
|
|
||||||
//sys accept(s int, rsa *RawSockaddrAny, addrlen *_Socklen) (fd int, err error)
|
//sys accept(s int, rsa *RawSockaddrAny, addrlen *_Socklen) (fd int, err error)
|
||||||
//sys accept4(s int, rsa *RawSockaddrAny, addrlen *_Socklen, flags int) (fd int, err error)
|
//sys accept4(s int, rsa *RawSockaddrAny, addrlen *_Socklen, flags int) (fd int, err error)
|
||||||
//sys bind(s int, addr unsafe.Pointer, addrlen _Socklen) (err error)
|
//sys bind(s int, addr unsafe.Pointer, addrlen _Socklen) (err error)
|
||||||
@ -85,6 +99,18 @@ func setTimeval(sec, usec int64) Timeval {
|
|||||||
return Timeval{Sec: sec, Usec: usec}
|
return Timeval{Sec: sec, Usec: usec}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func futimesat(dirfd int, path string, tv *[2]Timeval) (err error) {
|
||||||
|
if tv == nil {
|
||||||
|
return utimensat(dirfd, path, nil, 0)
|
||||||
|
}
|
||||||
|
|
||||||
|
ts := []Timespec{
|
||||||
|
NsecToTimespec(TimevalToNsec(tv[0])),
|
||||||
|
NsecToTimespec(TimevalToNsec(tv[1])),
|
||||||
|
}
|
||||||
|
return utimensat(dirfd, path, (*[2]Timespec)(unsafe.Pointer(&ts[0])), 0)
|
||||||
|
}
|
||||||
|
|
||||||
func Time(t *Time_t) (Time_t, error) {
|
func Time(t *Time_t) (Time_t, error) {
|
||||||
var tv Timeval
|
var tv Timeval
|
||||||
err := Gettimeofday(&tv)
|
err := Gettimeofday(&tv)
|
||||||
@ -105,6 +131,18 @@ func Utime(path string, buf *Utimbuf) error {
|
|||||||
return Utimes(path, tv)
|
return Utimes(path, tv)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func utimes(path string, tv *[2]Timeval) (err error) {
|
||||||
|
if tv == nil {
|
||||||
|
return utimensat(AT_FDCWD, path, nil, 0)
|
||||||
|
}
|
||||||
|
|
||||||
|
ts := []Timespec{
|
||||||
|
NsecToTimespec(TimevalToNsec(tv[0])),
|
||||||
|
NsecToTimespec(TimevalToNsec(tv[1])),
|
||||||
|
}
|
||||||
|
return utimensat(AT_FDCWD, path, (*[2]Timespec)(unsafe.Pointer(&ts[0])), 0)
|
||||||
|
}
|
||||||
|
|
||||||
func Pipe(p []int) (err error) {
|
func Pipe(p []int) (err error) {
|
||||||
if len(p) != 2 {
|
if len(p) != 2 {
|
||||||
return EINVAL
|
return EINVAL
|
||||||
@ -161,22 +199,6 @@ func Pause() (err error) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO(dfc): constants that should be in zsysnum_linux_arm64.go, remove
|
|
||||||
// these when the deprecated syscalls that the syscall package relies on
|
|
||||||
// are removed.
|
|
||||||
const (
|
|
||||||
SYS_GETPGRP = 1060
|
|
||||||
SYS_UTIMES = 1037
|
|
||||||
SYS_FUTIMESAT = 1066
|
|
||||||
SYS_PAUSE = 1061
|
|
||||||
SYS_USTAT = 1070
|
|
||||||
SYS_UTIME = 1063
|
|
||||||
SYS_LCHOWN = 1032
|
|
||||||
SYS_TIME = 1062
|
|
||||||
SYS_EPOLL_CREATE = 1042
|
|
||||||
SYS_EPOLL_WAIT = 1069
|
|
||||||
)
|
|
||||||
|
|
||||||
func Poll(fds []PollFd, timeout int) (n int, err error) {
|
func Poll(fds []PollFd, timeout int) (n int, err error) {
|
||||||
var ts *Timespec
|
var ts *Timespec
|
||||||
if timeout >= 0 {
|
if timeout >= 0 {
|
||||||
|
4
vendor/golang.org/x/sys/unix/syscall_linux_mips64x.go
generated
vendored
4
vendor/golang.org/x/sys/unix/syscall_linux_mips64x.go
generated
vendored
@ -8,6 +8,7 @@
|
|||||||
package unix
|
package unix
|
||||||
|
|
||||||
//sys Dup2(oldfd int, newfd int) (err error)
|
//sys Dup2(oldfd int, newfd int) (err error)
|
||||||
|
//sysnb EpollCreate(size int) (fd int, err error)
|
||||||
//sys EpollWait(epfd int, events []EpollEvent, msec int) (n int, err error)
|
//sys EpollWait(epfd int, events []EpollEvent, msec int) (n int, err error)
|
||||||
//sys Fadvise(fd int, offset int64, length int64, advice int) (err error) = SYS_FADVISE64
|
//sys Fadvise(fd int, offset int64, length int64, advice int) (err error) = SYS_FADVISE64
|
||||||
//sys Fchown(fd int, uid int, gid int) (err error)
|
//sys Fchown(fd int, uid int, gid int) (err error)
|
||||||
@ -47,6 +48,7 @@ func Select(nfd int, r *FdSet, w *FdSet, e *FdSet, timeout *Timeval) (n int, err
|
|||||||
//sys Statfs(path string, buf *Statfs_t) (err error)
|
//sys Statfs(path string, buf *Statfs_t) (err error)
|
||||||
//sys SyncFileRange(fd int, off int64, n int64, flags int) (err error)
|
//sys SyncFileRange(fd int, off int64, n int64, flags int) (err error)
|
||||||
//sys Truncate(path string, length int64) (err error)
|
//sys Truncate(path string, length int64) (err error)
|
||||||
|
//sys Ustat(dev int, ubuf *Ustat_t) (err error)
|
||||||
//sys accept(s int, rsa *RawSockaddrAny, addrlen *_Socklen) (fd int, err error)
|
//sys accept(s int, rsa *RawSockaddrAny, addrlen *_Socklen) (fd int, err error)
|
||||||
//sys accept4(s int, rsa *RawSockaddrAny, addrlen *_Socklen, flags int) (fd int, err error)
|
//sys accept4(s int, rsa *RawSockaddrAny, addrlen *_Socklen, flags int) (fd int, err error)
|
||||||
//sys bind(s int, addr unsafe.Pointer, addrlen _Socklen) (err error)
|
//sys bind(s int, addr unsafe.Pointer, addrlen _Socklen) (err error)
|
||||||
@ -65,6 +67,7 @@ func Select(nfd int, r *FdSet, w *FdSet, e *FdSet, timeout *Timeval) (n int, err
|
|||||||
//sys sendmsg(s int, msg *Msghdr, flags int) (n int, err error)
|
//sys sendmsg(s int, msg *Msghdr, flags int) (n int, err error)
|
||||||
//sys mmap(addr uintptr, length uintptr, prot int, flags int, fd int, offset int64) (xaddr uintptr, err error)
|
//sys mmap(addr uintptr, length uintptr, prot int, flags int, fd int, offset int64) (xaddr uintptr, err error)
|
||||||
|
|
||||||
|
//sys futimesat(dirfd int, path string, times *[2]Timeval) (err error)
|
||||||
//sysnb Gettimeofday(tv *Timeval) (err error)
|
//sysnb Gettimeofday(tv *Timeval) (err error)
|
||||||
|
|
||||||
func Time(t *Time_t) (tt Time_t, err error) {
|
func Time(t *Time_t) (tt Time_t, err error) {
|
||||||
@ -80,6 +83,7 @@ func Time(t *Time_t) (tt Time_t, err error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
//sys Utime(path string, buf *Utimbuf) (err error)
|
//sys Utime(path string, buf *Utimbuf) (err error)
|
||||||
|
//sys utimes(path string, times *[2]Timeval) (err error)
|
||||||
|
|
||||||
func setTimespec(sec, nsec int64) Timespec {
|
func setTimespec(sec, nsec int64) Timespec {
|
||||||
return Timespec{Sec: sec, Nsec: nsec}
|
return Timespec{Sec: sec, Nsec: nsec}
|
||||||
|
10
vendor/golang.org/x/sys/unix/syscall_linux_mipsx.go
generated
vendored
10
vendor/golang.org/x/sys/unix/syscall_linux_mipsx.go
generated
vendored
@ -15,6 +15,8 @@ import (
|
|||||||
func Syscall9(trap, a1, a2, a3, a4, a5, a6, a7, a8, a9 uintptr) (r1, r2 uintptr, err syscall.Errno)
|
func Syscall9(trap, a1, a2, a3, a4, a5, a6, a7, a8, a9 uintptr) (r1, r2 uintptr, err syscall.Errno)
|
||||||
|
|
||||||
//sys Dup2(oldfd int, newfd int) (err error)
|
//sys Dup2(oldfd int, newfd int) (err error)
|
||||||
|
//sysnb EpollCreate(size int) (fd int, err error)
|
||||||
|
//sys EpollWait(epfd int, events []EpollEvent, msec int) (n int, err error)
|
||||||
//sys Fadvise(fd int, offset int64, length int64, advice int) (err error) = SYS_FADVISE64
|
//sys Fadvise(fd int, offset int64, length int64, advice int) (err error) = SYS_FADVISE64
|
||||||
//sys Fchown(fd int, uid int, gid int) (err error)
|
//sys Fchown(fd int, uid int, gid int) (err error)
|
||||||
//sys Ftruncate(fd int, length int64) (err error) = SYS_FTRUNCATE64
|
//sys Ftruncate(fd int, length int64) (err error) = SYS_FTRUNCATE64
|
||||||
@ -33,13 +35,12 @@ func Syscall9(trap, a1, a2, a3, a4, a5, a6, a7, a8, a9 uintptr) (r1, r2 uintptr,
|
|||||||
//sysnb Setregid(rgid int, egid int) (err error)
|
//sysnb Setregid(rgid int, egid int) (err error)
|
||||||
//sysnb Setresgid(rgid int, egid int, sgid int) (err error)
|
//sysnb Setresgid(rgid int, egid int, sgid int) (err error)
|
||||||
//sysnb Setresuid(ruid int, euid int, suid int) (err error)
|
//sysnb Setresuid(ruid int, euid int, suid int) (err error)
|
||||||
|
|
||||||
//sysnb Setreuid(ruid int, euid int) (err error)
|
//sysnb Setreuid(ruid int, euid int) (err error)
|
||||||
//sys Shutdown(fd int, how int) (err error)
|
//sys Shutdown(fd int, how int) (err error)
|
||||||
//sys Splice(rfd int, roff *int64, wfd int, woff *int64, len int, flags int) (n int, err error)
|
//sys Splice(rfd int, roff *int64, wfd int, woff *int64, len int, flags int) (n int, err error)
|
||||||
|
|
||||||
//sys SyncFileRange(fd int, off int64, n int64, flags int) (err error)
|
//sys SyncFileRange(fd int, off int64, n int64, flags int) (err error)
|
||||||
//sys Truncate(path string, length int64) (err error) = SYS_TRUNCATE64
|
//sys Truncate(path string, length int64) (err error) = SYS_TRUNCATE64
|
||||||
|
//sys Ustat(dev int, ubuf *Ustat_t) (err error)
|
||||||
//sys accept(s int, rsa *RawSockaddrAny, addrlen *_Socklen) (fd int, err error)
|
//sys accept(s int, rsa *RawSockaddrAny, addrlen *_Socklen) (fd int, err error)
|
||||||
//sys accept4(s int, rsa *RawSockaddrAny, addrlen *_Socklen, flags int) (fd int, err error)
|
//sys accept4(s int, rsa *RawSockaddrAny, addrlen *_Socklen, flags int) (fd int, err error)
|
||||||
//sys bind(s int, addr unsafe.Pointer, addrlen _Socklen) (err error)
|
//sys bind(s int, addr unsafe.Pointer, addrlen _Socklen) (err error)
|
||||||
@ -61,16 +62,17 @@ func Syscall9(trap, a1, a2, a3, a4, a5, a6, a7, a8, a9 uintptr) (r1, r2 uintptr,
|
|||||||
//sys Ioperm(from int, num int, on int) (err error)
|
//sys Ioperm(from int, num int, on int) (err error)
|
||||||
//sys Iopl(level int) (err error)
|
//sys Iopl(level int) (err error)
|
||||||
|
|
||||||
|
//sys futimesat(dirfd int, path string, times *[2]Timeval) (err error)
|
||||||
//sysnb Gettimeofday(tv *Timeval) (err error)
|
//sysnb Gettimeofday(tv *Timeval) (err error)
|
||||||
//sysnb Time(t *Time_t) (tt Time_t, err error)
|
//sysnb Time(t *Time_t) (tt Time_t, err error)
|
||||||
|
//sys Utime(path string, buf *Utimbuf) (err error)
|
||||||
|
//sys utimes(path string, times *[2]Timeval) (err error)
|
||||||
|
|
||||||
//sys Lstat(path string, stat *Stat_t) (err error) = SYS_LSTAT64
|
//sys Lstat(path string, stat *Stat_t) (err error) = SYS_LSTAT64
|
||||||
//sys Fstat(fd int, stat *Stat_t) (err error) = SYS_FSTAT64
|
//sys Fstat(fd int, stat *Stat_t) (err error) = SYS_FSTAT64
|
||||||
//sys Fstatat(dirfd int, path string, stat *Stat_t, flags int) (err error) = SYS_FSTATAT64
|
//sys Fstatat(dirfd int, path string, stat *Stat_t, flags int) (err error) = SYS_FSTATAT64
|
||||||
//sys Stat(path string, stat *Stat_t) (err error) = SYS_STAT64
|
//sys Stat(path string, stat *Stat_t) (err error) = SYS_STAT64
|
||||||
|
|
||||||
//sys Utime(path string, buf *Utimbuf) (err error)
|
|
||||||
//sys EpollWait(epfd int, events []EpollEvent, msec int) (n int, err error)
|
|
||||||
//sys Pause() (err error)
|
//sys Pause() (err error)
|
||||||
|
|
||||||
func Fstatfs(fd int, buf *Statfs_t) (err error) {
|
func Fstatfs(fd int, buf *Statfs_t) (err error) {
|
||||||
|
7
vendor/golang.org/x/sys/unix/syscall_linux_ppc64x.go
generated
vendored
7
vendor/golang.org/x/sys/unix/syscall_linux_ppc64x.go
generated
vendored
@ -7,8 +7,9 @@
|
|||||||
|
|
||||||
package unix
|
package unix
|
||||||
|
|
||||||
//sys EpollWait(epfd int, events []EpollEvent, msec int) (n int, err error)
|
|
||||||
//sys Dup2(oldfd int, newfd int) (err error)
|
//sys Dup2(oldfd int, newfd int) (err error)
|
||||||
|
//sysnb EpollCreate(size int) (fd int, err error)
|
||||||
|
//sys EpollWait(epfd int, events []EpollEvent, msec int) (n int, err error)
|
||||||
//sys Fadvise(fd int, offset int64, length int64, advice int) (err error) = SYS_FADVISE64
|
//sys Fadvise(fd int, offset int64, length int64, advice int) (err error) = SYS_FADVISE64
|
||||||
//sys Fchown(fd int, uid int, gid int) (err error)
|
//sys Fchown(fd int, uid int, gid int) (err error)
|
||||||
//sys Fstat(fd int, stat *Stat_t) (err error)
|
//sys Fstat(fd int, stat *Stat_t) (err error)
|
||||||
@ -45,6 +46,7 @@ package unix
|
|||||||
//sys Statfs(path string, buf *Statfs_t) (err error)
|
//sys Statfs(path string, buf *Statfs_t) (err error)
|
||||||
//sys SyncFileRange(fd int, off int64, n int64, flags int) (err error) = SYS_SYNC_FILE_RANGE2
|
//sys SyncFileRange(fd int, off int64, n int64, flags int) (err error) = SYS_SYNC_FILE_RANGE2
|
||||||
//sys Truncate(path string, length int64) (err error)
|
//sys Truncate(path string, length int64) (err error)
|
||||||
|
//sys Ustat(dev int, ubuf *Ustat_t) (err error)
|
||||||
//sys accept(s int, rsa *RawSockaddrAny, addrlen *_Socklen) (fd int, err error)
|
//sys accept(s int, rsa *RawSockaddrAny, addrlen *_Socklen) (fd int, err error)
|
||||||
//sys accept4(s int, rsa *RawSockaddrAny, addrlen *_Socklen, flags int) (fd int, err error)
|
//sys accept4(s int, rsa *RawSockaddrAny, addrlen *_Socklen, flags int) (fd int, err error)
|
||||||
//sys bind(s int, addr unsafe.Pointer, addrlen _Socklen) (err error)
|
//sys bind(s int, addr unsafe.Pointer, addrlen _Socklen) (err error)
|
||||||
@ -63,10 +65,11 @@ package unix
|
|||||||
//sys sendmsg(s int, msg *Msghdr, flags int) (n int, err error)
|
//sys sendmsg(s int, msg *Msghdr, flags int) (n int, err error)
|
||||||
//sys mmap(addr uintptr, length uintptr, prot int, flags int, fd int, offset int64) (xaddr uintptr, err error)
|
//sys mmap(addr uintptr, length uintptr, prot int, flags int, fd int, offset int64) (xaddr uintptr, err error)
|
||||||
|
|
||||||
|
//sys futimesat(dirfd int, path string, times *[2]Timeval) (err error)
|
||||||
//sysnb Gettimeofday(tv *Timeval) (err error)
|
//sysnb Gettimeofday(tv *Timeval) (err error)
|
||||||
//sysnb Time(t *Time_t) (tt Time_t, err error)
|
//sysnb Time(t *Time_t) (tt Time_t, err error)
|
||||||
|
|
||||||
//sys Utime(path string, buf *Utimbuf) (err error)
|
//sys Utime(path string, buf *Utimbuf) (err error)
|
||||||
|
//sys utimes(path string, times *[2]Timeval) (err error)
|
||||||
|
|
||||||
func setTimespec(sec, nsec int64) Timespec {
|
func setTimespec(sec, nsec int64) Timespec {
|
||||||
return Timespec{Sec: sec, Nsec: nsec}
|
return Timespec{Sec: sec, Nsec: nsec}
|
||||||
|
4
vendor/golang.org/x/sys/unix/syscall_linux_s390x.go
generated
vendored
4
vendor/golang.org/x/sys/unix/syscall_linux_s390x.go
generated
vendored
@ -11,6 +11,7 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
//sys Dup2(oldfd int, newfd int) (err error)
|
//sys Dup2(oldfd int, newfd int) (err error)
|
||||||
|
//sysnb EpollCreate(size int) (fd int, err error)
|
||||||
//sys EpollWait(epfd int, events []EpollEvent, msec int) (n int, err error)
|
//sys EpollWait(epfd int, events []EpollEvent, msec int) (n int, err error)
|
||||||
//sys Fadvise(fd int, offset int64, length int64, advice int) (err error) = SYS_FADVISE64
|
//sys Fadvise(fd int, offset int64, length int64, advice int) (err error) = SYS_FADVISE64
|
||||||
//sys Fchown(fd int, uid int, gid int) (err error)
|
//sys Fchown(fd int, uid int, gid int) (err error)
|
||||||
@ -44,9 +45,11 @@ import (
|
|||||||
//sys Statfs(path string, buf *Statfs_t) (err error)
|
//sys Statfs(path string, buf *Statfs_t) (err error)
|
||||||
//sys SyncFileRange(fd int, off int64, n int64, flags int) (err error)
|
//sys SyncFileRange(fd int, off int64, n int64, flags int) (err error)
|
||||||
//sys Truncate(path string, length int64) (err error)
|
//sys Truncate(path string, length int64) (err error)
|
||||||
|
//sys Ustat(dev int, ubuf *Ustat_t) (err error)
|
||||||
//sysnb getgroups(n int, list *_Gid_t) (nn int, err error)
|
//sysnb getgroups(n int, list *_Gid_t) (nn int, err error)
|
||||||
//sysnb setgroups(n int, list *_Gid_t) (err error)
|
//sysnb setgroups(n int, list *_Gid_t) (err error)
|
||||||
|
|
||||||
|
//sys futimesat(dirfd int, path string, times *[2]Timeval) (err error)
|
||||||
//sysnb Gettimeofday(tv *Timeval) (err error)
|
//sysnb Gettimeofday(tv *Timeval) (err error)
|
||||||
|
|
||||||
func Time(t *Time_t) (tt Time_t, err error) {
|
func Time(t *Time_t) (tt Time_t, err error) {
|
||||||
@ -62,6 +65,7 @@ func Time(t *Time_t) (tt Time_t, err error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
//sys Utime(path string, buf *Utimbuf) (err error)
|
//sys Utime(path string, buf *Utimbuf) (err error)
|
||||||
|
//sys utimes(path string, times *[2]Timeval) (err error)
|
||||||
|
|
||||||
func setTimespec(sec, nsec int64) Timespec {
|
func setTimespec(sec, nsec int64) Timespec {
|
||||||
return Timespec{Sec: sec, Nsec: nsec}
|
return Timespec{Sec: sec, Nsec: nsec}
|
||||||
|
2
vendor/golang.org/x/sys/unix/syscall_linux_sparc64.go
generated
vendored
2
vendor/golang.org/x/sys/unix/syscall_linux_sparc64.go
generated
vendored
@ -68,6 +68,7 @@ func Iopl(level int) (err error) {
|
|||||||
return ENOSYS
|
return ENOSYS
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//sys futimesat(dirfd int, path string, times *[2]Timeval) (err error)
|
||||||
//sysnb Gettimeofday(tv *Timeval) (err error)
|
//sysnb Gettimeofday(tv *Timeval) (err error)
|
||||||
|
|
||||||
func Time(t *Time_t) (tt Time_t, err error) {
|
func Time(t *Time_t) (tt Time_t, err error) {
|
||||||
@ -83,6 +84,7 @@ func Time(t *Time_t) (tt Time_t, err error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
//sys Utime(path string, buf *Utimbuf) (err error)
|
//sys Utime(path string, buf *Utimbuf) (err error)
|
||||||
|
//sys utimes(path string, times *[2]Timeval) (err error)
|
||||||
|
|
||||||
func setTimespec(sec, nsec int64) Timespec {
|
func setTimespec(sec, nsec int64) Timespec {
|
||||||
return Timespec{Sec: sec, Nsec: nsec}
|
return Timespec{Sec: sec, Nsec: nsec}
|
||||||
|
7
vendor/golang.org/x/sys/unix/syscall_solaris.go
generated
vendored
7
vendor/golang.org/x/sys/unix/syscall_solaris.go
generated
vendored
@ -314,7 +314,11 @@ func UtimesNanoAt(dirfd int, path string, ts []Timespec, flags int) error {
|
|||||||
|
|
||||||
// FcntlInt performs a fcntl syscall on fd with the provided command and argument.
|
// FcntlInt performs a fcntl syscall on fd with the provided command and argument.
|
||||||
func FcntlInt(fd uintptr, cmd, arg int) (int, error) {
|
func FcntlInt(fd uintptr, cmd, arg int) (int, error) {
|
||||||
valptr, _, err := sysvicall6(uintptr(unsafe.Pointer(&procfcntl)), 3, uintptr(fd), uintptr(cmd), uintptr(arg), 0, 0, 0)
|
valptr, _, errno := sysvicall6(uintptr(unsafe.Pointer(&procfcntl)), 3, uintptr(fd), uintptr(cmd), uintptr(arg), 0, 0, 0)
|
||||||
|
var err error
|
||||||
|
if errno != 0 {
|
||||||
|
err = errno
|
||||||
|
}
|
||||||
return int(valptr), err
|
return int(valptr), err
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -595,6 +599,7 @@ func Poll(fds []PollFd, timeout int) (n int, err error) {
|
|||||||
//sys Dup(fd int) (nfd int, err error)
|
//sys Dup(fd int) (nfd int, err error)
|
||||||
//sys Dup2(oldfd int, newfd int) (err error)
|
//sys Dup2(oldfd int, newfd int) (err error)
|
||||||
//sys Exit(code int)
|
//sys Exit(code int)
|
||||||
|
//sys Faccessat(dirfd int, path string, mode uint32, flags int) (err error)
|
||||||
//sys Fchdir(fd int) (err error)
|
//sys Fchdir(fd int) (err error)
|
||||||
//sys Fchmod(fd int, mode uint32) (err error)
|
//sys Fchmod(fd int, mode uint32) (err error)
|
||||||
//sys Fchmodat(dirfd int, path string, mode uint32, flags int) (err error)
|
//sys Fchmodat(dirfd int, path string, mode uint32, flags int) (err error)
|
||||||
|
161
vendor/golang.org/x/sys/unix/zsyscall_linux_386.go
generated
vendored
161
vendor/golang.org/x/sys/unix/zsyscall_linux_386.go
generated
vendored
@ -143,21 +143,6 @@ func Unlinkat(dirfd int, path string, flags int) (err error) {
|
|||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
func utimes(path string, times *[2]Timeval) (err error) {
|
|
||||||
var _p0 *byte
|
|
||||||
_p0, err = BytePtrFromString(path)
|
|
||||||
if err != nil {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
_, _, e1 := Syscall(SYS_UTIMES, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(times)), 0)
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func utimensat(dirfd int, path string, times *[2]Timespec, flags int) (err error) {
|
func utimensat(dirfd int, path string, times *[2]Timespec, flags int) (err error) {
|
||||||
var _p0 *byte
|
var _p0 *byte
|
||||||
_p0, err = BytePtrFromString(path)
|
_p0, err = BytePtrFromString(path)
|
||||||
@ -173,16 +158,6 @@ func utimensat(dirfd int, path string, times *[2]Timespec, flags int) (err error
|
|||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
func futimesat(dirfd int, path *byte, times *[2]Timeval) (err error) {
|
|
||||||
_, _, e1 := Syscall(SYS_FUTIMESAT, uintptr(dirfd), uintptr(unsafe.Pointer(path)), uintptr(unsafe.Pointer(times)))
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func Getcwd(buf []byte) (n int, err error) {
|
func Getcwd(buf []byte) (n int, err error) {
|
||||||
var _p0 unsafe.Pointer
|
var _p0 unsafe.Pointer
|
||||||
if len(buf) > 0 {
|
if len(buf) > 0 {
|
||||||
@ -494,17 +469,6 @@ func Dup3(oldfd int, newfd int, flags int) (err error) {
|
|||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
func EpollCreate(size int) (fd int, err error) {
|
|
||||||
r0, _, e1 := RawSyscall(SYS_EPOLL_CREATE, uintptr(size), 0, 0)
|
|
||||||
fd = int(r0)
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func EpollCreate1(flag int) (fd int, err error) {
|
func EpollCreate1(flag int) (fd int, err error) {
|
||||||
r0, _, e1 := RawSyscall(SYS_EPOLL_CREATE1, uintptr(flag), 0, 0)
|
r0, _, e1 := RawSyscall(SYS_EPOLL_CREATE1, uintptr(flag), 0, 0)
|
||||||
fd = int(r0)
|
fd = int(r0)
|
||||||
@ -544,21 +508,6 @@ func Exit(code int) {
|
|||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
func Faccessat(dirfd int, path string, mode uint32, flags int) (err error) {
|
|
||||||
var _p0 *byte
|
|
||||||
_p0, err = BytePtrFromString(path)
|
|
||||||
if err != nil {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
_, _, e1 := Syscall6(SYS_FACCESSAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(flags), 0, 0)
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func Fallocate(fd int, mode uint32, off int64, len int64) (err error) {
|
func Fallocate(fd int, mode uint32, off int64, len int64) (err error) {
|
||||||
_, _, e1 := Syscall6(SYS_FALLOCATE, uintptr(fd), uintptr(mode), uintptr(off), uintptr(off>>32), uintptr(len), uintptr(len>>32))
|
_, _, e1 := Syscall6(SYS_FALLOCATE, uintptr(fd), uintptr(mode), uintptr(off), uintptr(off>>32), uintptr(len), uintptr(len>>32))
|
||||||
if e1 != 0 {
|
if e1 != 0 {
|
||||||
@ -1366,16 +1315,6 @@ func Unshare(flags int) (err error) {
|
|||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
func Ustat(dev int, ubuf *Ustat_t) (err error) {
|
|
||||||
_, _, e1 := Syscall(SYS_USTAT, uintptr(dev), uintptr(unsafe.Pointer(ubuf)), 0)
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func write(fd int, p []byte) (n int, err error) {
|
func write(fd int, p []byte) (n int, err error) {
|
||||||
var _p0 unsafe.Pointer
|
var _p0 unsafe.Pointer
|
||||||
if len(p) > 0 {
|
if len(p) > 0 {
|
||||||
@ -1535,6 +1474,21 @@ func Munlockall() (err error) {
|
|||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
func faccessat(dirfd int, path string, mode uint32) (err error) {
|
||||||
|
var _p0 *byte
|
||||||
|
_p0, err = BytePtrFromString(path)
|
||||||
|
if err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
_, _, e1 := Syscall(SYS_FACCESSAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode))
|
||||||
|
if e1 != 0 {
|
||||||
|
err = errnoErr(e1)
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
func pipe(p *[2]_C_int) (err error) {
|
func pipe(p *[2]_C_int) (err error) {
|
||||||
_, _, e1 := RawSyscall(SYS_PIPE, uintptr(unsafe.Pointer(p)), 0, 0)
|
_, _, e1 := RawSyscall(SYS_PIPE, uintptr(unsafe.Pointer(p)), 0, 0)
|
||||||
if e1 != 0 {
|
if e1 != 0 {
|
||||||
@ -1565,6 +1519,34 @@ func Dup2(oldfd int, newfd int) (err error) {
|
|||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
func EpollCreate(size int) (fd int, err error) {
|
||||||
|
r0, _, e1 := RawSyscall(SYS_EPOLL_CREATE, uintptr(size), 0, 0)
|
||||||
|
fd = int(r0)
|
||||||
|
if e1 != 0 {
|
||||||
|
err = errnoErr(e1)
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
func EpollWait(epfd int, events []EpollEvent, msec int) (n int, err error) {
|
||||||
|
var _p0 unsafe.Pointer
|
||||||
|
if len(events) > 0 {
|
||||||
|
_p0 = unsafe.Pointer(&events[0])
|
||||||
|
} else {
|
||||||
|
_p0 = unsafe.Pointer(&_zero)
|
||||||
|
}
|
||||||
|
r0, _, e1 := Syscall6(SYS_EPOLL_WAIT, uintptr(epfd), uintptr(_p0), uintptr(len(events)), uintptr(msec), 0, 0)
|
||||||
|
n = int(r0)
|
||||||
|
if e1 != 0 {
|
||||||
|
err = errnoErr(e1)
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
func Fadvise(fd int, offset int64, length int64, advice int) (err error) {
|
func Fadvise(fd int, offset int64, length int64, advice int) (err error) {
|
||||||
_, _, e1 := Syscall6(SYS_FADVISE64_64, uintptr(fd), uintptr(offset), uintptr(offset>>32), uintptr(length), uintptr(length>>32), uintptr(advice))
|
_, _, e1 := Syscall6(SYS_FADVISE64_64, uintptr(fd), uintptr(offset), uintptr(offset>>32), uintptr(length), uintptr(length>>32), uintptr(advice))
|
||||||
if e1 != 0 {
|
if e1 != 0 {
|
||||||
@ -1869,6 +1851,16 @@ func Truncate(path string, length int64) (err error) {
|
|||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
func Ustat(dev int, ubuf *Ustat_t) (err error) {
|
||||||
|
_, _, e1 := Syscall(SYS_USTAT, uintptr(dev), uintptr(unsafe.Pointer(ubuf)), 0)
|
||||||
|
if e1 != 0 {
|
||||||
|
err = errnoErr(e1)
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
func getgroups(n int, list *_Gid_t) (nn int, err error) {
|
func getgroups(n int, list *_Gid_t) (nn int, err error) {
|
||||||
r0, _, e1 := RawSyscall(SYS_GETGROUPS32, uintptr(n), uintptr(unsafe.Pointer(list)), 0)
|
r0, _, e1 := RawSyscall(SYS_GETGROUPS32, uintptr(n), uintptr(unsafe.Pointer(list)), 0)
|
||||||
nn = int(r0)
|
nn = int(r0)
|
||||||
@ -1912,23 +1904,6 @@ func mmap2(addr uintptr, length uintptr, prot int, flags int, fd int, pageOffset
|
|||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
func EpollWait(epfd int, events []EpollEvent, msec int) (n int, err error) {
|
|
||||||
var _p0 unsafe.Pointer
|
|
||||||
if len(events) > 0 {
|
|
||||||
_p0 = unsafe.Pointer(&events[0])
|
|
||||||
} else {
|
|
||||||
_p0 = unsafe.Pointer(&_zero)
|
|
||||||
}
|
|
||||||
r0, _, e1 := Syscall6(SYS_EPOLL_WAIT, uintptr(epfd), uintptr(_p0), uintptr(len(events)), uintptr(msec), 0, 0)
|
|
||||||
n = int(r0)
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func Pause() (err error) {
|
func Pause() (err error) {
|
||||||
_, _, e1 := Syscall(SYS_PAUSE, 0, 0, 0)
|
_, _, e1 := Syscall(SYS_PAUSE, 0, 0, 0)
|
||||||
if e1 != 0 {
|
if e1 != 0 {
|
||||||
@ -1959,6 +1934,21 @@ func setrlimit(resource int, rlim *rlimit32) (err error) {
|
|||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
func futimesat(dirfd int, path string, times *[2]Timeval) (err error) {
|
||||||
|
var _p0 *byte
|
||||||
|
_p0, err = BytePtrFromString(path)
|
||||||
|
if err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
_, _, e1 := Syscall(SYS_FUTIMESAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(times)))
|
||||||
|
if e1 != 0 {
|
||||||
|
err = errnoErr(e1)
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
func Gettimeofday(tv *Timeval) (err error) {
|
func Gettimeofday(tv *Timeval) (err error) {
|
||||||
_, _, e1 := RawSyscall(SYS_GETTIMEOFDAY, uintptr(unsafe.Pointer(tv)), 0, 0)
|
_, _, e1 := RawSyscall(SYS_GETTIMEOFDAY, uintptr(unsafe.Pointer(tv)), 0, 0)
|
||||||
if e1 != 0 {
|
if e1 != 0 {
|
||||||
@ -1995,6 +1985,21 @@ func Utime(path string, buf *Utimbuf) (err error) {
|
|||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
func utimes(path string, times *[2]Timeval) (err error) {
|
||||||
|
var _p0 *byte
|
||||||
|
_p0, err = BytePtrFromString(path)
|
||||||
|
if err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
_, _, e1 := Syscall(SYS_UTIMES, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(times)), 0)
|
||||||
|
if e1 != 0 {
|
||||||
|
err = errnoErr(e1)
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
func poll(fds *PollFd, nfds int, timeout int) (n int, err error) {
|
func poll(fds *PollFd, nfds int, timeout int) (n int, err error) {
|
||||||
r0, _, e1 := Syscall(SYS_POLL, uintptr(unsafe.Pointer(fds)), uintptr(nfds), uintptr(timeout))
|
r0, _, e1 := Syscall(SYS_POLL, uintptr(unsafe.Pointer(fds)), uintptr(nfds), uintptr(timeout))
|
||||||
n = int(r0)
|
n = int(r0)
|
||||||
|
127
vendor/golang.org/x/sys/unix/zsyscall_linux_amd64.go
generated
vendored
127
vendor/golang.org/x/sys/unix/zsyscall_linux_amd64.go
generated
vendored
@ -143,21 +143,6 @@ func Unlinkat(dirfd int, path string, flags int) (err error) {
|
|||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
func utimes(path string, times *[2]Timeval) (err error) {
|
|
||||||
var _p0 *byte
|
|
||||||
_p0, err = BytePtrFromString(path)
|
|
||||||
if err != nil {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
_, _, e1 := Syscall(SYS_UTIMES, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(times)), 0)
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func utimensat(dirfd int, path string, times *[2]Timespec, flags int) (err error) {
|
func utimensat(dirfd int, path string, times *[2]Timespec, flags int) (err error) {
|
||||||
var _p0 *byte
|
var _p0 *byte
|
||||||
_p0, err = BytePtrFromString(path)
|
_p0, err = BytePtrFromString(path)
|
||||||
@ -173,16 +158,6 @@ func utimensat(dirfd int, path string, times *[2]Timespec, flags int) (err error
|
|||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
func futimesat(dirfd int, path *byte, times *[2]Timeval) (err error) {
|
|
||||||
_, _, e1 := Syscall(SYS_FUTIMESAT, uintptr(dirfd), uintptr(unsafe.Pointer(path)), uintptr(unsafe.Pointer(times)))
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func Getcwd(buf []byte) (n int, err error) {
|
func Getcwd(buf []byte) (n int, err error) {
|
||||||
var _p0 unsafe.Pointer
|
var _p0 unsafe.Pointer
|
||||||
if len(buf) > 0 {
|
if len(buf) > 0 {
|
||||||
@ -494,17 +469,6 @@ func Dup3(oldfd int, newfd int, flags int) (err error) {
|
|||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
func EpollCreate(size int) (fd int, err error) {
|
|
||||||
r0, _, e1 := RawSyscall(SYS_EPOLL_CREATE, uintptr(size), 0, 0)
|
|
||||||
fd = int(r0)
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func EpollCreate1(flag int) (fd int, err error) {
|
func EpollCreate1(flag int) (fd int, err error) {
|
||||||
r0, _, e1 := RawSyscall(SYS_EPOLL_CREATE1, uintptr(flag), 0, 0)
|
r0, _, e1 := RawSyscall(SYS_EPOLL_CREATE1, uintptr(flag), 0, 0)
|
||||||
fd = int(r0)
|
fd = int(r0)
|
||||||
@ -544,21 +508,6 @@ func Exit(code int) {
|
|||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
func Faccessat(dirfd int, path string, mode uint32, flags int) (err error) {
|
|
||||||
var _p0 *byte
|
|
||||||
_p0, err = BytePtrFromString(path)
|
|
||||||
if err != nil {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
_, _, e1 := Syscall6(SYS_FACCESSAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(flags), 0, 0)
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func Fallocate(fd int, mode uint32, off int64, len int64) (err error) {
|
func Fallocate(fd int, mode uint32, off int64, len int64) (err error) {
|
||||||
_, _, e1 := Syscall6(SYS_FALLOCATE, uintptr(fd), uintptr(mode), uintptr(off), uintptr(len), 0, 0)
|
_, _, e1 := Syscall6(SYS_FALLOCATE, uintptr(fd), uintptr(mode), uintptr(off), uintptr(len), 0, 0)
|
||||||
if e1 != 0 {
|
if e1 != 0 {
|
||||||
@ -1366,16 +1315,6 @@ func Unshare(flags int) (err error) {
|
|||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
func Ustat(dev int, ubuf *Ustat_t) (err error) {
|
|
||||||
_, _, e1 := Syscall(SYS_USTAT, uintptr(dev), uintptr(unsafe.Pointer(ubuf)), 0)
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func write(fd int, p []byte) (n int, err error) {
|
func write(fd int, p []byte) (n int, err error) {
|
||||||
var _p0 unsafe.Pointer
|
var _p0 unsafe.Pointer
|
||||||
if len(p) > 0 {
|
if len(p) > 0 {
|
||||||
@ -1535,6 +1474,21 @@ func Munlockall() (err error) {
|
|||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
func faccessat(dirfd int, path string, mode uint32) (err error) {
|
||||||
|
var _p0 *byte
|
||||||
|
_p0, err = BytePtrFromString(path)
|
||||||
|
if err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
_, _, e1 := Syscall(SYS_FACCESSAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode))
|
||||||
|
if e1 != 0 {
|
||||||
|
err = errnoErr(e1)
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
func Dup2(oldfd int, newfd int) (err error) {
|
func Dup2(oldfd int, newfd int) (err error) {
|
||||||
_, _, e1 := Syscall(SYS_DUP2, uintptr(oldfd), uintptr(newfd), 0)
|
_, _, e1 := Syscall(SYS_DUP2, uintptr(oldfd), uintptr(newfd), 0)
|
||||||
if e1 != 0 {
|
if e1 != 0 {
|
||||||
@ -1545,6 +1499,17 @@ func Dup2(oldfd int, newfd int) (err error) {
|
|||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
func EpollCreate(size int) (fd int, err error) {
|
||||||
|
r0, _, e1 := RawSyscall(SYS_EPOLL_CREATE, uintptr(size), 0, 0)
|
||||||
|
fd = int(r0)
|
||||||
|
if e1 != 0 {
|
||||||
|
err = errnoErr(e1)
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
func EpollWait(epfd int, events []EpollEvent, msec int) (n int, err error) {
|
func EpollWait(epfd int, events []EpollEvent, msec int) (n int, err error) {
|
||||||
var _p0 unsafe.Pointer
|
var _p0 unsafe.Pointer
|
||||||
if len(events) > 0 {
|
if len(events) > 0 {
|
||||||
@ -1937,6 +1902,16 @@ func Truncate(path string, length int64) (err error) {
|
|||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
func Ustat(dev int, ubuf *Ustat_t) (err error) {
|
||||||
|
_, _, e1 := Syscall(SYS_USTAT, uintptr(dev), uintptr(unsafe.Pointer(ubuf)), 0)
|
||||||
|
if e1 != 0 {
|
||||||
|
err = errnoErr(e1)
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
func accept(s int, rsa *RawSockaddrAny, addrlen *_Socklen) (fd int, err error) {
|
func accept(s int, rsa *RawSockaddrAny, addrlen *_Socklen) (fd int, err error) {
|
||||||
r0, _, e1 := Syscall(SYS_ACCEPT, uintptr(s), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen)))
|
r0, _, e1 := Syscall(SYS_ACCEPT, uintptr(s), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen)))
|
||||||
fd = int(r0)
|
fd = int(r0)
|
||||||
@ -2127,6 +2102,21 @@ func mmap(addr uintptr, length uintptr, prot int, flags int, fd int, offset int6
|
|||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
func futimesat(dirfd int, path string, times *[2]Timeval) (err error) {
|
||||||
|
var _p0 *byte
|
||||||
|
_p0, err = BytePtrFromString(path)
|
||||||
|
if err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
_, _, e1 := Syscall(SYS_FUTIMESAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(times)))
|
||||||
|
if e1 != 0 {
|
||||||
|
err = errnoErr(e1)
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
func Utime(path string, buf *Utimbuf) (err error) {
|
func Utime(path string, buf *Utimbuf) (err error) {
|
||||||
var _p0 *byte
|
var _p0 *byte
|
||||||
_p0, err = BytePtrFromString(path)
|
_p0, err = BytePtrFromString(path)
|
||||||
@ -2142,6 +2132,21 @@ func Utime(path string, buf *Utimbuf) (err error) {
|
|||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
func utimes(path string, times *[2]Timeval) (err error) {
|
||||||
|
var _p0 *byte
|
||||||
|
_p0, err = BytePtrFromString(path)
|
||||||
|
if err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
_, _, e1 := Syscall(SYS_UTIMES, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(times)), 0)
|
||||||
|
if e1 != 0 {
|
||||||
|
err = errnoErr(e1)
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
func pipe(p *[2]_C_int) (err error) {
|
func pipe(p *[2]_C_int) (err error) {
|
||||||
_, _, e1 := RawSyscall(SYS_PIPE, uintptr(unsafe.Pointer(p)), 0, 0)
|
_, _, e1 := RawSyscall(SYS_PIPE, uintptr(unsafe.Pointer(p)), 0, 0)
|
||||||
if e1 != 0 {
|
if e1 != 0 {
|
||||||
|
161
vendor/golang.org/x/sys/unix/zsyscall_linux_arm.go
generated
vendored
161
vendor/golang.org/x/sys/unix/zsyscall_linux_arm.go
generated
vendored
@ -143,21 +143,6 @@ func Unlinkat(dirfd int, path string, flags int) (err error) {
|
|||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
func utimes(path string, times *[2]Timeval) (err error) {
|
|
||||||
var _p0 *byte
|
|
||||||
_p0, err = BytePtrFromString(path)
|
|
||||||
if err != nil {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
_, _, e1 := Syscall(SYS_UTIMES, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(times)), 0)
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func utimensat(dirfd int, path string, times *[2]Timespec, flags int) (err error) {
|
func utimensat(dirfd int, path string, times *[2]Timespec, flags int) (err error) {
|
||||||
var _p0 *byte
|
var _p0 *byte
|
||||||
_p0, err = BytePtrFromString(path)
|
_p0, err = BytePtrFromString(path)
|
||||||
@ -173,16 +158,6 @@ func utimensat(dirfd int, path string, times *[2]Timespec, flags int) (err error
|
|||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
func futimesat(dirfd int, path *byte, times *[2]Timeval) (err error) {
|
|
||||||
_, _, e1 := Syscall(SYS_FUTIMESAT, uintptr(dirfd), uintptr(unsafe.Pointer(path)), uintptr(unsafe.Pointer(times)))
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func Getcwd(buf []byte) (n int, err error) {
|
func Getcwd(buf []byte) (n int, err error) {
|
||||||
var _p0 unsafe.Pointer
|
var _p0 unsafe.Pointer
|
||||||
if len(buf) > 0 {
|
if len(buf) > 0 {
|
||||||
@ -494,17 +469,6 @@ func Dup3(oldfd int, newfd int, flags int) (err error) {
|
|||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
func EpollCreate(size int) (fd int, err error) {
|
|
||||||
r0, _, e1 := RawSyscall(SYS_EPOLL_CREATE, uintptr(size), 0, 0)
|
|
||||||
fd = int(r0)
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func EpollCreate1(flag int) (fd int, err error) {
|
func EpollCreate1(flag int) (fd int, err error) {
|
||||||
r0, _, e1 := RawSyscall(SYS_EPOLL_CREATE1, uintptr(flag), 0, 0)
|
r0, _, e1 := RawSyscall(SYS_EPOLL_CREATE1, uintptr(flag), 0, 0)
|
||||||
fd = int(r0)
|
fd = int(r0)
|
||||||
@ -544,21 +508,6 @@ func Exit(code int) {
|
|||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
func Faccessat(dirfd int, path string, mode uint32, flags int) (err error) {
|
|
||||||
var _p0 *byte
|
|
||||||
_p0, err = BytePtrFromString(path)
|
|
||||||
if err != nil {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
_, _, e1 := Syscall6(SYS_FACCESSAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(flags), 0, 0)
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func Fallocate(fd int, mode uint32, off int64, len int64) (err error) {
|
func Fallocate(fd int, mode uint32, off int64, len int64) (err error) {
|
||||||
_, _, e1 := Syscall6(SYS_FALLOCATE, uintptr(fd), uintptr(mode), uintptr(off), uintptr(off>>32), uintptr(len), uintptr(len>>32))
|
_, _, e1 := Syscall6(SYS_FALLOCATE, uintptr(fd), uintptr(mode), uintptr(off), uintptr(off>>32), uintptr(len), uintptr(len>>32))
|
||||||
if e1 != 0 {
|
if e1 != 0 {
|
||||||
@ -1366,16 +1315,6 @@ func Unshare(flags int) (err error) {
|
|||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
func Ustat(dev int, ubuf *Ustat_t) (err error) {
|
|
||||||
_, _, e1 := Syscall(SYS_USTAT, uintptr(dev), uintptr(unsafe.Pointer(ubuf)), 0)
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func write(fd int, p []byte) (n int, err error) {
|
func write(fd int, p []byte) (n int, err error) {
|
||||||
var _p0 unsafe.Pointer
|
var _p0 unsafe.Pointer
|
||||||
if len(p) > 0 {
|
if len(p) > 0 {
|
||||||
@ -1535,6 +1474,21 @@ func Munlockall() (err error) {
|
|||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
func faccessat(dirfd int, path string, mode uint32) (err error) {
|
||||||
|
var _p0 *byte
|
||||||
|
_p0, err = BytePtrFromString(path)
|
||||||
|
if err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
_, _, e1 := Syscall(SYS_FACCESSAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode))
|
||||||
|
if e1 != 0 {
|
||||||
|
err = errnoErr(e1)
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
func pipe2(p *[2]_C_int, flags int) (err error) {
|
func pipe2(p *[2]_C_int, flags int) (err error) {
|
||||||
_, _, e1 := RawSyscall(SYS_PIPE2, uintptr(unsafe.Pointer(p)), uintptr(flags), 0)
|
_, _, e1 := RawSyscall(SYS_PIPE2, uintptr(unsafe.Pointer(p)), uintptr(flags), 0)
|
||||||
if e1 != 0 {
|
if e1 != 0 {
|
||||||
@ -1734,6 +1688,34 @@ func Dup2(oldfd int, newfd int) (err error) {
|
|||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
func EpollCreate(size int) (fd int, err error) {
|
||||||
|
r0, _, e1 := RawSyscall(SYS_EPOLL_CREATE, uintptr(size), 0, 0)
|
||||||
|
fd = int(r0)
|
||||||
|
if e1 != 0 {
|
||||||
|
err = errnoErr(e1)
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
func EpollWait(epfd int, events []EpollEvent, msec int) (n int, err error) {
|
||||||
|
var _p0 unsafe.Pointer
|
||||||
|
if len(events) > 0 {
|
||||||
|
_p0 = unsafe.Pointer(&events[0])
|
||||||
|
} else {
|
||||||
|
_p0 = unsafe.Pointer(&_zero)
|
||||||
|
}
|
||||||
|
r0, _, e1 := Syscall6(SYS_EPOLL_WAIT, uintptr(epfd), uintptr(_p0), uintptr(len(events)), uintptr(msec), 0, 0)
|
||||||
|
n = int(r0)
|
||||||
|
if e1 != 0 {
|
||||||
|
err = errnoErr(e1)
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
func Fchown(fd int, uid int, gid int) (err error) {
|
func Fchown(fd int, uid int, gid int) (err error) {
|
||||||
_, _, e1 := Syscall(SYS_FCHOWN32, uintptr(fd), uintptr(uid), uintptr(gid))
|
_, _, e1 := Syscall(SYS_FCHOWN32, uintptr(fd), uintptr(uid), uintptr(gid))
|
||||||
if e1 != 0 {
|
if e1 != 0 {
|
||||||
@ -1852,6 +1834,16 @@ func Lstat(path string, stat *Stat_t) (err error) {
|
|||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
func Pause() (err error) {
|
||||||
|
_, _, e1 := Syscall(SYS_PAUSE, 0, 0, 0)
|
||||||
|
if e1 != 0 {
|
||||||
|
err = errnoErr(e1)
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
func sendfile(outfd int, infd int, offset *int64, count int) (written int, err error) {
|
func sendfile(outfd int, infd int, offset *int64, count int) (written int, err error) {
|
||||||
r0, _, e1 := Syscall6(SYS_SENDFILE64, uintptr(outfd), uintptr(infd), uintptr(unsafe.Pointer(offset)), uintptr(count), 0, 0)
|
r0, _, e1 := Syscall6(SYS_SENDFILE64, uintptr(outfd), uintptr(infd), uintptr(unsafe.Pointer(offset)), uintptr(count), 0, 0)
|
||||||
written = int(r0)
|
written = int(r0)
|
||||||
@ -1970,6 +1962,31 @@ func Stat(path string, stat *Stat_t) (err error) {
|
|||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
func Ustat(dev int, ubuf *Ustat_t) (err error) {
|
||||||
|
_, _, e1 := Syscall(SYS_USTAT, uintptr(dev), uintptr(unsafe.Pointer(ubuf)), 0)
|
||||||
|
if e1 != 0 {
|
||||||
|
err = errnoErr(e1)
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
func futimesat(dirfd int, path string, times *[2]Timeval) (err error) {
|
||||||
|
var _p0 *byte
|
||||||
|
_p0, err = BytePtrFromString(path)
|
||||||
|
if err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
_, _, e1 := Syscall(SYS_FUTIMESAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(times)))
|
||||||
|
if e1 != 0 {
|
||||||
|
err = errnoErr(e1)
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
func Gettimeofday(tv *Timeval) (err error) {
|
func Gettimeofday(tv *Timeval) (err error) {
|
||||||
_, _, e1 := RawSyscall(SYS_GETTIMEOFDAY, uintptr(unsafe.Pointer(tv)), 0, 0)
|
_, _, e1 := RawSyscall(SYS_GETTIMEOFDAY, uintptr(unsafe.Pointer(tv)), 0, 0)
|
||||||
if e1 != 0 {
|
if e1 != 0 {
|
||||||
@ -1980,25 +1997,13 @@ func Gettimeofday(tv *Timeval) (err error) {
|
|||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
func EpollWait(epfd int, events []EpollEvent, msec int) (n int, err error) {
|
func utimes(path string, times *[2]Timeval) (err error) {
|
||||||
var _p0 unsafe.Pointer
|
var _p0 *byte
|
||||||
if len(events) > 0 {
|
_p0, err = BytePtrFromString(path)
|
||||||
_p0 = unsafe.Pointer(&events[0])
|
if err != nil {
|
||||||
} else {
|
|
||||||
_p0 = unsafe.Pointer(&_zero)
|
|
||||||
}
|
|
||||||
r0, _, e1 := Syscall6(SYS_EPOLL_WAIT, uintptr(epfd), uintptr(_p0), uintptr(len(events)), uintptr(msec), 0, 0)
|
|
||||||
n = int(r0)
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
_, _, e1 := Syscall(SYS_UTIMES, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(times)), 0)
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func Pause() (err error) {
|
|
||||||
_, _, e1 := Syscall(SYS_PAUSE, 0, 0, 0)
|
|
||||||
if e1 != 0 {
|
if e1 != 0 {
|
||||||
err = errnoErr(e1)
|
err = errnoErr(e1)
|
||||||
}
|
}
|
||||||
|
76
vendor/golang.org/x/sys/unix/zsyscall_linux_arm64.go
generated
vendored
76
vendor/golang.org/x/sys/unix/zsyscall_linux_arm64.go
generated
vendored
@ -143,21 +143,6 @@ func Unlinkat(dirfd int, path string, flags int) (err error) {
|
|||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
func utimes(path string, times *[2]Timeval) (err error) {
|
|
||||||
var _p0 *byte
|
|
||||||
_p0, err = BytePtrFromString(path)
|
|
||||||
if err != nil {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
_, _, e1 := Syscall(SYS_UTIMES, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(times)), 0)
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func utimensat(dirfd int, path string, times *[2]Timespec, flags int) (err error) {
|
func utimensat(dirfd int, path string, times *[2]Timespec, flags int) (err error) {
|
||||||
var _p0 *byte
|
var _p0 *byte
|
||||||
_p0, err = BytePtrFromString(path)
|
_p0, err = BytePtrFromString(path)
|
||||||
@ -173,16 +158,6 @@ func utimensat(dirfd int, path string, times *[2]Timespec, flags int) (err error
|
|||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
func futimesat(dirfd int, path *byte, times *[2]Timeval) (err error) {
|
|
||||||
_, _, e1 := Syscall(SYS_FUTIMESAT, uintptr(dirfd), uintptr(unsafe.Pointer(path)), uintptr(unsafe.Pointer(times)))
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func Getcwd(buf []byte) (n int, err error) {
|
func Getcwd(buf []byte) (n int, err error) {
|
||||||
var _p0 unsafe.Pointer
|
var _p0 unsafe.Pointer
|
||||||
if len(buf) > 0 {
|
if len(buf) > 0 {
|
||||||
@ -494,17 +469,6 @@ func Dup3(oldfd int, newfd int, flags int) (err error) {
|
|||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
func EpollCreate(size int) (fd int, err error) {
|
|
||||||
r0, _, e1 := RawSyscall(SYS_EPOLL_CREATE, uintptr(size), 0, 0)
|
|
||||||
fd = int(r0)
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func EpollCreate1(flag int) (fd int, err error) {
|
func EpollCreate1(flag int) (fd int, err error) {
|
||||||
r0, _, e1 := RawSyscall(SYS_EPOLL_CREATE1, uintptr(flag), 0, 0)
|
r0, _, e1 := RawSyscall(SYS_EPOLL_CREATE1, uintptr(flag), 0, 0)
|
||||||
fd = int(r0)
|
fd = int(r0)
|
||||||
@ -544,21 +508,6 @@ func Exit(code int) {
|
|||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
func Faccessat(dirfd int, path string, mode uint32, flags int) (err error) {
|
|
||||||
var _p0 *byte
|
|
||||||
_p0, err = BytePtrFromString(path)
|
|
||||||
if err != nil {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
_, _, e1 := Syscall6(SYS_FACCESSAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(flags), 0, 0)
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func Fallocate(fd int, mode uint32, off int64, len int64) (err error) {
|
func Fallocate(fd int, mode uint32, off int64, len int64) (err error) {
|
||||||
_, _, e1 := Syscall6(SYS_FALLOCATE, uintptr(fd), uintptr(mode), uintptr(off), uintptr(len), 0, 0)
|
_, _, e1 := Syscall6(SYS_FALLOCATE, uintptr(fd), uintptr(mode), uintptr(off), uintptr(len), 0, 0)
|
||||||
if e1 != 0 {
|
if e1 != 0 {
|
||||||
@ -1366,16 +1315,6 @@ func Unshare(flags int) (err error) {
|
|||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
func Ustat(dev int, ubuf *Ustat_t) (err error) {
|
|
||||||
_, _, e1 := Syscall(SYS_USTAT, uintptr(dev), uintptr(unsafe.Pointer(ubuf)), 0)
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func write(fd int, p []byte) (n int, err error) {
|
func write(fd int, p []byte) (n int, err error) {
|
||||||
var _p0 unsafe.Pointer
|
var _p0 unsafe.Pointer
|
||||||
if len(p) > 0 {
|
if len(p) > 0 {
|
||||||
@ -1535,6 +1474,21 @@ func Munlockall() (err error) {
|
|||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
func faccessat(dirfd int, path string, mode uint32) (err error) {
|
||||||
|
var _p0 *byte
|
||||||
|
_p0, err = BytePtrFromString(path)
|
||||||
|
if err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
_, _, e1 := Syscall(SYS_FACCESSAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode))
|
||||||
|
if e1 != 0 {
|
||||||
|
err = errnoErr(e1)
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
func EpollWait(epfd int, events []EpollEvent, msec int) (n int, err error) {
|
func EpollWait(epfd int, events []EpollEvent, msec int) (n int, err error) {
|
||||||
var _p0 unsafe.Pointer
|
var _p0 unsafe.Pointer
|
||||||
if len(events) > 0 {
|
if len(events) > 0 {
|
||||||
|
191
vendor/golang.org/x/sys/unix/zsyscall_linux_mips.go
generated
vendored
191
vendor/golang.org/x/sys/unix/zsyscall_linux_mips.go
generated
vendored
@ -143,21 +143,6 @@ func Unlinkat(dirfd int, path string, flags int) (err error) {
|
|||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
func utimes(path string, times *[2]Timeval) (err error) {
|
|
||||||
var _p0 *byte
|
|
||||||
_p0, err = BytePtrFromString(path)
|
|
||||||
if err != nil {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
_, _, e1 := Syscall(SYS_UTIMES, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(times)), 0)
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func utimensat(dirfd int, path string, times *[2]Timespec, flags int) (err error) {
|
func utimensat(dirfd int, path string, times *[2]Timespec, flags int) (err error) {
|
||||||
var _p0 *byte
|
var _p0 *byte
|
||||||
_p0, err = BytePtrFromString(path)
|
_p0, err = BytePtrFromString(path)
|
||||||
@ -173,16 +158,6 @@ func utimensat(dirfd int, path string, times *[2]Timespec, flags int) (err error
|
|||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
func futimesat(dirfd int, path *byte, times *[2]Timeval) (err error) {
|
|
||||||
_, _, e1 := Syscall(SYS_FUTIMESAT, uintptr(dirfd), uintptr(unsafe.Pointer(path)), uintptr(unsafe.Pointer(times)))
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func Getcwd(buf []byte) (n int, err error) {
|
func Getcwd(buf []byte) (n int, err error) {
|
||||||
var _p0 unsafe.Pointer
|
var _p0 unsafe.Pointer
|
||||||
if len(buf) > 0 {
|
if len(buf) > 0 {
|
||||||
@ -494,17 +469,6 @@ func Dup3(oldfd int, newfd int, flags int) (err error) {
|
|||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
func EpollCreate(size int) (fd int, err error) {
|
|
||||||
r0, _, e1 := RawSyscall(SYS_EPOLL_CREATE, uintptr(size), 0, 0)
|
|
||||||
fd = int(r0)
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func EpollCreate1(flag int) (fd int, err error) {
|
func EpollCreate1(flag int) (fd int, err error) {
|
||||||
r0, _, e1 := RawSyscall(SYS_EPOLL_CREATE1, uintptr(flag), 0, 0)
|
r0, _, e1 := RawSyscall(SYS_EPOLL_CREATE1, uintptr(flag), 0, 0)
|
||||||
fd = int(r0)
|
fd = int(r0)
|
||||||
@ -544,21 +508,6 @@ func Exit(code int) {
|
|||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
func Faccessat(dirfd int, path string, mode uint32, flags int) (err error) {
|
|
||||||
var _p0 *byte
|
|
||||||
_p0, err = BytePtrFromString(path)
|
|
||||||
if err != nil {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
_, _, e1 := Syscall6(SYS_FACCESSAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(flags), 0, 0)
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func Fallocate(fd int, mode uint32, off int64, len int64) (err error) {
|
func Fallocate(fd int, mode uint32, off int64, len int64) (err error) {
|
||||||
_, _, e1 := Syscall6(SYS_FALLOCATE, uintptr(fd), uintptr(mode), uintptr(off>>32), uintptr(off), uintptr(len>>32), uintptr(len))
|
_, _, e1 := Syscall6(SYS_FALLOCATE, uintptr(fd), uintptr(mode), uintptr(off>>32), uintptr(off), uintptr(len>>32), uintptr(len))
|
||||||
if e1 != 0 {
|
if e1 != 0 {
|
||||||
@ -1366,16 +1315,6 @@ func Unshare(flags int) (err error) {
|
|||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
func Ustat(dev int, ubuf *Ustat_t) (err error) {
|
|
||||||
_, _, e1 := Syscall(SYS_USTAT, uintptr(dev), uintptr(unsafe.Pointer(ubuf)), 0)
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func write(fd int, p []byte) (n int, err error) {
|
func write(fd int, p []byte) (n int, err error) {
|
||||||
var _p0 unsafe.Pointer
|
var _p0 unsafe.Pointer
|
||||||
if len(p) > 0 {
|
if len(p) > 0 {
|
||||||
@ -1535,6 +1474,21 @@ func Munlockall() (err error) {
|
|||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
func faccessat(dirfd int, path string, mode uint32) (err error) {
|
||||||
|
var _p0 *byte
|
||||||
|
_p0, err = BytePtrFromString(path)
|
||||||
|
if err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
_, _, e1 := Syscall(SYS_FACCESSAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode))
|
||||||
|
if e1 != 0 {
|
||||||
|
err = errnoErr(e1)
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
func Dup2(oldfd int, newfd int) (err error) {
|
func Dup2(oldfd int, newfd int) (err error) {
|
||||||
_, _, e1 := Syscall(SYS_DUP2, uintptr(oldfd), uintptr(newfd), 0)
|
_, _, e1 := Syscall(SYS_DUP2, uintptr(oldfd), uintptr(newfd), 0)
|
||||||
if e1 != 0 {
|
if e1 != 0 {
|
||||||
@ -1545,6 +1499,34 @@ func Dup2(oldfd int, newfd int) (err error) {
|
|||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
func EpollCreate(size int) (fd int, err error) {
|
||||||
|
r0, _, e1 := RawSyscall(SYS_EPOLL_CREATE, uintptr(size), 0, 0)
|
||||||
|
fd = int(r0)
|
||||||
|
if e1 != 0 {
|
||||||
|
err = errnoErr(e1)
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
func EpollWait(epfd int, events []EpollEvent, msec int) (n int, err error) {
|
||||||
|
var _p0 unsafe.Pointer
|
||||||
|
if len(events) > 0 {
|
||||||
|
_p0 = unsafe.Pointer(&events[0])
|
||||||
|
} else {
|
||||||
|
_p0 = unsafe.Pointer(&_zero)
|
||||||
|
}
|
||||||
|
r0, _, e1 := Syscall6(SYS_EPOLL_WAIT, uintptr(epfd), uintptr(_p0), uintptr(len(events)), uintptr(msec), 0, 0)
|
||||||
|
n = int(r0)
|
||||||
|
if e1 != 0 {
|
||||||
|
err = errnoErr(e1)
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
func Fadvise(fd int, offset int64, length int64, advice int) (err error) {
|
func Fadvise(fd int, offset int64, length int64, advice int) (err error) {
|
||||||
_, _, e1 := Syscall9(SYS_FADVISE64, uintptr(fd), 0, uintptr(offset>>32), uintptr(offset), uintptr(length>>32), uintptr(length), uintptr(advice), 0, 0)
|
_, _, e1 := Syscall9(SYS_FADVISE64, uintptr(fd), 0, uintptr(offset>>32), uintptr(offset), uintptr(length>>32), uintptr(length), uintptr(advice), 0, 0)
|
||||||
if e1 != 0 {
|
if e1 != 0 {
|
||||||
@ -1794,6 +1776,16 @@ func Truncate(path string, length int64) (err error) {
|
|||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
func Ustat(dev int, ubuf *Ustat_t) (err error) {
|
||||||
|
_, _, e1 := Syscall(SYS_USTAT, uintptr(dev), uintptr(unsafe.Pointer(ubuf)), 0)
|
||||||
|
if e1 != 0 {
|
||||||
|
err = errnoErr(e1)
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
func accept(s int, rsa *RawSockaddrAny, addrlen *_Socklen) (fd int, err error) {
|
func accept(s int, rsa *RawSockaddrAny, addrlen *_Socklen) (fd int, err error) {
|
||||||
r0, _, e1 := Syscall(SYS_ACCEPT, uintptr(s), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen)))
|
r0, _, e1 := Syscall(SYS_ACCEPT, uintptr(s), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen)))
|
||||||
fd = int(r0)
|
fd = int(r0)
|
||||||
@ -2004,6 +1996,21 @@ func Iopl(level int) (err error) {
|
|||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
func futimesat(dirfd int, path string, times *[2]Timeval) (err error) {
|
||||||
|
var _p0 *byte
|
||||||
|
_p0, err = BytePtrFromString(path)
|
||||||
|
if err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
_, _, e1 := Syscall(SYS_FUTIMESAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(times)))
|
||||||
|
if e1 != 0 {
|
||||||
|
err = errnoErr(e1)
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
func Gettimeofday(tv *Timeval) (err error) {
|
func Gettimeofday(tv *Timeval) (err error) {
|
||||||
_, _, e1 := RawSyscall(SYS_GETTIMEOFDAY, uintptr(unsafe.Pointer(tv)), 0, 0)
|
_, _, e1 := RawSyscall(SYS_GETTIMEOFDAY, uintptr(unsafe.Pointer(tv)), 0, 0)
|
||||||
if e1 != 0 {
|
if e1 != 0 {
|
||||||
@ -2025,6 +2032,36 @@ func Time(t *Time_t) (tt Time_t, err error) {
|
|||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
func Utime(path string, buf *Utimbuf) (err error) {
|
||||||
|
var _p0 *byte
|
||||||
|
_p0, err = BytePtrFromString(path)
|
||||||
|
if err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
_, _, e1 := Syscall(SYS_UTIME, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(buf)), 0)
|
||||||
|
if e1 != 0 {
|
||||||
|
err = errnoErr(e1)
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
func utimes(path string, times *[2]Timeval) (err error) {
|
||||||
|
var _p0 *byte
|
||||||
|
_p0, err = BytePtrFromString(path)
|
||||||
|
if err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
_, _, e1 := Syscall(SYS_UTIMES, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(times)), 0)
|
||||||
|
if e1 != 0 {
|
||||||
|
err = errnoErr(e1)
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
func Lstat(path string, stat *Stat_t) (err error) {
|
func Lstat(path string, stat *Stat_t) (err error) {
|
||||||
var _p0 *byte
|
var _p0 *byte
|
||||||
_p0, err = BytePtrFromString(path)
|
_p0, err = BytePtrFromString(path)
|
||||||
@ -2080,38 +2117,6 @@ func Stat(path string, stat *Stat_t) (err error) {
|
|||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
func Utime(path string, buf *Utimbuf) (err error) {
|
|
||||||
var _p0 *byte
|
|
||||||
_p0, err = BytePtrFromString(path)
|
|
||||||
if err != nil {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
_, _, e1 := Syscall(SYS_UTIME, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(buf)), 0)
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func EpollWait(epfd int, events []EpollEvent, msec int) (n int, err error) {
|
|
||||||
var _p0 unsafe.Pointer
|
|
||||||
if len(events) > 0 {
|
|
||||||
_p0 = unsafe.Pointer(&events[0])
|
|
||||||
} else {
|
|
||||||
_p0 = unsafe.Pointer(&_zero)
|
|
||||||
}
|
|
||||||
r0, _, e1 := Syscall6(SYS_EPOLL_WAIT, uintptr(epfd), uintptr(_p0), uintptr(len(events)), uintptr(msec), 0, 0)
|
|
||||||
n = int(r0)
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func Pause() (err error) {
|
func Pause() (err error) {
|
||||||
_, _, e1 := Syscall(SYS_PAUSE, 0, 0, 0)
|
_, _, e1 := Syscall(SYS_PAUSE, 0, 0, 0)
|
||||||
if e1 != 0 {
|
if e1 != 0 {
|
||||||
|
127
vendor/golang.org/x/sys/unix/zsyscall_linux_mips64.go
generated
vendored
127
vendor/golang.org/x/sys/unix/zsyscall_linux_mips64.go
generated
vendored
@ -143,21 +143,6 @@ func Unlinkat(dirfd int, path string, flags int) (err error) {
|
|||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
func utimes(path string, times *[2]Timeval) (err error) {
|
|
||||||
var _p0 *byte
|
|
||||||
_p0, err = BytePtrFromString(path)
|
|
||||||
if err != nil {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
_, _, e1 := Syscall(SYS_UTIMES, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(times)), 0)
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func utimensat(dirfd int, path string, times *[2]Timespec, flags int) (err error) {
|
func utimensat(dirfd int, path string, times *[2]Timespec, flags int) (err error) {
|
||||||
var _p0 *byte
|
var _p0 *byte
|
||||||
_p0, err = BytePtrFromString(path)
|
_p0, err = BytePtrFromString(path)
|
||||||
@ -173,16 +158,6 @@ func utimensat(dirfd int, path string, times *[2]Timespec, flags int) (err error
|
|||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
func futimesat(dirfd int, path *byte, times *[2]Timeval) (err error) {
|
|
||||||
_, _, e1 := Syscall(SYS_FUTIMESAT, uintptr(dirfd), uintptr(unsafe.Pointer(path)), uintptr(unsafe.Pointer(times)))
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func Getcwd(buf []byte) (n int, err error) {
|
func Getcwd(buf []byte) (n int, err error) {
|
||||||
var _p0 unsafe.Pointer
|
var _p0 unsafe.Pointer
|
||||||
if len(buf) > 0 {
|
if len(buf) > 0 {
|
||||||
@ -494,17 +469,6 @@ func Dup3(oldfd int, newfd int, flags int) (err error) {
|
|||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
func EpollCreate(size int) (fd int, err error) {
|
|
||||||
r0, _, e1 := RawSyscall(SYS_EPOLL_CREATE, uintptr(size), 0, 0)
|
|
||||||
fd = int(r0)
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func EpollCreate1(flag int) (fd int, err error) {
|
func EpollCreate1(flag int) (fd int, err error) {
|
||||||
r0, _, e1 := RawSyscall(SYS_EPOLL_CREATE1, uintptr(flag), 0, 0)
|
r0, _, e1 := RawSyscall(SYS_EPOLL_CREATE1, uintptr(flag), 0, 0)
|
||||||
fd = int(r0)
|
fd = int(r0)
|
||||||
@ -544,21 +508,6 @@ func Exit(code int) {
|
|||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
func Faccessat(dirfd int, path string, mode uint32, flags int) (err error) {
|
|
||||||
var _p0 *byte
|
|
||||||
_p0, err = BytePtrFromString(path)
|
|
||||||
if err != nil {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
_, _, e1 := Syscall6(SYS_FACCESSAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(flags), 0, 0)
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func Fallocate(fd int, mode uint32, off int64, len int64) (err error) {
|
func Fallocate(fd int, mode uint32, off int64, len int64) (err error) {
|
||||||
_, _, e1 := Syscall6(SYS_FALLOCATE, uintptr(fd), uintptr(mode), uintptr(off), uintptr(len), 0, 0)
|
_, _, e1 := Syscall6(SYS_FALLOCATE, uintptr(fd), uintptr(mode), uintptr(off), uintptr(len), 0, 0)
|
||||||
if e1 != 0 {
|
if e1 != 0 {
|
||||||
@ -1366,16 +1315,6 @@ func Unshare(flags int) (err error) {
|
|||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
func Ustat(dev int, ubuf *Ustat_t) (err error) {
|
|
||||||
_, _, e1 := Syscall(SYS_USTAT, uintptr(dev), uintptr(unsafe.Pointer(ubuf)), 0)
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func write(fd int, p []byte) (n int, err error) {
|
func write(fd int, p []byte) (n int, err error) {
|
||||||
var _p0 unsafe.Pointer
|
var _p0 unsafe.Pointer
|
||||||
if len(p) > 0 {
|
if len(p) > 0 {
|
||||||
@ -1535,6 +1474,21 @@ func Munlockall() (err error) {
|
|||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
func faccessat(dirfd int, path string, mode uint32) (err error) {
|
||||||
|
var _p0 *byte
|
||||||
|
_p0, err = BytePtrFromString(path)
|
||||||
|
if err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
_, _, e1 := Syscall(SYS_FACCESSAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode))
|
||||||
|
if e1 != 0 {
|
||||||
|
err = errnoErr(e1)
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
func Dup2(oldfd int, newfd int) (err error) {
|
func Dup2(oldfd int, newfd int) (err error) {
|
||||||
_, _, e1 := Syscall(SYS_DUP2, uintptr(oldfd), uintptr(newfd), 0)
|
_, _, e1 := Syscall(SYS_DUP2, uintptr(oldfd), uintptr(newfd), 0)
|
||||||
if e1 != 0 {
|
if e1 != 0 {
|
||||||
@ -1545,6 +1499,17 @@ func Dup2(oldfd int, newfd int) (err error) {
|
|||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
func EpollCreate(size int) (fd int, err error) {
|
||||||
|
r0, _, e1 := RawSyscall(SYS_EPOLL_CREATE, uintptr(size), 0, 0)
|
||||||
|
fd = int(r0)
|
||||||
|
if e1 != 0 {
|
||||||
|
err = errnoErr(e1)
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
func EpollWait(epfd int, events []EpollEvent, msec int) (n int, err error) {
|
func EpollWait(epfd int, events []EpollEvent, msec int) (n int, err error) {
|
||||||
var _p0 unsafe.Pointer
|
var _p0 unsafe.Pointer
|
||||||
if len(events) > 0 {
|
if len(events) > 0 {
|
||||||
@ -1881,6 +1846,16 @@ func Truncate(path string, length int64) (err error) {
|
|||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
func Ustat(dev int, ubuf *Ustat_t) (err error) {
|
||||||
|
_, _, e1 := Syscall(SYS_USTAT, uintptr(dev), uintptr(unsafe.Pointer(ubuf)), 0)
|
||||||
|
if e1 != 0 {
|
||||||
|
err = errnoErr(e1)
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
func accept(s int, rsa *RawSockaddrAny, addrlen *_Socklen) (fd int, err error) {
|
func accept(s int, rsa *RawSockaddrAny, addrlen *_Socklen) (fd int, err error) {
|
||||||
r0, _, e1 := Syscall(SYS_ACCEPT, uintptr(s), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen)))
|
r0, _, e1 := Syscall(SYS_ACCEPT, uintptr(s), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen)))
|
||||||
fd = int(r0)
|
fd = int(r0)
|
||||||
@ -2071,6 +2046,21 @@ func mmap(addr uintptr, length uintptr, prot int, flags int, fd int, offset int6
|
|||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
func futimesat(dirfd int, path string, times *[2]Timeval) (err error) {
|
||||||
|
var _p0 *byte
|
||||||
|
_p0, err = BytePtrFromString(path)
|
||||||
|
if err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
_, _, e1 := Syscall(SYS_FUTIMESAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(times)))
|
||||||
|
if e1 != 0 {
|
||||||
|
err = errnoErr(e1)
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
func Gettimeofday(tv *Timeval) (err error) {
|
func Gettimeofday(tv *Timeval) (err error) {
|
||||||
_, _, e1 := RawSyscall(SYS_GETTIMEOFDAY, uintptr(unsafe.Pointer(tv)), 0, 0)
|
_, _, e1 := RawSyscall(SYS_GETTIMEOFDAY, uintptr(unsafe.Pointer(tv)), 0, 0)
|
||||||
if e1 != 0 {
|
if e1 != 0 {
|
||||||
@ -2096,6 +2086,21 @@ func Utime(path string, buf *Utimbuf) (err error) {
|
|||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
func utimes(path string, times *[2]Timeval) (err error) {
|
||||||
|
var _p0 *byte
|
||||||
|
_p0, err = BytePtrFromString(path)
|
||||||
|
if err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
_, _, e1 := Syscall(SYS_UTIMES, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(times)), 0)
|
||||||
|
if e1 != 0 {
|
||||||
|
err = errnoErr(e1)
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
func pipe2(p *[2]_C_int, flags int) (err error) {
|
func pipe2(p *[2]_C_int, flags int) (err error) {
|
||||||
_, _, e1 := RawSyscall(SYS_PIPE2, uintptr(unsafe.Pointer(p)), uintptr(flags), 0)
|
_, _, e1 := RawSyscall(SYS_PIPE2, uintptr(unsafe.Pointer(p)), uintptr(flags), 0)
|
||||||
if e1 != 0 {
|
if e1 != 0 {
|
||||||
|
127
vendor/golang.org/x/sys/unix/zsyscall_linux_mips64le.go
generated
vendored
127
vendor/golang.org/x/sys/unix/zsyscall_linux_mips64le.go
generated
vendored
@ -143,21 +143,6 @@ func Unlinkat(dirfd int, path string, flags int) (err error) {
|
|||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
func utimes(path string, times *[2]Timeval) (err error) {
|
|
||||||
var _p0 *byte
|
|
||||||
_p0, err = BytePtrFromString(path)
|
|
||||||
if err != nil {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
_, _, e1 := Syscall(SYS_UTIMES, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(times)), 0)
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func utimensat(dirfd int, path string, times *[2]Timespec, flags int) (err error) {
|
func utimensat(dirfd int, path string, times *[2]Timespec, flags int) (err error) {
|
||||||
var _p0 *byte
|
var _p0 *byte
|
||||||
_p0, err = BytePtrFromString(path)
|
_p0, err = BytePtrFromString(path)
|
||||||
@ -173,16 +158,6 @@ func utimensat(dirfd int, path string, times *[2]Timespec, flags int) (err error
|
|||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
func futimesat(dirfd int, path *byte, times *[2]Timeval) (err error) {
|
|
||||||
_, _, e1 := Syscall(SYS_FUTIMESAT, uintptr(dirfd), uintptr(unsafe.Pointer(path)), uintptr(unsafe.Pointer(times)))
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func Getcwd(buf []byte) (n int, err error) {
|
func Getcwd(buf []byte) (n int, err error) {
|
||||||
var _p0 unsafe.Pointer
|
var _p0 unsafe.Pointer
|
||||||
if len(buf) > 0 {
|
if len(buf) > 0 {
|
||||||
@ -494,17 +469,6 @@ func Dup3(oldfd int, newfd int, flags int) (err error) {
|
|||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
func EpollCreate(size int) (fd int, err error) {
|
|
||||||
r0, _, e1 := RawSyscall(SYS_EPOLL_CREATE, uintptr(size), 0, 0)
|
|
||||||
fd = int(r0)
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func EpollCreate1(flag int) (fd int, err error) {
|
func EpollCreate1(flag int) (fd int, err error) {
|
||||||
r0, _, e1 := RawSyscall(SYS_EPOLL_CREATE1, uintptr(flag), 0, 0)
|
r0, _, e1 := RawSyscall(SYS_EPOLL_CREATE1, uintptr(flag), 0, 0)
|
||||||
fd = int(r0)
|
fd = int(r0)
|
||||||
@ -544,21 +508,6 @@ func Exit(code int) {
|
|||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
func Faccessat(dirfd int, path string, mode uint32, flags int) (err error) {
|
|
||||||
var _p0 *byte
|
|
||||||
_p0, err = BytePtrFromString(path)
|
|
||||||
if err != nil {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
_, _, e1 := Syscall6(SYS_FACCESSAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(flags), 0, 0)
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func Fallocate(fd int, mode uint32, off int64, len int64) (err error) {
|
func Fallocate(fd int, mode uint32, off int64, len int64) (err error) {
|
||||||
_, _, e1 := Syscall6(SYS_FALLOCATE, uintptr(fd), uintptr(mode), uintptr(off), uintptr(len), 0, 0)
|
_, _, e1 := Syscall6(SYS_FALLOCATE, uintptr(fd), uintptr(mode), uintptr(off), uintptr(len), 0, 0)
|
||||||
if e1 != 0 {
|
if e1 != 0 {
|
||||||
@ -1366,16 +1315,6 @@ func Unshare(flags int) (err error) {
|
|||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
func Ustat(dev int, ubuf *Ustat_t) (err error) {
|
|
||||||
_, _, e1 := Syscall(SYS_USTAT, uintptr(dev), uintptr(unsafe.Pointer(ubuf)), 0)
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func write(fd int, p []byte) (n int, err error) {
|
func write(fd int, p []byte) (n int, err error) {
|
||||||
var _p0 unsafe.Pointer
|
var _p0 unsafe.Pointer
|
||||||
if len(p) > 0 {
|
if len(p) > 0 {
|
||||||
@ -1535,6 +1474,21 @@ func Munlockall() (err error) {
|
|||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
func faccessat(dirfd int, path string, mode uint32) (err error) {
|
||||||
|
var _p0 *byte
|
||||||
|
_p0, err = BytePtrFromString(path)
|
||||||
|
if err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
_, _, e1 := Syscall(SYS_FACCESSAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode))
|
||||||
|
if e1 != 0 {
|
||||||
|
err = errnoErr(e1)
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
func Dup2(oldfd int, newfd int) (err error) {
|
func Dup2(oldfd int, newfd int) (err error) {
|
||||||
_, _, e1 := Syscall(SYS_DUP2, uintptr(oldfd), uintptr(newfd), 0)
|
_, _, e1 := Syscall(SYS_DUP2, uintptr(oldfd), uintptr(newfd), 0)
|
||||||
if e1 != 0 {
|
if e1 != 0 {
|
||||||
@ -1545,6 +1499,17 @@ func Dup2(oldfd int, newfd int) (err error) {
|
|||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
func EpollCreate(size int) (fd int, err error) {
|
||||||
|
r0, _, e1 := RawSyscall(SYS_EPOLL_CREATE, uintptr(size), 0, 0)
|
||||||
|
fd = int(r0)
|
||||||
|
if e1 != 0 {
|
||||||
|
err = errnoErr(e1)
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
func EpollWait(epfd int, events []EpollEvent, msec int) (n int, err error) {
|
func EpollWait(epfd int, events []EpollEvent, msec int) (n int, err error) {
|
||||||
var _p0 unsafe.Pointer
|
var _p0 unsafe.Pointer
|
||||||
if len(events) > 0 {
|
if len(events) > 0 {
|
||||||
@ -1881,6 +1846,16 @@ func Truncate(path string, length int64) (err error) {
|
|||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
func Ustat(dev int, ubuf *Ustat_t) (err error) {
|
||||||
|
_, _, e1 := Syscall(SYS_USTAT, uintptr(dev), uintptr(unsafe.Pointer(ubuf)), 0)
|
||||||
|
if e1 != 0 {
|
||||||
|
err = errnoErr(e1)
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
func accept(s int, rsa *RawSockaddrAny, addrlen *_Socklen) (fd int, err error) {
|
func accept(s int, rsa *RawSockaddrAny, addrlen *_Socklen) (fd int, err error) {
|
||||||
r0, _, e1 := Syscall(SYS_ACCEPT, uintptr(s), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen)))
|
r0, _, e1 := Syscall(SYS_ACCEPT, uintptr(s), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen)))
|
||||||
fd = int(r0)
|
fd = int(r0)
|
||||||
@ -2071,6 +2046,21 @@ func mmap(addr uintptr, length uintptr, prot int, flags int, fd int, offset int6
|
|||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
func futimesat(dirfd int, path string, times *[2]Timeval) (err error) {
|
||||||
|
var _p0 *byte
|
||||||
|
_p0, err = BytePtrFromString(path)
|
||||||
|
if err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
_, _, e1 := Syscall(SYS_FUTIMESAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(times)))
|
||||||
|
if e1 != 0 {
|
||||||
|
err = errnoErr(e1)
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
func Gettimeofday(tv *Timeval) (err error) {
|
func Gettimeofday(tv *Timeval) (err error) {
|
||||||
_, _, e1 := RawSyscall(SYS_GETTIMEOFDAY, uintptr(unsafe.Pointer(tv)), 0, 0)
|
_, _, e1 := RawSyscall(SYS_GETTIMEOFDAY, uintptr(unsafe.Pointer(tv)), 0, 0)
|
||||||
if e1 != 0 {
|
if e1 != 0 {
|
||||||
@ -2096,6 +2086,21 @@ func Utime(path string, buf *Utimbuf) (err error) {
|
|||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
func utimes(path string, times *[2]Timeval) (err error) {
|
||||||
|
var _p0 *byte
|
||||||
|
_p0, err = BytePtrFromString(path)
|
||||||
|
if err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
_, _, e1 := Syscall(SYS_UTIMES, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(times)), 0)
|
||||||
|
if e1 != 0 {
|
||||||
|
err = errnoErr(e1)
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
func pipe2(p *[2]_C_int, flags int) (err error) {
|
func pipe2(p *[2]_C_int, flags int) (err error) {
|
||||||
_, _, e1 := RawSyscall(SYS_PIPE2, uintptr(unsafe.Pointer(p)), uintptr(flags), 0)
|
_, _, e1 := RawSyscall(SYS_PIPE2, uintptr(unsafe.Pointer(p)), uintptr(flags), 0)
|
||||||
if e1 != 0 {
|
if e1 != 0 {
|
||||||
|
191
vendor/golang.org/x/sys/unix/zsyscall_linux_mipsle.go
generated
vendored
191
vendor/golang.org/x/sys/unix/zsyscall_linux_mipsle.go
generated
vendored
@ -143,21 +143,6 @@ func Unlinkat(dirfd int, path string, flags int) (err error) {
|
|||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
func utimes(path string, times *[2]Timeval) (err error) {
|
|
||||||
var _p0 *byte
|
|
||||||
_p0, err = BytePtrFromString(path)
|
|
||||||
if err != nil {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
_, _, e1 := Syscall(SYS_UTIMES, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(times)), 0)
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func utimensat(dirfd int, path string, times *[2]Timespec, flags int) (err error) {
|
func utimensat(dirfd int, path string, times *[2]Timespec, flags int) (err error) {
|
||||||
var _p0 *byte
|
var _p0 *byte
|
||||||
_p0, err = BytePtrFromString(path)
|
_p0, err = BytePtrFromString(path)
|
||||||
@ -173,16 +158,6 @@ func utimensat(dirfd int, path string, times *[2]Timespec, flags int) (err error
|
|||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
func futimesat(dirfd int, path *byte, times *[2]Timeval) (err error) {
|
|
||||||
_, _, e1 := Syscall(SYS_FUTIMESAT, uintptr(dirfd), uintptr(unsafe.Pointer(path)), uintptr(unsafe.Pointer(times)))
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func Getcwd(buf []byte) (n int, err error) {
|
func Getcwd(buf []byte) (n int, err error) {
|
||||||
var _p0 unsafe.Pointer
|
var _p0 unsafe.Pointer
|
||||||
if len(buf) > 0 {
|
if len(buf) > 0 {
|
||||||
@ -494,17 +469,6 @@ func Dup3(oldfd int, newfd int, flags int) (err error) {
|
|||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
func EpollCreate(size int) (fd int, err error) {
|
|
||||||
r0, _, e1 := RawSyscall(SYS_EPOLL_CREATE, uintptr(size), 0, 0)
|
|
||||||
fd = int(r0)
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func EpollCreate1(flag int) (fd int, err error) {
|
func EpollCreate1(flag int) (fd int, err error) {
|
||||||
r0, _, e1 := RawSyscall(SYS_EPOLL_CREATE1, uintptr(flag), 0, 0)
|
r0, _, e1 := RawSyscall(SYS_EPOLL_CREATE1, uintptr(flag), 0, 0)
|
||||||
fd = int(r0)
|
fd = int(r0)
|
||||||
@ -544,21 +508,6 @@ func Exit(code int) {
|
|||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
func Faccessat(dirfd int, path string, mode uint32, flags int) (err error) {
|
|
||||||
var _p0 *byte
|
|
||||||
_p0, err = BytePtrFromString(path)
|
|
||||||
if err != nil {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
_, _, e1 := Syscall6(SYS_FACCESSAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(flags), 0, 0)
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func Fallocate(fd int, mode uint32, off int64, len int64) (err error) {
|
func Fallocate(fd int, mode uint32, off int64, len int64) (err error) {
|
||||||
_, _, e1 := Syscall6(SYS_FALLOCATE, uintptr(fd), uintptr(mode), uintptr(off), uintptr(off>>32), uintptr(len), uintptr(len>>32))
|
_, _, e1 := Syscall6(SYS_FALLOCATE, uintptr(fd), uintptr(mode), uintptr(off), uintptr(off>>32), uintptr(len), uintptr(len>>32))
|
||||||
if e1 != 0 {
|
if e1 != 0 {
|
||||||
@ -1366,16 +1315,6 @@ func Unshare(flags int) (err error) {
|
|||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
func Ustat(dev int, ubuf *Ustat_t) (err error) {
|
|
||||||
_, _, e1 := Syscall(SYS_USTAT, uintptr(dev), uintptr(unsafe.Pointer(ubuf)), 0)
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func write(fd int, p []byte) (n int, err error) {
|
func write(fd int, p []byte) (n int, err error) {
|
||||||
var _p0 unsafe.Pointer
|
var _p0 unsafe.Pointer
|
||||||
if len(p) > 0 {
|
if len(p) > 0 {
|
||||||
@ -1535,6 +1474,21 @@ func Munlockall() (err error) {
|
|||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
func faccessat(dirfd int, path string, mode uint32) (err error) {
|
||||||
|
var _p0 *byte
|
||||||
|
_p0, err = BytePtrFromString(path)
|
||||||
|
if err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
_, _, e1 := Syscall(SYS_FACCESSAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode))
|
||||||
|
if e1 != 0 {
|
||||||
|
err = errnoErr(e1)
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
func Dup2(oldfd int, newfd int) (err error) {
|
func Dup2(oldfd int, newfd int) (err error) {
|
||||||
_, _, e1 := Syscall(SYS_DUP2, uintptr(oldfd), uintptr(newfd), 0)
|
_, _, e1 := Syscall(SYS_DUP2, uintptr(oldfd), uintptr(newfd), 0)
|
||||||
if e1 != 0 {
|
if e1 != 0 {
|
||||||
@ -1545,6 +1499,34 @@ func Dup2(oldfd int, newfd int) (err error) {
|
|||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
func EpollCreate(size int) (fd int, err error) {
|
||||||
|
r0, _, e1 := RawSyscall(SYS_EPOLL_CREATE, uintptr(size), 0, 0)
|
||||||
|
fd = int(r0)
|
||||||
|
if e1 != 0 {
|
||||||
|
err = errnoErr(e1)
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
func EpollWait(epfd int, events []EpollEvent, msec int) (n int, err error) {
|
||||||
|
var _p0 unsafe.Pointer
|
||||||
|
if len(events) > 0 {
|
||||||
|
_p0 = unsafe.Pointer(&events[0])
|
||||||
|
} else {
|
||||||
|
_p0 = unsafe.Pointer(&_zero)
|
||||||
|
}
|
||||||
|
r0, _, e1 := Syscall6(SYS_EPOLL_WAIT, uintptr(epfd), uintptr(_p0), uintptr(len(events)), uintptr(msec), 0, 0)
|
||||||
|
n = int(r0)
|
||||||
|
if e1 != 0 {
|
||||||
|
err = errnoErr(e1)
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
func Fadvise(fd int, offset int64, length int64, advice int) (err error) {
|
func Fadvise(fd int, offset int64, length int64, advice int) (err error) {
|
||||||
_, _, e1 := Syscall9(SYS_FADVISE64, uintptr(fd), 0, uintptr(offset), uintptr(offset>>32), uintptr(length), uintptr(length>>32), uintptr(advice), 0, 0)
|
_, _, e1 := Syscall9(SYS_FADVISE64, uintptr(fd), 0, uintptr(offset), uintptr(offset>>32), uintptr(length), uintptr(length>>32), uintptr(advice), 0, 0)
|
||||||
if e1 != 0 {
|
if e1 != 0 {
|
||||||
@ -1794,6 +1776,16 @@ func Truncate(path string, length int64) (err error) {
|
|||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
func Ustat(dev int, ubuf *Ustat_t) (err error) {
|
||||||
|
_, _, e1 := Syscall(SYS_USTAT, uintptr(dev), uintptr(unsafe.Pointer(ubuf)), 0)
|
||||||
|
if e1 != 0 {
|
||||||
|
err = errnoErr(e1)
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
func accept(s int, rsa *RawSockaddrAny, addrlen *_Socklen) (fd int, err error) {
|
func accept(s int, rsa *RawSockaddrAny, addrlen *_Socklen) (fd int, err error) {
|
||||||
r0, _, e1 := Syscall(SYS_ACCEPT, uintptr(s), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen)))
|
r0, _, e1 := Syscall(SYS_ACCEPT, uintptr(s), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen)))
|
||||||
fd = int(r0)
|
fd = int(r0)
|
||||||
@ -2004,6 +1996,21 @@ func Iopl(level int) (err error) {
|
|||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
func futimesat(dirfd int, path string, times *[2]Timeval) (err error) {
|
||||||
|
var _p0 *byte
|
||||||
|
_p0, err = BytePtrFromString(path)
|
||||||
|
if err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
_, _, e1 := Syscall(SYS_FUTIMESAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(times)))
|
||||||
|
if e1 != 0 {
|
||||||
|
err = errnoErr(e1)
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
func Gettimeofday(tv *Timeval) (err error) {
|
func Gettimeofday(tv *Timeval) (err error) {
|
||||||
_, _, e1 := RawSyscall(SYS_GETTIMEOFDAY, uintptr(unsafe.Pointer(tv)), 0, 0)
|
_, _, e1 := RawSyscall(SYS_GETTIMEOFDAY, uintptr(unsafe.Pointer(tv)), 0, 0)
|
||||||
if e1 != 0 {
|
if e1 != 0 {
|
||||||
@ -2025,6 +2032,36 @@ func Time(t *Time_t) (tt Time_t, err error) {
|
|||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
func Utime(path string, buf *Utimbuf) (err error) {
|
||||||
|
var _p0 *byte
|
||||||
|
_p0, err = BytePtrFromString(path)
|
||||||
|
if err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
_, _, e1 := Syscall(SYS_UTIME, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(buf)), 0)
|
||||||
|
if e1 != 0 {
|
||||||
|
err = errnoErr(e1)
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
func utimes(path string, times *[2]Timeval) (err error) {
|
||||||
|
var _p0 *byte
|
||||||
|
_p0, err = BytePtrFromString(path)
|
||||||
|
if err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
_, _, e1 := Syscall(SYS_UTIMES, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(times)), 0)
|
||||||
|
if e1 != 0 {
|
||||||
|
err = errnoErr(e1)
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
func Lstat(path string, stat *Stat_t) (err error) {
|
func Lstat(path string, stat *Stat_t) (err error) {
|
||||||
var _p0 *byte
|
var _p0 *byte
|
||||||
_p0, err = BytePtrFromString(path)
|
_p0, err = BytePtrFromString(path)
|
||||||
@ -2080,38 +2117,6 @@ func Stat(path string, stat *Stat_t) (err error) {
|
|||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
func Utime(path string, buf *Utimbuf) (err error) {
|
|
||||||
var _p0 *byte
|
|
||||||
_p0, err = BytePtrFromString(path)
|
|
||||||
if err != nil {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
_, _, e1 := Syscall(SYS_UTIME, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(buf)), 0)
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func EpollWait(epfd int, events []EpollEvent, msec int) (n int, err error) {
|
|
||||||
var _p0 unsafe.Pointer
|
|
||||||
if len(events) > 0 {
|
|
||||||
_p0 = unsafe.Pointer(&events[0])
|
|
||||||
} else {
|
|
||||||
_p0 = unsafe.Pointer(&_zero)
|
|
||||||
}
|
|
||||||
r0, _, e1 := Syscall6(SYS_EPOLL_WAIT, uintptr(epfd), uintptr(_p0), uintptr(len(events)), uintptr(msec), 0, 0)
|
|
||||||
n = int(r0)
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func Pause() (err error) {
|
func Pause() (err error) {
|
||||||
_, _, e1 := Syscall(SYS_PAUSE, 0, 0, 0)
|
_, _, e1 := Syscall(SYS_PAUSE, 0, 0, 0)
|
||||||
if e1 != 0 {
|
if e1 != 0 {
|
||||||
|
147
vendor/golang.org/x/sys/unix/zsyscall_linux_ppc64.go
generated
vendored
147
vendor/golang.org/x/sys/unix/zsyscall_linux_ppc64.go
generated
vendored
@ -143,21 +143,6 @@ func Unlinkat(dirfd int, path string, flags int) (err error) {
|
|||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
func utimes(path string, times *[2]Timeval) (err error) {
|
|
||||||
var _p0 *byte
|
|
||||||
_p0, err = BytePtrFromString(path)
|
|
||||||
if err != nil {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
_, _, e1 := Syscall(SYS_UTIMES, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(times)), 0)
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func utimensat(dirfd int, path string, times *[2]Timespec, flags int) (err error) {
|
func utimensat(dirfd int, path string, times *[2]Timespec, flags int) (err error) {
|
||||||
var _p0 *byte
|
var _p0 *byte
|
||||||
_p0, err = BytePtrFromString(path)
|
_p0, err = BytePtrFromString(path)
|
||||||
@ -173,16 +158,6 @@ func utimensat(dirfd int, path string, times *[2]Timespec, flags int) (err error
|
|||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
func futimesat(dirfd int, path *byte, times *[2]Timeval) (err error) {
|
|
||||||
_, _, e1 := Syscall(SYS_FUTIMESAT, uintptr(dirfd), uintptr(unsafe.Pointer(path)), uintptr(unsafe.Pointer(times)))
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func Getcwd(buf []byte) (n int, err error) {
|
func Getcwd(buf []byte) (n int, err error) {
|
||||||
var _p0 unsafe.Pointer
|
var _p0 unsafe.Pointer
|
||||||
if len(buf) > 0 {
|
if len(buf) > 0 {
|
||||||
@ -494,17 +469,6 @@ func Dup3(oldfd int, newfd int, flags int) (err error) {
|
|||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
func EpollCreate(size int) (fd int, err error) {
|
|
||||||
r0, _, e1 := RawSyscall(SYS_EPOLL_CREATE, uintptr(size), 0, 0)
|
|
||||||
fd = int(r0)
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func EpollCreate1(flag int) (fd int, err error) {
|
func EpollCreate1(flag int) (fd int, err error) {
|
||||||
r0, _, e1 := RawSyscall(SYS_EPOLL_CREATE1, uintptr(flag), 0, 0)
|
r0, _, e1 := RawSyscall(SYS_EPOLL_CREATE1, uintptr(flag), 0, 0)
|
||||||
fd = int(r0)
|
fd = int(r0)
|
||||||
@ -544,21 +508,6 @@ func Exit(code int) {
|
|||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
func Faccessat(dirfd int, path string, mode uint32, flags int) (err error) {
|
|
||||||
var _p0 *byte
|
|
||||||
_p0, err = BytePtrFromString(path)
|
|
||||||
if err != nil {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
_, _, e1 := Syscall6(SYS_FACCESSAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(flags), 0, 0)
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func Fallocate(fd int, mode uint32, off int64, len int64) (err error) {
|
func Fallocate(fd int, mode uint32, off int64, len int64) (err error) {
|
||||||
_, _, e1 := Syscall6(SYS_FALLOCATE, uintptr(fd), uintptr(mode), uintptr(off), uintptr(len), 0, 0)
|
_, _, e1 := Syscall6(SYS_FALLOCATE, uintptr(fd), uintptr(mode), uintptr(off), uintptr(len), 0, 0)
|
||||||
if e1 != 0 {
|
if e1 != 0 {
|
||||||
@ -1366,16 +1315,6 @@ func Unshare(flags int) (err error) {
|
|||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
func Ustat(dev int, ubuf *Ustat_t) (err error) {
|
|
||||||
_, _, e1 := Syscall(SYS_USTAT, uintptr(dev), uintptr(unsafe.Pointer(ubuf)), 0)
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func write(fd int, p []byte) (n int, err error) {
|
func write(fd int, p []byte) (n int, err error) {
|
||||||
var _p0 unsafe.Pointer
|
var _p0 unsafe.Pointer
|
||||||
if len(p) > 0 {
|
if len(p) > 0 {
|
||||||
@ -1535,6 +1474,42 @@ func Munlockall() (err error) {
|
|||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
func Dup2(oldfd int, newfd int) (err error) {
|
||||||
|
_, _, e1 := Syscall(SYS_DUP2, uintptr(oldfd), uintptr(newfd), 0)
|
||||||
|
if e1 != 0 {
|
||||||
|
err = errnoErr(e1)
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
func EpollCreate(size int) (fd int, err error) {
|
||||||
|
r0, _, e1 := RawSyscall(SYS_EPOLL_CREATE, uintptr(size), 0, 0)
|
||||||
|
fd = int(r0)
|
||||||
|
if e1 != 0 {
|
||||||
|
err = errnoErr(e1)
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
func faccessat(dirfd int, path string, mode uint32) (err error) {
|
||||||
|
var _p0 *byte
|
||||||
|
_p0, err = BytePtrFromString(path)
|
||||||
|
if err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
_, _, e1 := Syscall(SYS_FACCESSAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode))
|
||||||
|
if e1 != 0 {
|
||||||
|
err = errnoErr(e1)
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
func EpollWait(epfd int, events []EpollEvent, msec int) (n int, err error) {
|
func EpollWait(epfd int, events []EpollEvent, msec int) (n int, err error) {
|
||||||
var _p0 unsafe.Pointer
|
var _p0 unsafe.Pointer
|
||||||
if len(events) > 0 {
|
if len(events) > 0 {
|
||||||
@ -1552,16 +1527,6 @@ func EpollWait(epfd int, events []EpollEvent, msec int) (n int, err error) {
|
|||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
func Dup2(oldfd int, newfd int) (err error) {
|
|
||||||
_, _, e1 := Syscall(SYS_DUP2, uintptr(oldfd), uintptr(newfd), 0)
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func Fadvise(fd int, offset int64, length int64, advice int) (err error) {
|
func Fadvise(fd int, offset int64, length int64, advice int) (err error) {
|
||||||
_, _, e1 := Syscall6(SYS_FADVISE64, uintptr(fd), uintptr(offset), uintptr(length), uintptr(advice), 0, 0)
|
_, _, e1 := Syscall6(SYS_FADVISE64, uintptr(fd), uintptr(offset), uintptr(length), uintptr(advice), 0, 0)
|
||||||
if e1 != 0 {
|
if e1 != 0 {
|
||||||
@ -1963,6 +1928,16 @@ func Truncate(path string, length int64) (err error) {
|
|||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
func Ustat(dev int, ubuf *Ustat_t) (err error) {
|
||||||
|
_, _, e1 := Syscall(SYS_USTAT, uintptr(dev), uintptr(unsafe.Pointer(ubuf)), 0)
|
||||||
|
if e1 != 0 {
|
||||||
|
err = errnoErr(e1)
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
func accept(s int, rsa *RawSockaddrAny, addrlen *_Socklen) (fd int, err error) {
|
func accept(s int, rsa *RawSockaddrAny, addrlen *_Socklen) (fd int, err error) {
|
||||||
r0, _, e1 := Syscall(SYS_ACCEPT, uintptr(s), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen)))
|
r0, _, e1 := Syscall(SYS_ACCEPT, uintptr(s), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen)))
|
||||||
fd = int(r0)
|
fd = int(r0)
|
||||||
@ -2153,6 +2128,21 @@ func mmap(addr uintptr, length uintptr, prot int, flags int, fd int, offset int6
|
|||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
func futimesat(dirfd int, path string, times *[2]Timeval) (err error) {
|
||||||
|
var _p0 *byte
|
||||||
|
_p0, err = BytePtrFromString(path)
|
||||||
|
if err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
_, _, e1 := Syscall(SYS_FUTIMESAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(times)))
|
||||||
|
if e1 != 0 {
|
||||||
|
err = errnoErr(e1)
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
func Gettimeofday(tv *Timeval) (err error) {
|
func Gettimeofday(tv *Timeval) (err error) {
|
||||||
_, _, e1 := RawSyscall(SYS_GETTIMEOFDAY, uintptr(unsafe.Pointer(tv)), 0, 0)
|
_, _, e1 := RawSyscall(SYS_GETTIMEOFDAY, uintptr(unsafe.Pointer(tv)), 0, 0)
|
||||||
if e1 != 0 {
|
if e1 != 0 {
|
||||||
@ -2189,6 +2179,21 @@ func Utime(path string, buf *Utimbuf) (err error) {
|
|||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
func utimes(path string, times *[2]Timeval) (err error) {
|
||||||
|
var _p0 *byte
|
||||||
|
_p0, err = BytePtrFromString(path)
|
||||||
|
if err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
_, _, e1 := Syscall(SYS_UTIMES, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(times)), 0)
|
||||||
|
if e1 != 0 {
|
||||||
|
err = errnoErr(e1)
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
func pipe(p *[2]_C_int) (err error) {
|
func pipe(p *[2]_C_int) (err error) {
|
||||||
_, _, e1 := RawSyscall(SYS_PIPE, uintptr(unsafe.Pointer(p)), 0, 0)
|
_, _, e1 := RawSyscall(SYS_PIPE, uintptr(unsafe.Pointer(p)), 0, 0)
|
||||||
if e1 != 0 {
|
if e1 != 0 {
|
||||||
|
147
vendor/golang.org/x/sys/unix/zsyscall_linux_ppc64le.go
generated
vendored
147
vendor/golang.org/x/sys/unix/zsyscall_linux_ppc64le.go
generated
vendored
@ -143,21 +143,6 @@ func Unlinkat(dirfd int, path string, flags int) (err error) {
|
|||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
func utimes(path string, times *[2]Timeval) (err error) {
|
|
||||||
var _p0 *byte
|
|
||||||
_p0, err = BytePtrFromString(path)
|
|
||||||
if err != nil {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
_, _, e1 := Syscall(SYS_UTIMES, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(times)), 0)
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func utimensat(dirfd int, path string, times *[2]Timespec, flags int) (err error) {
|
func utimensat(dirfd int, path string, times *[2]Timespec, flags int) (err error) {
|
||||||
var _p0 *byte
|
var _p0 *byte
|
||||||
_p0, err = BytePtrFromString(path)
|
_p0, err = BytePtrFromString(path)
|
||||||
@ -173,16 +158,6 @@ func utimensat(dirfd int, path string, times *[2]Timespec, flags int) (err error
|
|||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
func futimesat(dirfd int, path *byte, times *[2]Timeval) (err error) {
|
|
||||||
_, _, e1 := Syscall(SYS_FUTIMESAT, uintptr(dirfd), uintptr(unsafe.Pointer(path)), uintptr(unsafe.Pointer(times)))
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func Getcwd(buf []byte) (n int, err error) {
|
func Getcwd(buf []byte) (n int, err error) {
|
||||||
var _p0 unsafe.Pointer
|
var _p0 unsafe.Pointer
|
||||||
if len(buf) > 0 {
|
if len(buf) > 0 {
|
||||||
@ -494,17 +469,6 @@ func Dup3(oldfd int, newfd int, flags int) (err error) {
|
|||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
func EpollCreate(size int) (fd int, err error) {
|
|
||||||
r0, _, e1 := RawSyscall(SYS_EPOLL_CREATE, uintptr(size), 0, 0)
|
|
||||||
fd = int(r0)
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func EpollCreate1(flag int) (fd int, err error) {
|
func EpollCreate1(flag int) (fd int, err error) {
|
||||||
r0, _, e1 := RawSyscall(SYS_EPOLL_CREATE1, uintptr(flag), 0, 0)
|
r0, _, e1 := RawSyscall(SYS_EPOLL_CREATE1, uintptr(flag), 0, 0)
|
||||||
fd = int(r0)
|
fd = int(r0)
|
||||||
@ -544,21 +508,6 @@ func Exit(code int) {
|
|||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
func Faccessat(dirfd int, path string, mode uint32, flags int) (err error) {
|
|
||||||
var _p0 *byte
|
|
||||||
_p0, err = BytePtrFromString(path)
|
|
||||||
if err != nil {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
_, _, e1 := Syscall6(SYS_FACCESSAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(flags), 0, 0)
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func Fallocate(fd int, mode uint32, off int64, len int64) (err error) {
|
func Fallocate(fd int, mode uint32, off int64, len int64) (err error) {
|
||||||
_, _, e1 := Syscall6(SYS_FALLOCATE, uintptr(fd), uintptr(mode), uintptr(off), uintptr(len), 0, 0)
|
_, _, e1 := Syscall6(SYS_FALLOCATE, uintptr(fd), uintptr(mode), uintptr(off), uintptr(len), 0, 0)
|
||||||
if e1 != 0 {
|
if e1 != 0 {
|
||||||
@ -1366,16 +1315,6 @@ func Unshare(flags int) (err error) {
|
|||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
func Ustat(dev int, ubuf *Ustat_t) (err error) {
|
|
||||||
_, _, e1 := Syscall(SYS_USTAT, uintptr(dev), uintptr(unsafe.Pointer(ubuf)), 0)
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func write(fd int, p []byte) (n int, err error) {
|
func write(fd int, p []byte) (n int, err error) {
|
||||||
var _p0 unsafe.Pointer
|
var _p0 unsafe.Pointer
|
||||||
if len(p) > 0 {
|
if len(p) > 0 {
|
||||||
@ -1535,6 +1474,42 @@ func Munlockall() (err error) {
|
|||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
func Dup2(oldfd int, newfd int) (err error) {
|
||||||
|
_, _, e1 := Syscall(SYS_DUP2, uintptr(oldfd), uintptr(newfd), 0)
|
||||||
|
if e1 != 0 {
|
||||||
|
err = errnoErr(e1)
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
func EpollCreate(size int) (fd int, err error) {
|
||||||
|
r0, _, e1 := RawSyscall(SYS_EPOLL_CREATE, uintptr(size), 0, 0)
|
||||||
|
fd = int(r0)
|
||||||
|
if e1 != 0 {
|
||||||
|
err = errnoErr(e1)
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
func faccessat(dirfd int, path string, mode uint32) (err error) {
|
||||||
|
var _p0 *byte
|
||||||
|
_p0, err = BytePtrFromString(path)
|
||||||
|
if err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
_, _, e1 := Syscall(SYS_FACCESSAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode))
|
||||||
|
if e1 != 0 {
|
||||||
|
err = errnoErr(e1)
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
func EpollWait(epfd int, events []EpollEvent, msec int) (n int, err error) {
|
func EpollWait(epfd int, events []EpollEvent, msec int) (n int, err error) {
|
||||||
var _p0 unsafe.Pointer
|
var _p0 unsafe.Pointer
|
||||||
if len(events) > 0 {
|
if len(events) > 0 {
|
||||||
@ -1552,16 +1527,6 @@ func EpollWait(epfd int, events []EpollEvent, msec int) (n int, err error) {
|
|||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
func Dup2(oldfd int, newfd int) (err error) {
|
|
||||||
_, _, e1 := Syscall(SYS_DUP2, uintptr(oldfd), uintptr(newfd), 0)
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func Fadvise(fd int, offset int64, length int64, advice int) (err error) {
|
func Fadvise(fd int, offset int64, length int64, advice int) (err error) {
|
||||||
_, _, e1 := Syscall6(SYS_FADVISE64, uintptr(fd), uintptr(offset), uintptr(length), uintptr(advice), 0, 0)
|
_, _, e1 := Syscall6(SYS_FADVISE64, uintptr(fd), uintptr(offset), uintptr(length), uintptr(advice), 0, 0)
|
||||||
if e1 != 0 {
|
if e1 != 0 {
|
||||||
@ -1963,6 +1928,16 @@ func Truncate(path string, length int64) (err error) {
|
|||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
func Ustat(dev int, ubuf *Ustat_t) (err error) {
|
||||||
|
_, _, e1 := Syscall(SYS_USTAT, uintptr(dev), uintptr(unsafe.Pointer(ubuf)), 0)
|
||||||
|
if e1 != 0 {
|
||||||
|
err = errnoErr(e1)
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
func accept(s int, rsa *RawSockaddrAny, addrlen *_Socklen) (fd int, err error) {
|
func accept(s int, rsa *RawSockaddrAny, addrlen *_Socklen) (fd int, err error) {
|
||||||
r0, _, e1 := Syscall(SYS_ACCEPT, uintptr(s), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen)))
|
r0, _, e1 := Syscall(SYS_ACCEPT, uintptr(s), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen)))
|
||||||
fd = int(r0)
|
fd = int(r0)
|
||||||
@ -2153,6 +2128,21 @@ func mmap(addr uintptr, length uintptr, prot int, flags int, fd int, offset int6
|
|||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
func futimesat(dirfd int, path string, times *[2]Timeval) (err error) {
|
||||||
|
var _p0 *byte
|
||||||
|
_p0, err = BytePtrFromString(path)
|
||||||
|
if err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
_, _, e1 := Syscall(SYS_FUTIMESAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(times)))
|
||||||
|
if e1 != 0 {
|
||||||
|
err = errnoErr(e1)
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
func Gettimeofday(tv *Timeval) (err error) {
|
func Gettimeofday(tv *Timeval) (err error) {
|
||||||
_, _, e1 := RawSyscall(SYS_GETTIMEOFDAY, uintptr(unsafe.Pointer(tv)), 0, 0)
|
_, _, e1 := RawSyscall(SYS_GETTIMEOFDAY, uintptr(unsafe.Pointer(tv)), 0, 0)
|
||||||
if e1 != 0 {
|
if e1 != 0 {
|
||||||
@ -2189,6 +2179,21 @@ func Utime(path string, buf *Utimbuf) (err error) {
|
|||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
func utimes(path string, times *[2]Timeval) (err error) {
|
||||||
|
var _p0 *byte
|
||||||
|
_p0, err = BytePtrFromString(path)
|
||||||
|
if err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
_, _, e1 := Syscall(SYS_UTIMES, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(times)), 0)
|
||||||
|
if e1 != 0 {
|
||||||
|
err = errnoErr(e1)
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
func pipe(p *[2]_C_int) (err error) {
|
func pipe(p *[2]_C_int) (err error) {
|
||||||
_, _, e1 := RawSyscall(SYS_PIPE, uintptr(unsafe.Pointer(p)), 0, 0)
|
_, _, e1 := RawSyscall(SYS_PIPE, uintptr(unsafe.Pointer(p)), 0, 0)
|
||||||
if e1 != 0 {
|
if e1 != 0 {
|
||||||
|
127
vendor/golang.org/x/sys/unix/zsyscall_linux_s390x.go
generated
vendored
127
vendor/golang.org/x/sys/unix/zsyscall_linux_s390x.go
generated
vendored
@ -143,21 +143,6 @@ func Unlinkat(dirfd int, path string, flags int) (err error) {
|
|||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
func utimes(path string, times *[2]Timeval) (err error) {
|
|
||||||
var _p0 *byte
|
|
||||||
_p0, err = BytePtrFromString(path)
|
|
||||||
if err != nil {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
_, _, e1 := Syscall(SYS_UTIMES, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(times)), 0)
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func utimensat(dirfd int, path string, times *[2]Timespec, flags int) (err error) {
|
func utimensat(dirfd int, path string, times *[2]Timespec, flags int) (err error) {
|
||||||
var _p0 *byte
|
var _p0 *byte
|
||||||
_p0, err = BytePtrFromString(path)
|
_p0, err = BytePtrFromString(path)
|
||||||
@ -173,16 +158,6 @@ func utimensat(dirfd int, path string, times *[2]Timespec, flags int) (err error
|
|||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
func futimesat(dirfd int, path *byte, times *[2]Timeval) (err error) {
|
|
||||||
_, _, e1 := Syscall(SYS_FUTIMESAT, uintptr(dirfd), uintptr(unsafe.Pointer(path)), uintptr(unsafe.Pointer(times)))
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func Getcwd(buf []byte) (n int, err error) {
|
func Getcwd(buf []byte) (n int, err error) {
|
||||||
var _p0 unsafe.Pointer
|
var _p0 unsafe.Pointer
|
||||||
if len(buf) > 0 {
|
if len(buf) > 0 {
|
||||||
@ -494,17 +469,6 @@ func Dup3(oldfd int, newfd int, flags int) (err error) {
|
|||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
func EpollCreate(size int) (fd int, err error) {
|
|
||||||
r0, _, e1 := RawSyscall(SYS_EPOLL_CREATE, uintptr(size), 0, 0)
|
|
||||||
fd = int(r0)
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func EpollCreate1(flag int) (fd int, err error) {
|
func EpollCreate1(flag int) (fd int, err error) {
|
||||||
r0, _, e1 := RawSyscall(SYS_EPOLL_CREATE1, uintptr(flag), 0, 0)
|
r0, _, e1 := RawSyscall(SYS_EPOLL_CREATE1, uintptr(flag), 0, 0)
|
||||||
fd = int(r0)
|
fd = int(r0)
|
||||||
@ -544,21 +508,6 @@ func Exit(code int) {
|
|||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
func Faccessat(dirfd int, path string, mode uint32, flags int) (err error) {
|
|
||||||
var _p0 *byte
|
|
||||||
_p0, err = BytePtrFromString(path)
|
|
||||||
if err != nil {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
_, _, e1 := Syscall6(SYS_FACCESSAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(flags), 0, 0)
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func Fallocate(fd int, mode uint32, off int64, len int64) (err error) {
|
func Fallocate(fd int, mode uint32, off int64, len int64) (err error) {
|
||||||
_, _, e1 := Syscall6(SYS_FALLOCATE, uintptr(fd), uintptr(mode), uintptr(off), uintptr(len), 0, 0)
|
_, _, e1 := Syscall6(SYS_FALLOCATE, uintptr(fd), uintptr(mode), uintptr(off), uintptr(len), 0, 0)
|
||||||
if e1 != 0 {
|
if e1 != 0 {
|
||||||
@ -1366,16 +1315,6 @@ func Unshare(flags int) (err error) {
|
|||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
func Ustat(dev int, ubuf *Ustat_t) (err error) {
|
|
||||||
_, _, e1 := Syscall(SYS_USTAT, uintptr(dev), uintptr(unsafe.Pointer(ubuf)), 0)
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func write(fd int, p []byte) (n int, err error) {
|
func write(fd int, p []byte) (n int, err error) {
|
||||||
var _p0 unsafe.Pointer
|
var _p0 unsafe.Pointer
|
||||||
if len(p) > 0 {
|
if len(p) > 0 {
|
||||||
@ -1535,6 +1474,21 @@ func Munlockall() (err error) {
|
|||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
func faccessat(dirfd int, path string, mode uint32) (err error) {
|
||||||
|
var _p0 *byte
|
||||||
|
_p0, err = BytePtrFromString(path)
|
||||||
|
if err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
_, _, e1 := Syscall(SYS_FACCESSAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode))
|
||||||
|
if e1 != 0 {
|
||||||
|
err = errnoErr(e1)
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
func Dup2(oldfd int, newfd int) (err error) {
|
func Dup2(oldfd int, newfd int) (err error) {
|
||||||
_, _, e1 := Syscall(SYS_DUP2, uintptr(oldfd), uintptr(newfd), 0)
|
_, _, e1 := Syscall(SYS_DUP2, uintptr(oldfd), uintptr(newfd), 0)
|
||||||
if e1 != 0 {
|
if e1 != 0 {
|
||||||
@ -1545,6 +1499,17 @@ func Dup2(oldfd int, newfd int) (err error) {
|
|||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
func EpollCreate(size int) (fd int, err error) {
|
||||||
|
r0, _, e1 := RawSyscall(SYS_EPOLL_CREATE, uintptr(size), 0, 0)
|
||||||
|
fd = int(r0)
|
||||||
|
if e1 != 0 {
|
||||||
|
err = errnoErr(e1)
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
func EpollWait(epfd int, events []EpollEvent, msec int) (n int, err error) {
|
func EpollWait(epfd int, events []EpollEvent, msec int) (n int, err error) {
|
||||||
var _p0 unsafe.Pointer
|
var _p0 unsafe.Pointer
|
||||||
if len(events) > 0 {
|
if len(events) > 0 {
|
||||||
@ -1923,6 +1888,16 @@ func Truncate(path string, length int64) (err error) {
|
|||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
func Ustat(dev int, ubuf *Ustat_t) (err error) {
|
||||||
|
_, _, e1 := Syscall(SYS_USTAT, uintptr(dev), uintptr(unsafe.Pointer(ubuf)), 0)
|
||||||
|
if e1 != 0 {
|
||||||
|
err = errnoErr(e1)
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
func getgroups(n int, list *_Gid_t) (nn int, err error) {
|
func getgroups(n int, list *_Gid_t) (nn int, err error) {
|
||||||
r0, _, e1 := RawSyscall(SYS_GETGROUPS, uintptr(n), uintptr(unsafe.Pointer(list)), 0)
|
r0, _, e1 := RawSyscall(SYS_GETGROUPS, uintptr(n), uintptr(unsafe.Pointer(list)), 0)
|
||||||
nn = int(r0)
|
nn = int(r0)
|
||||||
@ -1944,6 +1919,21 @@ func setgroups(n int, list *_Gid_t) (err error) {
|
|||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
func futimesat(dirfd int, path string, times *[2]Timeval) (err error) {
|
||||||
|
var _p0 *byte
|
||||||
|
_p0, err = BytePtrFromString(path)
|
||||||
|
if err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
_, _, e1 := Syscall(SYS_FUTIMESAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(times)))
|
||||||
|
if e1 != 0 {
|
||||||
|
err = errnoErr(e1)
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
func Gettimeofday(tv *Timeval) (err error) {
|
func Gettimeofday(tv *Timeval) (err error) {
|
||||||
_, _, e1 := RawSyscall(SYS_GETTIMEOFDAY, uintptr(unsafe.Pointer(tv)), 0, 0)
|
_, _, e1 := RawSyscall(SYS_GETTIMEOFDAY, uintptr(unsafe.Pointer(tv)), 0, 0)
|
||||||
if e1 != 0 {
|
if e1 != 0 {
|
||||||
@ -1969,6 +1959,21 @@ func Utime(path string, buf *Utimbuf) (err error) {
|
|||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
func utimes(path string, times *[2]Timeval) (err error) {
|
||||||
|
var _p0 *byte
|
||||||
|
_p0, err = BytePtrFromString(path)
|
||||||
|
if err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
_, _, e1 := Syscall(SYS_UTIMES, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(times)), 0)
|
||||||
|
if e1 != 0 {
|
||||||
|
err = errnoErr(e1)
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
func pipe2(p *[2]_C_int, flags int) (err error) {
|
func pipe2(p *[2]_C_int, flags int) (err error) {
|
||||||
_, _, e1 := RawSyscall(SYS_PIPE2, uintptr(unsafe.Pointer(p)), uintptr(flags), 0)
|
_, _, e1 := RawSyscall(SYS_PIPE2, uintptr(unsafe.Pointer(p)), uintptr(flags), 0)
|
||||||
if e1 != 0 {
|
if e1 != 0 {
|
||||||
|
491
vendor/golang.org/x/sys/unix/zsyscall_linux_sparc64.go
generated
vendored
491
vendor/golang.org/x/sys/unix/zsyscall_linux_sparc64.go
generated
vendored
@ -14,6 +14,31 @@ var _ syscall.Errno
|
|||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
func fchmodat(dirfd int, path string, mode uint32) (err error) {
|
||||||
|
var _p0 *byte
|
||||||
|
_p0, err = BytePtrFromString(path)
|
||||||
|
if err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
_, _, e1 := Syscall(SYS_FCHMODAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode))
|
||||||
|
if e1 != 0 {
|
||||||
|
err = errnoErr(e1)
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
func ioctl(fd int, req uint, arg uintptr) (err error) {
|
||||||
|
_, _, e1 := Syscall(SYS_IOCTL, uintptr(fd), uintptr(req), uintptr(arg))
|
||||||
|
if e1 != 0 {
|
||||||
|
err = errnoErr(e1)
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
func Linkat(olddirfd int, oldpath string, newdirfd int, newpath string, flags int) (err error) {
|
func Linkat(olddirfd int, oldpath string, newdirfd int, newpath string, flags int) (err error) {
|
||||||
var _p0 *byte
|
var _p0 *byte
|
||||||
_p0, err = BytePtrFromString(oldpath)
|
_p0, err = BytePtrFromString(oldpath)
|
||||||
@ -118,21 +143,6 @@ func Unlinkat(dirfd int, path string, flags int) (err error) {
|
|||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
func utimes(path string, times *[2]Timeval) (err error) {
|
|
||||||
var _p0 *byte
|
|
||||||
_p0, err = BytePtrFromString(path)
|
|
||||||
if err != nil {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
_, _, e1 := Syscall(SYS_UTIMES, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(times)), 0)
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func utimensat(dirfd int, path string, times *[2]Timespec, flags int) (err error) {
|
func utimensat(dirfd int, path string, times *[2]Timespec, flags int) (err error) {
|
||||||
var _p0 *byte
|
var _p0 *byte
|
||||||
_p0, err = BytePtrFromString(path)
|
_p0, err = BytePtrFromString(path)
|
||||||
@ -148,16 +158,6 @@ func utimensat(dirfd int, path string, times *[2]Timespec, flags int) (err error
|
|||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
func futimesat(dirfd int, path *byte, times *[2]Timeval) (err error) {
|
|
||||||
_, _, e1 := Syscall(SYS_FUTIMESAT, uintptr(dirfd), uintptr(unsafe.Pointer(path)), uintptr(unsafe.Pointer(times)))
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func Getcwd(buf []byte) (n int, err error) {
|
func Getcwd(buf []byte) (n int, err error) {
|
||||||
var _p0 unsafe.Pointer
|
var _p0 unsafe.Pointer
|
||||||
if len(buf) > 0 {
|
if len(buf) > 0 {
|
||||||
@ -186,6 +186,104 @@ func wait4(pid int, wstatus *_C_int, options int, rusage *Rusage) (wpid int, err
|
|||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
func KeyctlInt(cmd int, arg2 int, arg3 int, arg4 int, arg5 int) (ret int, err error) {
|
||||||
|
r0, _, e1 := Syscall6(SYS_KEYCTL, uintptr(cmd), uintptr(arg2), uintptr(arg3), uintptr(arg4), uintptr(arg5), 0)
|
||||||
|
ret = int(r0)
|
||||||
|
if e1 != 0 {
|
||||||
|
err = errnoErr(e1)
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
func KeyctlBuffer(cmd int, arg2 int, buf []byte, arg5 int) (ret int, err error) {
|
||||||
|
var _p0 unsafe.Pointer
|
||||||
|
if len(buf) > 0 {
|
||||||
|
_p0 = unsafe.Pointer(&buf[0])
|
||||||
|
} else {
|
||||||
|
_p0 = unsafe.Pointer(&_zero)
|
||||||
|
}
|
||||||
|
r0, _, e1 := Syscall6(SYS_KEYCTL, uintptr(cmd), uintptr(arg2), uintptr(_p0), uintptr(len(buf)), uintptr(arg5), 0)
|
||||||
|
ret = int(r0)
|
||||||
|
if e1 != 0 {
|
||||||
|
err = errnoErr(e1)
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
func keyctlJoin(cmd int, arg2 string) (ret int, err error) {
|
||||||
|
var _p0 *byte
|
||||||
|
_p0, err = BytePtrFromString(arg2)
|
||||||
|
if err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
r0, _, e1 := Syscall(SYS_KEYCTL, uintptr(cmd), uintptr(unsafe.Pointer(_p0)), 0)
|
||||||
|
ret = int(r0)
|
||||||
|
if e1 != 0 {
|
||||||
|
err = errnoErr(e1)
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
func keyctlSearch(cmd int, arg2 int, arg3 string, arg4 string, arg5 int) (ret int, err error) {
|
||||||
|
var _p0 *byte
|
||||||
|
_p0, err = BytePtrFromString(arg3)
|
||||||
|
if err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
var _p1 *byte
|
||||||
|
_p1, err = BytePtrFromString(arg4)
|
||||||
|
if err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
r0, _, e1 := Syscall6(SYS_KEYCTL, uintptr(cmd), uintptr(arg2), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(arg5), 0)
|
||||||
|
ret = int(r0)
|
||||||
|
if e1 != 0 {
|
||||||
|
err = errnoErr(e1)
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
func keyctlIOV(cmd int, arg2 int, payload []Iovec, arg5 int) (err error) {
|
||||||
|
var _p0 unsafe.Pointer
|
||||||
|
if len(payload) > 0 {
|
||||||
|
_p0 = unsafe.Pointer(&payload[0])
|
||||||
|
} else {
|
||||||
|
_p0 = unsafe.Pointer(&_zero)
|
||||||
|
}
|
||||||
|
_, _, e1 := Syscall6(SYS_KEYCTL, uintptr(cmd), uintptr(arg2), uintptr(_p0), uintptr(len(payload)), uintptr(arg5), 0)
|
||||||
|
if e1 != 0 {
|
||||||
|
err = errnoErr(e1)
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
func keyctlDH(cmd int, arg2 *KeyctlDHParams, buf []byte) (ret int, err error) {
|
||||||
|
var _p0 unsafe.Pointer
|
||||||
|
if len(buf) > 0 {
|
||||||
|
_p0 = unsafe.Pointer(&buf[0])
|
||||||
|
} else {
|
||||||
|
_p0 = unsafe.Pointer(&_zero)
|
||||||
|
}
|
||||||
|
r0, _, e1 := Syscall6(SYS_KEYCTL, uintptr(cmd), uintptr(unsafe.Pointer(arg2)), uintptr(_p0), uintptr(len(buf)), 0, 0)
|
||||||
|
ret = int(r0)
|
||||||
|
if e1 != 0 {
|
||||||
|
err = errnoErr(e1)
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
func ptrace(request int, pid int, addr uintptr, data uintptr) (err error) {
|
func ptrace(request int, pid int, addr uintptr, data uintptr) (err error) {
|
||||||
_, _, e1 := Syscall6(SYS_PTRACE, uintptr(request), uintptr(pid), uintptr(addr), uintptr(data), 0, 0)
|
_, _, e1 := Syscall6(SYS_PTRACE, uintptr(request), uintptr(pid), uintptr(addr), uintptr(data), 0, 0)
|
||||||
if e1 != 0 {
|
if e1 != 0 {
|
||||||
@ -251,6 +349,33 @@ func Acct(path string) (err error) {
|
|||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
func AddKey(keyType string, description string, payload []byte, ringid int) (id int, err error) {
|
||||||
|
var _p0 *byte
|
||||||
|
_p0, err = BytePtrFromString(keyType)
|
||||||
|
if err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
var _p1 *byte
|
||||||
|
_p1, err = BytePtrFromString(description)
|
||||||
|
if err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
var _p2 unsafe.Pointer
|
||||||
|
if len(payload) > 0 {
|
||||||
|
_p2 = unsafe.Pointer(&payload[0])
|
||||||
|
} else {
|
||||||
|
_p2 = unsafe.Pointer(&_zero)
|
||||||
|
}
|
||||||
|
r0, _, e1 := Syscall6(SYS_ADD_KEY, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(_p2), uintptr(len(payload)), uintptr(ringid), 0)
|
||||||
|
id = int(r0)
|
||||||
|
if e1 != 0 {
|
||||||
|
err = errnoErr(e1)
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
func Adjtimex(buf *Timex) (state int, err error) {
|
func Adjtimex(buf *Timex) (state int, err error) {
|
||||||
r0, _, e1 := Syscall(SYS_ADJTIMEX, uintptr(unsafe.Pointer(buf)), 0, 0)
|
r0, _, e1 := Syscall(SYS_ADJTIMEX, uintptr(unsafe.Pointer(buf)), 0, 0)
|
||||||
state = int(r0)
|
state = int(r0)
|
||||||
@ -344,17 +469,6 @@ func Dup3(oldfd int, newfd int, flags int) (err error) {
|
|||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
func EpollCreate(size int) (fd int, err error) {
|
|
||||||
r0, _, e1 := RawSyscall(SYS_EPOLL_CREATE, uintptr(size), 0, 0)
|
|
||||||
fd = int(r0)
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func EpollCreate1(flag int) (fd int, err error) {
|
func EpollCreate1(flag int) (fd int, err error) {
|
||||||
r0, _, e1 := RawSyscall(SYS_EPOLL_CREATE1, uintptr(flag), 0, 0)
|
r0, _, e1 := RawSyscall(SYS_EPOLL_CREATE1, uintptr(flag), 0, 0)
|
||||||
fd = int(r0)
|
fd = int(r0)
|
||||||
@ -376,8 +490,19 @@ func EpollCtl(epfd int, op int, fd int, event *EpollEvent) (err error) {
|
|||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
func Eventfd(initval uint, flags int) (fd int, err error) {
|
||||||
|
r0, _, e1 := Syscall(SYS_EVENTFD2, uintptr(initval), uintptr(flags), 0)
|
||||||
|
fd = int(r0)
|
||||||
|
if e1 != 0 {
|
||||||
|
err = errnoErr(e1)
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
func Exit(code int) {
|
func Exit(code int) {
|
||||||
Syscall(SYS_EXIT_GROUP, uintptr(code), 0, 0)
|
SyscallNoError(SYS_EXIT_GROUP, uintptr(code), 0, 0)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -428,21 +553,6 @@ func Fchmod(fd int, mode uint32) (err error) {
|
|||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
func Fchmodat(dirfd int, path string, mode uint32, flags int) (err error) {
|
|
||||||
var _p0 *byte
|
|
||||||
_p0, err = BytePtrFromString(path)
|
|
||||||
if err != nil {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
_, _, e1 := Syscall6(SYS_FCHMODAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(flags), 0, 0)
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func Fchownat(dirfd int, path string, uid int, gid int, flags int) (err error) {
|
func Fchownat(dirfd int, path string, uid int, gid int, flags int) (err error) {
|
||||||
var _p0 *byte
|
var _p0 *byte
|
||||||
_p0, err = BytePtrFromString(path)
|
_p0, err = BytePtrFromString(path)
|
||||||
@ -528,7 +638,7 @@ func Getpgid(pid int) (pgid int, err error) {
|
|||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
func Getpid() (pid int) {
|
func Getpid() (pid int) {
|
||||||
r0, _, _ := RawSyscall(SYS_GETPID, 0, 0, 0)
|
r0, _ := RawSyscallNoError(SYS_GETPID, 0, 0, 0)
|
||||||
pid = int(r0)
|
pid = int(r0)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
@ -536,7 +646,7 @@ func Getpid() (pid int) {
|
|||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
func Getppid() (ppid int) {
|
func Getppid() (ppid int) {
|
||||||
r0, _, _ := RawSyscall(SYS_GETPPID, 0, 0, 0)
|
r0, _ := RawSyscallNoError(SYS_GETPPID, 0, 0, 0)
|
||||||
ppid = int(r0)
|
ppid = int(r0)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
@ -593,7 +703,7 @@ func Getsid(pid int) (sid int, err error) {
|
|||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
func Gettid() (tid int) {
|
func Gettid() (tid int) {
|
||||||
r0, _, _ := RawSyscall(SYS_GETTID, 0, 0, 0)
|
r0, _ := RawSyscallNoError(SYS_GETTID, 0, 0, 0)
|
||||||
tid = int(r0)
|
tid = int(r0)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
@ -692,6 +802,33 @@ func Klogctl(typ int, buf []byte) (n int, err error) {
|
|||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
func Lgetxattr(path string, attr string, dest []byte) (sz int, err error) {
|
||||||
|
var _p0 *byte
|
||||||
|
_p0, err = BytePtrFromString(path)
|
||||||
|
if err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
var _p1 *byte
|
||||||
|
_p1, err = BytePtrFromString(attr)
|
||||||
|
if err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
var _p2 unsafe.Pointer
|
||||||
|
if len(dest) > 0 {
|
||||||
|
_p2 = unsafe.Pointer(&dest[0])
|
||||||
|
} else {
|
||||||
|
_p2 = unsafe.Pointer(&_zero)
|
||||||
|
}
|
||||||
|
r0, _, e1 := Syscall6(SYS_LGETXATTR, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(_p2), uintptr(len(dest)), 0, 0)
|
||||||
|
sz = int(r0)
|
||||||
|
if e1 != 0 {
|
||||||
|
err = errnoErr(e1)
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
func Listxattr(path string, dest []byte) (sz int, err error) {
|
func Listxattr(path string, dest []byte) (sz int, err error) {
|
||||||
var _p0 *byte
|
var _p0 *byte
|
||||||
_p0, err = BytePtrFromString(path)
|
_p0, err = BytePtrFromString(path)
|
||||||
@ -714,6 +851,74 @@ func Listxattr(path string, dest []byte) (sz int, err error) {
|
|||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
func Llistxattr(path string, dest []byte) (sz int, err error) {
|
||||||
|
var _p0 *byte
|
||||||
|
_p0, err = BytePtrFromString(path)
|
||||||
|
if err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
var _p1 unsafe.Pointer
|
||||||
|
if len(dest) > 0 {
|
||||||
|
_p1 = unsafe.Pointer(&dest[0])
|
||||||
|
} else {
|
||||||
|
_p1 = unsafe.Pointer(&_zero)
|
||||||
|
}
|
||||||
|
r0, _, e1 := Syscall(SYS_LLISTXATTR, uintptr(unsafe.Pointer(_p0)), uintptr(_p1), uintptr(len(dest)))
|
||||||
|
sz = int(r0)
|
||||||
|
if e1 != 0 {
|
||||||
|
err = errnoErr(e1)
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
func Lremovexattr(path string, attr string) (err error) {
|
||||||
|
var _p0 *byte
|
||||||
|
_p0, err = BytePtrFromString(path)
|
||||||
|
if err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
var _p1 *byte
|
||||||
|
_p1, err = BytePtrFromString(attr)
|
||||||
|
if err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
_, _, e1 := Syscall(SYS_LREMOVEXATTR, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0)
|
||||||
|
if e1 != 0 {
|
||||||
|
err = errnoErr(e1)
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
func Lsetxattr(path string, attr string, data []byte, flags int) (err error) {
|
||||||
|
var _p0 *byte
|
||||||
|
_p0, err = BytePtrFromString(path)
|
||||||
|
if err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
var _p1 *byte
|
||||||
|
_p1, err = BytePtrFromString(attr)
|
||||||
|
if err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
var _p2 unsafe.Pointer
|
||||||
|
if len(data) > 0 {
|
||||||
|
_p2 = unsafe.Pointer(&data[0])
|
||||||
|
} else {
|
||||||
|
_p2 = unsafe.Pointer(&_zero)
|
||||||
|
}
|
||||||
|
_, _, e1 := Syscall6(SYS_LSETXATTR, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(_p2), uintptr(len(data)), uintptr(flags), 0)
|
||||||
|
if e1 != 0 {
|
||||||
|
err = errnoErr(e1)
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
func Mkdirat(dirfd int, path string, mode uint32) (err error) {
|
func Mkdirat(dirfd int, path string, mode uint32) (err error) {
|
||||||
var _p0 *byte
|
var _p0 *byte
|
||||||
_p0, err = BytePtrFromString(path)
|
_p0, err = BytePtrFromString(path)
|
||||||
@ -754,6 +959,17 @@ func Nanosleep(time *Timespec, leftover *Timespec) (err error) {
|
|||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
func PerfEventOpen(attr *PerfEventAttr, pid int, cpu int, groupFd int, flags int) (fd int, err error) {
|
||||||
|
r0, _, e1 := Syscall6(SYS_PERF_EVENT_OPEN, uintptr(unsafe.Pointer(attr)), uintptr(pid), uintptr(cpu), uintptr(groupFd), uintptr(flags), 0)
|
||||||
|
fd = int(r0)
|
||||||
|
if e1 != 0 {
|
||||||
|
err = errnoErr(e1)
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
func PivotRoot(newroot string, putold string) (err error) {
|
func PivotRoot(newroot string, putold string) (err error) {
|
||||||
var _p0 *byte
|
var _p0 *byte
|
||||||
_p0, err = BytePtrFromString(newroot)
|
_p0, err = BytePtrFromString(newroot)
|
||||||
@ -794,6 +1010,17 @@ func Prctl(option int, arg2 uintptr, arg3 uintptr, arg4 uintptr, arg5 uintptr) (
|
|||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
func Pselect(nfd int, r *FdSet, w *FdSet, e *FdSet, timeout *Timespec, sigmask *Sigset_t) (n int, err error) {
|
||||||
|
r0, _, e1 := Syscall6(SYS_PSELECT6, uintptr(nfd), uintptr(unsafe.Pointer(r)), uintptr(unsafe.Pointer(w)), uintptr(unsafe.Pointer(e)), uintptr(unsafe.Pointer(timeout)), uintptr(unsafe.Pointer(sigmask)))
|
||||||
|
n = int(r0)
|
||||||
|
if e1 != 0 {
|
||||||
|
err = errnoErr(e1)
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
func read(fd int, p []byte) (n int, err error) {
|
func read(fd int, p []byte) (n int, err error) {
|
||||||
var _p0 unsafe.Pointer
|
var _p0 unsafe.Pointer
|
||||||
if len(p) > 0 {
|
if len(p) > 0 {
|
||||||
@ -851,6 +1078,32 @@ func Renameat(olddirfd int, oldpath string, newdirfd int, newpath string) (err e
|
|||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
func RequestKey(keyType string, description string, callback string, destRingid int) (id int, err error) {
|
||||||
|
var _p0 *byte
|
||||||
|
_p0, err = BytePtrFromString(keyType)
|
||||||
|
if err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
var _p1 *byte
|
||||||
|
_p1, err = BytePtrFromString(description)
|
||||||
|
if err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
var _p2 *byte
|
||||||
|
_p2, err = BytePtrFromString(callback)
|
||||||
|
if err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
r0, _, e1 := Syscall6(SYS_REQUEST_KEY, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(unsafe.Pointer(_p2)), uintptr(destRingid), 0, 0)
|
||||||
|
id = int(r0)
|
||||||
|
if e1 != 0 {
|
||||||
|
err = errnoErr(e1)
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
func Setdomainname(p []byte) (err error) {
|
func Setdomainname(p []byte) (err error) {
|
||||||
var _p0 unsafe.Pointer
|
var _p0 unsafe.Pointer
|
||||||
if len(p) > 0 {
|
if len(p) > 0 {
|
||||||
@ -960,8 +1213,33 @@ func Setxattr(path string, attr string, data []byte, flags int) (err error) {
|
|||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
func Statx(dirfd int, path string, flags int, mask int, stat *Statx_t) (err error) {
|
||||||
|
var _p0 *byte
|
||||||
|
_p0, err = BytePtrFromString(path)
|
||||||
|
if err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
_, _, e1 := Syscall6(SYS_STATX, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(flags), uintptr(mask), uintptr(unsafe.Pointer(stat)), 0)
|
||||||
|
if e1 != 0 {
|
||||||
|
err = errnoErr(e1)
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
func Sync() {
|
func Sync() {
|
||||||
Syscall(SYS_SYNC, 0, 0, 0)
|
SyscallNoError(SYS_SYNC, 0, 0, 0)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
func Syncfs(fd int) (err error) {
|
||||||
|
_, _, e1 := Syscall(SYS_SYNCFS, uintptr(fd), 0, 0)
|
||||||
|
if e1 != 0 {
|
||||||
|
err = errnoErr(e1)
|
||||||
|
}
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1010,7 +1288,7 @@ func Times(tms *Tms) (ticks uintptr, err error) {
|
|||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
func Umask(mask int) (oldmask int) {
|
func Umask(mask int) (oldmask int) {
|
||||||
r0, _, _ := RawSyscall(SYS_UMASK, uintptr(mask), 0, 0)
|
r0, _ := RawSyscallNoError(SYS_UMASK, uintptr(mask), 0, 0)
|
||||||
oldmask = int(r0)
|
oldmask = int(r0)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
@ -1052,16 +1330,6 @@ func Unshare(flags int) (err error) {
|
|||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
func Ustat(dev int, ubuf *Ustat_t) (err error) {
|
|
||||||
_, _, e1 := Syscall(SYS_USTAT, uintptr(dev), uintptr(unsafe.Pointer(ubuf)), 0)
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func write(fd int, p []byte) (n int, err error) {
|
func write(fd int, p []byte) (n int, err error) {
|
||||||
var _p0 unsafe.Pointer
|
var _p0 unsafe.Pointer
|
||||||
if len(p) > 0 {
|
if len(p) > 0 {
|
||||||
@ -1169,14 +1437,8 @@ func Mlock(b []byte) (err error) {
|
|||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
func Munlock(b []byte) (err error) {
|
func Mlockall(flags int) (err error) {
|
||||||
var _p0 unsafe.Pointer
|
_, _, e1 := Syscall(SYS_MLOCKALL, uintptr(flags), 0, 0)
|
||||||
if len(b) > 0 {
|
|
||||||
_p0 = unsafe.Pointer(&b[0])
|
|
||||||
} else {
|
|
||||||
_p0 = unsafe.Pointer(&_zero)
|
|
||||||
}
|
|
||||||
_, _, e1 := Syscall(SYS_MUNLOCK, uintptr(_p0), uintptr(len(b)), 0)
|
|
||||||
if e1 != 0 {
|
if e1 != 0 {
|
||||||
err = errnoErr(e1)
|
err = errnoErr(e1)
|
||||||
}
|
}
|
||||||
@ -1185,8 +1447,30 @@ func Munlock(b []byte) (err error) {
|
|||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
func Mlockall(flags int) (err error) {
|
func Msync(b []byte, flags int) (err error) {
|
||||||
_, _, e1 := Syscall(SYS_MLOCKALL, uintptr(flags), 0, 0)
|
var _p0 unsafe.Pointer
|
||||||
|
if len(b) > 0 {
|
||||||
|
_p0 = unsafe.Pointer(&b[0])
|
||||||
|
} else {
|
||||||
|
_p0 = unsafe.Pointer(&_zero)
|
||||||
|
}
|
||||||
|
_, _, e1 := Syscall(SYS_MSYNC, uintptr(_p0), uintptr(len(b)), uintptr(flags))
|
||||||
|
if e1 != 0 {
|
||||||
|
err = errnoErr(e1)
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
func Munlock(b []byte) (err error) {
|
||||||
|
var _p0 unsafe.Pointer
|
||||||
|
if len(b) > 0 {
|
||||||
|
_p0 = unsafe.Pointer(&b[0])
|
||||||
|
} else {
|
||||||
|
_p0 = unsafe.Pointer(&_zero)
|
||||||
|
}
|
||||||
|
_, _, e1 := Syscall(SYS_MUNLOCK, uintptr(_p0), uintptr(len(b)), 0)
|
||||||
if e1 != 0 {
|
if e1 != 0 {
|
||||||
err = errnoErr(e1)
|
err = errnoErr(e1)
|
||||||
}
|
}
|
||||||
@ -1262,6 +1546,21 @@ func Fstat(fd int, stat *Stat_t) (err error) {
|
|||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
func Fstatat(dirfd int, path string, stat *Stat_t, flags int) (err error) {
|
||||||
|
var _p0 *byte
|
||||||
|
_p0, err = BytePtrFromString(path)
|
||||||
|
if err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
_, _, e1 := Syscall6(SYS_FSTATAT64, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), uintptr(flags), 0, 0)
|
||||||
|
if e1 != 0 {
|
||||||
|
err = errnoErr(e1)
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
func Fstatfs(fd int, buf *Statfs_t) (err error) {
|
func Fstatfs(fd int, buf *Statfs_t) (err error) {
|
||||||
_, _, e1 := Syscall(SYS_FSTATFS, uintptr(fd), uintptr(unsafe.Pointer(buf)), 0)
|
_, _, e1 := Syscall(SYS_FSTATFS, uintptr(fd), uintptr(unsafe.Pointer(buf)), 0)
|
||||||
if e1 != 0 {
|
if e1 != 0 {
|
||||||
@ -1283,7 +1582,7 @@ func Ftruncate(fd int, length int64) (err error) {
|
|||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
func Getegid() (egid int) {
|
func Getegid() (egid int) {
|
||||||
r0, _, _ := RawSyscall(SYS_GETEGID, 0, 0, 0)
|
r0, _ := RawSyscallNoError(SYS_GETEGID, 0, 0, 0)
|
||||||
egid = int(r0)
|
egid = int(r0)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
@ -1291,7 +1590,7 @@ func Getegid() (egid int) {
|
|||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
func Geteuid() (euid int) {
|
func Geteuid() (euid int) {
|
||||||
r0, _, _ := RawSyscall(SYS_GETEUID, 0, 0, 0)
|
r0, _ := RawSyscallNoError(SYS_GETEUID, 0, 0, 0)
|
||||||
euid = int(r0)
|
euid = int(r0)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
@ -1299,7 +1598,7 @@ func Geteuid() (euid int) {
|
|||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
func Getgid() (gid int) {
|
func Getgid() (gid int) {
|
||||||
r0, _, _ := RawSyscall(SYS_GETGID, 0, 0, 0)
|
r0, _ := RawSyscallNoError(SYS_GETGID, 0, 0, 0)
|
||||||
gid = int(r0)
|
gid = int(r0)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
@ -1317,7 +1616,7 @@ func Getrlimit(resource int, rlim *Rlimit) (err error) {
|
|||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
func Getuid() (uid int) {
|
func Getuid() (uid int) {
|
||||||
r0, _, _ := RawSyscall(SYS_GETUID, 0, 0, 0)
|
r0, _ := RawSyscallNoError(SYS_GETUID, 0, 0, 0)
|
||||||
uid = int(r0)
|
uid = int(r0)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
@ -1788,6 +2087,21 @@ func mmap(addr uintptr, length uintptr, prot int, flags int, fd int, offset int6
|
|||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
func futimesat(dirfd int, path string, times *[2]Timeval) (err error) {
|
||||||
|
var _p0 *byte
|
||||||
|
_p0, err = BytePtrFromString(path)
|
||||||
|
if err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
_, _, e1 := Syscall(SYS_FUTIMESAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(times)))
|
||||||
|
if e1 != 0 {
|
||||||
|
err = errnoErr(e1)
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
func Gettimeofday(tv *Timeval) (err error) {
|
func Gettimeofday(tv *Timeval) (err error) {
|
||||||
_, _, e1 := RawSyscall(SYS_GETTIMEOFDAY, uintptr(unsafe.Pointer(tv)), 0, 0)
|
_, _, e1 := RawSyscall(SYS_GETTIMEOFDAY, uintptr(unsafe.Pointer(tv)), 0, 0)
|
||||||
if e1 != 0 {
|
if e1 != 0 {
|
||||||
@ -1813,6 +2127,21 @@ func Utime(path string, buf *Utimbuf) (err error) {
|
|||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
func utimes(path string, times *[2]Timeval) (err error) {
|
||||||
|
var _p0 *byte
|
||||||
|
_p0, err = BytePtrFromString(path)
|
||||||
|
if err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
_, _, e1 := Syscall(SYS_UTIMES, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(times)), 0)
|
||||||
|
if e1 != 0 {
|
||||||
|
err = errnoErr(e1)
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
func pipe(p *[2]_C_int) (err error) {
|
func pipe(p *[2]_C_int) (err error) {
|
||||||
_, _, e1 := RawSyscall(SYS_PIPE, uintptr(unsafe.Pointer(p)), 0, 0)
|
_, _, e1 := RawSyscall(SYS_PIPE, uintptr(unsafe.Pointer(p)), 0, 0)
|
||||||
if e1 != 0 {
|
if e1 != 0 {
|
||||||
|
16
vendor/golang.org/x/sys/unix/zsyscall_solaris_amd64.go
generated
vendored
16
vendor/golang.org/x/sys/unix/zsyscall_solaris_amd64.go
generated
vendored
@ -41,6 +41,7 @@ import (
|
|||||||
//go:cgo_import_dynamic libc_dup dup "libc.so"
|
//go:cgo_import_dynamic libc_dup dup "libc.so"
|
||||||
//go:cgo_import_dynamic libc_dup2 dup2 "libc.so"
|
//go:cgo_import_dynamic libc_dup2 dup2 "libc.so"
|
||||||
//go:cgo_import_dynamic libc_exit exit "libc.so"
|
//go:cgo_import_dynamic libc_exit exit "libc.so"
|
||||||
|
//go:cgo_import_dynamic libc_faccessat faccessat "libc.so"
|
||||||
//go:cgo_import_dynamic libc_fchdir fchdir "libc.so"
|
//go:cgo_import_dynamic libc_fchdir fchdir "libc.so"
|
||||||
//go:cgo_import_dynamic libc_fchmod fchmod "libc.so"
|
//go:cgo_import_dynamic libc_fchmod fchmod "libc.so"
|
||||||
//go:cgo_import_dynamic libc_fchmodat fchmodat "libc.so"
|
//go:cgo_import_dynamic libc_fchmodat fchmodat "libc.so"
|
||||||
@ -169,6 +170,7 @@ import (
|
|||||||
//go:linkname procDup libc_dup
|
//go:linkname procDup libc_dup
|
||||||
//go:linkname procDup2 libc_dup2
|
//go:linkname procDup2 libc_dup2
|
||||||
//go:linkname procExit libc_exit
|
//go:linkname procExit libc_exit
|
||||||
|
//go:linkname procFaccessat libc_faccessat
|
||||||
//go:linkname procFchdir libc_fchdir
|
//go:linkname procFchdir libc_fchdir
|
||||||
//go:linkname procFchmod libc_fchmod
|
//go:linkname procFchmod libc_fchmod
|
||||||
//go:linkname procFchmodat libc_fchmodat
|
//go:linkname procFchmodat libc_fchmodat
|
||||||
@ -298,6 +300,7 @@ var (
|
|||||||
procDup,
|
procDup,
|
||||||
procDup2,
|
procDup2,
|
||||||
procExit,
|
procExit,
|
||||||
|
procFaccessat,
|
||||||
procFchdir,
|
procFchdir,
|
||||||
procFchmod,
|
procFchmod,
|
||||||
procFchmodat,
|
procFchmodat,
|
||||||
@ -695,6 +698,19 @@ func Exit(code int) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func Faccessat(dirfd int, path string, mode uint32, flags int) (err error) {
|
||||||
|
var _p0 *byte
|
||||||
|
_p0, err = BytePtrFromString(path)
|
||||||
|
if err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
_, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procFaccessat)), 4, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(flags), 0, 0)
|
||||||
|
if e1 != 0 {
|
||||||
|
err = e1
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
func Fchdir(fd int) (err error) {
|
func Fchdir(fd int) (err error) {
|
||||||
_, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procFchdir)), 1, uintptr(fd), 0, 0, 0, 0, 0)
|
_, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procFchdir)), 1, uintptr(fd), 0, 0, 0, 0, 0)
|
||||||
if e1 != 0 {
|
if e1 != 0 {
|
||||||
|
2
vendor/golang.org/x/sys/unix/ztypes_linux_386.go
generated
vendored
2
vendor/golang.org/x/sys/unix/ztypes_linux_386.go
generated
vendored
@ -705,6 +705,8 @@ const (
|
|||||||
|
|
||||||
AT_SYMLINK_FOLLOW = 0x400
|
AT_SYMLINK_FOLLOW = 0x400
|
||||||
AT_SYMLINK_NOFOLLOW = 0x100
|
AT_SYMLINK_NOFOLLOW = 0x100
|
||||||
|
|
||||||
|
AT_EACCESS = 0x200
|
||||||
)
|
)
|
||||||
|
|
||||||
type PollFd struct {
|
type PollFd struct {
|
||||||
|
2
vendor/golang.org/x/sys/unix/ztypes_linux_amd64.go
generated
vendored
2
vendor/golang.org/x/sys/unix/ztypes_linux_amd64.go
generated
vendored
@ -723,6 +723,8 @@ const (
|
|||||||
|
|
||||||
AT_SYMLINK_FOLLOW = 0x400
|
AT_SYMLINK_FOLLOW = 0x400
|
||||||
AT_SYMLINK_NOFOLLOW = 0x100
|
AT_SYMLINK_NOFOLLOW = 0x100
|
||||||
|
|
||||||
|
AT_EACCESS = 0x200
|
||||||
)
|
)
|
||||||
|
|
||||||
type PollFd struct {
|
type PollFd struct {
|
||||||
|
2
vendor/golang.org/x/sys/unix/ztypes_linux_arm.go
generated
vendored
2
vendor/golang.org/x/sys/unix/ztypes_linux_arm.go
generated
vendored
@ -693,6 +693,8 @@ const (
|
|||||||
|
|
||||||
AT_SYMLINK_FOLLOW = 0x400
|
AT_SYMLINK_FOLLOW = 0x400
|
||||||
AT_SYMLINK_NOFOLLOW = 0x100
|
AT_SYMLINK_NOFOLLOW = 0x100
|
||||||
|
|
||||||
|
AT_EACCESS = 0x200
|
||||||
)
|
)
|
||||||
|
|
||||||
type PollFd struct {
|
type PollFd struct {
|
||||||
|
2
vendor/golang.org/x/sys/unix/ztypes_linux_arm64.go
generated
vendored
2
vendor/golang.org/x/sys/unix/ztypes_linux_arm64.go
generated
vendored
@ -702,6 +702,8 @@ const (
|
|||||||
|
|
||||||
AT_SYMLINK_FOLLOW = 0x400
|
AT_SYMLINK_FOLLOW = 0x400
|
||||||
AT_SYMLINK_NOFOLLOW = 0x100
|
AT_SYMLINK_NOFOLLOW = 0x100
|
||||||
|
|
||||||
|
AT_EACCESS = 0x200
|
||||||
)
|
)
|
||||||
|
|
||||||
type PollFd struct {
|
type PollFd struct {
|
||||||
|
2
vendor/golang.org/x/sys/unix/ztypes_linux_mips.go
generated
vendored
2
vendor/golang.org/x/sys/unix/ztypes_linux_mips.go
generated
vendored
@ -697,6 +697,8 @@ const (
|
|||||||
|
|
||||||
AT_SYMLINK_FOLLOW = 0x400
|
AT_SYMLINK_FOLLOW = 0x400
|
||||||
AT_SYMLINK_NOFOLLOW = 0x100
|
AT_SYMLINK_NOFOLLOW = 0x100
|
||||||
|
|
||||||
|
AT_EACCESS = 0x200
|
||||||
)
|
)
|
||||||
|
|
||||||
type PollFd struct {
|
type PollFd struct {
|
||||||
|
2
vendor/golang.org/x/sys/unix/ztypes_linux_mips64.go
generated
vendored
2
vendor/golang.org/x/sys/unix/ztypes_linux_mips64.go
generated
vendored
@ -704,6 +704,8 @@ const (
|
|||||||
|
|
||||||
AT_SYMLINK_FOLLOW = 0x400
|
AT_SYMLINK_FOLLOW = 0x400
|
||||||
AT_SYMLINK_NOFOLLOW = 0x100
|
AT_SYMLINK_NOFOLLOW = 0x100
|
||||||
|
|
||||||
|
AT_EACCESS = 0x200
|
||||||
)
|
)
|
||||||
|
|
||||||
type PollFd struct {
|
type PollFd struct {
|
||||||
|
2
vendor/golang.org/x/sys/unix/ztypes_linux_mips64le.go
generated
vendored
2
vendor/golang.org/x/sys/unix/ztypes_linux_mips64le.go
generated
vendored
@ -704,6 +704,8 @@ const (
|
|||||||
|
|
||||||
AT_SYMLINK_FOLLOW = 0x400
|
AT_SYMLINK_FOLLOW = 0x400
|
||||||
AT_SYMLINK_NOFOLLOW = 0x100
|
AT_SYMLINK_NOFOLLOW = 0x100
|
||||||
|
|
||||||
|
AT_EACCESS = 0x200
|
||||||
)
|
)
|
||||||
|
|
||||||
type PollFd struct {
|
type PollFd struct {
|
||||||
|
2
vendor/golang.org/x/sys/unix/ztypes_linux_mipsle.go
generated
vendored
2
vendor/golang.org/x/sys/unix/ztypes_linux_mipsle.go
generated
vendored
@ -697,6 +697,8 @@ const (
|
|||||||
|
|
||||||
AT_SYMLINK_FOLLOW = 0x400
|
AT_SYMLINK_FOLLOW = 0x400
|
||||||
AT_SYMLINK_NOFOLLOW = 0x100
|
AT_SYMLINK_NOFOLLOW = 0x100
|
||||||
|
|
||||||
|
AT_EACCESS = 0x200
|
||||||
)
|
)
|
||||||
|
|
||||||
type PollFd struct {
|
type PollFd struct {
|
||||||
|
2
vendor/golang.org/x/sys/unix/ztypes_linux_ppc64.go
generated
vendored
2
vendor/golang.org/x/sys/unix/ztypes_linux_ppc64.go
generated
vendored
@ -712,6 +712,8 @@ const (
|
|||||||
|
|
||||||
AT_SYMLINK_FOLLOW = 0x400
|
AT_SYMLINK_FOLLOW = 0x400
|
||||||
AT_SYMLINK_NOFOLLOW = 0x100
|
AT_SYMLINK_NOFOLLOW = 0x100
|
||||||
|
|
||||||
|
AT_EACCESS = 0x200
|
||||||
)
|
)
|
||||||
|
|
||||||
type PollFd struct {
|
type PollFd struct {
|
||||||
|
2
vendor/golang.org/x/sys/unix/ztypes_linux_ppc64le.go
generated
vendored
2
vendor/golang.org/x/sys/unix/ztypes_linux_ppc64le.go
generated
vendored
@ -712,6 +712,8 @@ const (
|
|||||||
|
|
||||||
AT_SYMLINK_FOLLOW = 0x400
|
AT_SYMLINK_FOLLOW = 0x400
|
||||||
AT_SYMLINK_NOFOLLOW = 0x100
|
AT_SYMLINK_NOFOLLOW = 0x100
|
||||||
|
|
||||||
|
AT_EACCESS = 0x200
|
||||||
)
|
)
|
||||||
|
|
||||||
type PollFd struct {
|
type PollFd struct {
|
||||||
|
2
vendor/golang.org/x/sys/unix/ztypes_linux_s390x.go
generated
vendored
2
vendor/golang.org/x/sys/unix/ztypes_linux_s390x.go
generated
vendored
@ -728,6 +728,8 @@ const (
|
|||||||
|
|
||||||
AT_SYMLINK_FOLLOW = 0x400
|
AT_SYMLINK_FOLLOW = 0x400
|
||||||
AT_SYMLINK_NOFOLLOW = 0x100
|
AT_SYMLINK_NOFOLLOW = 0x100
|
||||||
|
|
||||||
|
AT_EACCESS = 0x200
|
||||||
)
|
)
|
||||||
|
|
||||||
type PollFd struct {
|
type PollFd struct {
|
||||||
|
18
vendor/golang.org/x/sys/windows/service.go
generated
vendored
18
vendor/golang.org/x/sys/windows/service.go
generated
vendored
@ -43,6 +43,11 @@ const (
|
|||||||
|
|
||||||
SC_STATUS_PROCESS_INFO = 0
|
SC_STATUS_PROCESS_INFO = 0
|
||||||
|
|
||||||
|
SC_ACTION_NONE = 0
|
||||||
|
SC_ACTION_RESTART = 1
|
||||||
|
SC_ACTION_REBOOT = 2
|
||||||
|
SC_ACTION_RUN_COMMAND = 3
|
||||||
|
|
||||||
SERVICE_STOPPED = 1
|
SERVICE_STOPPED = 1
|
||||||
SERVICE_START_PENDING = 2
|
SERVICE_START_PENDING = 2
|
||||||
SERVICE_STOP_PENDING = 3
|
SERVICE_STOP_PENDING = 3
|
||||||
@ -148,6 +153,19 @@ type ENUM_SERVICE_STATUS_PROCESS struct {
|
|||||||
ServiceStatusProcess SERVICE_STATUS_PROCESS
|
ServiceStatusProcess SERVICE_STATUS_PROCESS
|
||||||
}
|
}
|
||||||
|
|
||||||
|
type SERVICE_FAILURE_ACTIONS struct {
|
||||||
|
ResetPeriod uint32
|
||||||
|
RebootMsg *uint16
|
||||||
|
Command *uint16
|
||||||
|
ActionsCount uint32
|
||||||
|
Actions *SC_ACTION
|
||||||
|
}
|
||||||
|
|
||||||
|
type SC_ACTION struct {
|
||||||
|
Type uint32
|
||||||
|
Delay uint32
|
||||||
|
}
|
||||||
|
|
||||||
//sys CloseServiceHandle(handle Handle) (err error) = advapi32.CloseServiceHandle
|
//sys CloseServiceHandle(handle Handle) (err error) = advapi32.CloseServiceHandle
|
||||||
//sys CreateService(mgr Handle, serviceName *uint16, displayName *uint16, access uint32, srvType uint32, startType uint32, errCtl uint32, pathName *uint16, loadOrderGroup *uint16, tagId *uint32, dependencies *uint16, serviceStartName *uint16, password *uint16) (handle Handle, err error) [failretval==0] = advapi32.CreateServiceW
|
//sys CreateService(mgr Handle, serviceName *uint16, displayName *uint16, access uint32, srvType uint32, startType uint32, errCtl uint32, pathName *uint16, loadOrderGroup *uint16, tagId *uint32, dependencies *uint16, serviceStartName *uint16, password *uint16) (handle Handle, err error) [failretval==0] = advapi32.CreateServiceW
|
||||||
//sys OpenService(mgr Handle, serviceName *uint16, access uint32) (handle Handle, err error) [failretval==0] = advapi32.OpenServiceW
|
//sys OpenService(mgr Handle, serviceName *uint16, access uint32) (handle Handle, err error) [failretval==0] = advapi32.OpenServiceW
|
||||||
|
Loading…
Reference in New Issue
Block a user