mirror of
https://github.com/tahoe-lafs/tahoe-lafs.git
synced 2025-03-30 07:16:19 +00:00
See if we can use pywin32 GetFileType
This commit is contained in:
parent
52896432e1
commit
ad48e6c005
@ -24,6 +24,10 @@ from win32con import (
|
||||
from win32file import (
|
||||
INVALID_HANDLE_VALUE,
|
||||
FILE_TYPE_CHAR,
|
||||
|
||||
# <https://msdn.microsoft.com/en-us/library/aa364960(VS.85).aspx>
|
||||
# DWORD WINAPI GetFileType(DWORD hFile);
|
||||
GetFileType,
|
||||
)
|
||||
|
||||
# This one not exposed by pywin32 as far as I can tell.
|
||||
@ -113,19 +117,10 @@ def initialize():
|
||||
# and TZOmegaTZIOY
|
||||
# <http://stackoverflow.com/questions/878972/windows-cmd-encoding-change-causes-python-crash/1432462#1432462>.
|
||||
try:
|
||||
#
|
||||
# <https://msdn.microsoft.com/en-us/library/aa364960(VS.85).aspx>
|
||||
# DWORD WINAPI GetFileType(DWORD hFile);
|
||||
#
|
||||
# <https://msdn.microsoft.com/en-us/library/ms683167(VS.85).aspx>
|
||||
# BOOL WINAPI GetConsoleMode(HANDLE hConsole, LPDWORD lpMode);
|
||||
|
||||
GetFileType = WINFUNCTYPE(
|
||||
DWORD, DWORD,
|
||||
use_last_error=True
|
||||
)(("GetFileType", windll.kernel32))
|
||||
|
||||
|
||||
GetConsoleMode = WINFUNCTYPE(
|
||||
BOOL, HANDLE, POINTER(DWORD),
|
||||
use_last_error=True
|
||||
|
Loading…
x
Reference in New Issue
Block a user