Exemple #1
0
        // Token: 0x06001D52 RID: 7506 RVA: 0x00084580 File Offset: 0x00082780
        private static bool CheckLogHeaderInternal(long logfileNumber, string logfileInspect, FileState fileState, LogContinuityChecker continuityChecker, out LocalizedString error)
        {
            error = LocalizedString.Empty;
            JET_LOGINFOMISC jet_LOGINFOMISC;
            long            logfileGeneration = EseHelper.GetLogfileGeneration(logfileInspect, out jet_LOGINFOMISC);

            if (0L == logfileNumber && 0L != fileState.HighestGenerationPresent && fileState.HighestGenerationPresent + 1L != logfileGeneration)
            {
                ExTraceGlobals.LogInspectorTracer.TraceError <string, long, long>(0L, "Inspection of logfile {0} detected corruption (generation number {1} mismatch with highest logfile present {2})", logfileInspect, logfileGeneration, fileState.HighestGenerationPresent);
                error = ReplayStrings.LogInspectorE00OutOfSequence(logfileInspect, logfileGeneration, fileState.HighestGenerationPresent);
                return(false);
            }
            if (logfileNumber != 0L && logfileNumber != logfileGeneration)
            {
                ExTraceGlobals.LogInspectorTracer.TraceError <string, long>(0L, "Inspection of logfile {0} detected corruption (generation number {1} mismatch)", logfileInspect, logfileGeneration);
                error = ReplayStrings.LogInspectorGenerationMismatch(logfileInspect, logfileGeneration, logfileNumber);
                return(false);
            }
            if (fileState.LogfileSignature != null)
            {
                if (!jet_LOGINFOMISC.signLog.Equals(fileState.LogfileSignature.Value))
                {
                    ExTraceGlobals.LogInspectorTracer.TraceError <string, JET_SIGNATURE, JET_SIGNATURE>(0L, "Inspection of logfile {0} detected a signature mismatch (signature is {1}, expected {2})", logfileInspect, jet_LOGINFOMISC.signLog, fileState.LogfileSignature.Value);
                    error = ReplayStrings.LogInspectorSignatureMismatch(logfileInspect, logfileGeneration);
                    return(false);
                }
            }
            else
            {
                ExTraceGlobals.LogInspectorTracer.TraceDebug <JET_SIGNATURE, string>(0L, "Setting logfile signature to {0} from logfile {1}", jet_LOGINFOMISC.signLog, logfileInspect);
                fileState.LogfileSignature = new JET_SIGNATURE?(jet_LOGINFOMISC.signLog);
            }
            if (!continuityChecker.Examine(jet_LOGINFOMISC, logfileInspect, out error))
            {
                ExTraceGlobals.LogInspectorTracer.TraceError <string, LocalizedString>(0L, "Inspection of logfile {0} detected discontinuity: {1}", logfileInspect, error);
                return(false);
            }
            return(true);
        }
Exemple #2
0
        // Token: 0x06001D49 RID: 7497 RVA: 0x00084374 File Offset: 0x00082574
        internal static bool VerifyLogTask(long logfileNumber, string logfileInspect, FileState fileState, LogVerifier logVerifier, LogContinuityChecker continuityChecker, out LocalizedString error)
        {
            error = LocalizedString.Empty;
            if (logVerifier == null)
            {
                throw new ArgumentNullException("logVerifier");
            }
            EsentErrorException ex = logVerifier.Verify(logfileInspect);

            if (ex != null)
            {
                error = new LocalizedString(ex.Message);
                return(false);
            }
            return(LogInspector.CheckLogHeaderInternal(logfileNumber, logfileInspect, fileState, continuityChecker, out error));
        }
Exemple #3
0
        // Token: 0x06001D4B RID: 7499 RVA: 0x000843F4 File Offset: 0x000825F4
        internal static bool VerifyLogStatic(long logfileNumber, LogSource logSource, string logfileInspect, bool fRecopyOnFailure, FileState filestate, LogVerifier logVerifier, LogContinuityChecker continuityChecker, LogInspector.CheckStopDelegate checkStopPending, out LocalizedString error)
        {
            ulong num   = fRecopyOnFailure ? 3UL : 1UL;
            bool  flag  = false;
            bool  flag2 = false;

            error = LocalizedString.Empty;
            for (ulong num2 = 0UL; num2 < num; num2 += 1UL)
            {
                bool flag3 = false;
                if (flag2 && fRecopyOnFailure)
                {
                    LogInspector.RecopyCorruptLog(logfileNumber, logSource, logfileInspect);
                    flag3 = true;
                }
                checkStopPending();
                EsentErrorException ex = logVerifier.Verify(logfileInspect);
                if (ex != null)
                {
                    ExTraceGlobals.LogInspectorTracer.TraceError <string, EsentErrorException>(0L, "Inspection of logfile {0} failed: {1}", logfileInspect, ex);
                    error = new LocalizedString(ex.Message);
                    if (!(ex is EsentFileAccessDeniedException))
                    {
                        flag2 = true;
                        LogInspector.ReportCorruptLog(logfileInspect, error);
                    }
                }
                else
                {
                    flag2 = false;
                    checkStopPending();
                    flag = LogInspector.CheckLogHeader(logfileNumber, logfileInspect, filestate, continuityChecker, out error);
                    if (!flag)
                    {
                        LogInspector.ReportCorruptLog(logfileInspect, error);
                    }
                    else
                    {
                        if (flag3)
                        {
                            ReplayEventLogConstants.Tuple_InspectorFixedCorruptLog.LogEvent(logfileInspect, new object[]
                            {
                                logfileInspect
                            });
                            break;
                        }
                        break;
                    }
                }
            }
            return(flag);
        }
Exemple #4
0
        // Token: 0x06001D48 RID: 7496 RVA: 0x0008430C File Offset: 0x0008250C
        internal static bool CheckLogHeader(long logfileNumber, string logfileInspect, FileState fileState, LogContinuityChecker continuityChecker, out LocalizedString error)
        {
            error = LocalizedString.Empty;
            bool result;

            try
            {
                result = LogInspector.CheckLogHeaderInternal(logfileNumber, logfileInspect, fileState, continuityChecker, out error);
            }
            catch (EsentErrorException ex)
            {
                ReplayEventLogConstants.Tuple_IsamException.LogEvent(logfileInspect, new object[]
                {
                    "unknown",
                    ex.Message,
                    logfileInspect
                });
                result = false;
            }
            return(result);
        }