strip whitespace from end of lines
Modified: trunk/reactos/ntoskrnl/cc/cacheman.c
Modified: trunk/reactos/ntoskrnl/cc/copy.c
Modified: trunk/reactos/ntoskrnl/cc/fs.c
Modified: trunk/reactos/ntoskrnl/cc/mdl.c
Modified: trunk/reactos/ntoskrnl/cc/pin.c
Modified: trunk/reactos/ntoskrnl/cc/view.c
Modified: trunk/reactos/ntoskrnl/cm/cm.h
Modified: trunk/reactos/ntoskrnl/cm/ntfunc.c
Modified: trunk/reactos/ntoskrnl/cm/regfile.c
Modified: trunk/reactos/ntoskrnl/cm/registry.c
Modified: trunk/reactos/ntoskrnl/cm/regobj.c
Modified: trunk/reactos/ntoskrnl/dbgk/dbgkutil.c
Modified: trunk/reactos/ntoskrnl/dbgk/debug.c
Modified: trunk/reactos/ntoskrnl/ex/callback.c
Modified: trunk/reactos/ntoskrnl/ex/dbgctrl.c
Modified: trunk/reactos/ntoskrnl/ex/error.c
Modified: trunk/reactos/ntoskrnl/ex/event.c
Modified: trunk/reactos/ntoskrnl/ex/evtpair.c
Modified: trunk/reactos/ntoskrnl/ex/fmutex.c
Modified: trunk/reactos/ntoskrnl/ex/handle.c
Modified: trunk/reactos/ntoskrnl/ex/i386/interlck.c
Modified: trunk/reactos/ntoskrnl/ex/init.c
Modified: trunk/reactos/ntoskrnl/ex/interlck.c
Modified: trunk/reactos/ntoskrnl/ex/list.c
Modified: trunk/reactos/ntoskrnl/ex/lookas.c
Modified: trunk/reactos/ntoskrnl/ex/mutant.c
Modified: trunk/reactos/ntoskrnl/ex/power.c
Modified: trunk/reactos/ntoskrnl/ex/profile.c
Modified: trunk/reactos/ntoskrnl/ex/resource.c
Modified: trunk/reactos/ntoskrnl/ex/rundown.c
Modified: trunk/reactos/ntoskrnl/ex/sem.c
Modified: trunk/reactos/ntoskrnl/ex/synch.c
Modified: trunk/reactos/ntoskrnl/ex/sysinfo.c
Modified: trunk/reactos/ntoskrnl/ex/time.c
Modified: trunk/reactos/ntoskrnl/ex/timer.c
Modified: trunk/reactos/ntoskrnl/ex/util.c
Modified: trunk/reactos/ntoskrnl/ex/uuid.c
Modified: trunk/reactos/ntoskrnl/ex/win32k.c
Modified: trunk/reactos/ntoskrnl/ex/work.c
Modified: trunk/reactos/ntoskrnl/ex/zone.c
Modified: trunk/reactos/ntoskrnl/fs/fastio.c
Modified: trunk/reactos/ntoskrnl/fs/filelock.c
Modified: trunk/reactos/ntoskrnl/fs/mcb.c
Modified: trunk/reactos/ntoskrnl/fs/name.c
Modified: trunk/reactos/ntoskrnl/fs/notify.c
Modified: trunk/reactos/ntoskrnl/fs/oplock.c
Modified: trunk/reactos/ntoskrnl/fs/pool.c
Modified: trunk/reactos/ntoskrnl/fs/tunnel.c
Modified: trunk/reactos/ntoskrnl/fs/unc.c
Modified: trunk/reactos/ntoskrnl/fs/util.c
Modified: trunk/reactos/ntoskrnl/inbv/inbv.c
Modified: trunk/reactos/ntoskrnl/include/internal/callbacks.h
Modified: trunk/reactos/ntoskrnl/include/internal/cc.h
Modified: trunk/reactos/ntoskrnl/include/internal/debug.h
Modified: trunk/reactos/ntoskrnl/include/internal/ex.h
Modified: trunk/reactos/ntoskrnl/include/internal/i386/hal.h
Modified: trunk/reactos/ntoskrnl/include/internal/i386/ke.h
Modified: trunk/reactos/ntoskrnl/include/internal/i386/mm.h
Modified: trunk/reactos/ntoskrnl/include/internal/i386/ps.h
Modified: trunk/reactos/ntoskrnl/include/internal/ifs.h
Modified: trunk/reactos/ntoskrnl/include/internal/io.h
Modified: trunk/reactos/ntoskrnl/include/internal/kbd.h
Modified: trunk/reactos/ntoskrnl/include/internal/kd.h
Modified: trunk/reactos/ntoskrnl/include/internal/kdb.h
Modified: trunk/reactos/ntoskrnl/include/internal/kdbochs.h
Modified: trunk/reactos/ntoskrnl/include/internal/kdgdb.h
Modified: trunk/reactos/ntoskrnl/include/internal/ke.h
Modified: trunk/reactos/ntoskrnl/include/internal/ldr.h
Modified: trunk/reactos/ntoskrnl/include/internal/mm.h
Modified: trunk/reactos/ntoskrnl/include/internal/ntoskrnl.h
Modified: trunk/reactos/ntoskrnl/include/internal/ob.h
Modified: trunk/reactos/ntoskrnl/include/internal/pool.h
Modified: trunk/reactos/ntoskrnl/include/internal/port.h
Modified: trunk/reactos/ntoskrnl/include/internal/powerpc/ke.h
Modified: trunk/reactos/ntoskrnl/include/internal/ps.h
Modified: trunk/reactos/ntoskrnl/include/internal/se.h
Modified: trunk/reactos/ntoskrnl/include/internal/trap.h
Modified: trunk/reactos/ntoskrnl/include/internal/v86m.h
Modified: trunk/reactos/ntoskrnl/io/adapter.c
Modified: trunk/reactos/ntoskrnl/io/arcname.c
Modified: trunk/reactos/ntoskrnl/io/bootlog.c
Modified: trunk/reactos/ntoskrnl/io/controller.c
Modified: trunk/reactos/ntoskrnl/io/device.c
Modified: trunk/reactos/ntoskrnl/io/deviface.c
Modified: trunk/reactos/ntoskrnl/io/disk.c
Modified: trunk/reactos/ntoskrnl/io/driver.c
Modified: trunk/reactos/ntoskrnl/io/efi.c
Modified: trunk/reactos/ntoskrnl/io/error.c
Modified: trunk/reactos/ntoskrnl/io/event.c
Modified: trunk/reactos/ntoskrnl/io/file.c
Modified: trunk/reactos/ntoskrnl/io/fs.c
Modified: trunk/reactos/ntoskrnl/io/iocomp.c
Modified: trunk/reactos/ntoskrnl/io/iomgr.c
Modified: trunk/reactos/ntoskrnl/io/iowork.c
Modified: trunk/reactos/ntoskrnl/io/irp.c
Modified: trunk/reactos/ntoskrnl/io/irq.c
Modified: trunk/reactos/ntoskrnl/io/plugplay.c
Modified: trunk/reactos/ntoskrnl/io/pnpdma.c
Modified: trunk/reactos/ntoskrnl/io/pnpmgr.c
Modified: trunk/reactos/ntoskrnl/io/pnpnotify.c
[truncated at 100 lines; 160 more skipped]
Modified: trunk/reactos/ntoskrnl/cc/cacheman.c
--- trunk/reactos/ntoskrnl/cc/cacheman.c	2005-05-09 01:14:42 UTC (rev 15163)
+++ trunk/reactos/ntoskrnl/cc/cacheman.c	2005-05-09 01:38:29 UTC (rev 15164)
@@ -1,5 +1,5 @@
 /* $Id$
- * 
+ *
  * COPYRIGHT:       See COPYING in the top level directory
  * PROJECT:         ReactOS kernel
  * FILE:            ntoskrnl/cc/cacheman.c
@@ -31,7 +31,7 @@
     IN BOOLEAN BcbListHeld
     )
 {
-	LARGE_INTEGER i; 
+	LARGE_INTEGER i;
 
 	UNIMPLEMENTED;
 

Modified: trunk/reactos/ntoskrnl/cc/copy.c
--- trunk/reactos/ntoskrnl/cc/copy.c	2005-05-09 01:14:42 UTC (rev 15163)
+++ trunk/reactos/ntoskrnl/cc/copy.c	2005-05-09 01:38:29 UTC (rev 15164)
@@ -40,7 +40,7 @@
 
 /* FUNCTIONS *****************************************************************/
 
