CcWriteBehind

VOID __stdcall CcWriteBehind(_SHARED_CACHE_MAP *SharedCacheMap, _IO_STATUS_BLOCK *IoStatus){
  void *v3; 
  __int64 Partition; 
  int v6; 
  INT64 *v7; 
  _QWORD *PoolWithTag; 
  INT64 result[7]; 
  char v10; 
  char v11; 
  __int64 v12; 
  PSLIST_ENTRY v13; 
  v3 = 0i64;
  v13 = 0i64;
  Partition = CcGetPartition(SharedCacheMap);
  v6 = CcAllocateWorkQueueEntry(Partition, &v13);
  v7 = (INT64 *)v13;
  if( v6 < 0
    || (*((_BYTE *)&v13[7].Next + 8) = 2,
        v7[1] = 0i64,
        *v7 = 0i64,
        v7[2] = (INT64)SharedCacheMap,
        v7[3] = (INT64)IoStatus,
        *(_DWORD *)(Partition + 960) >= *(_DWORD *)(Partition + 200))
    || *(_QWORD *)(Partition + 928)
    || SharedCacheMap->WritesInProgress
    || (SharedCacheMap->Flags & 0x10000) != 0
    || *(_BYTE *)(Partition + 966)
    || (PoolWithTag = ExAllocatePoolWithTag(NonPagedPoolNx, 0x40ui64, 0x71576343ui64), (v3 = PoolWithTag) == 0i64) )
  {
    memset((INT64)result, 0i64);
    if( !v7 )
    {
      v12 = Partition;
      v7 = result;
      v11 = 2;
      result[1] = 0i64;
      result[0] = 0i64;
      result[2] = (INT64)SharedCacheMap;
      result[3] = (INT64)IoStatus;
      v10 = 0;
    }
    *((_BYTE *)v7 + 56) = 0;
    CcWriteBehindInternal((INT64)v7);
    if( v7 == result )
      v7 = 0i64;
  }
  else
  {
    PoolWithTag[7] = Partition;
    *((_DWORD *)PoolWithTag + 8) = 1;
    *((_BYTE *)v7 + 56) = 1;
    v7[6] = (INT64)(v7 + 5);
    v7[5] = (INT64)(v7 + 5);
    *((_WORD *)v7 + 16) = 1;
    *((_BYTE *)v7 + 34) = 6;
    *((_DWORD *)v7 + 9) = 0;
    PoolWithTag[2] = CcWriteBehindInternal;
    PoolWithTag[3] = v7;
    *PoolWithTag = 0i64;
    ExQueueWorkItemToPartition(PoolWithTag);
    KeWaitForSingleObject(v7 + 4, Executive, 0, 0, 0i64);
  }
  if( v7 )
    CcFreeWorkQueueEntry((INT64)v7);
  if( v3 )
    ExFreePoolWithTag(v3, 0x71576343u);
}

Referenced by:

CcWaitForUninitializeCacheMap
CcWorkerThread