Undo last change

svn path=/trunk/; revision=1831
This commit is contained in:
Phillip Susi 2001-04-26 04:01:54 +00:00
parent 6de9186661
commit af3325ef66

View file

@ -1,5 +1,5 @@
/* /*
* $Id: fat.c,v 1.22 2001/04/26 01:28:15 phreak Exp $ * $Id: fat.c,v 1.23 2001/04/26 04:01:54 phreak Exp $
* *
* COPYRIGHT: See COPYING in the top level directory * COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel * PROJECT: ReactOS kernel
@ -15,7 +15,7 @@
#include <wchar.h> #include <wchar.h>
#include <ntos/minmax.h> #include <ntos/minmax.h>
#define NDEBUG #define NDEBUGN
#include <debug.h> #include <debug.h>
#include "vfat.h" #include "vfat.h"
@ -133,10 +133,9 @@ Fat12GetNextCluster (PDEVICE_EXTENSION DeviceExt,
PVOID BaseAddress; PVOID BaseAddress;
*NextCluster = 0; *NextCluster = 0;
FATOffset = (CurrentCluster * 12) / 8; /* first byte containing value */
Status = CcRequestCacheSegment(DeviceExt->Fat12StorageBcb, Status = CcRequestCacheSegment(DeviceExt->Fat12StorageBcb,
PAGE_ROUND_DOWN(FATOffset), 0,
&BaseAddress, &BaseAddress,
&Valid, &Valid,
&CacheSeg); &CacheSeg);
@ -148,7 +147,7 @@ Fat12GetNextCluster (PDEVICE_EXTENSION DeviceExt,
{ {
Status = VfatReadSectors(DeviceExt->StorageDevice, Status = VfatReadSectors(DeviceExt->StorageDevice,
DeviceExt->FATStart, DeviceExt->FATStart,
PAGESIZE / BLOCKSIZE, DeviceExt->Boot->FATSectors,
BaseAddress); BaseAddress);
if (!NT_SUCCESS(Status)) if (!NT_SUCCESS(Status))
{ {
@ -158,12 +157,11 @@ Fat12GetNextCluster (PDEVICE_EXTENSION DeviceExt,
} }
CBlock = (PUCHAR)BaseAddress; CBlock = (PUCHAR)BaseAddress;
FATOffset = (CurrentCluster * 12) / 8; /* first byte containing value */
if ((CurrentCluster % 2) == 0) if ((CurrentCluster % 2) == 0)
{ {
Entry = CBlock[FATOffset]; Entry = CBlock[FATOffset];
DPRINT( "Entry = %x, FATOffset = %x\n", Entry, FATOffset );
Entry |= ((CBlock[FATOffset+1] & 0xf)<<8); Entry |= ((CBlock[FATOffset+1] & 0xf)<<8);
DPRINT( "Entry = %x\n", Entry );
} }
else else
{ {
@ -175,7 +173,6 @@ Fat12GetNextCluster (PDEVICE_EXTENSION DeviceExt,
Entry = 0xffffffff; Entry = 0xffffffff;
// DPRINT("Returning %x\n",Entry); // DPRINT("Returning %x\n",Entry);
*NextCluster = Entry; *NextCluster = Entry;
DPRINT( "NextCluster = %x, CurrentCluster = %x\n", *NextCluster, CurrentCluster );
CcReleaseCacheSegment(DeviceExt->Fat12StorageBcb, CacheSeg, TRUE); CcReleaseCacheSegment(DeviceExt->Fat12StorageBcb, CacheSeg, TRUE);
return Entry == 0xffffffff ? STATUS_END_OF_FILE : STATUS_SUCCESS; return Entry == 0xffffffff ? STATUS_END_OF_FILE : STATUS_SUCCESS;
} }