Exemplo n.º 1
0
 /// <summary>
 /// Retrieves the list of instances and databases that are part of the
 /// snapshot session at any given moment.
 /// </summary>
 /// <param name="snapshot">The identifier of the snapshot session.</param>
 /// <param name="numInstances">Returns the number of instances.</param>
 /// <param name="instances">Returns information about the instances.</param>
 /// <param name="grbit">Options for this call.</param>
 public static void JetOSSnapshotGetFreezeInfo(
     JET_OSSNAPID snapshot,
     out int numInstances,
     out JET_INSTANCE_INFO[] instances,
     SnapshotGetFreezeInfoGrbit grbit)
 {
     Api.Check(Api.Impl.JetOSSnapshotGetFreezeInfo(snapshot, out numInstances, out instances, grbit));
 }
Exemplo n.º 2
0
        public void JetOssnapidToStringFormat()
        {
            var value = new JET_OSSNAPID {
                Value = (IntPtr)0x123ABC
            };

            Assert.AreEqual("123ABC", string.Format("{0:X}", value));
        }
Exemplo n.º 3
0
        public void JetOssnapidToStringGeneralFormat()
        {
            var value = new JET_OSSNAPID {
                Value = (IntPtr)0x123ABC
            };

            VerifyIFormattableGeneralEqualsToString(value);
        }
Exemplo n.º 4
0
        public void JetOsSnapidToString()
        {
            var ossnapid = new JET_OSSNAPID {
                Value = (IntPtr)0x123ABC
            };

            Assert.AreEqual("JET_OSSNAPID(0x123abc)", ossnapid.ToString());
        }
Exemplo n.º 5
0
        public void VerifyJetOsSnapidInequality()
        {
            var x = JET_OSSNAPID.Nil;
            var y = new JET_OSSNAPID {
                Value = (IntPtr)0x7
            };

            TestUnequalObjects(x, y);
            Assert.IsTrue(x != y);
            Assert.IsFalse(x == y);
        }
Exemplo n.º 6
0
        public void VerifyOssnapidIsInvalidWorksAsExpected()
        {
            var zero     = JET_OSSNAPID.Nil;
            var minusOne = new JET_OSSNAPID()
            {
                Value = new IntPtr(~0)
            };
            var shouldBeValid = new JET_OSSNAPID()
            {
                Value = new IntPtr(4)
            };

            Assert.IsTrue(zero.IsInvalid);
            Assert.IsTrue(minusOne.IsInvalid);
            Assert.IsFalse(shouldBeValid.IsInvalid);
        }
Exemplo n.º 7
0
 /// <summary>
 /// Truncates the log for a specified instance during a snapshot session.
 /// </summary>
 /// <remarks>
 /// This function should be called only if the snapshot was created with the
 /// <see cref="VistaGrbits.ContinueAfterThaw"/> option. Otherwise, the snapshot
 /// session ends after the call to <see cref="Api.JetOSSnapshotThaw"/>.
 /// </remarks>
 /// <param name="snapshot">The snapshot identifier.</param>
 /// <param name="instance">The instance to truncat the log for.</param>
 /// <param name="grbit">Options for this call.</param>
 public static void JetOSSnapshotTruncateLogInstance(JET_OSSNAPID snapshot, JET_INSTANCE instance, SnapshotTruncateLogGrbit grbit)
 {
     Api.Check(Api.Impl.JetOSSnapshotTruncateLogInstance(snapshot, instance, grbit));
 }
Exemplo n.º 8
0
 /// <summary>
 /// Enables log truncation for all instances that are part of the snapshot session.
 /// </summary>
 /// <remarks>
 /// This function should be called only if the snapshot was created with the
 /// <see cref="VistaGrbits.ContinueAfterThaw"/> option. Otherwise, the snapshot
 /// session ends after the call to <see cref="Api.JetOSSnapshotThaw"/>.
 /// </remarks>
 /// <param name="snapshot">The snapshot identifier.</param>
 /// <param name="grbit">Options for this call.</param>
 public static void JetOSSnapshotTruncateLog(JET_OSSNAPID snapshot, SnapshotTruncateLogGrbit grbit)
 {
     Api.Check(Api.Impl.JetOSSnapshotTruncateLog(snapshot, grbit));
 }
