Skip to content

Commit dd38ade

Browse files
committed
os: omit existence check for GetFinalPathNameByHandle
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 <quimmuntal@gmail.com> Reviewed-by: Carlos Amedee <carlos@golang.org> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Bryan Mills <bcmills@google.com>
1 parent 0a17b2c commit dd38ade

File tree

2 files changed

+0
-10
lines changed

2 files changed

+0
-10
lines changed

src/internal/syscall/windows/syscall_windows.go

-4
Original file line numberDiff line numberDiff line change
@@ -365,10 +365,6 @@ const (
365365

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

368-
func LoadGetFinalPathNameByHandle() error {
369-
return procGetFinalPathNameByHandleW.Find()
370-
}
371-
372368
func ErrorLoadingGetTempPath2() error {
373369
return procGetTempPath2W.Find()
374370
}

src/os/file_windows.go

-6
Original file line numberDiff line numberDiff line change
@@ -377,12 +377,6 @@ func normaliseLinkPath(path string) (string, error) {
377377

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

380-
err := windows.LoadGetFinalPathNameByHandle()
381-
if err != nil {
382-
// we must be using old version of Windows
383-
return "", err
384-
}
385-
386380
h, err := openSymlink(path)
387381
if err != nil {
388382
return "", err

0 commit comments

Comments
 (0)