def get_file_system(path):
root = os.path.splitdrive(os.path.abspath(path))[0] + '\\'
import ctypes
- from ctypes.wintypes import LPCWSTR, LPWSTR, DWORD
- LPDWORD = ctypes.POINTER(DWORD)
- f = ctypes.windll.kernel32.GetVolumeInformationW
- f.argtypes = (LPCWSTR, LPWSTR, DWORD,
- LPDWORD, LPDWORD, LPDWORD, LPWSTR, DWORD)
+ kernel32 = ctypes.windll.kernel32
buf = ctypes.create_unicode_buffer("", 100)
- if f(root, None, 0, None, None, None, buf, len(buf)):
+ if kernel32.GetVolumeInformationW(root, None, 0, None, None, None, buf, len(buf)):
return buf.value
if get_file_system(support.TESTFN) == "NTFS":