[sys] windows: make GetDriveType use GetDriveTypeW

271 views
Skip to first unread message

Brad Fitzpatrick (Gerrit)

unread,
Dec 13, 2017, 3:32:15 PM12/13/17
to Scott Crunkleton, Alex Brainman, Ian Lance Taylor, goph...@pubsubhelper.golang.org, Brad Fitzpatrick, golang-co...@googlegroups.com

Brad Fitzpatrick would like Scott Crunkleton and Alex Brainman to review this change.

View Change

windows: make GetDriveType use GetDriveTypeW

Fixes golang/go#23121

Change-Id: I71495b82a573e9f492a52dde325522a6203c06eb
---
M windows/syscall_windows.go
M windows/zsyscall_windows.go
2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/windows/syscall_windows.go b/windows/syscall_windows.go
index e0da2aa..1e9f4bb 100644
--- a/windows/syscall_windows.go
+++ b/windows/syscall_windows.go
@@ -248,7 +248,7 @@
//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
diff --git a/windows/zsyscall_windows.go b/windows/zsyscall_windows.go
index 6ad2c85..c7b3b15 100644
--- a/windows/zsyscall_windows.go
+++ b/windows/zsyscall_windows.go
@@ -186,7 +186,7 @@
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 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
}

To view, visit change 83855. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: sys
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: I71495b82a573e9f492a52dde325522a6203c06eb
Gerrit-Change-Number: 83855
Gerrit-PatchSet: 1
Gerrit-Owner: Brad Fitzpatrick <brad...@golang.org>
Gerrit-Reviewer: Alex Brainman <alex.b...@gmail.com>
Gerrit-Reviewer: Scott Crunkleton <cru...@gmail.com>

Brad Fitzpatrick (Gerrit)

unread,
Dec 13, 2017, 3:32:57 PM12/13/17
to Brad Fitzpatrick, goph...@pubsubhelper.golang.org, Scott Crunkleton, Alex Brainman, golang-co...@googlegroups.com

