123456789101112131415161718192021222324252627282930313233 |
- //go:build windows && (386 || arm || mips || mipsle)
- package yu_file
- import (
- yu_sys "gogs.qqck.cn/s/tools/sys"
- "time"
- )
- func Openfile(name string, dwDesiredAccess, dwShareMode, dwCreationDisposition, dwFlagsAndAttributes uintptr) uintptr {
- _open:
- j_fd, _, j_errno := yu_sys.CreateFileW.Call(yu_sys.S{yu_sys.Unicode, name}, dwDesiredAccess, dwShareMode, 0, dwCreationDisposition, dwFlagsAndAttributes, 0)
- if j_errno == error_SHARING_VIOLATION {
- time.Sleep(time.Microsecond)
- goto _open
- } else if int32(j_fd) == -1 {
- return 0
- }
- return j_fd
- }
- // func setFilePointerEx(fd uintptr, set int64, newFilePointer *int64, whence uintptr) bool {
- // var j_r1 uintptr
- // if newFilePointer == nil {
- // j_r1, _, _ = syscall.SyscallN(addrSetFilePointerEx, fd, uintptr(set), 0, whence)
- // } else {
- // j_r1, _, _ = syscall.SyscallN(addrSetFilePointerEx, fd, uintptr(set), uintptr(unsafe.Pointer(newFilePointer)), whence)
- // }
- // if j_r1 == 0 {
- // return false
- // }
- // return true
- // }
|