1 #include <msp/core/winapi.h>
2 #include <msp/core/systemerror.h>
4 #include "handle_private.h"
11 using namespace Msp::IO;
13 int sys_seek_type(SeekType st)
22 throw invalid_argument("IO::sys_seek");
30 SeekOffset sys_seek(Handle &handle, SeekOffset offset, SeekType type)
32 LONG high = offset>>32;
33 DWORD ret = SetFilePointer(*handle, offset, &high, sys_seek_type(type));
34 if(ret==INVALID_SET_FILE_POINTER)
36 DWORD err = GetLastError();
38 throw system_error("SetFilePointer");
41 return (SeekOffset(high)<<32) | ret;