Exemplo n.º 9
0
 /// <summary>
 /// Notifies the engine that it can resume normal IO operations after a
 /// freeze period and a successful snapshot.
 /// </summary>
 /// <param name="snapshot">The ID of the snapshot.</param>
 /// <param name="grbit">Thaw options.</param>
 public static void JetOSSnapshotThaw(JET_OSSNAPID snapshot, SnapshotThawGrbit grbit)
 {
     Api.Check(Impl.JetOSSnapshotThaw(snapshot, grbit));
 }
Exemplo n.º 10
0
 public void JetOssnapidToStringFormat()
 {
     var value = new JET_OSSNAPID { Value = (IntPtr)0x123ABC };
     Assert.AreEqual("123ABC", String.Format("{0:X}", value));
 }
Exemplo n.º 11
0
 /// <summary>
 /// Notifies the engine that it can resume normal IO operations after a
 /// freeze period ended with a failed snapshot.
 /// </summary>
 /// <param name="snapid">Identifier of the snapshot session.</param>
 /// <param name="grbit">Options for this call.</param>
 public static void JetOSSnapshotAbort(JET_OSSNAPID snapid, SnapshotAbortGrbit grbit)
 {
     Api.Check(Api.Impl.JetOSSnapshotAbort(snapid, grbit));
 }
Exemplo n.º 12
0
 /// <summary>
 /// Enables log truncation for all instances that are part of the snapshot session.
 /// </summary>
 /// <remarks>
 /// This function should be called only if the snapshot was created with the
 /// <see cref="VistaGrbits.ContinueAfterThaw"/> option. Otherwise, the snapshot
 /// session ends after the call to <see cref="Api.JetOSSnapshotThaw"/>.
 /// </remarks>
 /// <param name="snapshot">The snapshot identifier.</param>
 /// <param name="grbit">Options for this call.</param>
 public static void JetOSSnapshotTruncateLog(JET_OSSNAPID snapshot, SnapshotTruncateLogGrbit grbit)
 {
     Api.Check(Api.Impl.JetOSSnapshotTruncateLog(snapshot, grbit));
 }
Exemplo n.º 13
0
 /// <summary>
 /// Selects a specific instance to be part of the snapshot session.
 /// </summary>
 /// <param name="snapshot">The snapshot identifier.</param>
 /// <param name="instance">The instance to add to the snapshot.</param>
 /// <param name="grbit">Options for this call.</param>
 public static void JetOSSnapshotPrepareInstance(JET_OSSNAPID snapshot, JET_INSTANCE instance, SnapshotPrepareInstanceGrbit grbit)
 {
     Api.Check(Api.Impl.JetOSSnapshotPrepareInstance(snapshot, instance, grbit));
 }
Exemplo n.º 14
0
 /// <summary>
 /// Notifies the engine that the snapshot session finished.
 /// </summary>
 /// <param name="snapshot">The identifier of the snapshot session.</param>
 /// <param name="grbit">Snapshot end options.</param>
 public static void JetOSSnapshotEnd(JET_OSSNAPID snapshot, SnapshotEndGrbit grbit)
 {
     Api.Check(Api.Impl.JetOSSnapshotEnd(snapshot, grbit));
 }
Exemplo n.º 15
0
 /// <summary>
 /// Truncates the log for a specified instance during a snapshot session.
 /// </summary>
 /// <remarks>
 /// This function should be called only if the snapshot was created with the
 /// <see cref="VistaGrbits.ContinueAfterThaw"/> option. Otherwise, the snapshot
 /// session ends after the call to <see cref="Api.JetOSSnapshotThaw"/>.
 /// </remarks>
 /// <param name="snapshot">The snapshot identifier.</param>
 /// <param name="instance">The instance to truncat the log for.</param>
 /// <param name="grbit">Options for this call.</param>
 public static void JetOSSnapshotTruncateLogInstance(JET_OSSNAPID snapshot, JET_INSTANCE instance, SnapshotTruncateLogGrbit grbit)
 {
     Api.Check(Api.Impl.JetOSSnapshotTruncateLogInstance(snapshot, instance, grbit));
 }
