Message313461
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). |
|
Date |
User |
Action |
Args |
2018-03-08 22:16:30 | eryksun | set | recipients:
+ eryksun, paul.moore, tim.golden, zach.ware, steve.dower, izbyshev |
2018-03-08 22:16:30 | eryksun | set | messageid: <1520547390.84.0.467229070634.issue33030@psf.upfronthosting.co.za> |
2018-03-08 22:16:30 | eryksun | link | issue33030 messages |
2018-03-08 22:16:30 | eryksun | create | |
|