/// <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)); }
public void JetOssnapidToStringFormat() { var value = new JET_OSSNAPID { Value = (IntPtr)0x123ABC }; Assert.AreEqual("123ABC", string.Format("{0:X}", value)); }
public void JetOssnapidToStringGeneralFormat() { var value = new JET_OSSNAPID { Value = (IntPtr)0x123ABC }; VerifyIFormattableGeneralEqualsToString(value); }
public void JetOsSnapidToString() { var ossnapid = new JET_OSSNAPID { Value = (IntPtr)0x123ABC }; Assert.AreEqual("JET_OSSNAPID(0x123abc)", ossnapid.ToString()); }
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); }
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); }
/// <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)); }
/// <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)); }
/// <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)); }
public void JetOssnapidToStringFormat() { var value = new JET_OSSNAPID { Value = (IntPtr)0x123ABC }; Assert.AreEqual("123ABC", String.Format("{0:X}", value)); }
/// <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)); }
/// <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)); }
/// <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)); }
/// <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)); }
/// <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)); }
/// <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)); }
/// <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)); }
/// <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)); }
public void JetOsSnapidToString() { var ossnapid = new JET_OSSNAPID { Value = (IntPtr)0x123ABC }; Assert.AreEqual("JET_OSSNAPID(0x123abc)", ossnapid.ToString()); }
/// <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)); }
/// <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)); }
public void JetOssnapidToStringGeneralFormat() { var value = new JET_OSSNAPID { Value = (IntPtr)0x123ABC }; VerifyIFormattableGeneralEqualsToString(value); }