Currently defined selectors for the DriverGestalt status call are listed in Table 8-5.
Table 8-5 DriverGestalt selectors
'boot' | Parameter RAM value to designate this driver/drive | BootResponse |
'dAPI' | API support for PC Exchange | APIResponse |
'devt' | Type of device the driver is driving | DevTResponse |
'dics' | [call sync only] icon suite for disk driver physical drive (formerly in csCode 22) | |
'ejec' | Eject options for shutdown/restart, as defined for the Shutdown Manager | EjectResponse |
'flus' | Determine if disk driver supports flush and if it needs a flush. | FlushResponse |
'intf' | Immediate location (or interface) for device | IntfResponse |
'lpwr' | True if driver supports power switching | Boolean |
'mics' | [call sync only] icon suite for disk driver media (formerly in csCode 21) | |
'mnam' | Pascal string describing the disk driver (formerly in csCode 21) | |
'pmn3' | Minimum power consumption at 3.3 V | unsigned long 1 |
'pmn5' | Minimum power consumption at 5 V | unsigned long * |
'pmx3' | Maximum power consumption at 3.3 V | unsigned long * |
'pmx5' | Maximum power consumption at 5 V | unsigned long * |
'psta' | True if device is currently in high power mode | Boolean |
'psup' | True if driver supports power control calls | PowerResponse |
'purg' | True if driver has purge permission | PurgeResponse |
'sync' | True if driver only behaves synchronously | SyncResponse |
'vers' | The version number of the driver | NumVersion 2 |
'vmop' | The disk drive's Virtual Memory options | VMOptionsResponse |
'wide' | True if driver supports the ioWPosOffset for 64-bit addressing | WideResponse |
For some types of devices, DriverGestalt responses may be dependent upon fields other than the selector field. For instance, the 'boot' selector returns a startup value that identifies a particular drive in the drive queue instead of a particular device or driver. A driver handling a partitioned disk, with each HFS partition representing a separate drive, returns a result appropriate for a particular partition, as specified by drive number in the ioVRefNum field.
Table lists the four character codes and corresponding constants for the DriverGestalt selectors.
Table 8-6 DriverGestalt selector four character codes and constants
The following response buffers are defined for some of the driver gestalt selectors listed in Table 8-5 :
struct DriverGestaltSyncResponse
{
Boolean behavesSynchronously;
UInt8 pad[3]
};
struct DriverGestaltBootResponse
{
UInt8 extDev; /* packed target (upper 5 bits)
LUN (lower 3 bits) */
UInt8 partition; /* partition */
UInt8 SIMSlot; /* slot */
UInt8 SIMsRSRC; /* sRsrcID */
};
struct DriverGestaltDevTResponse
{
OSType deviceType;
};
enum {
kdgDiskType = 'disk', /* standard r/w disk drive */
kdgTapeType = 'tape', /* tape drive */
kdgPrinterType = 'prnt', /* printer */
kdgProcessorType = 'proc', /* processor */
kdgWormType = 'worm', /* write-once */
kdgCDType = 'cdrm', /* cd-rom drive */
kdgFloppyType = 'flop', /* floppy disk drive */
kdgScannerType = 'scan', /* scanner */
kdgFileType = 'file', /* logical partition based on a
file (drive Container) */
kdgRemovableType = 'rdsk' /* removable media hard disk */
};
struct DriverGestaltIntfResponse
{
OSType interfaceType;
};
enum {
kdgScsiIntf = 'scsi', /* SCSI interface */
kdgPcmciaIntf = 'pcmc', /* PCMCIA interface */
kdgATAIntf = 'ata ', /* ATA/ATAPI interface */
kdgFireWireIntf = 'fire', /* FireWire 1394 interface */
kdgExtBus = 'card' /* Card Bus interface */
};
struct DriverGestaltAPIResponse
{
short partitionCmds; /* if bit 0 is nonzero, */
/* supports partition */
/* control and status calls */
/* prohibitMounting (control, kProhibitMounting) */
/* partitionToVRef (status, kGetPartitionStatus) */
/* getPartitionInfo (status, kGetPartInfo) */
short unused1; /* All the unused fields */
/* should be zero */
short unused2;
short unused3;
short unused4;
short unused5;
short unused6;
short unused7;
short unused8;
short unused9;
short unused10;
};
struct DriverGestaltPowerResponse {
unsigned long powerValue; /* Power consumed in Watts */
};
struct DriverGestaltFlushResponse
{
Boolean canFlush; /* Return true if driver */
/* supports the kdcFlush */
/* driver configure _Control */
/* call */
Boolean needsFlush; /* Return true if */
/* driver/device has */
/* data cached */
/* and needs to be flushed *
/* when the disk volume */
/* is flushed by the */
/* File Manager */
UInt8 pad[2];
};
/* Flags for purge permissions */
enum {
kbCloseOk = 0, /* Ok to call Close */
kbRemoveOk = 1, /* Ok to call RemoveDrvr */
kbPurgeOk = 2, /* Ok to call DisposePtr */
kmNoCloseNoPurge = 0,
kmOkCloseNoPurge = (1 << kbCloseOk) + (1 << kbRemoveOk),
kmOkCloseOkPurge = (1 << kbCloseOk) + (1 << kbRemoveOk) + (1 <<
kbPurgeOk)
};
struct DriverGestaltPurgeResponse
{
UInt16 purgePermission; /* 0 = Do not change */
/* the state of the driver */
/* 3 = Do Close() and */
/* DrvrRemove() this driver */
/* but don't deallocate */
/* driver code */
/* 7 = Do Close(), */
/* DrvrRemove(), and */
/* DisposePtr() */
UInt16 purgeReserved;
Ptr purgeDriverPointer;/* pointer to the start of */
/* the driver block (valid */
/* only if DisposePtr */
/* permission is given */
};
struct DriverGestaltEjectResponse {
UInt32 ejectFeatures; /* Features field */
};
/* Flags for Ejection Features field */
enum {
kRestartDontEject = 0, /* Dont Want eject */
/* during Restart */
kShutDownDontEject = 1, /* Dont Want eject */
/* during Shutdown */
kRestartDontEject_Mask = 1 << kRestartDontEject,
kShutDownDontEject_Mask = 1 << kShutDownDontEject
};
struct DriverGestaltWideResponse
{
Boolean supportsWide;
};