Author: tfaber
Date: Sun Aug 31 12:56:36 2014
New Revision: 64008
URL:
http://svn.reactos.org/svn/reactos?rev=64008&view=rev
Log:
[NTOS:CC]
- Consistently use LONGLONG for file offsets
Modified:
trunk/reactos/ntoskrnl/cc/copy.c
trunk/reactos/ntoskrnl/cc/view.c
trunk/reactos/ntoskrnl/include/internal/cc.h
trunk/reactos/ntoskrnl/mm/section.c
Modified: trunk/reactos/ntoskrnl/cc/copy.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/cc/copy.c?rev=640…
==============================================================================
--- trunk/reactos/ntoskrnl/cc/copy.c [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/cc/copy.c [iso-8859-1] Sun Aug 31 12:56:36 2014
@@ -200,7 +200,7 @@
_In_ PFILE_OBJECT FileObject,
_In_ LONGLONG FileOffset,
_Inout_ PVOID Buffer,
- _In_ ULONG Length,
+ _In_ LONGLONG Length,
_In_ CC_COPY_OPERATION Operation,
_In_ BOOLEAN Wait,
_Out_ PIO_STATUS_BLOCK IoStatus)
@@ -467,7 +467,7 @@
{
NTSTATUS Status;
LARGE_INTEGER WriteOffset;
- ULONG Length;
+ LONGLONG Length;
ULONG CurrentLength;
PMDL Mdl;
ULONG i;
@@ -478,7 +478,7 @@
"Wait %u)\n", FileObject, StartOffset->QuadPart,
EndOffset->QuadPart,
Wait);
- Length = EndOffset->u.LowPart - StartOffset->u.LowPart;
+ Length = EndOffset->QuadPart - StartOffset->QuadPart;
WriteOffset.QuadPart = StartOffset->QuadPart;
if (FileObject->SectionObjectPointer->SharedCacheMap == NULL)
@@ -489,9 +489,9 @@
while (Length > 0)
{
- if (Length + WriteOffset.u.LowPart % PAGE_SIZE > MAX_ZERO_LENGTH)
- {
- CurrentLength = MAX_ZERO_LENGTH - WriteOffset.u.LowPart % PAGE_SIZE;
+ if (Length + WriteOffset.QuadPart % PAGE_SIZE > MAX_ZERO_LENGTH)
+ {
+ CurrentLength = MAX_ZERO_LENGTH - WriteOffset.QuadPart % PAGE_SIZE;
}
else
{
Modified: trunk/reactos/ntoskrnl/cc/view.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/cc/view.c?rev=640…
==============================================================================
--- trunk/reactos/ntoskrnl/cc/view.c [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/cc/view.c [iso-8859-1] Sun Aug 31 12:56:36 2014
@@ -434,7 +434,7 @@
NTAPI
CcRosLookupVacb (
PROS_SHARED_CACHE_MAP SharedCacheMap,
- ULONG FileOffset)
+ LONGLONG FileOffset)
{
PLIST_ENTRY current_entry;
PROS_VACB current;
@@ -442,7 +442,7 @@
ASSERT(SharedCacheMap);
- DPRINT("CcRosLookupVacb(SharedCacheMap 0x%p, FileOffset %lu)\n",
+ DPRINT("CcRosLookupVacb(SharedCacheMap 0x%p, FileOffset %I64u)\n",
SharedCacheMap, FileOffset);
KeAcquireGuardedMutex(&ViewLock);
@@ -483,14 +483,14 @@
NTAPI
CcRosMarkDirtyVacb (
PROS_SHARED_CACHE_MAP SharedCacheMap,
- ULONG FileOffset)
+ LONGLONG FileOffset)
{
PROS_VACB Vacb;
KIRQL oldIrql;
ASSERT(SharedCacheMap);
- DPRINT("CcRosMarkDirtyVacb(SharedCacheMap 0x%p, FileOffset %lu)\n",
+ DPRINT("CcRosMarkDirtyVacb(SharedCacheMap 0x%p, FileOffset %I64u)\n",
SharedCacheMap, FileOffset);
Vacb = CcRosLookupVacb(SharedCacheMap, FileOffset);
@@ -529,7 +529,7 @@
NTAPI
CcRosUnmapVacb (
PROS_SHARED_CACHE_MAP SharedCacheMap,
- ULONG FileOffset,
+ LONGLONG FileOffset,
BOOLEAN NowDirty)
{
PROS_VACB Vacb;
@@ -538,7 +538,7 @@
ASSERT(SharedCacheMap);
- DPRINT("CcRosUnmapVacb(SharedCacheMap 0x%p, FileOffset %lu, NowDirty
%u)\n",
+ DPRINT("CcRosUnmapVacb(SharedCacheMap 0x%p, FileOffset %I64u, NowDirty
%u)\n",
SharedCacheMap, FileOffset, NowDirty);
Vacb = CcRosLookupVacb(SharedCacheMap, FileOffset);
@@ -582,7 +582,7 @@
NTSTATUS
CcRosCreateVacb (
PROS_SHARED_CACHE_MAP SharedCacheMap,
- ULONG FileOffset,
+ LONGLONG FileOffset,
PROS_VACB *Vacb)
{
PROS_VACB current;
@@ -595,7 +595,7 @@
DPRINT("CcRosCreateVacb()\n");
- if (FileOffset >= SharedCacheMap->FileSize.u.LowPart)
+ if (FileOffset >= SharedCacheMap->FileSize.QuadPart)
{
*Vacb = NULL;
return STATUS_INVALID_PARAMETER;
@@ -729,8 +729,8 @@
NTAPI
CcRosGetVacb (
PROS_SHARED_CACHE_MAP SharedCacheMap,
- ULONG FileOffset,
- PULONGLONG BaseOffset,
+ LONGLONG FileOffset,
+ PLONGLONG BaseOffset,
PVOID* BaseAddress,
PBOOLEAN UptoDate,
PROS_VACB *Vacb)
@@ -781,7 +781,7 @@
NTAPI
CcRosRequestVacb (
PROS_SHARED_CACHE_MAP SharedCacheMap,
- ULONG FileOffset,
+ LONGLONG FileOffset,
PVOID* BaseAddress,
PBOOLEAN UptoDate,
PROS_VACB *Vacb)
@@ -789,13 +789,13 @@
* FUNCTION: Request a page mapping for a shared cache map
*/
{
- ULONGLONG BaseOffset;
+ LONGLONG BaseOffset;
ASSERT(SharedCacheMap);
if (FileOffset % VACB_MAPPING_GRANULARITY != 0)
{
- DPRINT1("Bad fileoffset %x should be multiple of %x",
+ DPRINT1("Bad fileoffset %I64x should be multiple of %x",
FileOffset, VACB_MAPPING_GRANULARITY);
KeBugCheck(CACHE_MANAGER);
}
@@ -896,7 +896,7 @@
while (RemainingLength > 0)
{
- current = CcRosLookupVacb(SharedCacheMap, Offset.u.LowPart);
+ current = CcRosLookupVacb(SharedCacheMap, Offset.QuadPart);
if (current != NULL)
{
if (current->Dirty)
Modified: trunk/reactos/ntoskrnl/include/internal/cc.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/include/internal/…
==============================================================================
--- trunk/reactos/ntoskrnl/include/internal/cc.h [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/include/internal/cc.h [iso-8859-1] Sun Aug 31 12:56:36 2014
@@ -184,8 +184,8 @@
NTAPI
CcRosGetVacb(
PROS_SHARED_CACHE_MAP SharedCacheMap,
- ULONG FileOffset,
- PULONGLONG BaseOffset,
+ LONGLONG FileOffset,
+ PLONGLONG BaseOffset,
PVOID *BaseAddress,
PBOOLEAN UptoDate,
PROS_VACB *Vacb
@@ -211,7 +211,7 @@
NTAPI
CcRosUnmapVacb(
PROS_SHARED_CACHE_MAP SharedCacheMap,
- ULONG FileOffset,
+ LONGLONG FileOffset,
BOOLEAN NowDirty
);
@@ -219,7 +219,7 @@
NTAPI
CcRosLookupVacb(
PROS_SHARED_CACHE_MAP SharedCacheMap,
- ULONG FileOffset
+ LONGLONG FileOffset
);
VOID
@@ -230,7 +230,7 @@
NTAPI
CcRosMarkDirtyVacb(
PROS_SHARED_CACHE_MAP SharedCacheMap,
- ULONG FileOffset
+ LONGLONG FileOffset
);
NTSTATUS
@@ -267,7 +267,7 @@
NTAPI
CcRosRequestVacb(
PROS_SHARED_CACHE_MAP SharedCacheMap,
- ULONG FileOffset,
+ LONGLONG FileOffset,
PVOID* BaseAddress,
PBOOLEAN UptoDate,
PROS_VACB *Vacb
@@ -295,10 +295,10 @@
FORCEINLINE
BOOLEAN
DoRangesIntersect(
- _In_ ULONGLONG Offset1,
- _In_ ULONG Length1,
- _In_ ULONGLONG Offset2,
- _In_ ULONG Length2)
+ _In_ LONGLONG Offset1,
+ _In_ LONGLONG Length1,
+ _In_ LONGLONG Offset2,
+ _In_ LONGLONG Length2)
{
if (Offset1 + Length1 <= Offset2)
return FALSE;
@@ -310,9 +310,9 @@
FORCEINLINE
BOOLEAN
IsPointInRange(
- _In_ ULONGLONG Offset1,
- _In_ ULONG Length1,
- _In_ ULONGLONG Point)
+ _In_ LONGLONG Offset1,
+ _In_ LONGLONG Length1,
+ _In_ LONGLONG Point)
{
return DoRangesIntersect(Offset1, Length1, Point, 1);
}
Modified: trunk/reactos/ntoskrnl/mm/section.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/mm/section.c?rev=…
==============================================================================
--- trunk/reactos/ntoskrnl/mm/section.c [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/mm/section.c [iso-8859-1] Sun Aug 31 12:56:36 2014
@@ -928,7 +928,7 @@
SharedCacheMap = FileObject->SectionObjectPointer->SharedCacheMap;
IsDirectMapped = TRUE;
#ifndef NEWCC
- Status = CcRosUnmapVacb(SharedCacheMap, FileOffset.LowPart, Dirty);
+ Status = CcRosUnmapVacb(SharedCacheMap, FileOffset.QuadPart, Dirty);
#else
Status = STATUS_SUCCESS;
#endif
@@ -1017,7 +1017,7 @@
}
BOOLEAN MiIsPageFromCache(PMEMORY_AREA MemoryArea,
- ULONG SegOffset)
+ LONGLONG SegOffset)
{
#ifndef NEWCC
if (!(MemoryArea->Data.SectionData.Segment->Image.Characteristics &
IMAGE_SCN_MEM_SHARED))
@@ -1025,7 +1025,7 @@
PROS_SHARED_CACHE_MAP SharedCacheMap;
PROS_VACB Vacb;
SharedCacheMap =
MemoryArea->Data.SectionData.Section->FileObject->SectionObjectPointer->SharedCacheMap;
- Vacb = CcRosLookupVacb(SharedCacheMap, (ULONG)(SegOffset +
MemoryArea->Data.SectionData.Segment->Image.FileOffset));
+ Vacb = CcRosLookupVacb(SharedCacheMap, SegOffset +
MemoryArea->Data.SectionData.Segment->Image.FileOffset);
if (Vacb)
{
CcRosReleaseVacb(SharedCacheMap, Vacb, Vacb->Valid, FALSE, TRUE);
@@ -1063,7 +1063,7 @@
NTSTATUS
NTAPI
MiReadPage(PMEMORY_AREA MemoryArea,
- ULONG_PTR SegOffset,
+ LONGLONG SegOffset,
PPFN_NUMBER Page)
/*
* FUNCTION: Read a page for a section backed memory area.
@@ -1073,21 +1073,21 @@
* Page - Variable that receives a page contains the read data.
*/
{
- ULONGLONG BaseOffset;
- ULONGLONG FileOffset;
+ LONGLONG BaseOffset;
+ LONGLONG FileOffset;
PVOID BaseAddress;
BOOLEAN UptoDate;
PROS_VACB Vacb;
PFILE_OBJECT FileObject;
NTSTATUS Status;
- ULONG_PTR RawLength;
+ LONGLONG RawLength;
PROS_SHARED_CACHE_MAP SharedCacheMap;
BOOLEAN IsImageSection;
- ULONG_PTR Length;
+ LONGLONG Length;
FileObject = MemoryArea->Data.SectionData.Section->FileObject;
SharedCacheMap = FileObject->SectionObjectPointer->SharedCacheMap;
- RawLength =
(ULONG_PTR)(MemoryArea->Data.SectionData.Segment->RawLength.QuadPart);
+ RawLength = MemoryArea->Data.SectionData.Segment->RawLength.QuadPart;
FileOffset = SegOffset +
MemoryArea->Data.SectionData.Segment->Image.FileOffset;
IsImageSection = MemoryArea->Data.SectionData.Section->AllocationAttributes
& SEC_IMAGE ? TRUE : FALSE;
@@ -1111,7 +1111,7 @@
* alignment less than the file system block size.
*/
Status = CcRosGetVacb(SharedCacheMap,
- (ULONG)FileOffset,
+ FileOffset,
&BaseOffset,
&BaseAddress,
&UptoDate,
@@ -1150,7 +1150,7 @@
PEPROCESS Process;
KIRQL Irql;
PVOID PageAddr;
- ULONG_PTR VacbOffset;
+ LONGLONG VacbOffset;
/*
* Allocate a page, this is rather complicated by the possibility
@@ -1164,7 +1164,7 @@
return(Status);
}
Status = CcRosGetVacb(SharedCacheMap,
- (ULONG)FileOffset,
+ FileOffset,
&BaseOffset,
&BaseAddress,
&UptoDate,
@@ -1189,7 +1189,7 @@
Process = PsGetCurrentProcess();
PageAddr = MiMapPageInHyperSpace(Process, *Page, &Irql);
- VacbOffset = (ULONG_PTR)(BaseOffset + VACB_MAPPING_GRANULARITY - FileOffset);
+ VacbOffset = BaseOffset + VACB_MAPPING_GRANULARITY - FileOffset;
Length = RawLength - SegOffset;
if (Length <= VacbOffset && Length <= PAGE_SIZE)
{
@@ -1205,7 +1205,7 @@
MiUnmapPageInHyperSpace(Process, PageAddr, Irql);
CcRosReleaseVacb(SharedCacheMap, Vacb, TRUE, FALSE, FALSE);
Status = CcRosGetVacb(SharedCacheMap,
- (ULONG)(FileOffset + VacbOffset),
+ FileOffset + VacbOffset,
&BaseOffset,
&BaseAddress,
&UptoDate,
@@ -1246,7 +1246,7 @@
NTSTATUS
NTAPI
MiReadPage(PMEMORY_AREA MemoryArea,
- ULONG_PTR SegOffset,
+ LONGLONG SegOffset,
PPFN_NUMBER Page)
/*
* FUNCTION: Read a page for a section backed memory area.
@@ -1514,7 +1514,7 @@
}
else
{
- Status = MiReadPage(MemoryArea, (ULONG_PTR)Offset.QuadPart, &Page);
+ Status = MiReadPage(MemoryArea, Offset.QuadPart, &Page);
if (!NT_SUCCESS(Status))
{
DPRINT1("MiReadPage failed (Status %x)\n", Status);
@@ -1981,7 +1981,7 @@
*/
if (DirectMapped && !Context.Private)
{
- if(!MiIsPageFromCache(MemoryArea, Context.Offset.LowPart))
+ if(!MiIsPageFromCache(MemoryArea, Context.Offset.QuadPart))
{
DPRINT1("Direct mapped non private page is not associated with the
cache.\n");
KeBugCheck(MEMORY_MANAGEMENT);
@@ -2073,7 +2073,7 @@
KeBugCheckEx(MEMORY_MANAGEMENT, STATUS_UNSUCCESSFUL, SwapEntry,
(ULONG_PTR)Process, (ULONG_PTR)Address);
}
#ifndef NEWCC
- Status = CcRosUnmapVacb(SharedCacheMap, (ULONG)FileOffset, FALSE);
+ Status = CcRosUnmapVacb(SharedCacheMap, FileOffset, FALSE);
#else
Status = STATUS_SUCCESS;
#endif
@@ -2373,7 +2373,7 @@
ASSERT(SwapEntry == 0);
//SOffset.QuadPart = Offset.QuadPart + Segment->Image.FileOffset;
#ifndef NEWCC
- CcRosMarkDirtyVacb(SharedCacheMap, Offset.LowPart);
+ CcRosMarkDirtyVacb(SharedCacheMap, Offset.QuadPart);
#endif
MmLockSectionSegment(Segment);
MmSetPageEntrySectionSegment(Segment, &Offset, PageEntry);
@@ -4027,7 +4027,7 @@
FileObject = MemoryArea->Data.SectionData.Section->FileObject;
SharedCacheMap = FileObject->SectionObjectPointer->SharedCacheMap;
#ifndef NEWCC
- CcRosMarkDirtyVacb(SharedCacheMap, (ULONG)(Offset.QuadPart +
Segment->Image.FileOffset));
+ CcRosMarkDirtyVacb(SharedCacheMap, Offset.QuadPart +
Segment->Image.FileOffset);
#endif
ASSERT(SwapEntry == 0);
}