Scott, you added this line in 0dd5e194bbf5eb84a39666eb4c98a4d007e4203a (https://go-review.googlesource.com/78235).

View Change

    To view, visit change 83855. To unsubscribe, or for help writing mail filters, visit settings.

    Gerrit-Project: sys
    Gerrit-Branch: master
    Gerrit-MessageType: comment
    Gerrit-Change-Id: I71495b82a573e9f492a52dde325522a6203c06eb
    Gerrit-Change-Number: 83855
    Gerrit-PatchSet: 1
    Gerrit-Owner: Brad Fitzpatrick <brad...@golang.org>
    Gerrit-Reviewer: Alex Brainman <alex.b...@gmail.com>
    Gerrit-Reviewer: Brad Fitzpatrick <brad...@golang.org>
    Gerrit-Reviewer: Scott Crunkleton <cru...@gmail.com>
    Gerrit-Comment-Date: Wed, 13 Dec 2017 20:32:55 +0000
    Gerrit-HasComments: No
    Gerrit-HasLabels: No

    Alex Brainman (Gerrit)

    unread,
    Dec 13, 2017, 4:01:13 PM12/13/17
    to Brad Fitzpatrick, goph...@pubsubhelper.golang.org, Scott Crunkleton, golang-co...@googlegroups.com

    Patch set 1:Code-Review +2

    View Change

      To view, visit change 83855. To unsubscribe, or for help writing mail filters, visit settings.

      Gerrit-Project: sys
      Gerrit-Branch: master
      Gerrit-MessageType: comment
      Gerrit-Change-Id: I71495b82a573e9f492a52dde325522a6203c06eb
      Gerrit-Change-Number: 83855
      Gerrit-PatchSet: 1
      Gerrit-Owner: Brad Fitzpatrick <brad...@golang.org>
      Gerrit-Reviewer: Alex Brainman <alex.b...@gmail.com>
      Gerrit-Reviewer: Brad Fitzpatrick <brad...@golang.org>
      Gerrit-Reviewer: Scott Crunkleton <cru...@gmail.com>
      Gerrit-Comment-Date: Wed, 13 Dec 2017 21:01:08 +0000
      Gerrit-HasComments: No
      Gerrit-HasLabels: Yes

      Brad Fitzpatrick (Gerrit)

      unread,
      Dec 13, 2017, 4:01:41 PM12/13/17
      to Brad Fitzpatrick, goph...@pubsubhelper.golang.org, Alex Brainman, Scott Crunkleton, golang-co...@googlegroups.com

      Patch set 1:Run-TryBot +1

      View Change

        To view, visit change 83855. To unsubscribe, or for help writing mail filters, visit settings.

        Gerrit-Project: sys
        Gerrit-Branch: master
        Gerrit-MessageType: comment
        Gerrit-Change-Id: I71495b82a573e9f492a52dde325522a6203c06eb
        Gerrit-Change-Number: 83855
        Gerrit-PatchSet: 1
        Gerrit-Owner: Brad Fitzpatrick <brad...@golang.org>
        Gerrit-Reviewer: Alex Brainman <alex.b...@gmail.com>
        Gerrit-Reviewer: Brad Fitzpatrick <brad...@golang.org>
        Gerrit-Reviewer: Scott Crunkleton <cru...@gmail.com>
        Gerrit-Comment-Date: Wed, 13 Dec 2017 21:01:38 +0000
        Gerrit-HasComments: No
        Gerrit-HasLabels: Yes

        Gobot Gobot (Gerrit)

        unread,
        Dec 13, 2017, 4:01:44 PM12/13/17
        to Brad Fitzpatrick, goph...@pubsubhelper.golang.org, Alex Brainman, Scott Crunkleton, golang-co...@googlegroups.com

        TryBots beginning. Status page: https://farmer.golang.org/try?commit=e581e859

        View Change

          To view, visit change 83855. To unsubscribe, or for help writing mail filters, visit settings.

          Gerrit-Project: sys
          Gerrit-Branch: master
          Gerrit-MessageType: comment
          Gerrit-Change-Id: I71495b82a573e9f492a52dde325522a6203c06eb
          Gerrit-Change-Number: 83855
          Gerrit-PatchSet: 1
          Gerrit-Owner: Brad Fitzpatrick <brad...@golang.org>
          Gerrit-Reviewer: Alex Brainman <alex.b...@gmail.com>
          Gerrit-Reviewer: Brad Fitzpatrick <brad...@golang.org>
          Gerrit-Reviewer: Scott Crunkleton <cru...@gmail.com>
          Gerrit-CC: Gobot Gobot <go...@golang.org>
          Gerrit-Comment-Date: Wed, 13 Dec 2017 21:01:42 +0000
          Gerrit-HasComments: No
          Gerrit-HasLabels: No

          Gobot Gobot (Gerrit)

          unread,
          Dec 13, 2017, 4:04:55 PM12/13/17
          to Brad Fitzpatrick, goph...@pubsubhelper.golang.org, Alex Brainman, Scott Crunkleton, golang-co...@googlegroups.com

          TryBots are happy.

          Patch set 1:TryBot-Result +1

          View Change

            To view, visit change 83855. To unsubscribe, or for help writing mail filters, visit settings.

            Gerrit-Project: sys
            Gerrit-Branch: master
            Gerrit-MessageType: comment
            Gerrit-Change-Id: I71495b82a573e9f492a52dde325522a6203c06eb
            Gerrit-Change-Number: 83855
            Gerrit-PatchSet: 1
            Gerrit-Owner: Brad Fitzpatrick <brad...@golang.org>
            Gerrit-Reviewer: Alex Brainman <alex.b...@gmail.com>
            Gerrit-Reviewer: Brad Fitzpatrick <brad...@golang.org>
            Gerrit-Reviewer: Gobot Gobot <go...@golang.org>
            Gerrit-Reviewer: Scott Crunkleton <cru...@gmail.com>
            Gerrit-Comment-Date: Wed, 13 Dec 2017 21:04:52 +0000
            Gerrit-HasComments: No
            Gerrit-HasLabels: Yes

            Brad Fitzpatrick (Gerrit)

            unread,
            Dec 13, 2017, 4:08:13 PM12/13/17
            to Brad Fitzpatrick, goph...@pubsubhelper.golang.org, golang-...@googlegroups.com, Gobot Gobot, Alex Brainman, Scott Crunkleton, golang-co...@googlegroups.com

            Brad Fitzpatrick merged this change.

            View Change

            Approvals: Alex Brainman: Looks good to me, approved Brad Fitzpatrick: Run TryBots Gobot Gobot: TryBots succeeded
            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.b...@gmail.com>
            Run-TryBot: Brad Fitzpatrick <brad...@golang.org>
            TryBot-Result: Gobot Gobot <go...@golang.org>
            Gerrit-MessageType: merged
            Gerrit-Change-Id: I71495b82a573e9f492a52dde325522a6203c06eb
            Gerrit-Change-Number: 83855
            Gerrit-PatchSet: 2
            Gerrit-Owner: Brad Fitzpatrick <brad...@golang.org>
            Gerrit-Reviewer: Alex Brainman <alex.b...@gmail.com>
            Reply all
            Reply to author
            Forward
            0 new messages