[NTOSKRNL:CC] Disable Fault Clustering while Probing

It ensure fault clustering is disabled for current thread, otherwise on some test it was failing MmProbeAndLockPages
This commit is contained in:
Dibyamartanda Samanta 2024-08-16 06:50:35 +02:00 committed by CodingWorkshop Signing Team
parent 688615fa39
commit e25bcab194
Signed by: CodingWorkshop Signing Team
GPG Key ID: 6DC88369C82795D2

View File

@ -357,10 +357,11 @@ CcPrepareMdlWrite(IN PFILE_OBJECT FileObject,
currentThread = KeGetCurrentThread();
SavedState = currentThread->UserIdealProcessor ;
currentThread->UserIdealProcessor = 1;
savedDisablePageFaultClustering = currentThread->DisablePageFaultClustering;
currentThread->DisablePageFaultClustering = 1;
MmProbeAndLockPages(Mdl, KernelMode, IoWriteAccess);
currentThread->UserIdealProcessor = SavedState;
SavedState
currentThread->DisablePageFaultClustering = savedDisablePageFaultClustering;
/* Update the Read Aheas Stats*/
KeAcquireInStackQueuedSpinLock(&SharedCacheMap->BcbSpinLock, &LockHandle);
if ( ReadAhead_Length.QuadPart > SharedCacheMap->ValidDataGoal.QuadPart )