Skip to content

Commit

Permalink
os: omit existence check for GetFinalPathNameByHandle
Browse files Browse the repository at this point in the history
GetFinalPathNameByHandle exists since Windows Vista, which we no longer
support, so we don't need to prove that it exists before using it.

Updates #57003

Change-Id: Iff2bbe51d3baa3aabcaacf39ea3cbeda0088b9d7
Reviewed-on: https://go-review.googlesource.com/c/go/+/522195
Run-TryBot: Quim Muntal <[email protected]>
Reviewed-by: Carlos Amedee <[email protected]>
TryBot-Result: Gopher Robot <[email protected]>
Reviewed-by: Bryan Mills <[email protected]>
  • Loading branch information
qmuntal committed Aug 25, 2023
1 parent 0a17b2c commit dd38ade
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 10 deletions.
4 changes: 0 additions & 4 deletions src/internal/syscall/windows/syscall_windows.go
Original file line number Diff line number Diff line change
Expand Up @@ -365,10 +365,6 @@ const (

//sys GetFinalPathNameByHandle(file syscall.Handle, filePath *uint16, filePathSize uint32, flags uint32) (n uint32, err error) = kernel32.GetFinalPathNameByHandleW

func LoadGetFinalPathNameByHandle() error {
return procGetFinalPathNameByHandleW.Find()
}

func ErrorLoadingGetTempPath2() error {
return procGetTempPath2W.Find()
}
Expand Down
6 changes: 0 additions & 6 deletions src/os/file_windows.go
Original file line number Diff line number Diff line change
Expand Up @@ -377,12 +377,6 @@ func normaliseLinkPath(path string) (string, error) {

// handle paths, like \??\Volume{abc}\...

err := windows.LoadGetFinalPathNameByHandle()
if err != nil {
// we must be using old version of Windows
return "", err
}

h, err := openSymlink(path)
if err != nil {
return "", err
Expand Down

0 comments on commit dd38ade

Please sign in to comment.