diff options
| author | Ondřej Surý <ondrej@sury.org> | 2011-09-13 12:00:31 +0200 |
|---|---|---|
| committer | Ondřej Surý <ondrej@sury.org> | 2011-09-13 12:00:31 +0200 |
| commit | 04f99b387021a8ce32a8795360cba9beaf986a81 (patch) | |
| tree | f806c632c5dec5bb83190946d6d8ff8bd33c0e57 /src/pkg/syscall/zsyscall_windows_386.go | |
| parent | d9514677ddaa705852cbba5034cb6d284261b53a (diff) | |
| download | golang-04f99b387021a8ce32a8795360cba9beaf986a81.tar.gz | |
Imported Upstream version 2011.09.07upstream-weekly/2011.09.07
Diffstat (limited to 'src/pkg/syscall/zsyscall_windows_386.go')
| -rw-r--r-- | src/pkg/syscall/zsyscall_windows_386.go | 19 |
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)) |
