-
-
Save joselitosn/fbdd6f62a913bb9850f4 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from cffi import FFI | |
ffi = FFI() | |
ffi.set_unicode(True) | |
ffi.cdef(''' | |
HANDLE FindFirstVolume(LPTSTR lpszVolumeName, DWORD cchBufferLength); | |
BOOL FindVolumeClose(HANDLE hFindVolume); | |
''') | |
lib = ffi.verify(''' | |
#include <windows.h> | |
''', libraries=["kernel32"]) | |
LEN = 10000 | |
buf = ffi.new("TCHAR[]", LEN) | |
h = lib.FindFirstVolume(buf, LEN) | |
print(ffi.string(buf)) | |
lib.FindVolumeClose(h) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment