// Token: 0x06000971 RID: 2417 RVA: 0x0002C598 File Offset: 0x0002A798
        internal static void DumpLogRecordsToFile(string logfile, string outputFile)
        {
            ExTraceGlobals.EseutilWrapperTracer.TraceDebug <string, string>(0L, "Dumping logfile {0} to output file {1}", logfile, outputFile);
            string      basename    = EseHelper.BaseNameFromLogfileName(logfile);
            LogVerifier logVerifier = new LogVerifier(basename, outputFile);

            try
            {
                logVerifier.Dump(logfile);
            }
            finally
            {
                logVerifier.Term();
            }
        }
Example #2
0
        public static Exception Verify(string fileName, string logFilePrefix, long expectedGen, JET_SIGNATURE?expectedLogSignature)
        {
            LogVerifier         logVerifier = new LogVerifier(logFilePrefix);
            EsentErrorException ex          = logVerifier.Verify(fileName);

            if (ex != null)
            {
                return(ex);
            }
            JET_LOGINFOMISC jet_LOGINFOMISC;

            UnpublishedApi.JetGetLogFileInfo(fileName, out jet_LOGINFOMISC, JET_LogInfo.Misc2);
            if ((long)jet_LOGINFOMISC.ulGeneration != expectedGen)
            {
                return(new FileCheckLogfileGenerationException(fileName, (long)jet_LOGINFOMISC.ulGeneration, expectedGen));
            }
            if (expectedLogSignature != null && !jet_LOGINFOMISC.signLog.Equals(expectedLogSignature))
            {
                return(new FileCheckLogfileSignatureException(fileName, jet_LOGINFOMISC.signLog.ToString(), expectedLogSignature.ToString()));
            }
            return(null);
        }
Example #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);
        }
Example #4
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));
        }