github.com/rclone/rclone@v1.66.1-0.20240517100346-7b89735ae726/vfs/vfstest/write_windows.go (about)

     1  //go:build windows
     2  
     3  package vfstest
     4  
     5  import (
     6  	"runtime"
     7  	"testing"
     8  
     9  	"golang.org/x/sys/windows"
    10  )
    11  
    12  // TestWriteFileDoubleClose tests double close on write
    13  func TestWriteFileDoubleClose(t *testing.T) {
    14  	t.Skip("not supported on " + runtime.GOOS)
    15  }
    16  
    17  // writeTestDup performs the platform-specific implementation of the dup() syscall
    18  func writeTestDup(oldfd uintptr) (uintptr, error) {
    19  	p := windows.CurrentProcess()
    20  	var h windows.Handle
    21  	return uintptr(h), windows.DuplicateHandle(p, windows.Handle(oldfd), p, &h, 0, true, windows.DUPLICATE_SAME_ACCESS)
    22  }