Exemplo n.º 16
0
 /// <summary>
 /// Notifies the engine that the snapshot session finished.
 /// </summary>
 /// <param name="snapshot">The identifier of the snapshot session.</param>
 /// <param name="grbit">Snapshot end options.</param>
 public static void JetOSSnapshotEnd(JET_OSSNAPID snapshot, SnapshotEndGrbit grbit)
 {
     Api.Check(Api.Impl.JetOSSnapshotEnd(snapshot, grbit));
 }
Exemplo n.º 17
0
 /// <summary>
 /// Selects a specific instance to be part of the snapshot session.
 /// </summary>
 /// <param name="snapshot">The snapshot identifier.</param>
 /// <param name="instance">The instance to add to the snapshot.</param>
 /// <param name="grbit">Options for this call.</param>
 public static void JetOSSnapshotPrepareInstance(JET_OSSNAPID snapshot, JET_INSTANCE instance, SnapshotPrepareInstanceGrbit grbit)
 {
     Api.Check(Api.Impl.JetOSSnapshotPrepareInstance(snapshot, instance, grbit));
 }
Exemplo n.º 18
0
 /// <summary>
 /// Starts a snapshot. While the snapshot is in progress, no
 /// write-to-disk activity by the engine can take place.
 /// </summary>
 /// <param name="snapshot">The snapshot session.</param>
 /// <param name="numInstances">
 /// Returns the number of instances that are part of the snapshot session.
 /// </param>
 /// <param name="instances">
 /// Returns information about the instances that are part of the snapshot session.
 /// </param>
 /// <param name="grbit">
 /// Snapshot freeze options.
 /// </param>
 public static void JetOSSnapshotFreeze(JET_OSSNAPID snapshot, out int numInstances, out JET_INSTANCE_INFO[] instances, SnapshotFreezeGrbit grbit)
 {
     Api.Check(Impl.JetOSSnapshotFreeze(snapshot, out numInstances, out instances, grbit));
 }
Exemplo n.º 19
0
 public void JetOsSnapidToString()
 {
     var ossnapid = new JET_OSSNAPID { Value = (IntPtr)0x123ABC };
     Assert.AreEqual("JET_OSSNAPID(0x123abc)", ossnapid.ToString());
 }
Exemplo n.º 20
0
 /// <summary>
 /// Begins the preparations for a snapshot session. A snapshot session
 /// is a short time interval in which the engine does not issue any
 /// write IOs to disk, so that the engine can participate in a volume
 /// snapshot session (when driven by a snapshot writer).
 /// </summary>
 /// <param name="snapshot">Returns the ID of the snapshot session.</param>
 /// <param name="grbit">Snapshot options.</param>
 public static void JetOSSnapshotPrepare(out JET_OSSNAPID snapshot, SnapshotPrepareGrbit grbit)
 {
     Api.Check(Impl.JetOSSnapshotPrepare(out snapshot, grbit));
 }
Exemplo n.º 21
0
 /// <summary>
 /// Notifies the engine that it can resume normal IO operations after a
 /// freeze period ended with a failed snapshot.
 /// </summary>
 /// <param name="snapid">Identifier of the snapshot session.</param>
 /// <param name="grbit">Options for this call.</param>
 public static void JetOSSnapshotAbort(JET_OSSNAPID snapid, SnapshotAbortGrbit grbit)
 {
     Api.Check(Api.Impl.JetOSSnapshotAbort(snapid, grbit));
 }
Exemplo n.º 22
0
 public void JetOssnapidToStringGeneralFormat()
 {
     var value = new JET_OSSNAPID { Value = (IntPtr)0x123ABC };
     VerifyIFormattableGeneralEqualsToString(value);
 }