diff options
author | Wim <wim@42.be> | 2022-11-27 00:42:16 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-11-27 00:42:16 +0100 |
commit | 4fd0a7672777f0ed15692ae2ba47838208537558 (patch) | |
tree | b119834a8b9ee78aa8f1b2ad05efa7da50516cbf /vendor/modernc.org/libc/libc_windows_386.go | |
parent | 6da9d567dc9195e9a5211f23a6795a41f56a1bfc (diff) | |
download | matterbridge-msglm-4fd0a7672777f0ed15692ae2ba47838208537558.tar.gz matterbridge-msglm-4fd0a7672777f0ed15692ae2ba47838208537558.tar.bz2 matterbridge-msglm-4fd0a7672777f0ed15692ae2ba47838208537558.zip |
Update dependencies (#1929)
Diffstat (limited to 'vendor/modernc.org/libc/libc_windows_386.go')
-rw-r--r-- | vendor/modernc.org/libc/libc_windows_386.go | 59 |
1 files changed, 50 insertions, 9 deletions
diff --git a/vendor/modernc.org/libc/libc_windows_386.go b/vendor/modernc.org/libc/libc_windows_386.go index 268ba5bd..d48e6f65 100644 --- a/vendor/modernc.org/libc/libc_windows_386.go +++ b/vendor/modernc.org/libc/libc_windows_386.go @@ -11,6 +11,7 @@ import ( "unsafe" "modernc.org/libc/errno" + "modernc.org/libc/sys/stat" "modernc.org/libc/sys/types" ) @@ -511,27 +512,33 @@ func X_gmtime32(t *TLS, sourceTime uintptr) uintptr { } // LONG SetWindowLongW( -// HWND hWnd, -// int nIndex, -// LONG dwNewLong +// +// HWND hWnd, +// int nIndex, +// LONG dwNewLong +// // ); func XSetWindowLongW(t *TLS, hwnd uintptr, nIndex int32, dwNewLong long) long { panic(todo("")) } // LONG GetWindowLongW( -// HWND hWnd, -// int nIndex +// +// HWND hWnd, +// int nIndex +// // ); func XGetWindowLongW(t *TLS, hwnd uintptr, nIndex int32) long { panic(todo("")) } // LRESULT LRESULT DefWindowProcW( -// HWND hWnd, -// UINT Msg, -// WPARAM wParam, -// LPARAM lParam +// +// HWND hWnd, +// UINT Msg, +// WPARAM wParam, +// LPARAM lParam +// // ); func XDefWindowProcW(t *TLS, _ ...interface{}) int32 { panic(todo("")) @@ -540,3 +547,37 @@ func XDefWindowProcW(t *TLS, _ ...interface{}) int32 { func XSendMessageTimeoutW(t *TLS, _ ...interface{}) int32 { panic(todo("")) } + +// int _fstat( +// +// int fd, +// struct __stat *buffer +// +// ); +func X_fstat(t *TLS, fd int32, buffer uintptr) int32 { + f, ok := fdToFile(fd) + if !ok { + t.setErrno(EBADF) + return -1 + } + + var d syscall.ByHandleFileInformation + err := syscall.GetFileInformationByHandle(f.Handle, &d) + if err != nil { + t.setErrno(EBADF) + return -1 + } + + var bStat32 = (*stat.X_stat32)(unsafe.Pointer(buffer)) + var accessTime = int64(d.LastAccessTime.HighDateTime)<<32 + int64(d.LastAccessTime.LowDateTime) + bStat32.Fst_atime = int32(WindowsTickToUnixSeconds(accessTime)) + var modTime = int64(d.LastWriteTime.HighDateTime)<<32 + int64(d.LastWriteTime.LowDateTime) + bStat32.Fst_mtime = int32(WindowsTickToUnixSeconds(modTime)) + var crTime = int64(d.CreationTime.HighDateTime)<<32 + int64(d.CreationTime.LowDateTime) + bStat32.Fst_ctime = int32(WindowsTickToUnixSeconds(crTime)) + var fSz = int64(d.FileSizeHigh)<<32 + int64(d.FileSizeLow) + bStat32.Fst_size = int32(fSz) + bStat32.Fst_mode = WindowsAttrbiutesToStat(d.FileAttributes) + + return 0 +} |