aboutsummaryrefslogtreecommitdiff
path: root/vendor/golang.org/x/sys/windows/zsyscall_windows.go
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/golang.org/x/sys/windows/zsyscall_windows.go')
-rw-r--r--vendor/golang.org/x/sys/windows/zsyscall_windows.go15
1 files changed, 14 insertions, 1 deletions
diff --git a/vendor/golang.org/x/sys/windows/zsyscall_windows.go b/vendor/golang.org/x/sys/windows/zsyscall_windows.go
index eb9f062..8bbd0cc 100644
--- a/vendor/golang.org/x/sys/windows/zsyscall_windows.go
+++ b/vendor/golang.org/x/sys/windows/zsyscall_windows.go
@@ -86,6 +86,7 @@ var (
86 procFindNextFileW = modkernel32.NewProc("FindNextFileW") 86 procFindNextFileW = modkernel32.NewProc("FindNextFileW")
87 procFindClose = modkernel32.NewProc("FindClose") 87 procFindClose = modkernel32.NewProc("FindClose")
88 procGetFileInformationByHandle = modkernel32.NewProc("GetFileInformationByHandle") 88 procGetFileInformationByHandle = modkernel32.NewProc("GetFileInformationByHandle")
89 procGetFileInformationByHandleEx = modkernel32.NewProc("GetFileInformationByHandleEx")
89 procGetCurrentDirectoryW = modkernel32.NewProc("GetCurrentDirectoryW") 90 procGetCurrentDirectoryW = modkernel32.NewProc("GetCurrentDirectoryW")
90 procSetCurrentDirectoryW = modkernel32.NewProc("SetCurrentDirectoryW") 91 procSetCurrentDirectoryW = modkernel32.NewProc("SetCurrentDirectoryW")
91 procCreateDirectoryW = modkernel32.NewProc("CreateDirectoryW") 92 procCreateDirectoryW = modkernel32.NewProc("CreateDirectoryW")
@@ -610,7 +611,7 @@ func ExitProcess(exitcode uint32) {
610 return 611 return
611} 612}
612 613
613func CreateFile(name *uint16, access uint32, mode uint32, sa *SecurityAttributes, createmode uint32, attrs uint32, templatefile int32) (handle Handle, err error) { 614func CreateFile(name *uint16, access uint32, mode uint32, sa *SecurityAttributes, createmode uint32, attrs uint32, templatefile Handle) (handle Handle, err error) {
614 r0, _, e1 := syscall.Syscall9(procCreateFileW.Addr(), 7, uintptr(unsafe.Pointer(name)), uintptr(access), uintptr(mode), uintptr(unsafe.Pointer(sa)), uintptr(createmode), uintptr(attrs), uintptr(templatefile), 0, 0) 615 r0, _, e1 := syscall.Syscall9(procCreateFileW.Addr(), 7, uintptr(unsafe.Pointer(name)), uintptr(access), uintptr(mode), uintptr(unsafe.Pointer(sa)), uintptr(createmode), uintptr(attrs), uintptr(templatefile), 0, 0)
615 handle = Handle(r0) 616 handle = Handle(r0)
616 if handle == InvalidHandle { 617 if handle == InvalidHandle {
@@ -772,6 +773,18 @@ func GetFileInformationByHandle(handle Handle, data *ByHandleFileInformation) (e
772 return 773 return
773} 774}
774 775
776func GetFileInformationByHandleEx(handle Handle, class uint32, outBuffer *byte, outBufferLen uint32) (err error) {
777 r1, _, e1 := syscall.Syscall6(procGetFileInformationByHandleEx.Addr(), 4, uintptr(handle), uintptr(class), uintptr(unsafe.Pointer(outBuffer)), uintptr(outBufferLen), 0, 0)
778 if r1 == 0 {
779 if e1 != 0 {
780 err = errnoErr(e1)
781 } else {
782 err = syscall.EINVAL
783 }
784 }
785 return
786}
787
775func GetCurrentDirectory(buflen uint32, buf *uint16) (n uint32, err error) { 788func GetCurrentDirectory(buflen uint32, buf *uint16) (n uint32, err error) {
776 r0, _, e1 := syscall.Syscall(procGetCurrentDirectoryW.Addr(), 2, uintptr(buflen), uintptr(unsafe.Pointer(buf)), 0) 789 r0, _, e1 := syscall.Syscall(procGetCurrentDirectoryW.Addr(), 2, uintptr(buflen), uintptr(unsafe.Pointer(buf)), 0)
777 n = uint32(r0) 790 n = uint32(r0)