David K. Bainbridge | 528b318 | 2017-01-23 08:51:59 -0800 | [diff] [blame] | 1 | // Copyright 2013 Canonical Ltd. |
| 2 | // Licensed under the LGPLv3, see LICENCE file for details. |
| 3 | |
| 4 | // mksyscall_windows.pl -l32 file_windows.go |
| 5 | // MACHINE GENERATED BY THE COMMAND ABOVE; DO NOT EDIT |
| 6 | |
| 7 | package utils |
| 8 | |
| 9 | import "unsafe" |
| 10 | import "syscall" |
| 11 | |
| 12 | var ( |
| 13 | modkernel32 = syscall.NewLazyDLL("kernel32.dll") |
| 14 | |
| 15 | procMoveFileExW = modkernel32.NewProc("MoveFileExW") |
| 16 | ) |
| 17 | |
| 18 | func moveFileEx(lpExistingFileName *uint16, lpNewFileName *uint16, dwFlags uint32) (err error) { |
| 19 | r1, _, e1 := syscall.Syscall(procMoveFileExW.Addr(), 3, uintptr(unsafe.Pointer(lpExistingFileName)), uintptr(unsafe.Pointer(lpNewFileName)), uintptr(dwFlags)) |
| 20 | if r1 == 0 { |
| 21 | if e1 != 0 { |
| 22 | err = error(e1) |
| 23 | } else { |
| 24 | err = syscall.EINVAL |
| 25 | } |
| 26 | } |
| 27 | return |
| 28 | } |