|
|
1.1 ! root 1: /*++ ! 2: ! 3: Copyright (c) 1993 - Colorado Memory Systems, Inc. ! 4: All Rights Reserved ! 5: ! 6: Module Name: ! 7: ! 8: gettcap.c ! 9: ! 10: Abstract: ! 11: ! 12: Gets the capacity of the tape drive (by querying the low-level ! 13: driver). ! 14: ! 15: Revision History: ! 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: q117GetTapeCapacity( ! 34: struct S_O_DGetCap *ptr, ! 35: PQ117_CONTEXT Context ! 36: ) ! 37: ! 38: /*++ ! 39: ! 40: Routine Description: ! 41: ! 42: Get the media's capacity from q117i driver ! 43: ! 44: Arguments: ! 45: ! 46: Ptr - ! 47: ! 48: Context - ! 49: ! 50: ! 51: Return Value: ! 52: ! 53: ! 54: --*/ ! 55: ! 56: { ! 57: struct S_O_DGetCap capacity; ! 58: IO_REQUEST req; ! 59: LONG ret; ! 60: ! 61: ret = q117DoCmd((PVOID)&req, DGetCap, (PVOID)&capacity, Context); ! 62: if (!ret) { ! 63: ! 64: if (ptr) { ! 65: ! 66: *ptr = capacity; ! 67: ! 68: } else { ! 69: ! 70: Context->CurrentTape.LastSegment = capacity.FormattableSegments - 1; ! 71: Context->CurrentTape.TapeFormatCode = capacity.TapeFormatCode; ! 72: ! 73: // ! 74: // If more than what can fit in the bad sector map, then ! 75: // we got some real problems. ! 76: // ! 77: if ((Context->CurrentTape.LastSegment > MAX_BAD_BLOCKS) && ! 78: (Context->CurrentTape.TapeFormatCode == QIC_FORMAT)) { ! 79: ! 80: ret = FCodeErr; ! 81: ! 82: } ! 83: ! 84: Context->drive_type = capacity.drive_type; ! 85: } ! 86: } ! 87: return(ret); ! 88: }
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.