forked from mhammond/pywin32
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
bug mhammond#752 - fix ERROR_BAD_LENGTH in GetFileInformationByHandle…
…Ex in x86 builds When called with FileBasicInfo, GetFileInformationByHandleEx may throw pywintypes.error(24, 'GetFileInformationByHandleEx', 'The program issued a command but the command length is incorrect.'). With some older SDKs an odd pragma pack(4) directive is issued in <winsock2.h> before including of <windows.h>: #if (!defined(_WIN64) && !defined(WIN32)) #include <pshpack4.h> #endif ...no pragma pack(pop) #include <windows.h> If windows.h has not been seen earlier, it gets compiled with non default alignment. This makes sizeof and layout of some structs incorrect, including FILE_BASIC_INFO used in GetFileInformationByHandleEx. Neither distutils nor setup.py defines 'WIN32' so we are affected. Among SDKs with this quirk are 7.0a, the one that goes with 'Visual C++ for Python 2.7' and apparently 7.1. SDK known to be not affected are 8.0 and 8.1 from VS2015-update3, but pythonwin's setup.py does not seem to support them now.
- Loading branch information
Showing
3 changed files
with
50 additions
and
0 deletions.
There are no files selected for viewing
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
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
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