|
|
1.1 root 1: /*++
2:
3: Copyright (c) 1993 - Colorado Memory Systems, Inc.
4: All Rights Reserved
5:
6: Module Name:
7:
8: selecttd.c
9:
10: Abstract:
11:
12: Is analogous to SelVol() but instead of selecting a volume, selects
13: the tape directory 'volume'.
14:
15: Revision History:
16:
17:
18:
19:
20: --*/
21:
22: //
23: // include files
24: //
25:
26: #include <ntddk.h>
27: #include <ntddtape.h>
28: #include "common.h"
29: #include "q117.h"
30: #include "protos.h"
31:
32:
33: STATUS
34: q117SelectTD(
35: IN OUT PQ117_CONTEXT Context
36: )
37:
38: /*++
39:
40: Routine Description:
41:
42: This routine is analogous to SelectVol(), and is called before the
43: first call to ReadVolumeEntry().
44:
45: Arguments:
46:
47: Context -
48:
49: Return Value:
50:
51: NoErr, any Driver error except BadBlk, <EndOfVol>, RdncUnsc (because
52: the bad block map is skipped over.
53:
54: --*/
55:
56: {
57: STATUS ret; // Return value from other routines called.
58: VOLUME_TABLE_ENTRY temp;
59:
60: //
61: // Zero the active volume and end of tape. This is probably extraneous.
62: //
63: Context->ActiveVolumeNumber=0;
64: Context->CurrentOperation.EndOfUsedTape=0;
65:
66: //
67: // Make a fake volume entry to read the volume directory
68: //
69: temp.StartSegment = Context->CurrentTape.VolumeSegment;
70: temp.EndingSegment = temp.StartSegment;
71: temp.StacCompress = FALSE;
72: temp.VendorSpecific = FALSE;
73: temp.CompressSwitch = FALSE;
74: temp.DirectorySize = 0;
75: temp.DataSize = q117GoodDataBytes(temp.StartSegment, Context);
76:
77: #ifndef NO_MARKS
78:
79: //
80: // Clear all possibility of hitting a set mark
81: //
82: Context->CurrentMark = Context->MarkArray.TotalMarks = 0;
83: Context->MarkArray.MarkEntry[Context->CurrentMark].Offset = 0xffffffff;
84:
85: #endif
86:
87: if (ret=q117SelVol(&temp,Context)) {
88: return(ret);
89: }
90:
91: if (Context->tapedir) {
92:
93: ret = q117ReconstructSegment(Context->tapedir,Context);
94:
95: Context->CurrentOperation.SegmentPointer = Context->tapedir->Data;
96: Context->CurrentOperation.SegmentBytesRemaining = q117GoodDataBytes(temp.StartSegment, Context);
97: }
98:
99: return(ret);
100: }
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.