From f5ab68a2c698db36bd5fcd4caba5d987de957fe4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Herv=C3=A9=20Poussineau?= Date: Tue, 13 Jan 2015 20:08:23 +0000 Subject: [PATCH] [FREELDR] PXE: support backward seeking svn path=/trunk/; revision=66035 --- reactos/boot/freeldr/freeldr/fs/pxe.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/reactos/boot/freeldr/freeldr/fs/pxe.c b/reactos/boot/freeldr/freeldr/fs/pxe.c index e6d2496c1af..54deaac4ccc 100644 --- a/reactos/boot/freeldr/freeldr/fs/pxe.c +++ b/reactos/boot/freeldr/freeldr/fs/pxe.c @@ -263,8 +263,13 @@ static ARC_STATUS PxeSeek(ULONG FileId, LARGE_INTEGER* Position, SEEKMODE SeekMo return EINVAL; if (!_CachedFile && Position->LowPart < _FilePosition) - // We don't support backward seek without caching - return EINVAL; + { + // Close and reopen the file to go to position 0 + if (PxeClose(FileId) != ESUCCESS) + return EIO; + if (PxeOpen(_OpenFileName, OpenReadOnly, &FileId) != ESUCCESS) + return EIO; + } RtlZeroMemory(&readData, sizeof(readData)); readData.Buffer.segment = ((UINT32)_Packet & 0xf0000) / 16;