|
|
1.1 ! root 1: /*++ ! 2: ! 3: Copyright (c) 1993 - Colorado Memory Systems, Inc. ! 4: All Rights Reserved ! 5: ! 6: Module Name: ! 7: ! 8: selvol.c ! 9: ! 10: Abstract: ! 11: ! 12: Sets "state" to read an existing QIC-40/80 volume. ! 13: ! 14: Revision History: ! 15: ! 16: ! 17: ! 18: ! 19: --*/ ! 20: ! 21: // ! 22: // include files ! 23: // ! 24: ! 25: #include <ntddk.h> ! 26: #include <ntddtape.h> ! 27: #include "common.h" ! 28: #include "q117.h" ! 29: #include "protos.h" ! 30: ! 31: ! 32: STATUS ! 33: q117SelVol ( ! 34: PVOLUME_TABLE_ENTRY TheVolumeTable, ! 35: PQ117_CONTEXT Context ! 36: ) ! 37: ! 38: /*++ ! 39: ! 40: Routine Description: ! 41: ! 42: May be called from SelectVol() or StBk(). Decides how many tracks ! 43: to read in to start a backup or restore. Allocates memory for ! 44: track buffers and redundancy data and IORequest structures through ! 45: ArrangeMem(). ! 46: ! 47: Arguments: ! 48: ! 49: TheVolumeTable - the tape directory entry for this volume. ! 50: ! 51: Context - ! 52: ! 53: Return Value: ! 54: ! 55: NoErr, any Driver error except BadBlk, RdncUnsc, <LinkRC>, ! 56: <EndOfVol>, TapeFull. ! 57: ! 58: --*/ ! 59: ! 60: { ! 61: LONG ret = NoErr; ! 62: ! 63: // ! 64: // set up global variables ! 65: // ! 66: Context->CurrentOperation.LastSegment = TheVolumeTable->EndingSegment; ! 67: Context->CurrentOperation.CurrentSegment = TheVolumeTable->StartSegment; ! 68: Context->CurrentOperation.LastSegmentRead = Context->CurrentOperation.CurrentSegment - 1; ! 69: Context->CurrentOperation.BytesOnTape = TheVolumeTable->DataSize; ! 70: Context->CurrentMark = 0; ! 71: Context->CurrentOperation.BytesRead = 0; ! 72: // ! 73: // force a read of the first segment (if skipblock not called) ! 74: // ! 75: Context->CurrentOperation.SegmentBytesRemaining = 0; ! 76: ! 77: if (TheVolumeTable->SequenceNumber == 1) { ! 78: Context->CurrentOperation.SegmentStatus = NoErr; ! 79: } ! 80: ! 81: return(ret); ! 82: }
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.