Exemplo n.º 1
0
        public bool checkDbTest(
			string	sDbName,
			DbSystem	dbSystem)
        {
            MyDbCheckStatus	dbCheckStatus = null;
            DbInfo				dbInfo = null;
            XFLM_DB_HDR			dbHdr = new XFLM_DB_HDR();

            // Try restoring the database

            beginTest( "Check Database Test (" + sDbName + ")");

            dbCheckStatus = new MyDbCheckStatus();
            try
            {
                dbInfo = dbSystem.dbCheck( sDbName, null, null, null,
                    DbCheckFlags.XFLM_ONLINE | DbCheckFlags.XFLM_DO_LOGICAL_CHECK,
                    dbCheckStatus);
            }
            catch (XFlaimException ex)
            {
                endTest( dbCheckStatus.outputLines(), ex, "checking database");
                return( false);
            }

            dbInfo.getDbHdr( dbHdr);
            System.Console.Write( "\n");
            System.Console.WriteLine( "Signature............. {0}", dbHdr.szSignature);
            System.Console.WriteLine( "Database Version...... {0}", dbHdr.ui32DbVersion);
            System.Console.WriteLine( "Block Size............ {0}", dbHdr.ui16BlockSize);

            if (dbHdr.szSignature != "FLAIMDB")
            {
                endTest( true, false);
                System.Console.WriteLine( "Invalid signature in database header");
                return( false);
            }
            if (dbHdr.ui16BlockSize != 8192 && dbHdr.ui16BlockSize != 4096)
            {
                endTest( true, false);
                System.Console.WriteLine( "Invalid block size in database header");
                return( false);
            }
            if ((DBVersions)dbHdr.ui32DbVersion != DBVersions.XFLM_CURRENT_VERSION_NUM)
            {
                endTest( true, false);
                System.Console.WriteLine( "Invalid version in database header");
                return( false);
            }
            endTest( true, true);
            return( true);
        }
Exemplo n.º 2
0
 private static extern void xflaim_DbInfo_getDbHdr(
     [In]  IntPtr pDbInfo,
     [Out] XFLM_DB_HDR pDbHdr);
Exemplo n.º 3
0
        //-----------------------------------------------------------------------------
        // getDbHdr
        //-----------------------------------------------------------------------------
        /// <summary>
        /// Get the database header
        /// </summary>
        /// <param name="pDbHdr">
        /// Database header is returned here.
        /// </param>
        public void getDbHdr(
			XFLM_DB_HDR	pDbHdr)
        {
            xflaim_DbInfo_getDbHdr( m_pDbInfo, pDbHdr);
        }
Exemplo n.º 4
0
//-----------------------------------------------------------------------------
// getDbHdr
//-----------------------------------------------------------------------------

        /// <summary>
        /// Get the database header
        /// </summary>
        /// <param name="pDbHdr">
        /// Database header is returned here.
        /// </param>
        public void getDbHdr(
            XFLM_DB_HDR pDbHdr)
        {
            xflaim_DbInfo_getDbHdr(m_pDbInfo, pDbHdr);
        }