CcForceWriteThrough
VOID __stdcall CcForceWriteThrough(
_FILE_OBJECT *FileObject,
UINT64 WriteLength,
_SHARED_CACHE_MAP *SharedCacheMap,
UINT8 SetForceWriteThroughFlag){
unsigned int v6;
INT64 Partition;
struct _KLOCK_QUEUE_HANDLE LockHandle;
v6 = WriteLength;
memset(&LockHandle, 0, sizeof(LockHandle));
if( SharedCacheMap )
Partition = CcGetPartition(SharedCacheMap);
else
Partition = *((_QWORD *)PspSystemPartition + 1);
if( (FileObject->Flags & 0x1000000) != 0
&& !CcCanIWriteStreamEx((UINT8 *)Partition, (INT64)FileObject, v6, 0i64, 0, 0i64)
|| SetForceWriteThroughFlag
&& (int)PsGetIoPriorityThread((__int64)KeGetCurrentThread()) <= 0
&& (FileObject->Flags & 0x8000) == 0 )
{
if( SetForceWriteThroughFlag )
{
if( (SharedCacheMap->Flags & 0x400) == 0 )
{
KeAcquireInStackQueuedSpinLock((UINT64 *)(Partition + 128), &LockHandle);
SharedCacheMap->Flags |= 0x400u;
KeReleaseInStackQueuedSpinLockFromDpcLevel(&LockHandle);
__writecr8(LockHandle.OldIrql);
}
}
}
}Referenced by:
CcPrepareMdlWrite