Cygwin: disk device: stop using SetFilePointer

This is a really old and crappy API, as the previous commit shows.
Use NtQueryInformationFile(FilePositionInformation) here instead.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
This commit is contained in:
Corinna Vinschen 2019-02-09 18:41:47 +01:00
parent 0be0b8f033
commit 52d91f112e
1 changed files with 6 additions and 3 deletions

View File

@ -384,9 +384,12 @@ fhandler_dev_floppy::dup (fhandler_base *child, int flags)
inline off_t
fhandler_dev_floppy::get_current_position ()
{
LARGE_INTEGER off = { QuadPart: 0LL };
off.LowPart = SetFilePointer (get_handle (), 0, &off.HighPart, FILE_CURRENT);
return off.QuadPart;
IO_STATUS_BLOCK io;
FILE_POSITION_INFORMATION fpi = { { QuadPart : 0LL } };
NtQueryInformationFile (get_handle (), &io, &fpi, sizeof fpi,
FilePositionInformation);
return fpi.CurrentByteOffset.QuadPart;
}
void __reg3