https://git.reactos.org/?p=reactos.git;a=commitdiff;h=f3b9beeb391858c79b1fc…
commit f3b9beeb391858c79b1fc474e566690cf2e765bc
Author: Pierre Schweitzer <pierre(a)reactos.org>
AuthorDate: Tue Oct 23 21:48:01 2018 +0200
Commit: Pierre Schweitzer <pierre(a)reactos.org>
CommitDate: Tue Oct 23 22:07:53 2018 +0200
[NTOSKRNL] Translate pinning flags to mapping flags when first mapping a file
---
ntoskrnl/cc/pin.c | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/ntoskrnl/cc/pin.c b/ntoskrnl/cc/pin.c
index 4f0e4f5a82..d972f8a75d 100644
--- a/ntoskrnl/cc/pin.c
+++ b/ntoskrnl/cc/pin.c
@@ -267,6 +267,7 @@ CcpPinData(
BOOLEAN Result;
PROS_VACB Vacb;
KIRQL OldIrql;
+ ULONG MapFlags;
KeAcquireSpinLock(&SharedCacheMap->BcbSpinLock, &OldIrql);
NewBcb = CcpFindBcb(SharedCacheMap, FileOffset, Length, TRUE);
@@ -305,7 +306,13 @@ CcpPinData(
return FALSE;
}
- Result = CcpMapData(SharedCacheMap, FileOffset, Length, Flags, &Vacb,
Buffer);
+ MapFlags = Flags & PIN_WAIT;
+ if (BooleanFlagOn(Flags, PIN_NO_READ))
+ {
+ SetFlag(MapFlags, MAP_NO_READ);
+ }
+
+ Result = CcpMapData(SharedCacheMap, FileOffset, Length, MapFlags, &Vacb,
Buffer);
if (Result)
{
NewBcb = CcpGetAppropriateBcb(SharedCacheMap, Vacb, FileOffset, Length,
Flags, TRUE);