diff options
Diffstat (limited to 'src/pkg/syscall/zsyscall_windows_386.go')
-rw-r--r-- | src/pkg/syscall/zsyscall_windows_386.go | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/pkg/syscall/zsyscall_windows_386.go b/src/pkg/syscall/zsyscall_windows_386.go index 46e16f43c..543992ea6 100644 --- a/src/pkg/syscall/zsyscall_windows_386.go +++ b/src/pkg/syscall/zsyscall_windows_386.go @@ -63,6 +63,7 @@ var ( procSetEnvironmentVariableW = getSysProcAddr(modkernel32, "SetEnvironmentVariableW") procSetFileTime = getSysProcAddr(modkernel32, "SetFileTime") procGetFileAttributesW = getSysProcAddr(modkernel32, "GetFileAttributesW") + procSetFileAttributesW = getSysProcAddr(modkernel32, "SetFileAttributesW") procGetCommandLineW = getSysProcAddr(modkernel32, "GetCommandLineW") procCommandLineToArgvW = getSysProcAddr(modshell32, "CommandLineToArgvW") procLocalFree = getSysProcAddr(modkernel32, "LocalFree") @@ -806,6 +807,20 @@ func GetFileAttributes(name *uint16) (attrs uint32, errno int) { return } +func SetFileAttributes(name *uint16, attrs uint32) (errno int) { + r1, _, e1 := Syscall(procSetFileAttributesW, 2, uintptr(unsafe.Pointer(name)), uintptr(attrs), 0) + if int(r1) == 0 { + if e1 != 0 { + errno = int(e1) + } else { + errno = EINVAL + } + } else { + errno = 0 + } + return +} + func GetCommandLine() (cmd *uint16) { r0, _, _ := Syscall(procGetCommandLineW, 0, 0, 0, 0) cmd = (*uint16)(unsafe.Pointer(r0)) |