CmpTransWriteLog

NTSTATUS __stdcall CmpTransWriteLog(_CM_RM *CmRm, PVOID LogData, UINT64 LogDataLen, UINT64 Flags, _CLS_LSN *LastLsn){
  _ETHREAD *CurrentThread; 
  ULONG v6; 
  ULONG v7; 
  int v10; 
  NTSTATUS v11; 
  __int64 v12; 
  NTSTATUS v13; 
  int v14; 
  __int64 v16; 
  int v17; 
  int v18; 
  int v19; 
  unsigned int v20; 
  int v21; 
  int v22; 
  ULONG v23; 
  int v24; 
  int v25; 
  struct _EVENT_DATA_DESCRIPTOR v26; 
  int *v27; 
  int v28; 
  int v29; 
  int *v30; 
  int v31; 
  int v32; 
  struct _EVENT_DATA_DESCRIPTOR v33; 
  int *v34; 
  int v35; 
  int v36; 
  int *v37; 
  int v38; 
  int v39; 
  CurrentThread = (_ETHREAD *)KeGetCurrentThread();
  v6 = Flags;
  v20 = 0;
  v7 = LogDataLen;
  v23 = Flags;
  --*((_WORD *)CurrentThread + 242);
  ExAcquireResourceExclusiveLite(CmRm->RmLock, 1u);
  v10 = 0;
  while( 1 )
  {
    v11 = CmpDoTransWriteLogRecord((INT64)CmRm, (CHAR *)LogData, v7, v6, LastLsn);
    v13 = v11;
    if( v11 != -1072037859 )
      break;
    if( v10 )
    {
      if( v10 != 1 )
        goto LABEL_6;
LABEL_11:
      v20 = ++v10;
      v17 = CmpAddRemoveRMLogContainer((__int64)CmRm);
      if( (unsigned int)dword_140C02130 > 5 && tlgKeywordOn((__int64)&dword_140C02130, 1i64) )
      {
        v29 = 0;
        v32 = 0;
        v27 = &v21;
        v21 = v16;
        v30 = &v22;
        v28 = v16 + 3;
        v31 = v16 + 3;
        v22 = v17;
        tlgWriteTransfer_EtwWriteTransfer(
          (__int64)&dword_140C02130,
          (unsigned __int8 *)byte_140022B83,
          0i64,
          0i64,
          v16 + 3,
          &v26);
      }
      if( v17 < 0 )
        goto LABEL_6;
      CmpLogCheckpoint((__int64)CmRm, v16, 1);
      v6 = v23;
    }
    else
    {
      v10 = 1;
      v20 = 1;
      if( (int)CmpLogCheckpoint((__int64)CmRm, v12, 1) < 0 )
        goto LABEL_11;
    }
  }
  if( v11 >= 0 )
  {
    CmpComputeLogFillLevel(
      CmRm->LogFileObject,
      (UINT64)&CmRm->BaseLsn,
      (UINT64)LastLsn,
      (UINT64 *)LODWORD(CmRm->ContainerSize));
    if( v14 >= 0 && v20 >= 0x50 )
    {
      CmpAddRemoveRMLogContainer((__int64)CmRm);
      if( (unsigned int)dword_140C02130 > 5 )
      {
        if( tlgKeywordOn((__int64)&dword_140C02130, 1i64) )
        {
          v36 = 0;
          v39 = 0;
          v34 = &v24;
          v35 = v18 + 3;
          v37 = &v25;
          v25 = v19;
          v38 = v18 + 3;
          v24 = 2;
          tlgWriteTransfer_EtwWriteTransfer(
            (__int64)&dword_140C02130,
            (unsigned __int8 *)qword_140022B50,
            0i64,
            0i64,
            v18 + 3,
            &v33);
        }
      }
    }
  }
LABEL_6:
  ExReleaseResourceLite(CmRm->RmLock);
  KeLeaveCriticalRegionThread((__int64)KeGetCurrentThread());
  return v13;
}

Referenced by:

CmAddLogForAction
CmLogTmRmAction