2003-06-07 Casper S. Hornstrup <chorns@users.sourceforge.net>

Changes for compiling with w32api

	* include/ddk/cctypes.h (PREACTOS_COMMON_FCB_HEADER): Remove.
	(FSRTL_COMMON_FCB_HEADER): Add.
	* include/ddk/iotypes.h (FILE_OBJECT): Rename field
	SectionObjectPointers to SectionObjectPointer.
	* ntoskrnl/cc/copy.c, ntoskrnl/cc/misc.c, ntoskrnl/cc/pin.c,
	ntoskrnl/cc/view.c, ntoskrnl/io/rawfs.c, ntoskrnl/mm/section.c,
	drivers/fs/cdfs/cleanup.c, drivers/fs/cdfs/fcb.c,
	drivers/fs/cdfs/fsctl.c, drivers/fs/ntfs/fcb.c, drivers/fs/ntfs/fsctl.c,
	drivers/fs/vfat/close.c, drivers/fs/vfat/create.c,
	drivers/fs/vfat/finfo.c, drivers/fs/vfat/fcb.c, drivers/fs/vfat/fsctl.c:
	Use new	FILE_OBJECT structure.
	* drivers/fs/cdfs/cdfs.h, drivers/fs/ntfs/ntfs.h, drivers/fs/vfat/vfat.h:
	Use new FSRTL_COMMON_FCB_HEADER structure.
	* drivers/net/afd/include/afd.h (FSRTL_COMMON_FCB_HEADER): Remove.
	* include/ddk/ketypes.h (KQUEUE): Match w32api structure.
	* ntoskrnl/ke/queue.c, ntoskrnl/ke/wait.c: Use new structure.
	* ntoskrnl/ke/spinlock.c (KeAcquireSpinLockAtDpcLevel,
	KeReleaseSpinLockFromDpcLevel): Undefine before declaring.

svn path=/trunk/; revision=4865
This commit is contained in:
Casper Hornstrup 2003-06-07 11:34:36 +00:00
parent 83f9a49a15
commit 922b9fdf46
27 changed files with 128 additions and 111 deletions

View file

@ -1,3 +1,26 @@
2003-06-07 Casper S. Hornstrup <chorns@users.sourceforge.net>
Changes for compiling with w32api
* include/ddk/cctypes.h (PREACTOS_COMMON_FCB_HEADER): Remove.
(FSRTL_COMMON_FCB_HEADER): Add.
* include/ddk/iotypes.h (FILE_OBJECT): Rename field
SectionObjectPointers to SectionObjectPointer.
* ntoskrnl/cc/copy.c, ntoskrnl/cc/misc.c, ntoskrnl/cc/pin.c,
ntoskrnl/cc/view.c, ntoskrnl/io/rawfs.c, ntoskrnl/mm/section.c,
drivers/fs/cdfs/cleanup.c, drivers/fs/cdfs/fcb.c,
drivers/fs/cdfs/fsctl.c, drivers/fs/ntfs/fcb.c, drivers/fs/ntfs/fsctl.c,
drivers/fs/vfat/close.c, drivers/fs/vfat/create.c,
drivers/fs/vfat/finfo.c, drivers/fs/vfat/fcb.c, drivers/fs/vfat/fsctl.c:
Use new FILE_OBJECT structure.
* drivers/fs/cdfs/cdfs.h, drivers/fs/ntfs/ntfs.h, drivers/fs/vfat/vfat.h:
Use new FSRTL_COMMON_FCB_HEADER structure.
* drivers/net/afd/include/afd.h (FSRTL_COMMON_FCB_HEADER): Remove.
* include/ddk/ketypes.h (KQUEUE): Match w32api structure.
* ntoskrnl/ke/queue.c, ntoskrnl/ke/wait.c: Use new structure.
* ntoskrnl/ke/spinlock.c (KeAcquireSpinLockAtDpcLevel,
KeReleaseSpinLockFromDpcLevel): Undefine before declaring.
2003-06-07 Casper S. Hornstrup <chorns@users.sourceforge.net>
Changes for compiling with w32api

View file

