FsRtlLogCcFlushError

INT64 __stdcall FsRtlLogCcFlushError(
        UNICODE_STRING *FileName,
        DEVICE_OBJECT *DeviceObject,
        _SECTION_OBJECT_POINTERS *SectionObjectPointer,
        INT64 FlushError,
        UINT64 Flags){
  unsigned int v7; 
  int v8; 
  INT64 result; 
  bool v10; 
  __int64 v11; 
  int v12; 
  UINT8 v13; 
  _BYTE *v14; 
  void *v15; 
  int v16; 
  _BYTE *v17; 
  unsigned int v18; 
  UINT8 *v19; 
  UINT64 Length; 
  wchar_t *Buffer; 
  unsigned int v22; 
  unsigned int v23; 
  __int64 v24; 
  UINT8 *v25; 
  UINT8 *v26; 
  v7 = 0;
  v8 = FlushError;
  result = MmIsWriteErrorFatal(1ui64, (*((_DWORD *)DeviceObject + 13) >> 4) & 1, (unsigned int)FlushError);
  if( !(_DWORD)result )
    return result;
  if( v8 > -1073741623 )
  {
    if( v8 > -1073741252 )
    {
      if( v8 == -1073741247 || v8 == -1073740964 )
        goto LABEL_29;
      if( v8 > -1073740699 )
      {
        if( v8 <= -1073740697 )
          goto LABEL_29;
        v10 = v8 == -1073740672;
        goto LABEL_27;
      }
    }
    else
    {
      if( v8 == -1073741252 || v8 == -1073741620 || v8 == -1073741309 )
        goto LABEL_29;
      if( v8 > -1073741301 )
      {
        if( v8 <= -1073741299 )
          goto LABEL_29;
        v10 = v8 == -1073741258;
        goto LABEL_27;
      }
    }
LABEL_28:
    v11 = 3221226018i64;
    v12 = -2147221454;
    goto LABEL_30;
  }
  switch( v8 )
  {
    case -1073741623:
      goto LABEL_29;
    case -1073741816:
    case -1073741790:
    case -1073741697:
      v11 = 3221266561i64;
      v12 = -2147221364;
      break;
    case -1073741672:
    case -1073741667:
    case -1073741662:
      v11 = 3221266562i64;
      v12 = -2147221363;
      break;
    case -1073741636:
    case -1073741634:
      goto LABEL_29;
    default:
      v10 = v8 == -1073741628;
LABEL_27:
      if( !v10 )
        goto LABEL_28;
LABEL_29:
      v11 = 3221266560i64;
      v12 = -2147221365;
      break;
  }
LABEL_30:
  __incgsdword(0x813Cu);
  if( (Flags & 1) == 0 )
    IoRaiseInformationalHardError((_VACB_ARRAY_HEADER *)v11);
  if( (Flags & 2) == 0 )
  {
    v13 = -16;
    if( (unsigned __int64)FileName->Length + 50 <= 0xF0 )
      v13 = LOBYTE(FileName->Length) + 50;
    LODWORD(v14) = IoAllocateErrorLogEntry(DeviceObject, v13);
    v15 = v14;
    if( v14 )
    {
      *((_DWORD *)v14 + 3) = v12;
      *v14 = 4;
      v16 = v13;
      v17 = v14 + 48;
      *((_WORD *)v14 + 3) = 48;
      v18 = v16 - 50;
      *((_DWORD *)v14 + 5) = v8;
      v19 = v14 + 48;
      *(_DWORD *)(v14 + 2) = 65540;
      *((_DWORD *)v14 + 10) = v8;
      Length = FileName->Length;
      Buffer = FileName->Buffer;
      if( v18 >= (unsigned int)Length )
      {
        memmove(v19, (UINT8 *)Buffer, Length);
        v26 = &v17[2 * ((unsigned __int64)FileName->Length >> 1)];
      }
      else
      {
        v22 = 2 * (v18 >> 2) - 4;
        v23 = v18 - v22 - 8;
        v24 = v22;
        memmove(v19, (UINT8 *)Buffer, v22);
        v25 = &v17[v24];
        *(_QWORD *)v25 = 0x20002E002E0020i64;
        v25 += 8;
        memmove(v25, (UINT8 *)FileName->Buffer + FileName->Length - (unsigned __int64)v23, v23);
        v26 = &v25[v23];
      }
      *(_WORD *)v26 = 0;
      IoWriteErrorLogEntry(v15);
    }
    else
    {
      return(unsigned int)-1073741670;
    }
  }
  return v7;
}

Referenced by:

CcMmLogLostDelayedWriteError