mirror of
https://github.com/rwinkhart/sys.git
synced 2026-09-05 08:37:31 -04:00
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>
This commit is contained in:
@@ -248,7 +248,7 @@ func NewCallbackCDecl(fn interface{}) uintptr {
|
|||||||
//sys FindNextVolumeMountPoint(findVolumeMountPoint Handle, volumeMountPoint *uint16, bufferLength uint32) (err error) = FindNextVolumeMountPointW
|
//sys FindNextVolumeMountPoint(findVolumeMountPoint Handle, volumeMountPoint *uint16, bufferLength uint32) (err error) = FindNextVolumeMountPointW
|
||||||
//sys FindVolumeClose(findVolume Handle) (err error)
|
//sys FindVolumeClose(findVolume Handle) (err error)
|
||||||
//sys FindVolumeMountPointClose(findVolumeMountPoint 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 GetLogicalDrives() (drivesBitMask uint32, err error) [failretval==0]
|
||||||
//sys GetLogicalDriveStrings(bufferLength uint32, buffer *uint16) (n uint32, err error) [failretval==0] = GetLogicalDriveStringsW
|
//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
|
//sys GetVolumeInformation(rootPathName *uint16, volumeNameBuffer *uint16, volumeNameSize uint32, volumeNameSerialNumber *uint32, maximumComponentLength *uint32, fileSystemFlags *uint32, fileSystemNameBuffer *uint16, fileSystemNameSize uint32) (err error) = GetVolumeInformationW
|
||||||
|
|||||||
@@ -186,7 +186,7 @@ var (
|
|||||||
procFindNextVolumeMountPointW = modkernel32.NewProc("FindNextVolumeMountPointW")
|
procFindNextVolumeMountPointW = modkernel32.NewProc("FindNextVolumeMountPointW")
|
||||||
procFindVolumeClose = modkernel32.NewProc("FindVolumeClose")
|
procFindVolumeClose = modkernel32.NewProc("FindVolumeClose")
|
||||||
procFindVolumeMountPointClose = modkernel32.NewProc("FindVolumeMountPointClose")
|
procFindVolumeMountPointClose = modkernel32.NewProc("FindVolumeMountPointClose")
|
||||||
procGetDriveType = modkernel32.NewProc("GetDriveType")
|
procGetDriveTypeW = modkernel32.NewProc("GetDriveTypeW")
|
||||||
procGetLogicalDrives = modkernel32.NewProc("GetLogicalDrives")
|
procGetLogicalDrives = modkernel32.NewProc("GetLogicalDrives")
|
||||||
procGetLogicalDriveStringsW = modkernel32.NewProc("GetLogicalDriveStringsW")
|
procGetLogicalDriveStringsW = modkernel32.NewProc("GetLogicalDriveStringsW")
|
||||||
procGetVolumeInformationW = modkernel32.NewProc("GetVolumeInformationW")
|
procGetVolumeInformationW = modkernel32.NewProc("GetVolumeInformationW")
|
||||||
@@ -1962,7 +1962,7 @@ func FindVolumeMountPointClose(findVolumeMountPoint Handle) (err error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func GetDriveType(rootPathName *uint16) (driveType uint32) {
|
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)
|
driveType = uint32(r0)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user