mercurial/win32.py
changeset 35549 94a127152e25
parent 35512 5cc1becd0493
child 35550 ed30934165c9
--- a/mercurial/win32.py	Sun Oct 22 22:49:11 2017 +0900
+++ b/mercurial/win32.py	Tue Jan 02 12:02:25 2018 +0900
@@ -8,6 +8,7 @@
 from __future__ import absolute_import
 
 import ctypes
+import ctypes.wintypes as wintypes
 import errno
 import msvcrt
 import os
@@ -33,6 +34,7 @@
 _HANDLE = ctypes.c_void_p
 _HWND = _HANDLE
 _PCCERT_CONTEXT = ctypes.c_void_p
+_MAX_PATH = wintypes.MAX_PATH
 
 _INVALID_HANDLE_VALUE = _HANDLE(-1).value
 
@@ -460,7 +462,7 @@
                    _DRIVE_RAMDISK):
         return None
 
-    size = 256
+    size = _MAX_PATH + 1
     name = ctypes.create_string_buffer(size)
 
     if not _kernel32.GetVolumeInformationA(volume, None, 0, None, None, None,