-/* $Id: create.c,v 1.12 2001/01/08 02:14:06 dwelch Exp $
+/* $Id: create.c,v 1.13 2001/01/12 21:00:08 dwelch Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel
char *block;
ULONG StartingSector;
ULONG NextCluster;
+ NTSTATUS Status;
Size = DeviceExt->rootDirectorySectors; //FIXME : in fat32, no limit
StartingSector = DeviceExt->rootStart;
{
if (StartingSector == ClusterToSector (DeviceExt, NextCluster + 1))
{
- NextCluster = GetNextCluster (DeviceExt, NextCluster);
+ Status = GetNextCluster (DeviceExt, NextCluster, &NextCluster);
if (NextCluster == 0 || NextCluster == 0xffffffff)
{
*(Vpb->VolumeLabel) = 0;
ULONG StartingSector;
ULONG NextCluster;
WCHAR TempStr[2];
+ NTSTATUS Status;
DPRINT ("FindFile(Parent %x, FileToFind '%S')\n", Parent, FileToFind);
{
if (StartingSector == ClusterToSector (DeviceExt, NextCluster + 1))
{
- NextCluster = GetNextCluster (DeviceExt, NextCluster);
+ Status = GetNextCluster (DeviceExt, NextCluster, &NextCluster);
if (NextCluster == 0 || NextCluster == 0xffffffff)
{
if (StartSector)
FileObject = Stack->FileObject;
DeviceExt = DeviceObject->DeviceExtension;
assert (DeviceExt);
-
+
Status = FsdOpenFile (DeviceExt, FileObject, FileObject->FileName.Buffer);
CHECKPOINT;
// updEntry (DeviceExt, FileObject);
while (Cluster != 0xffffffff && Cluster > 1)
{
- NextCluster = GetNextCluster (DeviceExt, Cluster);
- WriteCluster (DeviceExt, Cluster, 0);
+ Status = GetNextCluster (DeviceExt, Cluster, &NextCluster);
+ // WriteCluster (DeviceExt, Cluster, 0);
Cluster = NextCluster;
}
}
/*
- * $Id: fat.c,v 1.10 2001/01/08 02:14:06 dwelch Exp $
+ * $Id: fat.c,v 1.11 2001/01/12 21:00:08 dwelch Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel
/* FUNCTIONS ****************************************************************/
-ULONG
-Fat32GetNextCluster (PDEVICE_EXTENSION DeviceExt, ULONG CurrentCluster)
+NTSTATUS
+Fat32GetNextCluster (PDEVICE_EXTENSION DeviceExt,
+ ULONG CurrentCluster,
+ PULONG NextCluster)
/*
* FUNCTION: Retrieve the next FAT32 cluster from the FAT table via a physical
* disk read
ULONG FATsector;
ULONG FATeis;
PULONG Block;
+ NTSTATUS Status;
Block = ExAllocatePool (NonPagedPool, 1024);
FATsector = CurrentCluster / (512 / sizeof (ULONG));
FATeis = CurrentCluster - (FATsector * (512 / sizeof (ULONG)));
- /* FIXME: Check status */
- VfatReadSectors (DeviceExt->StorageDevice,
- (ULONG) (DeviceExt->FATStart + FATsector), 1,
- (UCHAR *) Block);
+ Status = VfatReadSectors (DeviceExt->StorageDevice,
+ (ULONG) (DeviceExt->FATStart + FATsector), 1,
+ (UCHAR *) Block);
+ if (!NT_SUCCESS(Status))
+ {
+ return(Status);
+ }
CurrentCluster = Block[FATeis];
if (CurrentCluster >= 0xffffff8 && CurrentCluster <= 0xfffffff)
CurrentCluster = 0xffffffff;
ExFreePool (Block);
- return (CurrentCluster);
+ *NextCluster = CurrentCluster;
+ return (STATUS_SUCCESS);
}
-ULONG
-Fat16GetNextCluster (PDEVICE_EXTENSION DeviceExt, ULONG CurrentCluster)
+NTSTATUS
+Fat16GetNextCluster (PDEVICE_EXTENSION DeviceExt,
+ ULONG CurrentCluster,
+ PULONG NextCluster)
/*
* FUNCTION: Retrieve the next FAT16 cluster from the FAT table from the
* in-memory FAT
*/
{
- PUSHORT Block;
PVOID BaseAddress;
BOOLEAN Valid;
PCACHE_SEGMENT CacheSeg;
&BaseAddress,
&Valid,
&CacheSeg);
+ if (!NT_SUCCESS(Status))
+ {
+ return(Status);
+ }
if (!Valid)
{
Status = VfatReadSectors(DeviceExt->StorageDevice,
if (!NT_SUCCESS(Status))
{
CcReleaseCacheSegment(DeviceExt->StorageBcb, CacheSeg, FALSE);
- return(0xFFFFFFFF);
+ return(Status);
}
}
CurrentCluster = *((PUSHORT)(BaseAddress + (FATOffset % PAGESIZE)));
if (CurrentCluster >= 0xfff8 && CurrentCluster <= 0xffff)
- CurrentCluster = 0xffffffff;
+ CurrentCluster = 0xffffffff;
CcReleaseCacheSegment(DeviceExt->StorageBcb, CacheSeg, TRUE);
- return (CurrentCluster);
+ *NextCluster = CurrentCluster;
+ return (STATUS_SUCCESS);
}
-ULONG
-Fat12GetNextCluster (PDEVICE_EXTENSION DeviceExt, ULONG CurrentCluster)
+NTSTATUS
+Fat12GetNextCluster (PDEVICE_EXTENSION DeviceExt,
+ ULONG CurrentCluster,
+ PULONG NextCluster)
/*
- * FUNCTION: Retrieve the next FAT12 cluster from the FAT table from the
- * in-memory FAT
+ * FUNCTION: Retrieve the next FAT12 cluster from the FAT table
*/
{
- unsigned char *CBlock;
ULONG FATOffset;
ULONG Entry;
- PVOID PBlock;
NTSTATUS Status;
PVOID BaseAddress;
BOOLEAN Valid;
&BaseAddress,
&Valid,
&CacheSeg);
+ if (!NT_SUCCESS(Status))
+ {
+ return(Status);
+ }
if (!Valid)
{
Status = VfatReadSectors(DeviceExt->StorageDevice,
if (!NT_SUCCESS(Status))
{
CcReleaseCacheSegment(DeviceExt->StorageBcb, CacheSeg, FALSE);
- return(0xFFFFFFFF);
+ return(Status);
}
}
Value1 = ((PUCHAR)BaseAddress)[FATOffset % PAGESIZE];
&BaseAddress,
&Valid,
&CacheSeg);
+ if (!NT_SUCCESS(Status))
+ {
+ return(Status);
+ }
if (!Valid)
{
ULONG NextOffset;
if (!NT_SUCCESS(Status))
{
CcReleaseCacheSegment(DeviceExt->StorageBcb, CacheSeg, FALSE);
- return(0xFFFFFFFF);
+ return(Status);
}
}
Value2 = ((PUCHAR)BaseAddress)[0];
if (Entry >= 0xff8 && Entry <= 0xfff)
Entry = 0xffffffff;
DPRINT ("Returning %x\n", Entry);
- return (Entry);
+ *NextCluster = Entry;
+ return (STATUS_SUCCESS);
}
-ULONG
-GetNextCluster (PDEVICE_EXTENSION DeviceExt, ULONG CurrentCluster)
+NTSTATUS
+GetNextCluster (PDEVICE_EXTENSION DeviceExt,
+ ULONG CurrentCluster,
+ PULONG NextCluster)
/*
* FUNCTION: Retrieve the next cluster depending on the FAT type
*/
{
- ULONG NextCluster;
+ NTSTATUS Status;
DPRINT ("GetNextCluster(DeviceExt %x, CurrentCluster %x)\n",
DeviceExt, CurrentCluster);
if (DeviceExt->FatType == FAT16)
{
- NextCluster = Fat16GetNextCluster (DeviceExt, CurrentCluster);
+ Status = Fat16GetNextCluster (DeviceExt, CurrentCluster, NextCluster);
}
else if (DeviceExt->FatType == FAT32)
{
- NextCluster = Fat32GetNextCluster (DeviceExt, CurrentCluster);
+ Status = Fat32GetNextCluster (DeviceExt, CurrentCluster, NextCluster);
}
else
{
- NextCluster = Fat12GetNextCluster (DeviceExt, CurrentCluster);
+ Status = Fat12GetNextCluster (DeviceExt, CurrentCluster, NextCluster);
}
ExReleaseResourceLite (&DeviceExt->FatResource);
- return (NextCluster);
+ return (Status);
+}
+
+NTSTATUS
+VfatRequestDiskPage(PDEVICE_EXTENSION DeviceExt,
+ ULONG Offset,
+ PVOID* BaseAddress,
+ PCACHE_SEGMENT* CacheSeg)
+{
+ NTSTATUS Status;
+ BOOLEAN Valid;
+
+ Status = CcRequestCacheSegment(DeviceExt->StorageBcb,
+ Offset,
+ BaseAddress,
+ &Valid,
+ CacheSeg);
+ if (!NT_SUCCESS(Status))
+ {
+ return(Status);
+ }
+ if (!Valid)
+ {
+ Status = VfatReadSectors(DeviceExt->StorageDevice,
+ Offset,
+ PAGESIZE / BLOCKSIZE,
+ *BaseAddress);
+ if (!NT_SUCCESS(Status))
+ {
+ CcReleaseCacheSegment(DeviceExt->StorageBcb, *CacheSeg, FALSE);
+ return(Status);
+ }
+ }
+ return(STATUS_SUCCESS);
}
+#if 0
ULONG
FAT16FindAvailableCluster (PDEVICE_EXTENSION DeviceExt)
/*
*/
{
PUSHORT Block;
- int i;
- Block = (PUSHORT) DeviceExt->FAT;
- for (i = 2; i < (DeviceExt->Boot->FATSectors * 256); i++)
- if (Block[i] == 0)
- return (i);
- /* Give an error message (out of disk space) if we reach here) */
- return 0;
+ ULONG i;
+ PCACHE_SEG CacheSeg;
+ PVOID BaseAddress;
+ BOOLEAN Valid;
+ ULONG StartOffset;
+ ULONG FatLength;
+ ULONG j;
+ ULONG RCluster;
+ ULONG Length;
+
+ StartOffset = DeviceExt->Boot->FatStart * BLOCKSIZE;
+ FatLength = DevceExt->Boot->FatSectors * BLOCKSIZE;
+
+ if (StartOffset % PAGESIZE) != 0)
+ {
+ Status = VfatRequestDiskPage(DeviceExt,
+ PAGE_ROUND_DOWN(StartOffset),
+ &BaseAddress,
+ &CacheSeg);
+ if (!NT_SUCCESS(Status))
+ {
+ return(0);
+ }
+ Length = max(PAGESIZE, FatLength);
+ for (j = (StartOffset % PAGESIZE); j < Length; j+=2)
+ {
+ if ((*((PUSHORT)(BaseAddress + j))) == 0)
+ {
+ CcReleaseCacheSegment(DeviceExt->StorageBcb, CacheSeg, FALSE);
+ return(j);
+ }
+ }
+ CcReleaseCacheSegment(DeviceExt->StorageBcb, CacheSeg, FALSE);
+ StartOffset = StartOffset + (Length - (StartOffset % PAGESIZE));
+ FatLength = FatLength - (Length - (StartOffset % PAGESIZE));
+ }
+ for (i = 0; i < (FatLength / PAGESIZE); i++)
+ {
+ Status = VfatRequestDiskPage(DeviceExt,
+ PAGE_ROUND_DOWN(StartOffset),
+ &BaseAddress,
+ &CacheSeg);
+ if (!NT_SUCCESS(Status))
+ {
+ return(0);
+ }
+ for (j = 0; j < PAGESIZE; j+=2)
+ {
+ if (*((PUSHORT)(BaseAddress + j)) == 0)
+ {
+ CcReleaseCacheSegment(DeviceExt->StorageBcb,
+ CacheSeg,
+ TRUE);
+ RCluster =
+ (StartOffset + j) - (DeviceExt->Boot->FatStart * BLOCKSIZE);
+ RCluster = RCluster / 2;
+ return(RCluster);
+ }
+ }
+ }
+ return(0);
}
ULONG
return LastCluster;
}
}
+#endif
ULONG
ClusterToSector (PDEVICE_EXTENSION DeviceExt, unsigned long Cluster)
DPRINT ("Finished VFATReadSectors\n");
}
+#if 0
VOID
VFATWriteCluster (PDEVICE_EXTENSION DeviceExt, PVOID Buffer, ULONG Cluster)
/*
VfatWriteSectors (DeviceExt->StorageDevice,
Sector, DeviceExt->Boot->SectorsPerCluster, Buffer);
}
+#endif
-/* $Id: iface.c,v 1.47 2001/01/08 02:14:06 dwelch Exp $
+/* $Id: iface.c,v 1.48 2001/01/12 21:00:08 dwelch Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel
DeviceExt->FatType = FAT16;
}
- // with FAT32 it's not a good idea to load always fat in memory
- // because on a 8GB partition with 2 KO clusters, the fat = 8 MO
- if (DeviceExt->FatType != FAT32)
- {
- DeviceExt->FAT =
- ExAllocatePool (NonPagedPool,
- BLOCKSIZE * DeviceExt->Boot->FATSectors);
- /* FIXME: Check status */
- VfatReadSectors (DeviceToMount, DeviceExt->FATStart,
- DeviceExt->Boot->FATSectors, (UCHAR *) DeviceExt->FAT);
- }
return STATUS_SUCCESS;
}
-# $Id: makefile,v 1.25 2001/01/01 04:42:12 dwelch Exp $
+# $Id: makefile,v 1.26 2001/01/12 21:00:08 dwelch Exp $
#
#
PATH_TO_TOP = ../../..
rw.o finfo.o volume.o shutdown.o $(TARGET).coff
LIBS = ../../../ntoskrnl/ntoskrnl.a
-CFLAGS = -g
+CFLAGS = -g -Wall -Werror
all: $(TARGET).nostrip.sys $(TARGET).sys
-/* $Id: rw.c,v 1.14 2001/01/08 02:14:06 dwelch Exp $
+
+/* $Id: rw.c,v 1.15 2001/01/12 21:00:08 dwelch Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel
/* FUNCTIONS *****************************************************************/
-VOID
+NTSTATUS
NextCluster(PDEVICE_EXTENSION DeviceExt,
ULONG FirstCluster,
PULONG CurrentCluster)
{
- DPRINT("NextCluster() (*CurrentCluster) 0x%x\n", (*CurrentCluster));
if (FirstCluster == 1)
{
(*CurrentCluster) += DeviceExt->Boot->SectorsPerCluster;
+ return(STATUS_SUCCESS);
}
else
{
- (*CurrentCluster) = GetNextCluster(DeviceExt, (*CurrentCluster));
+ NTSTATUS Status;
+
+ Status = GetNextCluster(DeviceExt, (*CurrentCluster), CurrentCluster);
+ return(Status);
}
- DPRINT("NextCluster() finished (*CurrentCluster) 0x%x\n",
- (*CurrentCluster));
}
-ULONG
+NTSTATUS
OffsetToCluster(PDEVICE_EXTENSION DeviceExt,
ULONG FirstCluster,
- ULONG FileOffset)
+ ULONG FileOffset,
+ PULONG Cluster)
{
ULONG CurrentCluster;
ULONG i;
-
- DPRINT("OffsetToCluster(FirstCluster 0x%x)\n", FirstCluster);
+ NTSTATUS Status;
- CurrentCluster = FirstCluster;
if (FirstCluster == 1)
{
/* root of FAT16 or FAT12 */
- CurrentCluster = DeviceExt->rootStart + FileOffset
+ *Cluster = DeviceExt->rootStart + FileOffset
/ (DeviceExt->BytesPerCluster) * DeviceExt->Boot->SectorsPerCluster;
+ return(STATUS_SUCCESS);
}
else
{
+ CurrentCluster = FirstCluster;
for (i = 0; i < FileOffset / DeviceExt->BytesPerCluster; i++)
{
- CurrentCluster = GetNextCluster (DeviceExt, CurrentCluster);
+ Status = GetNextCluster (DeviceExt, CurrentCluster, &CurrentCluster);
+ if (!NT_SUCCESS(Status))
+ {
+ return(Status);
+ }
}
+ *Cluster = CurrentCluster;
+ return(STATUS_SUCCESS);
}
- DPRINT("OffsetToCluster() = 0x%x\n", CurrentCluster);
- return(CurrentCluster);
}
NTSTATUS
PVFATFCB Fcb;
PVOID Temp;
ULONG TempLength;
+ NTSTATUS Status;
/* PRECONDITION */
assert (DeviceExt != NULL);
for (FileOffset = 0; FileOffset < ReadOffset / DeviceExt->BytesPerCluster;
FileOffset++)
{
- CurrentCluster = GetNextCluster (DeviceExt, CurrentCluster);
+ Status = GetNextCluster (DeviceExt, CurrentCluster, &CurrentCluster);
+ return(Status);
}
/*
else
{
VFATLoadCluster (DeviceExt, Temp, CurrentCluster);
- CurrentCluster = GetNextCluster (DeviceExt, CurrentCluster);
+ Status = GetNextCluster (DeviceExt, CurrentCluster, &CurrentCluster);
}
TempLength = min (Length, DeviceExt->BytesPerCluster -
(ReadOffset % DeviceExt->BytesPerCluster));
else
{
VFATLoadCluster (DeviceExt, Buffer, CurrentCluster);
- CurrentCluster = GetNextCluster (DeviceExt, CurrentCluster);
+ Status = GetNextCluster (DeviceExt, CurrentCluster, &CurrentCluster);
}
if (CurrentCluster == 0xffffffff)
{
else
{
VFATLoadCluster (DeviceExt, Temp, CurrentCluster);
- CurrentCluster = GetNextCluster (DeviceExt, CurrentCluster);
+ Status = GetNextCluster (DeviceExt, CurrentCluster, &CurrentCluster);
}
memcpy (Buffer, Temp, Length);
}
PULONG CurrentCluster,
PVOID Destination)
{
- DPRINT("VfatRawReadCluster() *CurrentCluster 0x%x\n", *CurrentCluster);
+ NTSTATUS Status;
+
if (FirstCluster == 1)
{
- /* FIXME: Check status */
- VfatReadSectors (DeviceExt->StorageDevice,
- (*CurrentCluster),
- DeviceExt->Boot->SectorsPerCluster,
- Destination);
- (*CurrentCluster) += DeviceExt->Boot->SectorsPerCluster;
+ Status = VfatReadSectors (DeviceExt->StorageDevice,
+ (*CurrentCluster),
+ DeviceExt->Boot->SectorsPerCluster,
+ Destination);
+ return(Status);
}
else
{
VFATLoadCluster (DeviceExt, Destination, (*CurrentCluster));
- (*CurrentCluster) = GetNextCluster (DeviceExt, (*CurrentCluster));
+ Status = STATUS_SUCCESS;
+ return(Status);
}
- DPRINT("VfatRawReadCluster() finished *CurrentCluster 0x%x\n",
- *CurrentCluster);
- return(STATUS_SUCCESS);
}
NTSTATUS
return(Status);
}
}
- else
- {
- /*
- * Otherwise go on to the next cluster
- */
- if (FirstCluster == 1)
- {
- (*CurrentCluster) += DeviceExt->Boot->SectorsPerCluster;
- }
- else
- {
- (*CurrentCluster) = GetNextCluster(DeviceExt, (*CurrentCluster));
- }
- }
/*
* Copy the data from the cache to the caller
*/
memcpy(Destination, BaseAddress, BytesPerCluster);
CcReleaseCacheSegment(Fcb->RFCB.Bcb, CacheSeg, TRUE);
+
+ Status = NextCluster(DeviceExt, FirstCluster, CurrentCluster);
+ if (!NT_SUCCESS(Status))
+ {
+ return(Status);
+ }
}
else
{
CcReleaseCacheSegment(Fcb->RFCB.Bcb, CacheSeg, FALSE);
return(Status);
}
- if (CurrentCluster == 0xFFFFFFFF)
+ Status = NextCluster(DeviceExt, FirstCluster, CurrentCluster);
+ if ((*CurrentCluster) == 0xFFFFFFFF)
{
break;
}
for (i = 0; i < (PAGESIZE / DeviceExt->BytesPerCluster); i++)
{
NextCluster(DeviceExt, FirstCluster, CurrentCluster);
- if (CurrentCluster == 0xFFFFFFFF)
+ if ((*CurrentCluster) == 0xFFFFFFFF)
{
break;
}
*/
{
ULONG CurrentCluster;
- ULONG FileOffset;
ULONG FirstCluster;
PVFATFCB Fcb;
PVOID Temp;
ULONG TempLength;
ULONG ChunkSize;
+ NTSTATUS Status;
/* PRECONDITION */
assert (DeviceExt != NULL);
*/
Temp = ExAllocatePool (NonPagedPool, ChunkSize);
if (!Temp)
- return STATUS_UNSUCCESSFUL;
+ {
+ return(STATUS_NO_MEMORY);
+ }
/*
* Find the cluster to start the read from
* FIXME: Optimize by remembering the last cluster read and using if
* possible.
*/
- CurrentCluster = OffsetToCluster(DeviceExt, FirstCluster, ReadOffset);
+ Status = OffsetToCluster(DeviceExt, FirstCluster, ReadOffset,
+ &CurrentCluster);
+ if (!NT_SUCCESS(Status))
+ {
+ return(Status);
+ }
/*
* If the read doesn't begin on a cluster boundary then read a full
PVOID Buffer;
ULONG Offset;
PIO_STACK_LOCATION Stack = IoGetCurrentIrpStackLocation (Irp);
- PFILE_OBJECT FileObject = Stack->FileObject;
- PDEVICE_EXTENSION DeviceExt = DeviceObject->DeviceExtension;
+ /* PFILE_OBJECT FileObject = Stack->FileObject; */
+ /* PDEVICE_EXTENSION DeviceExt = DeviceObject->DeviceExtension; */
NTSTATUS Status;
DPRINT ("VfatWrite(DeviceObject %x Irp %x)\n", DeviceObject, Irp);
-/* $Id: shutdown.c,v 1.1 2000/12/29 13:45:01 ekohl Exp $
+/* $Id: shutdown.c,v 1.2 2001/01/12 21:00:08 dwelch Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel
NTSTATUS STDCALL
VfatShutdown(PDEVICE_OBJECT DeviceObject, PIRP Irp)
{
- PIO_STACK_LOCATION Stack = IoGetCurrentIrpStackLocation(Irp);
- PFILE_OBJECT FileObject = Stack->FileObject;
- PDEVICE_EXTENSION DeviceExtension = DeviceObject->DeviceExtension;
NTSTATUS Status;
DPRINT("VfatShutdown(DeviceObject %x, Irp %x)\n",DeviceObject, Irp);
-/* $Id: vfat.h,v 1.20 2001/01/08 02:14:06 dwelch Exp $ */
+/* $Id: vfat.h,v 1.21 2001/01/12 21:00:08 dwelch Exp $ */
#include <ddk/ntifs.h>
int FATEntriesPerSector, FATUnit;
ULONG BytesPerCluster;
ULONG FatType;
- unsigned char* FAT;
} DEVICE_EXTENSION, *PDEVICE_EXTENSION;
typedef struct _VFATFCB
*/
ULONG
ClusterToSector(PDEVICE_EXTENSION DeviceExt, ULONG Cluster);
-ULONG
-GetNextCluster(PDEVICE_EXTENSION DeviceExt, ULONG CurrentCluster);
+NTSTATUS
+GetNextCluster(PDEVICE_EXTENSION DeviceExt,
+ ULONG CurrentCluster,
+ PULONG NextCluster);
VOID
VFATLoadCluster(PDEVICE_EXTENSION DeviceExt, PVOID Buffer, ULONG Cluster);
ULONG
FAT16CountAvailableClusters(PDEVICE_EXTENSION DeviceExt);
ULONG
FAT32CountAvailableClusters(PDEVICE_EXTENSION DeviceExt);
+VOID
+WriteCluster (PDEVICE_EXTENSION DeviceExt, ULONG ClusterToWrite,
+ ULONG NewValue);
/*
* functions from volume.c
-/* $Id: volume.c,v 1.5 2000/12/29 23:17:12 dwelch Exp $
+/* $Id: volume.c,v 1.6 2001/01/12 21:00:08 dwelch Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel
else
FsSizeInfo->TotalAllocationUnits.QuadPart = BootSect->SectorsHuge;
- FsSizeInfo->AvailableAllocationUnits.QuadPart =
- FAT32CountAvailableClusters (DeviceExt);
+ /* FsSizeInfo->AvailableAllocationUnits.QuadPart =
+ FAT32CountAvailableClusters (DeviceExt); */
FsSizeInfo->SectorsPerAllocationUnit = BootSect->SectorsPerCluster;
FsSizeInfo->BytesPerSector = BootSect->BytesPerSector;
FsSizeInfo->TotalAllocationUnits.QuadPart = BootSect->Sectors;
else
FsSizeInfo->TotalAllocationUnits.QuadPart = BootSect->SectorsHuge;
-
+ /*
if (DeviceExt->FatType == FAT16)
FsSizeInfo->AvailableAllocationUnits.QuadPart =
FAT16CountAvailableClusters (DeviceExt);
else
FsSizeInfo->AvailableAllocationUnits.QuadPart =
FAT12CountAvailableClusters (DeviceExt);
-
+ */
FsSizeInfo->SectorsPerAllocationUnit = BootSect->SectorsPerCluster;
FsSizeInfo->BytesPerSector = BootSect->BytesPerSector;
}
PSECTION_PAGE_TABLE PageTables[NR_SECTION_PAGE_TABLES];
} SECTION_PAGE_DIRECTORY, *PSECTION_PAGE_DIRECTORY;
+typedef struct
+{
+ ULONG FileOffset;
+ ULONG Protection;
+ ULONG Attributes;
+ SECTION_PAGE_DIRECTORY PageDirectory;
+ KMUTEX Lock;
+} MM_SECTION_SEGMENT;
+
typedef struct
{
CSHORT Type;
-/* $Id: main.c,v 1.71 2001/01/06 21:40:13 rex Exp $
+/* $Id: main.c,v 1.72 2001/01/12 21:00:07 dwelch Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel
sizeof(LOADER_MODULE) * KeLoaderBlock.ModsCount);
KeLoaderBlock.ModsAddr = (ULONG)&KeLoaderModules;
- /*FIXME: Preliminary hack!!!! Add boot device to beginning of command line.
+ /*
+ * FIXME: Preliminary hack!!!! Add boot device to beginning of command line.
* This should be done by the boot loader.
*/
strcpy (KeLoaderCommandLine,
- "multi(0)disk(0)rdisk(0)partition(1)\\reactos");
+ "multi(0)disk(0)rdisk(0)partition(1)\\reactos ");
strcat (KeLoaderCommandLine, (PUCHAR)KeLoaderBlock.CommandLine);
KeLoaderBlock.CommandLine = (ULONG)KeLoaderCommandLine;
*/
RtlInitAnsiString (&ProcedureName,
"LdrInitializeThunk");
- DPRINT1("Getting address of system DLL entrypoint\n");
Status = LdrGetProcedureAddress ((PVOID)ImageBase,
&ProcedureName,
0,
ZwClose(NTDllSectionHandle);
return (Status);
}
- DPRINT1("SystemDllEntryPoint 0x%08lx\n",
- SystemDllEntryPoint);
*LdrStartupAddr = SystemDllEntryPoint;
/*