@ -163,7 +163,7 @@ typedef struct
typedef struct _FCB
{
REACTOS_COMMON_FCB_HEADER RFCB;
FSRTL_COMMON_FCB_HEADER RFCB;
SECTION_OBJECT_POINTERS SectionObjectPointers;
PFILE_OBJECT FileObject;

View file

@ -16,7 +16,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
/* $Id: cleanup.c,v 1.3 2003/02/13 22:24:15 hbirr Exp $
/* $Id: cleanup.c,v 1.4 2003/06/07 11:34:35 chorns Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel
@ -52,7 +52,7 @@ CdfsCleanupFile(PDEVICE_EXTENSION DeviceExt,
/* Uninitialize file cache if initialized for this file object. */
if (FileObject->SectionObjectPointers && FileObject->SectionObjectPointers->SharedCacheMap)
if (FileObject->SectionObjectPointer && FileObject->SectionObjectPointer->SharedCacheMap)
{
CcRosReleaseFileCache (FileObject);
}

View file

@ -16,7 +16,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
/* $Id: fcb.c,v 1.12 2003/02/13 22:24:15 hbirr Exp $
/* $Id: fcb.c,v 1.13 2003/06/07 11:34:35 chorns Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel
@ -236,7 +236,7 @@ CdfsFCBInitializeCache(PVCB Vcb,
FileObject->Flags = FileObject->Flags | FO_FCB_IS_VALID |
FO_DIRECT_CACHE_PAGING_READ;
FileObject->SectionObjectPointers = &Fcb->SectionObjectPointers;
FileObject->SectionObjectPointer = &Fcb->SectionObjectPointers;
FileObject->FsContext = Fcb;
FileObject->FsContext2 = newCCB;
newCCB->PtrFileObject = FileObject;
@ -414,7 +414,7 @@ CdfsAttachFCBToFileObject(PDEVICE_EXTENSION Vcb,
FileObject->Flags = FileObject->Flags | FO_FCB_IS_VALID |
FO_DIRECT_CACHE_PAGING_READ;
FileObject->SectionObjectPointers = &Fcb->SectionObjectPointers;
FileObject->SectionObjectPointer = &Fcb->SectionObjectPointers;
FileObject->FsContext = Fcb;
FileObject->FsContext2 = newCCB;
newCCB->PtrFileObject = FileObject;

View file

@ -16,7 +16,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
/* $Id: fsctl.c,v 1.13 2003/02/13 22:24:15 hbirr Exp $
/* $Id: fsctl.c,v 1.14 2003/06/07 11:34:35 chorns Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel
@ -381,7 +381,7 @@ CdfsMountVolume(PDEVICE_OBJECT DeviceObject,
DeviceExt->StreamFileObject->Flags = DeviceExt->StreamFileObject->Flags | FO_FCB_IS_VALID | FO_DIRECT_CACHE_PAGING_READ;
DeviceExt->StreamFileObject->FsContext = Fcb;
DeviceExt->StreamFileObject->FsContext2 = Ccb;
DeviceExt->StreamFileObject->SectionObjectPointers = &Fcb->SectionObjectPointers;
DeviceExt->StreamFileObject->SectionObjectPointer = &Fcb->SectionObjectPointers;
DeviceExt->StreamFileObject->PrivateCacheMap = NULL;
DeviceExt->StreamFileObject->Vpb = DeviceExt->Vpb;
Ccb->PtrFileObject = DeviceExt->StreamFileObject;

View file

@ -16,7 +16,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
/* $Id: fcb.c,v 1.5 2003/02/13 22:24:16 hbirr Exp $
/* $Id: fcb.c,v 1.6 2003/06/07 11:34:35 chorns Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel
@ -235,7 +235,7 @@ NtfsFCBInitializeCache(PVCB Vcb,
FileObject->Flags = FileObject->Flags | FO_FCB_IS_VALID |
FO_DIRECT_CACHE_PAGING_READ;
FileObject->SectionObjectPointers = &Fcb->SectionObjectPointers;
FileObject->SectionObjectPointer = &Fcb->SectionObjectPointers;
FileObject->FsContext = Fcb;
FileObject->FsContext2 = newCCB;
newCCB->PtrFileObject = FileObject;
@ -406,7 +406,7 @@ NtfsAttachFCBToFileObject(PDEVICE_EXTENSION Vcb,
FileObject->Flags = FileObject->Flags | FO_FCB_IS_VALID |
FO_DIRECT_CACHE_PAGING_READ;
FileObject->SectionObjectPointers = &Fcb->SectionObjectPointers;
FileObject->SectionObjectPointer = &Fcb->SectionObjectPointers;
FileObject->FsContext = Fcb;
FileObject->FsContext2 = newCCB;
newCCB->PtrFileObject = FileObject;

View file

@ -16,7 +16,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
/* $Id: fsctl.c,v 1.5 2003/02/13 22:24:16 hbirr Exp $
/* $Id: fsctl.c,v 1.6 2003/06/07 11:34:36 chorns Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel
@ -277,7 +277,7 @@ NtfsMountVolume(PDEVICE_OBJECT DeviceObject,
DeviceExt->StreamFileObject->Flags = DeviceExt->StreamFileObject->Flags | FO_FCB_IS_VALID | FO_DIRECT_CACHE_PAGING_READ;
DeviceExt->StreamFileObject->FsContext = Fcb;
DeviceExt->StreamFileObject->FsContext2 = Ccb;
DeviceExt->StreamFileObject->SectionObjectPointers = &Fcb->SectionObjectPointers;
DeviceExt->StreamFileObject->SectionObjectPointer = &Fcb->SectionObjectPointers;
DeviceExt->StreamFileObject->PrivateCacheMap = NULL;
DeviceExt->StreamFileObject->Vpb = DeviceExt->Vpb;
Ccb->PtrFileObject = DeviceExt->StreamFileObject;

View file

@ -78,7 +78,7 @@ typedef struct
typedef struct _FCB
{
REACTOS_COMMON_FCB_HEADER RFCB;
FSRTL_COMMON_FCB_HEADER RFCB;
SECTION_OBJECT_POINTERS SectionObjectPointers;
PFILE_OBJECT FileObject;

View file

@ -1,4 +1,4 @@
/* $Id: close.c,v 1.17 2003/02/13 22:24:16 hbirr Exp $
/* $Id: close.c,v 1.18 2003/06/07 11:34:36 chorns Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel
@ -67,7 +67,7 @@ VfatCloseFile (PDEVICE_EXTENSION DeviceExt, PFILE_OBJECT FileObject)
FileObject->FsContext2 = NULL;
FileObject->FsContext = NULL;
FileObject->SectionObjectPointers = NULL;
FileObject->SectionObjectPointer = NULL;
if (pCcb)
{

View file

@ -16,7 +16,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
/* $Id: create.c,v 1.56 2003/05/11 09:51:26 hbirr Exp $
/* $Id: create.c,v 1.57 2003/06/07 11:34:36 chorns Exp $
*
* PROJECT: ReactOS kernel
* FILE: services/fs/vfat/create.c
@ -490,7 +490,7 @@ VfatSupersedeFile(PDEVICE_EXTENSION DeviceExt, PFILE_OBJECT FileObject,
Fcb->RFCB.ValidDataLength.QuadPart = 0;
/* Notify cache manager about the change in file size if caching is
initialized on the file stream */
if (FileObject->SectionObjectPointers->SharedCacheMap != NULL)
if (FileObject->SectionObjectPointer->SharedCacheMap != NULL)
{
CcSetFileSizes(FileObject, (PCC_FILE_SIZES)&Fcb->RFCB.AllocationSize);
}
@ -558,7 +558,7 @@ VfatCreateFile (PDEVICE_OBJECT DeviceObject, PIRP Irp)
}
memset(pCcb, 0, sizeof(VFATCCB));
FileObject->Flags |= FO_FCB_IS_VALID;
FileObject->SectionObjectPointers = &pFcb->SectionObjectPointers;
FileObject->SectionObjectPointer = &pFcb->SectionObjectPointers;
FileObject->FsContext = pFcb;
FileObject->FsContext2 = pCcb;
pFcb->RefCount++;

