Jacek Caban (@jacek) commented about dlls/wininet/internet.c:
- RETURNS
- Current position of the file on success
*/
- INVALID_SET_FILE_POINTER on failure
DWORD WINAPI InternetSetFilePointer(HINTERNET hFile, LONG lDistanceToMove, PVOID pReserved, DWORD dwMoveContext, DWORD_PTR dwContext) {
- FIXME("(%p %ld %p %ld %Ix): stub\n", hFile, lDistanceToMove, pReserved, dwMoveContext, dwContext);
- DWORD err = ERROR_INVALID_HANDLE, res = INVALID_SET_FILE_POINTER;
- object_header_t *hdr;
- TRACE("(%p %ld %p %ld %Ix)\n", hFile, lDistanceToMove, pReserved, dwMoveContext, dwContext);
- hdr = get_handle_object(hFile);
- if(!hdr)
goto lend;
Error handling is more complicated than it needs to be, you could just SetLastError() and return here and avoid GetLastError()+SetLastError() in the other error path.