Преглед изворни кода

windows: make GetDriveType use GetDriveTypeW

Fixes golang/go#23121

Change-Id: I71495b82a573e9f492a52dde325522a6203c06eb
Reviewed-on: https://go-review.googlesource.com/83855
Reviewed-by: Alex Brainman <alex.brainman@gmail.com>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Brad Fitzpatrick пре 8 година
родитељ
комит
0131e684e8
2 измењених фајлова са 3 додато и 3 уклоњено
  1. 1 1
      windows/syscall_windows.go
  2. 2 2
      windows/zsyscall_windows.go

+ 1 - 1
windows/syscall_windows.go

@@ -248,7 +248,7 @@ func NewCallbackCDecl(fn interface{}) uintptr {
 //sys	FindNextVolumeMountPoint(findVolumeMountPoint Handle, volumeMountPoint *uint16, bufferLength uint32) (err error) = FindNextVolumeMountPointW
 //sys	FindVolumeClose(findVolume Handle) (err error)
 //sys	FindVolumeMountPointClose(findVolumeMountPoint Handle) (err error)
-//sys	GetDriveType(rootPathName *uint16) (driveType uint32)
+//sys	GetDriveType(rootPathName *uint16) (driveType uint32) = GetDriveTypeW
 //sys	GetLogicalDrives() (drivesBitMask uint32, err error) [failretval==0]
 //sys	GetLogicalDriveStrings(bufferLength uint32, buffer *uint16) (n uint32, err error) [failretval==0] = GetLogicalDriveStringsW
 //sys	GetVolumeInformation(rootPathName *uint16, volumeNameBuffer *uint16, volumeNameSize uint32, volumeNameSerialNumber *uint32, maximumComponentLength *uint32, fileSystemFlags *uint32, fileSystemNameBuffer *uint16, fileSystemNameSize uint32) (err error) = GetVolumeInformationW

+ 2 - 2
windows/zsyscall_windows.go

@@ -186,7 +186,7 @@ var (
 	procFindNextVolumeMountPointW          = modkernel32.NewProc("FindNextVolumeMountPointW")
 	procFindVolumeClose                    = modkernel32.NewProc("FindVolumeClose")
 	procFindVolumeMountPointClose          = modkernel32.NewProc("FindVolumeMountPointClose")
-	procGetDriveType                       = modkernel32.NewProc("GetDriveType")
+	procGetDriveTypeW                      = modkernel32.NewProc("GetDriveTypeW")
 	procGetLogicalDrives                   = modkernel32.NewProc("GetLogicalDrives")
 	procGetLogicalDriveStringsW            = modkernel32.NewProc("GetLogicalDriveStringsW")
 	procGetVolumeInformationW              = modkernel32.NewProc("GetVolumeInformationW")
@@ -1962,7 +1962,7 @@ func FindVolumeMountPointClose(findVolumeMountPoint Handle) (err error) {
 }
 
 func GetDriveType(rootPathName *uint16) (driveType uint32) {
-	r0, _, _ := syscall.Syscall(procGetDriveType.Addr(), 1, uintptr(unsafe.Pointer(rootPathName)), 0, 0)
+	r0, _, _ := syscall.Syscall(procGetDriveTypeW.Addr(), 1, uintptr(unsafe.Pointer(rootPathName)), 0, 0)
 	driveType = uint32(r0)
 	return
 }