|
Mac OS 9
|
Disk Driver Interfaces. More...
Go to the source code of this file.
Data Structures | |
| struct | DrvSts |
| struct | DrvSts2 |
Macros | |
| #define | GetDrvStsPtrFromDrvQElPtr(driveQElement) ((DrvSts *)((BytePtr)driveQElement - offsetof(DrvSts, qLink))) |
| #define | GetDrvSts2PtrFromDrvQElPtr(driveQElement) ((DrvSts2 *)((BytePtr)driveQElement - offsetof(DrvSts2, qLink))) |
Typedefs | |
| typedef struct DrvSts | DrvSts |
| typedef struct DrvSts2 | DrvSts2 |
Functions | |
| OSErr | DiskEject (short drvNum) |
| OSErr | SetTagBuffer (void *buffPtr) |
| OSErr | DriveStatus (short drvNum, DrvSts *status) |
| void | AddDrive (short drvrRefNum, short drvNum, DrvQElPtr qEl) |
| Add a drive to the drive queue. More... | |
| printf ("Drv# FileSys Blocks locked 1-sided empty\n") | |
Variables | |
| long | totBlks |
| Obtain pointer to the drive queue header. More... | |
| Boolean | locked |
| Boolean | oneSide |
| Boolean | empty |
| qhp = GetDrvQHdr() | |
| qep = (DrvQEl *)qhp->qHead | |
| do | |
| bp = 4 | |
| </pre > *par | Copyright |
Disk Driver Interfaces.
For bug reports, consult the following page on the World Wide Web:
http://developer.apple.com/bugreporter/
| void AddDrive | ( | short | drvrRefNum, |
| short | drvNum, | ||
| DrvQElPtr | qEl | ||
| ) |
Add a drive to the drive queue.
AddDrive adds a drive to the drive queue. drvrRefNum driver reference number drvNum drive number being added qElpointer to DrvQEl structure
an operating system Error Code .
| OSErr DiskEject | ( | short | drvNum | ) |
| OSErr DriveStatus | ( | short | drvNum, |
| DrvSts * | status | ||
| ) |
| OSErr SetTagBuffer | ( | void * | buffPtr | ) |
| do |
| long totBlks |
Obtain pointer to the drive queue header.
GetDrvQHdr returns the address of the header of the standard Operating System queue used to maintain the linked-list of disk drive information records. There is one DrvQEl entry for each physical drive attached to the Mac.
a 32-bit QHdrPtr; the address of the 10-byte QHdr structure whose qLink field points to the first DrvQEl structure in the queue.
C programmers may prefer to get this address from the global variable DrvQHdr (at 0x0308). You can use this function to obtain information about drives attached to the system; it may be the only way to get this collection of information. If you need to monkey with this queue, you can use Enqueue and Dequeue . In addition to the information in the DrvQEl structure, there are four bytes of additional data that precede each element. The following describes these prefix bytes: OffsetDescription -4(bit 7 set) = disk is locked (write-protected) -30 = no disk in drive 1 or 2 = disk is in drive 8 = non-ejectable disk FCh...FFh = disk was ejected within last 1.5 seconds 48h = non-ejectable disk, but driver expects a call -2(used internally during system startup) -1(bit 7 clear) = drive supports only single-sided media The following example reads the elements of the drive queue and displays information about all drives attached to the system. Example #include < Files.h> #include < OSUtils.h > QHdrPtr qhp; // address of a QHdr structure DrvQEl qep; Byte *bp; / helps to decode prefix bytes