/// <summary> /// Perform a snapshot backup using the W2K3 abort API. /// </summary> private void SnapshotBackupServer2003Apis() { using (var instance = this.CreateInstance()) { instance.Init(); using (var session = new Session(instance)) { Api.JetAttachDatabase(session, this.database, AttachDatabaseGrbit.None); JET_DBID dbid; Api.JetOpenDatabase(session, this.database, string.Empty, out dbid, OpenDatabaseGrbit.None); JET_OSSNAPID snapshot; Api.JetOSSnapshotPrepare(out snapshot, SnapshotPrepareGrbit.CopySnapshot); int numInstances; JET_INSTANCE_INFO[] instances; Api.JetOSSnapshotFreeze(snapshot, out numInstances, out instances, SnapshotFreezeGrbit.None); Server2003Api.JetOSSnapshotAbort(snapshot, SnapshotAbortGrbit.None); } } }
public void VerifyXpThrowsExceptionOnJetOSSnapshotAbort() { Server2003Api.JetOSSnapshotAbort(JET_OSSNAPID.Nil, SnapshotAbortGrbit.None); }