DriveStatus
short drvNum ; which drive to query
DrvSts * status ; a structure containing information for the drive DriveStatus returns information about a particular drive. drvNum is a short indicating the particular drive for which you want
information.
status is a parameter indicating something about the drive (see the
Returns: an error return code indicating success or failure of the function. It will be one of:
noErr (0) No error
nsDrvErr (-56) No such drive
Notes: DriveStatus is the same as a Device Manager status call with csCode equal to the global constant drvStsCode. The drive's status is returned in
csParam through csParam +21.
In addition, when csCode equals 5, DriveStatus verifies that the disk in the drive specified by ioRefNum in the parameter block is correctly
formatted. This includes hard disks.
disk. When csParam is 1, a single-sided disk in a double-sided drive is
formatted. For any other combination of disks and drives, csParam should
be 0. You should have no need for this call since this function is
automatically carried out by the Disk Initialization Package.
track cache feature. A nonzero value in csParam's high-order byte enables
the cache while a 0 disables it. A value of 1 in the low-order byte of
csParam installs the cache, a -1 removes it, and a 0 does nothing. The
cache is stored in the system heap and the driver gives up cache space as
needed when a GrowZone procedure is called for the system heap.
When csCode equals 21 and csParam is a pointer ( represented as a long integer), DriveStatus returns a pointer to an icon data structure whose format is the same as an 'ICN#' resource. The icon data structure will hold
the icon, a mask icon, and a Pascal string and generally describes the disk
media. The string is used in the Get Info dialog to specify the drive associated
with the icon. Your application has to fill in this string information via the
Finder since the Device Driver leaves it null. The logical drive number has
to be in the ioRefNum field of the parameter block and it has to reference a
hard disk.
When csCode equals 22 and csParam is a pointer (cast as a long integer), DriveStatus serves a function similar to the one above. It returns a pointer to an icon and a mask icon describing the physical drive. It does not
involve a Pascal string for further describing the physical drive associated
with the icon.
When csCode equals 23 and csParam is a pointer ( represented as a long integer), DriveStatus returns information in csParam's low-order byte as follows:
Value Meaning
0 No such drive
1 Unspecified drive
2 400K drive
3 800K drive
4 reserved
5 reserved
6 reserved
7 Hard Disk 20
The csParam high-order byte returns information specifying drive attributes such as:
Bit Meaning
8 Set for external drives, clear for internal
9 Set if SCSI drive, clear if IWM
10 Set if drive is fixed, clear if it's removable
11 Set for secondary drive, clear for primary
12-15 reserved