示例#1
0
        /// <summary>
        /// Sets the members of this object from a native object.
        /// </summary>
        /// <param name="native">The native object.</param>
        internal void SetFromNativeDbinfoMisc(ref NATIVE_DBINFOMISC4 native)
        {
            this.SetFromNativeDbinfoMisc(ref native.dbinfo);

            unchecked
            {
                this._genMinRequired       = (int)native.genMinRequired;
                this._genMaxRequired       = (int)native.genMaxRequired;
                this._logtimeGenMaxCreate  = native.logtimeGenMaxCreate;
                this._ulRepairCount        = (int)native.ulRepairCount;
                this._logtimeRepair        = native.logtimeRepair;
                this._ulRepairCountOld     = (int)native.ulRepairCountOld;
                this._ulECCFixSuccess      = (int)native.ulECCFixSuccess;
                this._logtimeECCFixSuccess = native.logtimeECCFixSuccess;
                this._ulECCFixSuccessOld   = (int)native.ulECCFixSuccessOld;
                this._ulECCFixFail         = (int)native.ulECCFixFail;
                this._logtimeECCFixFail    = native.logtimeECCFixFail;
                this._ulECCFixFailOld      = (int)native.ulECCFixFailOld;
                this._ulBadChecksum        = (int)native.ulBadChecksum;
                this._logtimeBadChecksum   = native.logtimeBadChecksum;
                this._ulBadChecksumOld     = (int)native.ulBadChecksumOld;
                this._genCommitted         = (int)native.genCommitted;
                this._bkinfoCopyPrev       = native.bkinfoCopyPrev;
                this._bkinfoDiffPrev       = native.bkinfoDiffPrev;
            }
        }
示例#2
0
 /// <summary>
 /// Sets the members of this object from a native object.
 /// </summary>
 /// <param name="native">The native object.</param>
 internal void SetFromNativeDbinfoMisc(ref NATIVE_DBINFOMISC native)
 {
     unchecked
     {
         this._ulVersion          = (int)native.ulVersion;
         this._ulUpdate           = (int)native.ulUpdate;
         this._signDb             = new JET_SIGNATURE(native.signDb);
         this._dbstate            = (JET_dbstate)native.dbstate;
         this._lgposConsistent    = native.lgposConsistent;
         this._logtimeConsistent  = native.logtimeConsistent;
         this._logtimeAttach      = native.logtimeAttach;
         this._lgposAttach        = native.lgposAttach;
         this._logtimeDetach      = native.logtimeDetach;
         this._lgposDetach        = native.lgposDetach;
         this._signLog            = new JET_SIGNATURE(native.signLog);
         this._bkinfoFullPrev     = native.bkinfoFullPrev;
         this._bkinfoIncPrev      = native.bkinfoIncPrev;
         this._bkinfoFullCur      = native.bkinfoFullCur;
         this._fShadowingDisabled = 0 != native.fShadowingDisabled;
         this._fUpgradeDb         = 0 != native.fUpgradeDb;
         this._dwMajorVersion     = (int)native.dwMajorVersion;
         this._dwMinorVersion     = (int)native.dwMinorVersion;
         this._dwBuildNumber      = (int)native.dwBuildNumber;
         this._lSPNumber          = (int)native.lSPNumber;
         this._cbPageSize         = (int)native.cbPageSize;
     }
 }
示例#3
0
        /// <summary>
        /// Initializes a new instance of the <see cref="JET_SIGNATURE"/> struct.
        /// </summary>
        /// <param name="bytes">The serialized representation of a JET_SIGNATURE from ToBytes().</param>
        public JET_SIGNATURE(byte[] bytes)
        {
            var    nativeSignature = new NATIVE_SIGNATURE();
            IntPtr ptr             = Marshal.AllocHGlobal(Marshal.SizeOf(nativeSignature));

            Marshal.Copy(bytes, 0, ptr, Marshal.SizeOf(nativeSignature));
            for (int i = bytes.Length; i < Marshal.SizeOf(nativeSignature); i++)
            {
                Marshal.WriteByte(ptr, i, 0);
            }

            nativeSignature = (NATIVE_SIGNATURE)Marshal.PtrToStructure(ptr, nativeSignature.GetType());
            Marshal.FreeHGlobal(ptr);

            this.ulRandom       = nativeSignature.ulRandom;
            this.logtimeCreate  = nativeSignature.logtimeCreate;
            this.szComputerName = nativeSignature.szComputerName;
        }
示例#4
0
 /// <summary>
 /// Initializes a new instance of the <see cref="JET_SIGNATURE"/> struct.
 /// </summary>
 /// <param name="native">A native signature to initialize the members with.</param>
 internal JET_SIGNATURE(NATIVE_SIGNATURE native)
 {
     this.ulRandom       = native.ulRandom;
     this.logtimeCreate  = native.logtimeCreate;
     this.szComputerName = native.szComputerName;
 }
示例#5
0
 /// <summary>
 /// Initializes a new instance of the <see cref="JET_SIGNATURE"/> struct.
 /// </summary>
 /// <param name="random">A random number.</param>
 /// <param name="time">The time for the creation time.</param>
 /// <param name="computerName">The optional computer name.</param>
 internal JET_SIGNATURE(int random, DateTime?time, string computerName)
 {
     this.ulRandom       = unchecked ((uint)random);
     this.logtimeCreate  = time.HasValue ? new JET_LOGTIME(time.Value) : new JET_LOGTIME();
     this.szComputerName = computerName;
 }