diff --git a/NTOSKRNL/CC/cclazywriter.cpp b/NTOSKRNL/CC/cclazywriter.cpp index bfd7c0c..3c323bf 100644 --- a/NTOSKRNL/CC/cclazywriter.cpp +++ b/NTOSKRNL/CC/cclazywriter.cpp @@ -15,57 +15,6 @@ extern "C" /*Internal Function*/ - - -VOID -NTAPI -CcComputeNextScanTime(PLARGE_INTEGER OldestTICKTIMEForMetadata, PLARGE_INTEGER NextScanDelay) -{ - NextScanDelay- = 0; - LARGE_INTEGER CurrentTickCount = {0}; - LARGE_INTEGER TICKTIME = {0}; - LARGE_INTEGER WRITE_DELAY = {0}; - LARGE_INTEGER TICK_ELAPSED = {0}; - - if (CcMaxWriteBehindThreads < CcNumberofWorkerThreads) - { - - - KeQueryTickCount(&CurrentTickCount); - - // Calculate Tick Time based on the current tick count and the oldest scan time - TICKTIME.QuadPart = 160000000 / KeMaximumIncrement; - WRITE_DELAY.QuadPart = (OldestTICKTIMEForMetadata->QuadPart - CurrentTickCount.QuadPart) / KeMaximumIncrement; - - // Increment the consecutive workless lazy scan count - ++CcConsecutiveWorklessLazyScanCount; - - // Check if the oldest scan time is not the maximum and the calculated delay is greater than the current tick - // count - if (OldestTICKTIMEForMetadata->QuadPart != -1 && OldestTICKTIMEForMetadata->QuadPart != 0x7FFFFFFFFFFFFFFF && - (TICKTIME.QuadPart + OldestTICKTIMEForMetadata->QuadPart) > CurrentTickCount.QuadPart) - { - - TICK_ELAPSED.QuadPart = OldestTICKTIMEForMetadata->QuadPart - CurrentTickCount.QuadPart; - - // Calculate the next scan delay - NextScanDelay->QuadPart = TICKTIME.QuadPart + TICK_ELAPSED.QuadPart; - - // Reset the consecutive workless lazy scan count - CcConsecutiveWorklessLazyScanCount = 0; - } - - // Check if the number of consecutive workless lazy scans has reached the maximum - if (CcConsecutiveWorklessLazyScanCount >= CcMaxWorklessLazywriteScans) - { - // Disable the scan by setting the next scan delay to the maximum values - NextScanDelay->QuadPart = -1; - CcConsecutiveWorklessLazyScanCount = 0; - NextScanDelay->HighPart = 0x7FFFFFFF; - } - } -} - VOID VECTORCALL CcPostWorkQueue(IN PWORK_QUEUE_ENTRY WorkItem, @@ -951,10 +900,10 @@ NTAPI CcLazyWriteScan() CcPostWorkQueue(workItem, &CcRegularWorkQueue); } - CcComputeNextScanTime(&OldestLWSTimeStamp, &NextScanDelay); + // CcComputeNextScanTime(&OldestLWSTimeStamp, &NextScanDelay); Enable When Threadpool is finished - if (!IsListEmpty(&PostWorkList) || !IsListEmpty(&CcDeferredWrites) || MmRegistryStatus.ProductStatus || - NextScanDelay.QuadPart != 0x7FFFFFFFFFFFFFFF)) + // if (!IsListEmpty(&PostWorkList) || !IsListEmpty(&CcDeferredWrites) || MmRegistryStatus.ProductStatus ||NextScanDelay.QuadPart != 0x7FFFFFFFFFFFFFFF)) + if (!IsListEmpty(&PostWorkList) || !IsListEmpty(&CcDeferredWrites) || MmRegistryStatus.ProductStatus)) { /* Schedule a lazy write scan */ CcRescheduleLazyWriteScan(&NextScanDelay); @@ -1117,7 +1066,7 @@ CcWorkerThread(PVOID Parameter) { CcQueueThrottle = FALSE; DropThrottle = FALSE; - CcReEngageWorkerThreads(CcThreadsActiveBeforeThrottle, CcExtraThreadsActiveBeforeThrottle); + // CcReEngageWorkerThreads(CcThreadsActiveBeforeThrottle, CcExtraThreadsActiveBeforeThrottle); Enable When Threadpool is ready } if (IoStatus.Information == 0x8A5E)