View file

@ -1,4 +1,4 @@
/* $Id: fcb.c,v 1.28 2003/05/11 09:51:26 hbirr Exp $
/* $Id: fcb.c,v 1.29 2003/06/07 11:34:36 chorns Exp $
*
*
* FILE: fcb.c
@ -154,7 +154,7 @@ vfatReleaseFCB(PDEVICE_EXTENSION pVCB, PVFATFCB pFCB)
if (vfatFCBIsDirectory(pFCB))
{
/* Uninitialize file cache if initialized for this file object. */
if (pFCB->FileObject->SectionObjectPointers->SharedCacheMap)
if (pFCB->FileObject->SectionObjectPointer->SharedCacheMap)
{
CcRosReleaseFileCache(pFCB->FileObject);
}
@ -284,7 +284,7 @@ vfatFCBInitializeCacheFromVolume (PVCB vcb, PVFATFCB fcb)
memset (newCCB, 0, sizeof (VFATCCB));
fileObject->Flags |= FO_FCB_IS_VALID | FO_DIRECT_CACHE_PAGING_READ;
fileObject->SectionObjectPointers = &fcb->SectionObjectPointers;
fileObject->SectionObjectPointer = &fcb->SectionObjectPointers;
fileObject->FsContext = fcb;
fileObject->FsContext2 = newCCB;
fcb->FileObject = fileObject;
@ -461,7 +461,7 @@ vfatAttachFCBToFileObject (PDEVICE_EXTENSION vcb,
fileObject->Flags = fileObject->Flags | FO_FCB_IS_VALID |
FO_DIRECT_CACHE_PAGING_READ;
fileObject->SectionObjectPointers = &fcb->SectionObjectPointers;
fileObject->SectionObjectPointer = &fcb->SectionObjectPointers;
fileObject->FsContext = fcb;
fileObject->FsContext2 = newCCB;
DPRINT ("file open: fcb:%x file size: %d\n", fcb, fcb->entry.FileSize);

View file

@ -1,4 +1,4 @@
/* $Id: finfo.c,v 1.29 2003/06/04 18:01:02 hbirr Exp $
/* $Id: finfo.c,v 1.30 2003/06/07 11:34:36 chorns Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel
@ -193,13 +193,13 @@ VfatSetDispositionInformation(PFILE_OBJECT FileObject,
}
if (DispositionInfo->DoDeleteFile)
{
if (MmFlushImageSection (FileObject->SectionObjectPointers, MmFlushForDelete))
if (MmFlushImageSection (FileObject->SectionObjectPointer, MmFlushForDelete))
{
KeAcquireSpinLock (&DeviceExt->FcbListLock, &oldIrql);
count = FCB->RefCount;
if (FCB->RefCount > 1)
{
DPRINT1("%d %x\n", FCB->RefCount, CcGetFileObjectFromSectionPtrs(FileObject->SectionObjectPointers));
DPRINT1("%d %x\n", FCB->RefCount, CcGetFileObjectFromSectionPtrs(FileObject->SectionObjectPointer));
Status = STATUS_ACCESS_DENIED;
}
else
@ -402,7 +402,7 @@ VOID UpdateFileSize(PFILE_OBJECT FileObject, PVFATFCB Fcb, ULONG Size, ULONG Clu
Fcb->RFCB.FileSize.QuadPart = Size;
Fcb->RFCB.ValidDataLength.QuadPart = Size;
if (FileObject->SectionObjectPointers->SharedCacheMap != NULL)
if (FileObject->SectionObjectPointer->SharedCacheMap != NULL)
{
CcSetFileSizes(FileObject, (PCC_FILE_SIZES)&Fcb->RFCB.AllocationSize);
}

View file

@ -16,7 +16,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
/* $Id: fsctl.c,v 1.15 2003/05/11 09:51:26 hbirr Exp $
/* $Id: fsctl.c,v 1.16 2003/06/07 11:34:36 chorns Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel
@ -303,7 +303,7 @@ VfatMount (PVFAT_IRP_CONTEXT IrpContext)
DeviceExt->FATFileObject->Flags = DeviceExt->FATFileObject->Flags | FO_FCB_IS_VALID | FO_DIRECT_CACHE_PAGING_READ;
DeviceExt->FATFileObject->FsContext = Fcb;
DeviceExt->FATFileObject->FsContext2 = Ccb;
DeviceExt->FATFileObject->SectionObjectPointers = &Fcb->SectionObjectPointers;
DeviceExt->FATFileObject->SectionObjectPointer = &Fcb->SectionObjectPointers;
DeviceExt->FATFileObject->PrivateCacheMap = NULL;
DeviceExt->FATFileObject->Vpb = DeviceObject->Vpb;
Fcb->FileObject = DeviceExt->FATFileObject;

View file

@ -1,4 +1,4 @@
/* $Id: vfat.h,v 1.57 2003/05/11 09:51:26 hbirr Exp $ */
/* $Id: vfat.h,v 1.58 2003/06/07 11:34:36 chorns Exp $ */
#include <ddk/ntifs.h>
@ -182,7 +182,7 @@ extern PVFAT_GLOBAL_DATA VfatGlobalData;
typedef struct _VFATFCB
{
/* FCB header required by ROS/NT */
REACTOS_COMMON_FCB_HEADER RFCB;
FSRTL_COMMON_FCB_HEADER RFCB;
SECTION_OBJECT_POINTERS SectionObjectPointers;
ERESOURCE MainResource;
ERESOURCE PagingIoResource;

View file

@ -35,21 +35,6 @@ typedef struct _AFDCCB {
/* Flags for CCB structure */
#define CCB_CLEANED 0x00000001
/* Borrowed from http://www.acc.umu.se/~bosse/ntifs.h by Bo Branten */
typedef struct _FSRTL_COMMON_FCB_HEADER {
CSHORT NodeTypeCode;
CSHORT NodeByteSize;
UCHAR Flags;
UCHAR IsFastIoPossible;
UCHAR Flags2;
UCHAR Reserved;
PERESOURCE Resource;
PERESOURCE PagingIoResource;
LARGE_INTEGER AllocationSize;
LARGE_INTEGER FileSize;
LARGE_INTEGER ValidDataLength;
} FSRTL_COMMON_FCB_HEADER, *PFSRTL_COMMON_FCB_HEADER;
typedef struct _FsdNTRequiredFCB {
FSRTL_COMMON_FCB_HEADER CommonFCBHeader;
SECTION_OBJECT_POINTERS SectionObject;

View file

@ -73,13 +73,18 @@ typedef VOID STDCALL_FUNC
(*PFLUSH_TO_LSN)(IN PVOID LogHandle,
IN LARGE_INTEGER Lsn);
typedef struct _REACTOS_COMMON_FCB_HEADER
{
CSHORT NodeTypeCode;
CSHORT NodeByteSize;
LARGE_INTEGER AllocationSize;
LARGE_INTEGER FileSize;
LARGE_INTEGER ValidDataLength;
} REACTOS_COMMON_FCB_HEADER, *PREACTOS_COMMON_FCB_HEADER;
typedef struct _FSRTL_COMMON_FCB_HEADER {
CSHORT NodeTypeCode;
CSHORT NodeByteSize;
UCHAR Flags;
UCHAR IsFastIoPossible;
UCHAR Flags2;
UCHAR Reserved;
PERESOURCE Resource;
PERESOURCE PagingIoResource;
LARGE_INTEGER AllocationSize;
LARGE_INTEGER FileSize;
LARGE_INTEGER ValidDataLength;
} FSRTL_COMMON_FCB_HEADER, *PFSRTL_COMMON_FCB_HEADER;
#endif /* __INCLUDE_DDK_CCTYPES_H */

View file

@ -1,4 +1,4 @@
/* $Id: iotypes.h,v 1.48 2003/05/28 18:09:09 chorns Exp $
/* $Id: iotypes.h,v 1.49 2003/06/07 11:34:36 chorns Exp $
*
*/
@ -595,7 +595,7 @@ typedef struct _FILE_OBJECT
struct _VPB* Vpb;
PVOID FsContext;
PVOID FsContext2;
PSECTION_OBJECT_POINTERS SectionObjectPointers;
PSECTION_OBJECT_POINTERS SectionObjectPointer;
PVOID PrivateCacheMap;
NTSTATUS FinalStatus;
struct _FILE_OBJECT* RelatedFileObject;

View file

@ -74,8 +74,8 @@ typedef struct _KQUEUE
{
DISPATCHER_HEADER Header;
LIST_ENTRY EntryListHead;
ULONG RunningThreads;
ULONG MaximumThreads;
ULONG CurrentCount;
ULONG MaximumCount;
LIST_ENTRY ThreadListHead;
} KQUEUE, *PKQUEUE;

View file

@ -1,4 +1,4 @@
/* $Id: copy.c,v 1.16 2003/05/25 21:50:18 hbirr Exp $
/* $Id: copy.c,v 1.17 2003/06/07 11:34:36 chorns Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel
@ -267,7 +267,7 @@ CcCopyRead (IN PFILE_OBJECT FileObject,
FileObject, (ULONG)FileOffset->QuadPart, Length, Wait,
Buffer, IoStatus);
Bcb = FileObject->SectionObjectPointers->SharedCacheMap;
Bcb = FileObject->SectionObjectPointer->SharedCacheMap;
ReadOffset = FileOffset->QuadPart;
DPRINT("AllocationSize %d, FileSize %d\n",
@ -369,7 +369,7 @@ CcCopyWrite (IN PFILE_OBJECT FileObject,
"Length %d, Wait %d, Buffer %x)\n",
FileObject, (ULONG)FileOffset->QuadPart, Length, Wait, Buffer);
Bcb = FileObject->SectionObjectPointers->SharedCacheMap;
Bcb = FileObject->SectionObjectPointer->SharedCacheMap;
WriteOffset = (ULONG)FileOffset->QuadPart;
if (!Wait)
@ -473,7 +473,7 @@ CcZeroData (IN PFILE_OBJECT FileObject,
Length = EndOffset->u.LowPart - StartOffset->u.LowPart;
if (FileObject->SectionObjectPointers->SharedCacheMap == NULL)
if (FileObject->SectionObjectPointer->SharedCacheMap == NULL)
{
/* File is not cached */
WriteOffset.QuadPart = StartOffset->QuadPart;
@ -533,7 +533,7 @@ CcZeroData (IN PFILE_OBJECT FileObject,
PHYSICAL_ADDRESS page;
Start = StartOffset->u.LowPart;
Bcb = FileObject->SectionObjectPointers->SharedCacheMap;
Bcb = FileObject->SectionObjectPointer->SharedCacheMap;
if (Wait)
{
/* testing, if the requested datas are available */

View file

@ -91,7 +91,7 @@ CcSetFileSizes (IN PFILE_OBJECT FileObject,
(ULONG)FileSizes->FileSize.QuadPart,
(ULONG)FileSizes->ValidDataLength.QuadPart);
Bcb = FileObject->SectionObjectPointers->SharedCacheMap;
Bcb = FileObject->SectionObjectPointer->SharedCacheMap;
assert(Bcb);
if (FileSizes->AllocationSize.QuadPart < Bcb->AllocationSize.QuadPart)

View file

@ -1,4 +1,4 @@
/* $Id: pin.c,v 1.11 2003/02/13 22:24:18 hbirr Exp $
/* $Id: pin.c,v 1.12 2003/06/07 11:34:36 chorns Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel
@ -51,7 +51,7 @@ CcMapData (IN PFILE_OBJECT FileObject,
Length, Wait, pBcb, pBuffer);
ReadOffset = FileOffset->QuadPart;
Bcb = FileObject->SectionObjectPointers->SharedCacheMap;
Bcb = FileObject->SectionObjectPointer->SharedCacheMap;
assert(Bcb);
DPRINT("AllocationSize %d, FileSize %d\n",

View file

@ -16,7 +16,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
/* $Id: view.c,v 1.61 2003/06/06 21:02:42 hbirr Exp $
/* $Id: view.c,v 1.62 2003/06/07 11:34:36 chorns Exp $
*
* PROJECT: ReactOS kernel
* FILE: ntoskrnl/cc/view.c
@ -922,7 +922,7 @@ CcRosDeleteFileCache(PFILE_OBJECT FileObject, PBCB Bcb)
Bcb->RefCount++;
ExReleaseFastMutex(&ViewLock);
CcFlushCache(FileObject->SectionObjectPointers, NULL, 0, NULL);
CcFlushCache(FileObject->SectionObjectPointer, NULL, 0, NULL);
ExAcquireFastMutex(&ViewLock);
Bcb->RefCount--;
@ -934,7 +934,7 @@ CcRosDeleteFileCache(PFILE_OBJECT FileObject, PBCB Bcb)
Bcb->BcbRemoveListEntry.Flink = NULL;
}
FileObject->SectionObjectPointers->SharedCacheMap = NULL;
FileObject->SectionObjectPointer->SharedCacheMap = NULL;
/*
* Release all cache segments.
@ -977,7 +977,7 @@ VOID CcRosReferenceCache(PFILE_OBJECT FileObject)
{
PBCB Bcb;
ExAcquireFastMutex(&ViewLock);
Bcb = (PBCB)FileObject->SectionObjectPointers->SharedCacheMap;
Bcb = (PBCB)FileObject->SectionObjectPointer->SharedCacheMap;
assert(Bcb);
if (Bcb->RefCount == 0)
{
@ -1016,7 +1016,7 @@ VOID CcRosDereferenceCache(PFILE_OBJECT FileObject)
{
PBCB Bcb;
ExAcquireFastMutex(&ViewLock);
Bcb = (PBCB)FileObject->SectionObjectPointers->SharedCacheMap;
Bcb = (PBCB)FileObject->SectionObjectPointer->SharedCacheMap;
assert(Bcb);
if (Bcb->RefCount > 0)
{
@ -1049,9 +1049,9 @@ CcRosReleaseFileCache(PFILE_OBJECT FileObject)
ExAcquireFastMutex(&ViewLock);
if (FileObject->SectionObjectPointers->SharedCacheMap != NULL)
if (FileObject->SectionObjectPointer->SharedCacheMap != NULL)
{
Bcb = FileObject->SectionObjectPointers->SharedCacheMap;
Bcb = FileObject->SectionObjectPointer->SharedCacheMap;
if (FileObject->PrivateCacheMap != NULL)
{
FileObject->PrivateCacheMap = NULL;
@ -1090,7 +1090,7 @@ CcRosInitializeFileCache(PFILE_OBJECT FileObject,
ExAcquireFastMutex(&ViewLock);
Bcb = FileObject->SectionObjectPointers->SharedCacheMap;
Bcb = FileObject->SectionObjectPointer->SharedCacheMap;
if (Bcb == NULL)
{
Bcb = ExAllocateFromNPagedLookasideList(&BcbLookasideList);
@ -1109,13 +1109,13 @@ CcRosInitializeFileCache(PFILE_OBJECT FileObject,
if (FileObject->FsContext)
{
Bcb->AllocationSize =
((REACTOS_COMMON_FCB_HEADER*)FileObject->FsContext)->AllocationSize;
((PFSRTL_COMMON_FCB_HEADER)FileObject->FsContext)->AllocationSize;
Bcb->FileSize =
((REACTOS_COMMON_FCB_HEADER*)FileObject->FsContext)->FileSize;
((PFSRTL_COMMON_FCB_HEADER)FileObject->FsContext)->FileSize;
}
KeInitializeSpinLock(&Bcb->BcbLock);
InitializeListHead(&Bcb->BcbSegmentListHead);
FileObject->SectionObjectPointers->SharedCacheMap = Bcb;
FileObject->SectionObjectPointer->SharedCacheMap = Bcb;
}
if (FileObject->PrivateCacheMap == NULL)
{

View file

@ -1,4 +1,4 @@
/* $Id: rawfs.c,v 1.2 2003/05/15 13:34:37 ekohl Exp $
/* $Id: rawfs.c,v 1.3 2003/06/07 11:34:36 chorns Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel
@ -65,7 +65,7 @@ typedef struct _RAWFS_IRP_CONTEXT
typedef struct _RAWFS_FCB
{
/* Start FCB header required by ReactOS/Windows NT */
REACTOS_COMMON_FCB_HEADER RFCB;
FSRTL_COMMON_FCB_HEADER RFCB;
SECTION_OBJECT_POINTERS SectionObjectPointers;
ERESOURCE MainResource;
ERESOURCE PagingIoResource;
@ -457,7 +457,7 @@ RawFsCreateFile(IN PRAWFS_IRP_CONTEXT IrpContext)
}
FileObject->Flags |= FO_FCB_IS_VALID;
FileObject->SectionObjectPointers = &pFcb->SectionObjectPointers;
FileObject->SectionObjectPointer = &pFcb->SectionObjectPointers;
FileObject->FsContext = pFcb;
FileObject->FsContext2 = pCcb;
pFcb->RefCount++;

View file

@ -16,7 +16,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
/* $Id: queue.c,v 1.5 2003/03/19 23:10:31 gdalsnes Exp $
/* $Id: queue.c,v 1.6 2003/06/07 11:34:36 chorns Exp $
*
* PROJECT: ReactOS kernel
* FILE: ntoskrnl/ke/queue.c
@ -48,8 +48,8 @@ KeInitializeQueue(IN PKQUEUE Queue,
0);
InitializeListHead(&Queue->EntryListHead);
InitializeListHead(&Queue->ThreadListHead);
Queue->RunningThreads = 0;
Queue->MaximumThreads = (Count == 0) ? (ULONG) KeNumberProcessors : Count;
Queue->CurrentCount = 0;
Queue->MaximumCount = (Count == 0) ? (ULONG) KeNumberProcessors : Count;
}
@ -85,7 +85,7 @@ KiInsertQueue(
InsertTailList(&Queue->EntryListHead, Entry);
}
if (Queue->RunningThreads < Queue->MaximumThreads && InitialState == 0)
if (Queue->CurrentCount < Queue->MaximumCount && InitialState == 0)
{
KeDispatcherObjectWake(&Queue->Header);
}
@ -134,11 +134,11 @@ KeRemoveQueue(IN PKQUEUE Queue,
//associate with this queue
InsertHeadList(&Queue->ThreadListHead, &Thread->QueueListEntry);
Queue->RunningThreads++;
Queue->CurrentCount++;
Thread->Queue = Queue;
}
if (Queue->RunningThreads <= Queue->MaximumThreads && !IsListEmpty(&Queue->EntryListHead))
if (Queue->CurrentCount <= Queue->MaximumCount && !IsListEmpty(&Queue->EntryListHead))
{
ListEntry = RemoveHeadList(&Queue->EntryListHead);
Queue->Header.SignalState--;

View file

@ -1,4 +1,4 @@
/* $Id: spinlock.c,v 1.15 2003/06/07 10:37:50 chorns Exp $
/* $Id: spinlock.c,v 1.16 2003/06/07 11:34:36 chorns Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel
@ -63,6 +63,8 @@ KeInitializeSpinLock (PKSPIN_LOCK SpinLock)
*SpinLock = 0;
}
#undef KeAcquireSpinLockAtDpcLevel
VOID STDCALL
KeAcquireSpinLockAtDpcLevel (PKSPIN_LOCK SpinLock)
/*
@ -95,6 +97,8 @@ KeAcquireSpinLockAtDpcLevel (PKSPIN_LOCK SpinLock)
}
}
#undef KeReleaseSpinLockFromDpcLevel
VOID STDCALL
KeReleaseSpinLockFromDpcLevel (PKSPIN_LOCK SpinLock)
/*

View file

@ -634,8 +634,8 @@ KeWaitForMultipleObjects(ULONG Count,
//io completion
if (CurrentThread->Queue)
{
CurrentThread->Queue->RunningThreads--;
if (WaitReason != WrQueue && CurrentThread->Queue->RunningThreads < CurrentThread->Queue->MaximumThreads &&
CurrentThread->Queue->CurrentCount--;
if (WaitReason != WrQueue && CurrentThread->Queue->CurrentCount < CurrentThread->Queue->MaximumCount &&
!IsListEmpty(&CurrentThread->Queue->EntryListHead))
{
KeDispatcherObjectWake(&CurrentThread->Queue->Header);
@ -647,7 +647,7 @@ KeWaitForMultipleObjects(ULONG Count,
//io completion
if (CurrentThread->Queue)
{
CurrentThread->Queue->RunningThreads++;
CurrentThread->Queue->CurrentCount++;
}

View file

@ -16,7 +16,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
/* $Id: section.c,v 1.114 2003/06/06 21:00:28 hbirr Exp $
/* $Id: section.c,v 1.115 2003/06/07 11:34:36 chorns Exp $
*
* PROJECT: ReactOS kernel
* FILE: ntoskrnl/mm/section.c
@ -94,14 +94,14 @@ MmFreePageTablesSectionSegment(PMM_SECTION_SEGMENT Segment)
VOID
MmFreeSectionSegments(PFILE_OBJECT FileObject)
{
if (FileObject->SectionObjectPointers->ImageSectionObject != NULL)
if (FileObject->SectionObjectPointer->ImageSectionObject != NULL)
{
PMM_IMAGE_SECTION_OBJECT ImageSectionObject;
ULONG i;
ImageSectionObject =
(PMM_IMAGE_SECTION_OBJECT)FileObject->SectionObjectPointers->
(PMM_IMAGE_SECTION_OBJECT)FileObject->SectionObjectPointer->
ImageSectionObject;
for (i = 0; i < ImageSectionObject->NrSegments; i++)
@ -115,13 +115,13 @@ MmFreeSectionSegments(PFILE_OBJECT FileObject)
MmFreePageTablesSectionSegment(&ImageSectionObject->Segments[i]);
}
ExFreePool(ImageSectionObject);
FileObject->SectionObjectPointers->ImageSectionObject = NULL;
FileObject->SectionObjectPointer->ImageSectionObject = NULL;
}
if (FileObject->SectionObjectPointers->DataSectionObject != NULL)
if (FileObject->SectionObjectPointer->DataSectionObject != NULL)
{
PMM_SECTION_SEGMENT Segment;
Segment = (PMM_SECTION_SEGMENT)FileObject->SectionObjectPointers->
Segment = (PMM_SECTION_SEGMENT)FileObject->SectionObjectPointer->
DataSectionObject;
if (Segment->ReferenceCount != 0)
@ -131,7 +131,7 @@ MmFreeSectionSegments(PFILE_OBJECT FileObject)
}
MmFreePageTablesSectionSegment(Segment);
ExFreePool(Segment);
FileObject->SectionObjectPointers->DataSectionObject = NULL;
FileObject->SectionObjectPointer->DataSectionObject = NULL;
}
}
@ -310,7 +310,7 @@ MmUnsharePageEntrySectionSegment(PSECTION_OBJECT Section,
(Offset + PAGE_SIZE <= Segment->RawLength || !IsImageSection))
{
NTSTATUS Status;
Bcb = FileObject->SectionObjectPointers->SharedCacheMap;
Bcb = FileObject->SectionObjectPointer->SharedCacheMap;
Status = CcRosUnmapCacheSegment(Bcb, FileOffset, Dirty);
if (!NT_SUCCESS(Status))
{
@ -343,7 +343,7 @@ BOOL MiIsPageFromCache(PMEMORY_AREA MemoryArea,
PBCB Bcb;
PCACHE_SEGMENT CacheSeg;
Bcb = MemoryArea->Data.SectionData.Section->FileObject->SectionObjectPointers->SharedCacheMap;
Bcb = MemoryArea->Data.SectionData.Section->FileObject->SectionObjectPointer->SharedCacheMap;
CacheSeg = CcRosLookupCacheSegment(Bcb, SegOffset + MemoryArea->Data.SectionData.Segment->FileOffset);
if (CacheSeg)
{
@ -378,7 +378,7 @@ MiReadPage(PMEMORY_AREA MemoryArea,
ULONG Length;
FileObject = MemoryArea->Data.SectionData.Section->FileObject;
Bcb = FileObject->SectionObjectPointers->SharedCacheMap;
Bcb = FileObject->SectionObjectPointer->SharedCacheMap;
RawLength = MemoryArea->Data.SectionData.Segment->RawLength;
FileOffset = SegOffset + MemoryArea->Data.SectionData.Segment->FileOffset;
IsImageSection = MemoryArea->Data.SectionData.Section->AllocationAttributes & SEC_IMAGE ? TRUE : FALSE;
@ -1313,7 +1313,7 @@ MmPageOutSectionView(PMADDRESS_SPACE AddressSpace,
DirectMapped = FALSE;
if (FileObject != NULL)
{
Bcb = FileObject->SectionObjectPointers->SharedCacheMap;
Bcb = FileObject->SectionObjectPointer->SharedCacheMap;
/*
* If the file system is letting us go directly to the cache and the
@ -1676,7 +1676,7 @@ MmWritePageSectionView(PMADDRESS_SPACE AddressSpace,
DirectMapped = FALSE;
if (FileObject != NULL)
{
Bcb = FileObject->SectionObjectPointers->SharedCacheMap;
Bcb = FileObject->SectionObjectPointer->SharedCacheMap;
/*
* If the file system is letting us go directly to the cache and the
@ -2268,11 +2268,11 @@ MmCreateDataFileSection(PHANDLE SectionHandle,
else
{
MaximumSize =
((PREACTOS_COMMON_FCB_HEADER)FileObject->FsContext)->FileSize;
((PFSRTL_COMMON_FCB_HEADER)FileObject->FsContext)->FileSize;
}
if (MaximumSize.QuadPart >
((PREACTOS_COMMON_FCB_HEADER)FileObject->FsContext)->FileSize.QuadPart)
((PFSRTL_COMMON_FCB_HEADER)FileObject->FsContext)->FileSize.QuadPart)
{
IO_STATUS_BLOCK Iosb;
Status = NtSetInformationFile(FileHandle,
@ -2309,7 +2309,7 @@ MmCreateDataFileSection(PHANDLE SectionHandle,
* If this file hasn't been mapped as a data file before then allocate a
* section segment to describe the data file mapping
*/
if (FileObject->SectionObjectPointers->DataSectionObject == NULL)
if (FileObject->SectionObjectPointer->DataSectionObject == NULL)
{
Segment = ExAllocatePoolWithTag(NonPagedPool, sizeof(MM_SECTION_SEGMENT),
TAG_MM_SECTION_SEGMENT);
@ -2342,7 +2342,7 @@ MmCreateDataFileSection(PHANDLE SectionHandle,
ObDereferenceObject(FileObject);
return(Status);
}
FileObject->SectionObjectPointers->DataSectionObject = (PVOID)Segment;
FileObject->SectionObjectPointer->DataSectionObject = (PVOID)Segment;
Segment->FileOffset = 0;
Segment->Protection = 0;
@ -2368,7 +2368,7 @@ MmCreateDataFileSection(PHANDLE SectionHandle,
* to extend it
*/
Segment =
(PMM_SECTION_SEGMENT)FileObject->SectionObjectPointers->
(PMM_SECTION_SEGMENT)FileObject->SectionObjectPointer->
DataSectionObject;
Section->Segments = Segment;
InterlockedIncrement((PLONG)&Segment->ReferenceCount);
@ -2653,7 +2653,7 @@ MmCreateImageSection(PHANDLE SectionHandle,
* section segments to describe the mapping
*/
NrSegments = PEHeader.FileHeader.NumberOfSections + 1;
if (FileObject->SectionObjectPointers->ImageSectionObject == NULL)
if (FileObject->SectionObjectPointer->ImageSectionObject == NULL)
{
ULONG i;
ULONG Size;
@ -2758,7 +2758,7 @@ MmCreateImageSection(PHANDLE SectionHandle,
KeInitializeMutex(&SectionSegments[i].Lock, 0);
}
FileObject->SectionObjectPointers->ImageSectionObject =
FileObject->SectionObjectPointer->ImageSectionObject =
(PVOID)ImageSectionObject;
}
else
@ -2766,7 +2766,7 @@ MmCreateImageSection(PHANDLE SectionHandle,
ULONG i;
ImageSectionObject = (PMM_IMAGE_SECTION_OBJECT)
FileObject->SectionObjectPointers->ImageSectionObject;
FileObject->SectionObjectPointer->ImageSectionObject;
SectionSegments = ImageSectionObject->Segments;
Section->Segments = SectionSegments;
@ -3086,7 +3086,7 @@ MmFreeSectionPage(PVOID Context, MEMORY_AREA* MemoryArea, PVOID Address,
if (PhysAddr.QuadPart == PAGE_FROM_SSE(Entry) && Dirty)
{
FileObject = MemoryArea->Data.SectionData.Section->FileObject;
Bcb = FileObject->SectionObjectPointers->SharedCacheMap;
Bcb = FileObject->SectionObjectPointer->SharedCacheMap;
CcRosMarkDirtyCacheSegment(Bcb, Offset);
assert(SwapEntry == 0);
}