summaryrefslogtreecommitdiff
path: root/src/pkg/syscall/zsyscall_windows_386.go
diff options
context:
space:
mode:
Diffstat (limited to 'src/pkg/syscall/zsyscall_windows_386.go')
-rw-r--r--src/pkg/syscall/zsyscall_windows_386.go19
1 files changed, 17 insertions, 2 deletions
diff --git a/src/pkg/syscall/zsyscall_windows_386.go b/src/pkg/syscall/zsyscall_windows_386.go
index b46493f8d..24c82a479 100644
--- a/src/pkg/syscall/zsyscall_windows_386.go
+++ b/src/pkg/syscall/zsyscall_windows_386.go
@@ -66,6 +66,7 @@ var (
procSetFileTime = modkernel32.NewProc("SetFileTime")
procGetFileAttributesW = modkernel32.NewProc("GetFileAttributesW")
procSetFileAttributesW = modkernel32.NewProc("SetFileAttributesW")
+ procGetFileAttributesExW = modkernel32.NewProc("GetFileAttributesExW")
procGetCommandLineW = modkernel32.NewProc("GetCommandLineW")
procCommandLineToArgvW = modshell32.NewProc("CommandLineToArgvW")
procLocalFree = modkernel32.NewProc("LocalFree")
@@ -141,9 +142,9 @@ func FreeLibrary(handle Handle) (errno int) {
return
}
-func GetProcAddress(module Handle, procname string) (proc Handle, errno int) {
+func GetProcAddress(module Handle, procname string) (proc uintptr, errno int) {
r0, _, e1 := Syscall(procGetProcAddress.Addr(), 2, uintptr(module), uintptr(unsafe.Pointer(StringBytePtr(procname))), 0)
- proc = Handle(r0)
+ proc = uintptr(r0)
if proc == 0 {
if e1 != 0 {
errno = int(e1)
@@ -848,6 +849,20 @@ func SetFileAttributes(name *uint16, attrs uint32) (errno int) {
return
}
+func GetFileAttributesEx(name *uint16, level uint32, info *byte) (errno int) {
+ r1, _, e1 := Syscall(procGetFileAttributesExW.Addr(), 3, uintptr(unsafe.Pointer(name)), uintptr(level), uintptr(unsafe.Pointer(info)))
+ if int(r1) == 0 {
+ if e1 != 0 {
+ errno = int(e1)
+ } else {
+ errno = EINVAL
+ }
+ } else {
+ errno = 0
+ }
+ return
+}
+
func GetCommandLine() (cmd *uint16) {
r0, _, _ := Syscall(procGetCommandLineW.Addr(), 0, 0, 0, 0)
cmd = (*uint16)(unsafe.Pointer(r0))