This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author eryksun
Recipients eryksun, izbyshev, paul.moore, steve.dower, tim.golden, zach.ware
Date 2018-03-08.22:16:30
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1520547390.84.0.467229070634.issue33030@psf.upfronthosting.co.za>
In-reply-to
Content
FYI, here's a sampling of successful calls that modify the last error value.

Most Create- functions intentionally set the last error to 0 on success, such as CreateFile, CreateFileMapping, CreateSymbolicLink, CreateJobObject, CreateEvent, CreateMutex, CreateSemaphore, and CreateWaitableTimer. 

Some other functions also intentionally set the last error to 0 on success, such as SetWaitableTimer and the functions that work with security identifiers (SIDs) such as EqualSid, GetLengthSid, GetSidIdentifierAuthority, and GetSidSubAuthority.

The return value of some functions is the low DWORD of a file size, such as GetCompressedFileSize, GetFileSize, and SetFilePointer. In this case 0xFFFFFFFF is either a valid size or indicates an error. The function is forced to clarify this by setting the last error to 0 on success. GetFileSizeEx and SetFilePointerEx are preferred, since they don't have this problem.

Some functions make internal calls to CreateFile or DeviceIoControl. These cases might even set the last error to a non-zero value on success. Examples include GetVolumePathName (e.g. ERROR_MORE_DATA from DeviceIoControl), GetFinalPathNameByHandle (opening  "\\.\MountPointManager"), and GetDriveType (e.g. for junction mountpoints).
History
Date User Action Args
2018-03-08 22:16:30eryksunsetrecipients: + eryksun, paul.moore, tim.golden, zach.ware, steve.dower, izbyshev
2018-03-08 22:16:30eryksunsetmessageid: <1520547390.84.0.467229070634.issue33030@psf.upfronthosting.co.za>
2018-03-08 22:16:30eryksunlinkissue33030 messages
2018-03-08 22:16:30eryksuncreate