-VOID 
+VOID
 CcInitCacheZeroPage(VOID)
 {
    NTSTATUS Status;
@@ -100,7 +100,7 @@
 		Buffer = pTemp;
 	  }
 #endif
-	  Length = Length - TempLength; 
+	  Length = Length - TempLength;
 	  previous = current;
 	  current = current->NextInChain;
 	  CcRosReleaseCacheSegment(Bcb, previous, TRUE, FALSE, FALSE);
@@ -126,7 +126,7 @@
 	      current2 = current2->NextInChain;
 	      current_size += Bcb->CacheSegmentSize;
 	    }
-	  
+
 	  /*
 	   * Create an MDL which contains all their pages.
 	   */
@@ -191,7 +191,7 @@
 			Buffer = pTemp;
 		  }
 #endif
-	      Length = Length - TempLength; 
+	      Length = Length - TempLength;
 	      CcRosReleaseCacheSegment(Bcb, previous, TRUE, FALSE, FALSE);
 	      current_size += Bcb->CacheSegmentSize;
 	    }
@@ -200,7 +200,7 @@
   return(STATUS_SUCCESS);
 }
 
-NTSTATUS 
+NTSTATUS
 ReadCacheSegment(PCACHE_SEGMENT CacheSeg)
 {
   ULONG Size;
@@ -221,7 +221,7 @@
   MmBuildMdlForNonPagedPool(Mdl);
   Mdl->MdlFlags |= MDL_IO_PAGE_READ;
   KeInitializeEvent(&Event, NotificationEvent, FALSE);
-  Status = IoPageRead(CacheSeg->Bcb->FileObject, Mdl, &SegOffset, & Event, &IoStatus); 
+  Status = IoPageRead(CacheSeg->Bcb->FileObject, Mdl, &SegOffset, & Event, &IoStatus);
   if (Status == STATUS_PENDING)
   {
      KeWaitForSingleObject(&Event, Executive, KernelMode, FALSE, NULL);
@@ -235,13 +235,13 @@
     }
   if (CacheSeg->Bcb->CacheSegmentSize > Size)
     {
-      memset ((char*)CacheSeg->BaseAddress + Size, 0, 
+      memset ((char*)CacheSeg->BaseAddress + Size, 0,
 	      CacheSeg->Bcb->CacheSegmentSize - Size);
     }
   return STATUS_SUCCESS;
 }
 
-NTSTATUS 
+NTSTATUS
 WriteCacheSegment(PCACHE_SEGMENT CacheSeg)
 {
   ULONG Size;
@@ -316,7 +316,7 @@
   KIRQL oldirql;
   PLIST_ENTRY current_entry;
   PCACHE_SEGMENT current;
-  
+
   DPRINT("CcCopyRead(FileObject %x, FileOffset %x, "
 	 "Length %d, Wait %d, Buffer %x, IoStatus %x)\n",
 	 FileObject, (ULONG)FileOffset->QuadPart, Length, Wait,
@@ -324,7 +324,7 @@
 
   Bcb = FileObject->SectionObjectPointer->SharedCacheMap;
   ReadOffset = (ULONG)FileOffset->QuadPart;
-  
+
   DPRINT("AllocationSize %d, FileSize %d\n",
          (ULONG)Bcb->AllocationSize.QuadPart,
          (ULONG)Bcb->FileSize.QuadPart);
@@ -339,7 +339,7 @@
       current_entry = Bcb->BcbSegmentListHead.Flink;
       while (current_entry != &Bcb->BcbSegmentListHead)
 	{
-	  current = CONTAINING_RECORD(current_entry, CACHE_SEGMENT, 
+	  current = CONTAINING_RECORD(current_entry, CACHE_SEGMENT,
 				      BcbSegmentListEntry);
 	  if (!current->Valid && current->FileOffset < ReadOffset + Length
 	      && current->FileOffset + Bcb->CacheSegmentSize > ReadOffset)
@@ -359,7 +359,7 @@
     {
       TempLength = min (Length, Bcb->CacheSegmentSize - TempLength);
       Status = CcRosRequestCacheSegment(Bcb,
-					ROUND_DOWN(ReadOffset, 
+					ROUND_DOWN(ReadOffset,
 						   Bcb->CacheSegmentSize),
 					&BaseAddress, &Valid, &CacheSeg);
       if (!NT_SUCCESS(Status))
@@ -380,14 +380,14 @@
 	      return FALSE;
 	    }
 	}
-      memcpy (Buffer, (char*)BaseAddress + ReadOffset % Bcb->CacheSegmentSize, 
+      memcpy (Buffer, (char*)BaseAddress + ReadOffset % Bcb->CacheSegmentSize,
 	      TempLength);
       CcRosReleaseCacheSegment(Bcb, CacheSeg, TRUE, FALSE, FALSE);
       ReadLength += TempLength;
       Length -= TempLength;
       ReadOffset += TempLength;
       Buffer = (PVOID)((char*)Buffer + TempLength);
-    }  
+    }
   while (Length > 0)
     {
       TempLength = min(max(Bcb->CacheSegmentSize, MAX_RW_LENGTH), Length);
@@ -445,14 +445,14 @@
        current_entry = Bcb->BcbSegmentListHead.Flink;
        while (current_entry != &Bcb->BcbSegmentListHead)
 	 {
-	   CacheSeg = CONTAINING_RECORD(current_entry, CACHE_SEGMENT, 
+	   CacheSeg = CONTAINING_RECORD(current_entry, CACHE_SEGMENT,
 					BcbSegmentListEntry);
 	   if (!CacheSeg->Valid)
 	     {
-	       if ((WriteOffset >= CacheSeg->FileOffset && 
+	       if ((WriteOffset >= CacheSeg->FileOffset &&
 		    WriteOffset < CacheSeg->FileOffset + Bcb->CacheSegmentSize)
-		   || (WriteOffset + Length > CacheSeg->FileOffset && 
-		       WriteOffset + Length <= CacheSeg->FileOffset + 
+		   || (WriteOffset + Length > CacheSeg->FileOffset &&
+		       WriteOffset + Length <= CacheSeg->FileOffset +
 		       Bcb->CacheSegmentSize))
 		 {
 		   KeReleaseSpinLock(&Bcb->BcbLock, oldirql);
@@ -484,10 +484,10 @@
 	       return(FALSE);
 	     }
 	 }
-       memcpy ((char*)BaseAddress + WriteOffset % Bcb->CacheSegmentSize, 
+       memcpy ((char*)BaseAddress + WriteOffset % Bcb->CacheSegmentSize,
 	       Buffer, TempLength);
        CcRosReleaseCacheSegment(Bcb, CacheSeg, TRUE, TRUE, FALSE);
-       
+
        Length -= TempLength;
        WriteOffset += TempLength;
 #if defined(__GNUC__)
@@ -500,7 +500,7 @@
 	  }
 #endif
      }
-   
+
    while (Length > 0)
      {
        TempLength = min (Bcb->CacheSegmentSize, Length);
@@ -612,11 +612,11 @@
   ULONG i;
   IO_STATUS_BLOCK Iosb;
   KEVENT Event;
-  
+
   DPRINT("CcZeroData(FileObject %x, StartOffset %I64x, EndOffset %I64x, "
-	 "Wait %d)\n", FileObject, StartOffset->QuadPart, EndOffset->QuadPart, 
+	 "Wait %d)\n", FileObject, StartOffset->QuadPart, EndOffset->QuadPart,
 	 Wait);
-  
+
   Length = EndOffset->u.LowPart - StartOffset->u.LowPart;
   WriteOffset.QuadPart = StartOffset->QuadPart;
 
@@ -625,7 +625,7 @@
       /* File is not cached */
 
       Mdl = alloca(MmSizeOfMdl(NULL, MAX_ZERO_LENGTH));
- 
+
       while (Length > 0)
 	{
 	  if (Length + WriteOffset.u.LowPart % PAGE_SIZE > MAX_ZERO_LENGTH)
@@ -649,7 +649,7 @@
              KeWaitForSingleObject(&Event, Executive, KernelMode, FALSE, NULL);
              Status = Iosb.Status;
 	  }
-          MmUnmapLockedPages(Mdl->MappedSystemVa, Mdl);            
+          MmUnmapLockedPages(Mdl->MappedSystemVa, Mdl);
 	  if (!NT_SUCCESS(Status))
 	    {
 	      return(FALSE);
@@ -675,14 +675,14 @@
 	  current_entry = Bcb->BcbSegmentListHead.Flink;
 	  while (current_entry != &Bcb->BcbSegmentListHead)
 	    {
-	      CacheSeg = CONTAINING_RECORD(current_entry, CACHE_SEGMENT, 
+	      CacheSeg = CONTAINING_RECORD(current_entry, CACHE_SEGMENT,
 					   BcbSegmentListEntry);
 	      if (!CacheSeg->Valid)
 		{
-		  if ((WriteOffset.u.LowPart >= CacheSeg->FileOffset && 
+		  if ((WriteOffset.u.LowPart >= CacheSeg->FileOffset &&
 		       WriteOffset.u.LowPart < CacheSeg->FileOffset + Bcb->CacheSegmentSize)
-		      || (WriteOffset.u.LowPart + Length > CacheSeg->FileOffset && 
-			  WriteOffset.u.LowPart + Length <= 
+		      || (WriteOffset.u.LowPart + Length > CacheSeg->FileOffset &&
+			  WriteOffset.u.LowPart + Length <=
 			  CacheSeg->FileOffset + Bcb->CacheSegmentSize))
 		    {
 		      KeReleaseSpinLock(&Bcb->BcbLock, oldirql);
@@ -726,7 +726,7 @@
 		      Status = ReadCacheSegment(current);
 		      if (!NT_SUCCESS(Status))
 			{
-			  DPRINT1("ReadCacheSegment failed, status %x\n", 
+			  DPRINT1("ReadCacheSegment failed, status %x\n",
 				  Status);
 			}
 		    }
@@ -743,7 +743,7 @@
 	      Length -= TempLength;
 
       	      current = current->NextInChain;
-	    } 
+	    }
 
           current = CacheSeg;
 	  while (current != NULL)

Modified: trunk/reactos/ntoskrnl/cc/fs.c
--- trunk/reactos/ntoskrnl/cc/fs.c	2005-05-09 01:14:42 UTC (rev 15163)
+++ trunk/reactos/ntoskrnl/cc/fs.c	2005-05-09 01:38:29 UTC (rev 15164)
@@ -1,4 +1,4 @@
-/* $Id:$
+/* $Id$
  *
  * COPYRIGHT:       See COPYING in the top level directory
  * PROJECT:         ReactOS kernel
@@ -17,7 +17,7 @@
 #ifndef VACB_MAPPING_GRANULARITY
 #define VACB_MAPPING_GRANULARITY (256 * 1024)
 #endif
- 
+
 /* GLOBALS   *****************************************************************/
 
 extern FAST_MUTEX ViewLock;
@@ -41,7 +41,7 @@
 {
 	UNIMPLEMENTED;
 
-	LARGE_INTEGER i; 
+	LARGE_INTEGER i;
 	i.QuadPart = 0;
 	return i;
 }
@@ -71,7 +71,7 @@
 {
 	UNIMPLEMENTED;
 
-	LARGE_INTEGER i; 
+	LARGE_INTEGER i;
 	i.QuadPart = 0;
 	return i;
 }
@@ -136,7 +136,7 @@
   LIST_ENTRY FreeListHead;
   NTSTATUS Status;
 
-  DPRINT("CcSetFileSizes(FileObject %x, FileSizes %x)\n", 
+  DPRINT("CcSetFileSizes(FileObject %x, FileSizes %x)\n",
 	 FileObject, FileSizes);
   DPRINT("AllocationSize %d, FileSize %d, ValidDataLength %d\n",
          (ULONG)FileSizes->AllocationSize.QuadPart,
@@ -151,7 +151,7 @@
    */
   if (Bcb == NULL)
      return;
- 
+
   if (FileSizes->AllocationSize.QuadPart < Bcb->AllocationSize.QuadPart)
   {
      InitializeListHead(&FreeListHead);
@@ -184,7 +184,7 @@
 	   }
 	}
      }
-     
+
      Bcb->AllocationSize = FileSizes->AllocationSize;
      Bcb->FileSize = FileSizes->FileSize;
      KeReleaseSpinLock(&Bcb->BcbLock, oldirql);

Modified: trunk/reactos/ntoskrnl/cc/mdl.c
--- trunk/reactos/ntoskrnl/cc/mdl.c	2005-05-09 01:14:42 UTC (rev 15163)
+++ trunk/reactos/ntoskrnl/cc/mdl.c	2005-05-09 01:38:29 UTC (rev 15164)
@@ -1,5 +1,5 @@
 /* $Id$
- * 
+ *
  * COPYRIGHT:       See COPYING in the top level directory
  * PROJECT:         ReactOS kernel
  * FILE:            ntoskrnl/cc/fs.c
@@ -49,13 +49,13 @@
  * 	Used by CcMdlReadComplete@8 and FsRtl
  *
  */
-VOID 
+VOID
 STDCALL
 CcMdlReadCompleteDev(IN PMDL MdlChain,
                      IN PFILE_OBJECT FileObject)
 {
     PMDL Mdl;
-    
+
     /* Free MDLs */
     while ((Mdl = MdlChain))
     {
@@ -88,11 +88,11 @@
 {
     PDEVICE_OBJECT DeviceObject = NULL;
     PFAST_IO_DISPATCH FastDispatch;
-   
+
     /* Get Fast Dispatch Data */
     DeviceObject = IoGetRelatedDeviceObject(FileObject);
     FastDispatch = DeviceObject->DriverObject->FastIoDispatch;
-    
+
     /* Check if we support Fast Calls, and check this one */
     if (FastDispatch && FastDispatch->MdlReadComplete)
     {
@@ -101,7 +101,7 @@
                                       MdlChain,
                                       DeviceObject);
     }
-    
+
     /* Use slow path */
     CcMdlReadCompleteDev(MdlChain, FileObject);
 }
@@ -117,11 +117,11 @@
 {
     PDEVICE_OBJECT DeviceObject = NULL;
     PFAST_IO_DISPATCH FastDispatch;
-   
+
     /* Get Fast Dispatch Data */
     DeviceObject = IoGetRelatedDeviceObject(FileObject);
     FastDispatch = DeviceObject->DriverObject->FastIoDispatch;
-    
+
     /* Check if we support Fast Calls, and check this one */
     if (FastDispatch && FastDispatch->MdlWriteComplete)
     {
@@ -131,7 +131,7 @@
                                        MdlChain,
                                        DeviceObject);
     }
-    
+
     /* Use slow path */
     CcMdlWriteCompleteDev(FileOffset, MdlChain, FileObject);
 }

Modified: trunk/reactos/ntoskrnl/cc/pin.c
--- trunk/reactos/ntoskrnl/cc/pin.c	2005-05-09 01:14:42 UTC (rev 15163)
+++ trunk/reactos/ntoskrnl/cc/pin.c	2005-05-09 01:38:29 UTC (rev 15164)
@@ -40,11 +40,11 @@
   NTSTATUS Status;
   PINTERNAL_BCB iBcb;
   ULONG ROffset;
-  
+
   DPRINT("CcMapData(FileObject %x, FileOffset %d, Length %d, Wait %d,"
 	 " pBcb %x, pBuffer %x)\n", FileObject, (ULONG)FileOffset->QuadPart,
 	 Length, Wait, pBcb, pBuffer);
-  
+
   ReadOffset = (ULONG)FileOffset->QuadPart;
   Bcb = FileObject->SectionObjectPointer->SharedCacheMap;
   ASSERT(Bcb);
@@ -52,7 +52,7 @@
   DPRINT("AllocationSize %d, FileSize %d\n",
          (ULONG)Bcb->AllocationSize.QuadPart,
          (ULONG)Bcb->FileSize.QuadPart);
-  
+
   if (ReadOffset % Bcb->CacheSegmentSize + Length > Bcb->CacheSegmentSize)
     {
       return(FALSE);
@@ -193,7 +193,7 @@
 CcUnpinData (IN PVOID Bcb)
 {
   PINTERNAL_BCB iBcb = Bcb;
-  CcRosReleaseCacheSegment(iBcb->CacheSegment->Bcb, iBcb->CacheSegment, TRUE, 
+  CcRosReleaseCacheSegment(iBcb->CacheSegment->Bcb, iBcb->CacheSegment, TRUE,
                            iBcb->Dirty, FALSE);
   if (--iBcb->RefCount == 0)
   {

Modified: trunk/reactos/ntoskrnl/cc/view.c
--- trunk/reactos/ntoskrnl/cc/view.c	2005-05-09 01:14:42 UTC (rev 15163)
+++ trunk/reactos/ntoskrnl/cc/view.c	2005-05-09 01:38:29 UTC (rev 15164)
@@ -10,24 +10,24 @@
 
 /* NOTES **********************************************************************
  *
- * This is not the NT implementation of a file cache nor anything much like 
- * it. 
+ * This is not the NT implementation of a file cache nor anything much like
+ * it.
  *
- * The general procedure for a filesystem to implement a read or write 
+ * The general procedure for a filesystem to implement a read or write
  * dispatch routine is as follows
- * 
+ *
  * (1) If caching for the FCB hasn't been initiated then so do by calling
  * CcInitializeFileCache.
- * 
+ *
  * (2) For each 4k region which is being read or written obtain a cache page
- * by calling CcRequestCachePage. 
+ * by calling CcRequestCachePage.
  *
- * (3) If either the page is being read or not completely written, and it is 
+ * (3) If either the page is being read or not completely written, and it is
  * not up to date then read its data from the underlying medium. If the read
- * fails then call CcReleaseCachePage with VALID as FALSE and return a error.  
- * 
+ * fails then call CcReleaseCachePage with VALID as FALSE and return a error.
+ *
  * (4) Copy the data into or out of the page as necessary.
- * 
+ *
  * (5) Release the cache page
  */
 /* INCLUDES ******************************************************************/
@@ -39,9 +39,9 @@
 /* GLOBALS *******************************************************************/
 
 /*
- * If CACHE_BITMAP is defined, the cache manager uses one large memory region 
- * within the kernel address space and allocate/deallocate space from this block 
- * over a bitmap. If CACHE_BITMAP is used, the size of the mdl mapping region 
+ * If CACHE_BITMAP is defined, the cache manager uses one large memory region
+ * within the kernel address space and allocate/deallocate space from this block
+ * over a bitmap. If CACHE_BITMAP is used, the size of the mdl mapping region
  * must be reduced (ntoskrnl\mm\mdl.c, MI_MDLMAPPING_REGION_SIZE).
  */
 //#define CACHE_BITMAP
@@ -148,7 +148,7 @@
   }
 
   NewTarget = WriteCount[0];
-  
+
   Target = max(NewTarget, Target);
 
   current_entry = DirtySegmentListHead.Flink;
@@ -158,7 +158,7 @@
   }
   while (current_entry != &DirtySegmentListHead && Target > 0)
     {
-      current = CONTAINING_RECORD(current_entry, CACHE_SEGMENT, 
+      current = CONTAINING_RECORD(current_entry, CACHE_SEGMENT,
 				  DirtySegmentListEntry);
       current_entry = current_entry->Flink;
       Locked = ExTryToAcquireFastMutex(&current->Lock);
@@ -174,7 +174,7 @@
 	}
       ExReleaseFastMutex(&ViewLock);
       PagesPerSegment = current->Bcb->CacheSegmentSize / PAGE_SIZE;
-      Status = CcRosFlushCacheSegment(current);      
+      Status = CcRosFlushCacheSegment(current);
       ExReleaseFastMutex(&current->Lock);
       if (!NT_SUCCESS(Status) &&  (Status != STATUS_END_OF_FILE))
       {
@@ -205,7 +205,7 @@
  * ARGUMENTS:
  *       Target - The number of pages to be freed.
  *       Priority - The priority of free (currently unused).
- *       NrFreed - Points to a variable where the number of pages 
+ *       NrFreed - Points to a variable where the number of pages
  *                 actually freed is returned.
  */
 {
@@ -219,17 +219,17 @@
   DPRINT("CcRosTrimCache(Target %d)\n", Target);
 
   *NrFreed = 0;
-  
+
   InitializeListHead(&FreeList);
-  
+
   ExAcquireFastMutex(&ViewLock);
   current_entry = CacheSegmentLRUListHead.Flink;
   while (current_entry != &CacheSegmentLRUListHead && Target > 0)
     {
-      current = CONTAINING_RECORD(current_entry, CACHE_SEGMENT, 
+      current = CONTAINING_RECORD(current_entry, CACHE_SEGMENT,
 				  CacheSegmentLRUListEntry);
       current_entry = current_entry->Flink;
-      
+
       KeAcquireSpinLock(&current->Bcb->BcbLock, &oldIrql);
       if (current->ReferenceCount == 0)
       {
@@ -249,7 +249,7 @@
 	   {
 	     ULONG i;
 	     NTSTATUS Status;
-	        
+
              current->ReferenceCount++;
 	     last = current;
 	     current->PageOut = TRUE;
@@ -281,7 +281,7 @@
   while (!IsListEmpty(&FreeList))
   {
      current_entry = RemoveHeadList(&FreeList);
-     current = CONTAINING_RECORD(current_entry, CACHE_SEGMENT, 
+     current = CONTAINING_RECORD(current_entry, CACHE_SEGMENT,
 				 BcbSegmentListEntry);
      CcRosInternalFreeCacheSegment(current);
   }
@@ -290,7 +290,7 @@
   return(STATUS_SUCCESS);
 }
 
-NTSTATUS 
+NTSTATUS
 CcRosReleaseCacheSegment(PBCB Bcb,
 			 PCACHE_SEGMENT CacheSeg,
 			 BOOLEAN Valid,
@@ -334,11 +334,11 @@
   KeReleaseSpinLock(&Bcb->BcbLock, oldIrql);
   ExReleaseFastMutex(&ViewLock);
   ExReleaseFastMutex(&CacheSeg->Lock);
-  
+
   return(STATUS_SUCCESS);
 }
 
-PCACHE_SEGMENT 
+PCACHE_SEGMENT
 CcRosLookupCacheSegment(PBCB Bcb, ULONG FileOffset)
 {
   PLIST_ENTRY current_entry;
@@ -353,7 +353,7 @@
   current_entry = Bcb->BcbSegmentListHead.Flink;
   while (current_entry != &Bcb->BcbSegmentListHead)
     {
-      current = CONTAINING_RECORD(current_entry, CACHE_SEGMENT, 
+      current = CONTAINING_RECORD(current_entry, CACHE_SEGMENT,
 				  BcbSegmentListEntry);
       if (current->FileOffset <= FileOffset &&
 	  (current->FileOffset + Bcb->CacheSegmentSize) > FileOffset)
@@ -499,14 +499,14 @@
   /* There is window between the call to CcRosLookupCacheSegment
    * and CcRosCreateCacheSegment. We must check if a segment on
    * the fileoffset exist. If there exist a segment, we release
-   * our new created segment and return the existing one. 
+   * our new created segment and return the existing one.
    */
   KeAcquireSpinLock(&Bcb->BcbLock, &oldIrql);
   current_entry = Bcb->BcbSegmentListHead.Flink;
   previous = NULL;
   while (current_entry != &Bcb->BcbSegmentListHead)
   {
-     current = CONTAINING_RECORD(current_entry, CACHE_SEGMENT, 
+     current = CONTAINING_RECORD(current_entry, CACHE_SEGMENT,
 				 BcbSegmentListEntry);
      if (current->FileOffset <= FileOffset &&
       	(current->FileOffset + Bcb->CacheSegmentSize) > FileOffset)
@@ -554,7 +554,7 @@
   KeAcquireSpinLock(&CiCacheSegMappingRegionLock, &oldIrql);
 
   StartingOffset = RtlFindClearBitsAndSet(&CiCacheSegMappingRegionAllocMap, Bcb->CacheSegmentSize / PAGE_SIZE, CiCacheSegMappingRegionHint);
-  
+
   if (StartingOffset == 0xffffffff)
   {
      DPRINT1("Out of CacheSeg mapping space\n");
@@ -565,7 +565,7 @@
 
   if (CiCacheSegMappingRegionHint == StartingOffset)
   {
-     CiCacheSegMappingRegionHint += Bcb->CacheSegmentSize / PAGE_SIZE; 
+     CiCacheSegMappingRegionHint += Bcb->CacheSegmentSize / PAGE_SIZE;
   }
 
   KeReleaseSpinLock(&CiCacheSegMappingRegionLock, oldIrql);
@@ -627,10 +627,10 @@
   Length = ROUND_UP(Length, Bcb->CacheSegmentSize);
 
 #if defined(__GNUC__)
-  CacheSegList = alloca(sizeof(PCACHE_SEGMENT) * 
+  CacheSegList = alloca(sizeof(PCACHE_SEGMENT) *
 			(Length / Bcb->CacheSegmentSize));
 #elif defined(_MSC_VER)
-  CacheSegList = _alloca(sizeof(PCACHE_SEGMENT) * 
+  CacheSegList = _alloca(sizeof(PCACHE_SEGMENT) *
 			(Length / Bcb->CacheSegmentSize));
 #else
 #error Unknown compiler for alloca intrinsic stack allocation "function"
@@ -668,7 +668,7 @@
 	}
     }
   Previous->NextInChain = NULL;
-  
+
   return(STATUS_SUCCESS);
 }
 
@@ -713,7 +713,7 @@
    return(STATUS_SUCCESS);
 }
 
-NTSTATUS STDCALL 
+NTSTATUS STDCALL
 CcRosRequestCacheSegment(PBCB Bcb,
 		      ULONG FileOffset,
 		      PVOID* BaseAddress,
@@ -743,8 +743,8 @@
 }
 #ifdef CACHE_BITMAP
 #else
-STATIC VOID 
-CcFreeCachePage(PVOID Context, MEMORY_AREA* MemoryArea, PVOID Address, 
+STATIC VOID
+CcFreeCachePage(PVOID Context, MEMORY_AREA* MemoryArea, PVOID Address,
 		PFN_TYPE Page, SWAPENTRY SwapEntry, BOOLEAN Dirty)
 {
   ASSERT(SwapEntry == 0);
@@ -754,7 +754,7 @@
     }
 }
 #endif
-NTSTATUS 
+NTSTATUS
 CcRosInternalFreeCacheSegment(PCACHE_SEGMENT CacheSeg)
 /*
  * FUNCTION: Releases a cache segment associated with a BCB
@@ -774,7 +774,7 @@
   /* Unmap all the pages. */
   for (i = 0; i < RegionSize; i++)
     {
-      MmDeleteVirtualMapping(NULL, 
+      MmDeleteVirtualMapping(NULL,
 			     CacheSeg->BaseAddress + (i * PAGE_SIZE),
 			     FALSE,
 			     NULL,
@@ -785,7 +785,7 @@
   KeAcquireSpinLock(&CiCacheSegMappingRegionLock, &oldIrql);
   /* Deallocate all the pages used. */
   Base = (ULONG)(CacheSeg->BaseAddress - CiCacheSegMappingRegionBase) / PAGE_SIZE;
-  
+
   RtlClearBits(&CiCacheSegMappingRegionAllocMap, Base, RegionSize);
 
   CiCacheSegMappingRegionHint = min (CiCacheSegMappingRegionHint, Base);
@@ -858,12 +858,12 @@
       {
 	 Offset = *FileOffset;
       }
-      else 
+      else
       {
 	 Offset.QuadPart = (LONGLONG)0;
 	 Length = Bcb->FileSize.u.LowPart;
       }
-   
+
       if (IoStatus)
       {
 	 IoStatus->Status = STATUS_SUCCESS;
@@ -909,7 +909,7 @@
    }
 }
 
-NTSTATUS 
+NTSTATUS
 CcRosDeleteFileCache(PFILE_OBJECT FileObject, PBCB Bcb)
 /*
  * FUNCTION: Releases the BCB associated with a file object
@@ -938,7 +938,7 @@
          Bcb->BcbRemoveListEntry.Flink = NULL;
       }
 
-      FileObject->SectionObjectPointer->SharedCacheMap = NULL;  
+      FileObject->SectionObjectPointer->SharedCacheMap = NULL;
 
       /*
        * Release all cache segments.
@@ -960,7 +960,7 @@
 	 }
          InsertHeadList(&FreeList, &current->BcbSegmentListEntry);
       }
-      KeReleaseSpinLock(&Bcb->BcbLock, oldIrql);	
+      KeReleaseSpinLock(&Bcb->BcbLock, oldIrql);
 
       ExReleaseFastMutex(&ViewLock);
       ObDereferenceObject (Bcb->FileObject);
@@ -971,7 +971,7 @@
          current = CONTAINING_RECORD(current_entry, CACHE_SEGMENT, BcbSegmentListEntry);
          Status = CcRosInternalFreeCacheSegment(current);
       }
-      ExFreeToNPagedLookasideList(&BcbLookasideList, Bcb);   
+      ExFreeToNPagedLookasideList(&BcbLookasideList, Bcb);
       ExAcquireFastMutex(&ViewLock);
    }
    return(STATUS_SUCCESS);
@@ -1042,7 +1042,7 @@
   ExReleaseFastMutex(&ViewLock);
 }
 
-NTSTATUS STDCALL 
+NTSTATUS STDCALL
 CcRosReleaseFileCache(PFILE_OBJECT FileObject)
 /*
  * FUNCTION: Called by the file system when a handle to a file object
@@ -1082,7 +1082,7 @@
   return(STATUS_SUCCESS);
 }
 
-NTSTATUS 
+NTSTATUS
 CcTryToInitializeFileCache(PFILE_OBJECT FileObject)
 {
    PBCB Bcb;
@@ -1115,7 +1115,7 @@
 }
 
 
-NTSTATUS STDCALL 
+NTSTATUS STDCALL
 CcRosInitializeFileCache(PFILE_OBJECT FileObject,
 			 ULONG CacheSegmentSize)
 /*
@@ -1146,9 +1146,9 @@
       Bcb->CacheSegmentSize = CacheSegmentSize;
       if (FileObject->FsContext)
       {
-         Bcb->AllocationSize = 
+         Bcb->AllocationSize =
 	   ((PFSRTL_COMMON_FCB_HEADER)FileObject->FsContext)->AllocationSize;
-         Bcb->FileSize = 
+         Bcb->FileSize =
 	   ((PFSRTL_COMMON_FCB_HEADER)FileObject->FsContext)->FileSize;
       }
       KeInitializeSpinLock(&Bcb->BcbLock);
@@ -1219,7 +1219,7 @@
           DbgPrint("LazyCloseThread: Terminating\n");
 	  break;
       }
-      
+
       ExAcquireFastMutex(&ViewLock);
       CcTimeStamp++;
       if (CcTimeStamp >= 30)
@@ -1250,7 +1250,7 @@
 #endif
   NTSTATUS Status;
   KPRIORITY Priority;
-  
+
   DPRINT("CcInitView()\n");
 #ifdef CACHE_BITMAP
   BoundaryAddressMultiple.QuadPart = 0;
@@ -1281,7 +1281,7 @@
   RtlClearAllBits(&CiCacheSegMappingRegionAllocMap);
 
   KeInitializeSpinLock(&CiCacheSegMappingRegionLock);
-#endif  
+#endif
   InitializeListHead(&CacheSegmentListHead);
   InitializeListHead(&DirtySegmentListHead);
   InitializeListHead(&CacheSegmentLRUListHead);
@@ -1310,10 +1310,10 @@
 				   20);
 
   MmInitializeMemoryConsumer(MC_CACHE, CcRosTrimCache);
-  
+
   CcInitCacheZeroPage();
 
-  CcTimeStamp = 0;  
+  CcTimeStamp = 0;
   LazyCloseThreadShouldTerminate = FALSE;
   KeInitializeEvent (&LazyCloseThreadEvent, SynchronizationEvent, FALSE);
   Status = PsCreateSystemThread(&LazyCloseThreadHandle,

Modified: trunk/reactos/ntoskrnl/cm/cm.h
--- trunk/reactos/ntoskrnl/cm/cm.h	2005-05-09 01:14:42 UTC (rev 15163)
+++ trunk/reactos/ntoskrnl/cm/cm.h	2005-05-09 01:38:29 UTC (rev 15164)
@@ -356,7 +356,7 @@
 
   /* List entry into the global key object list */
   LIST_ENTRY ListEntry;
-  
+
   /* Time stamp for the last access by the parse routine */
   ULONG TimeStamp;
 } KEY_OBJECT, *PKEY_OBJECT;

Modified: trunk/reactos/ntoskrnl/cm/ntfunc.c
--- trunk/reactos/ntoskrnl/cm/ntfunc.c	2005-05-09 01:14:42 UTC (rev 15163)
+++ trunk/reactos/ntoskrnl/cm/ntfunc.c	2005-05-09 01:38:29 UTC (rev 15164)
@@ -1,5 +1,5 @@
 /* $Id$
- * 
+ *
  * COPYRIGHT:       See COPYING in the top level directory
  * PROJECT:         ReactOS kernel
  * FILE:            ntoskrnl/cm/ntfunc.c
@@ -39,11 +39,11 @@
                    IN OUT PLARGE_INTEGER Cookie)
 {
   PREGISTRY_CALLBACK Callback;
-  
+
   PAGED_CODE();
-  
+
   ASSERT(Function && Cookie);
-  
+
   Callback = ExAllocatePoolWithTag(PagedPool,
                                    sizeof(REGISTRY_CALLBACK),
                                    TAG('C', 'M', 'c', 'b'));
@@ -54,7 +54,7 @@
     Callback->Function = Function;
     Callback->Context = Context;
     Callback->PendingDelete = FALSE;
-    
+
     /* add it to the callback list and receive a cookie for the callback */
     ExAcquireFastMutex(&CmiCallbackLock);
     /* FIXME - to receive a unique cookie we'll just return the pointer to the
@@ -63,7 +63,7 @@
     InsertTailList(&CmiCallbackHead, &Callback->ListEntry);
 
     ExReleaseFastMutex(&CmiCallbackLock);
-    
+
     *Cookie = Callback->Cookie;
     return STATUS_SUCCESS;
   }
@@ -79,7 +79,7 @@
 CmUnRegisterCallback(IN LARGE_INTEGER Cookie)
 {
   PLIST_ENTRY CurrentEntry;
-  
+
   PAGED_CODE();
 
   ExAcquireFastMutex(&CmiCallbackLock);
@@ -121,7 +121,7 @@
       }
     }
   }
-  
+
   ExReleaseFastMutex(&CmiCallbackLock);
 
   return STATUS_UNSUCCESSFUL;
@@ -133,9 +133,9 @@
                            IN PVOID Argument2)
 {
   PLIST_ENTRY CurrentEntry;
-  
+
   PAGED_CODE();
-  
+
   ExAcquireFastMutex(&CmiCallbackLock);
 
   for(CurrentEntry = CmiCallbackHead.Flink;
@@ -149,10 +149,10 @@
        ExAcquireRundownProtectionEx(&CurrentCallback->RundownRef, 1))
     {
       NTSTATUS Status;
-      
+
       /* don't hold locks during the callbacks! */
       ExReleaseFastMutex(&CmiCallbackLock);
-      
+
       Status = CurrentCallback->Function(CurrentCallback->Context,
                                          Argument1,
                                          Argument2);
@@ -169,9 +169,9 @@
       ExReleaseRundownProtectionEx(&CurrentCallback->RundownRef, 1);
     }
   }
-  
+
   ExReleaseFastMutex(&CmiCallbackLock);
-  
+
   return STATUS_SUCCESS;
 }
 
@@ -191,7 +191,7 @@
   PVOID Object;
   PWSTR Start;
   unsigned i;
-  
+
   PAGED_CODE();
 
   DPRINT("NtCreateKey (Name %wZ  KeyHandle %x  Root %x)\n",
@@ -358,7 +358,7 @@
   ExReleaseResourceLite(&CmiRegistryLock);
   KeLeaveCriticalRegion();
 
-  
+
   ObDereferenceObject(Object);
 
   if (Disposition)
@@ -376,11 +376,11 @@
   KPROCESSOR_MODE PreviousMode;
   PKEY_OBJECT KeyObject;
   NTSTATUS Status;
-  
+
   PAGED_CODE();
 
   DPRINT1("NtDeleteKey(KeyHandle %x) called\n", KeyHandle);
-  
+
   PreviousMode = ExGetPreviousMode();
 
   /* Verify that the handle is valid and is a registry key */
@@ -462,9 +462,9 @@
   ULONG NameSize, ClassSize;
   KPROCESSOR_MODE PreviousMode;
   NTSTATUS Status;
-  
+
   PAGED_CODE();
-  
+
   PreviousMode = ExGetPreviousMode();
 
   DPRINT("KH %x  I %d  KIC %x KI %x  L %d  RL %x\n",
@@ -687,10 +687,10 @@
 	        Status = STATUS_BUFFER_OVERFLOW;
 	        CHECKPOINT;
 	      }
-	    else if (Length - FIELD_OFFSET(KEY_NODE_INFORMATION, Name[0]) - 
+	    else if (Length - FIELD_OFFSET(KEY_NODE_INFORMATION, Name[0]) -
 	             NameSize < ClassSize)
 	      {
-	        ClassSize = Length - FIELD_OFFSET(KEY_NODE_INFORMATION, Name[0]) - 
+	        ClassSize = Length - FIELD_OFFSET(KEY_NODE_INFORMATION, Name[0]) -
 	                    NameSize;
 	        Status = STATUS_BUFFER_OVERFLOW;
 	        CHECKPOINT;
@@ -812,7 +812,7 @@
   PKEY_VALUE_BASIC_INFORMATION  ValueBasicInformation;
   PKEY_VALUE_PARTIAL_INFORMATION  ValuePartialInformation;
   PKEY_VALUE_FULL_INFORMATION  ValueFullInformation;
-  
+
[truncated at 1000 lines; 38181 more skipped]