Important: The Device Manager is deprecated as of Mac OS X v10.5. You should use the I/O Kit or the File Manager instead.
Framework |
CoreServices/CoreServices.h |
Declared in | Devices.h Files.h IOMacOSTypes.h |
Important: The Device Manager is deprecated as of Mac OS X v10.5. You should use the I/O Kit or the File Manager instead.
In Mac OS 9 and earlier, applications used the Device Manager to open, close, and exchange information with device drivers. In addition, device drivers used the Device Manager when they needed to supply a user interface. In Mac OS X, applications that need to communicate directly with hardware devices must use the I/O Kit. For more information about the I/O Kit, see I/O Kit Fundamentals.
Mac OS X applications can access serial devices through the device file system. You can use the I/O Kit to obtain a path to a device file in the /dev
directory, and then use traditional UNIX serial port access through the POSIX termios API. For more information, see Accessing Hardware From Applications.
Other software products that relied on the Device Manager in the past, such as desk accessories, should be converted into Mac OS X applications.
Note: The Device Manager header file Devices.h
has been removed in Mac OS X v10.5 and later. The functions previously declared in this header file are now declared in Files.h
. Documentation for these deprecated functions is available in File Manager Reference.
typedef MPAddressSpaceID AddressSpaceID;
IOMacOSTypes.h
struct AuxDCE { Ptr dCtlDriver; volatile SInt16 dCtlFlags; QHdr dCtlQHdr; SInt32 dCtlPosition; Handle dCtlStorage; SInt16 dCtlRefNum; SInt32 dCtlCurTicks; GrafPtr dCtlWindow; SInt16 dCtlDelay; SInt16 dCtlEMask; SInt16 dCtlMenu; SInt8 dCtlSlot; SInt8 dCtlSlotId; SInt32 dCtlDevBase; Ptr dCtlOwner; SInt8 dCtlExtDev; SInt8 fillByte; UInt32 dCtlNodeID; }; typedef AuxDCE* AuxDCEPtr; typedef AuxDCEPtr* AuxDCEHandle;
struct DCtlEntry { Ptr dCtlDriver; volatile SInt16 dCtlFlags; QHdr dCtlQHdr; volatile SInt32 dCtlPosition; Handle dCtlStorage; SInt16 dCtlRefNum; SInt32 dCtlCurTicks; GrafPtr dCtlWindow; SInt16 dCtlDelay; SInt16 dCtlEMask; SInt16 dCtlMenu; }; typedef DCtlEntry* DCtlPtr; typedef DCtlPtr* DCtlHandle;
struct DriverFinalInfo { DriverRefNum refNum; RegEntryID deviceEntry; }; typedef DriverFinalInfo* DriverFinalInfoPtr;
struct DriverInitInfo { DriverRefNum refNum; RegEntryID deviceEntry; }; typedef DriverInitInfo* DriverInitInfoPtr;
typedef UInt32 DriverOpenCount;
Devices.h
typedef SInt16 DriverRefNum;
Devices.h
typedef DriverInitInfo DriverReplaceInfo; typedef DriverInitInfo* DriverReplaceInfoPtr;
typedef DriverFinalInfo DriverSupersededInfo; typedef DriverFinalInfo* DriverSupersededInfoPtr;
struct DRVRHeader { short drvrFlags; short drvrDelay; short drvrEMask; short drvrMenu; short drvrOpen; short drvrPrime; short drvrCtl; short drvrStatus; short drvrClose; unsigned char drvrName[1]; }; typedef struct DRVRHeader DRVRHeader; typedef DRVRHeader * DRVRHeaderPtr;
Devices.h
struct FileBasedDriverDetailed { FileBasedDriverRecord fileBasedDriver; Str63 fragName; }; typedef FileBasedDriverDetailed* FileBasedDriverDetailedPtr;
struct FileBasedDriverRecord { FSSpec theSpec; MacDriverType theType; Boolean compatibleProp; UInt8 pad[3]; }; typedef FileBasedDriverRecord* FileBasedDriverRecordPtr;
union IOCommandContents { ParmBlkPtr pb; DriverInitInfoPtr initialInfo; DriverFinalInfoPtr finalInfo; DriverReplaceInfoPtr replaceInfo; DriverSupersededInfoPtr supersededInfo; };
typedef struct OpaqueIOCommandID * IOCommandID;
Devices.h
typedef UInt16 UnitNumber;
Devices.h
Defines the value of the caller
parameter
to a Chooser device package.
enum { chooserID = 1 };
Define values of the message
parameter
to a Chooser device package.
enum { chooserInitMsg = 11, newSelMsg = 12, fillListMsg = 13, getSelMsg = 14, selectMsg = 15, deselectMsg = 16, terminateMsg = 17, buttonMsg = 19 };
chooserInitMsg
The user selected this device package.
Available in Mac OS X v10.0 through Mac OS X v10.4.
Declared in Devices.h
.
newSelMsg
The user made new device selections.
Available in Mac OS X v10.0 through Mac OS X v10.4.
Declared in Devices.h
.
fillListMsg
Fill the device list with choices.
Available in Mac OS X v10.0 through Mac OS X v10.4.
Declared in Devices.h
.
getSelMsg
Mark one or more choices as selected.
Available in Mac OS X v10.0 through Mac OS X v10.4.
Declared in Devices.h
.
selectMsg
The user made a selection.
Available in Mac OS X v10.0 through Mac OS X v10.4.
Declared in Devices.h
.
deselectMsg
The user canceled a selection.
Available in Mac OS X v10.0 through Mac OS X v10.4.
Declared in Devices.h
.
terminateMsg
Allows device package to clean up.
Available in Mac OS X v10.0 through Mac OS X v10.4.
Declared in Devices.h
.
buttonMsg
The user selected a button.
Available in Mac OS X v10.0 through Mac OS X v10.4.
Declared in Devices.h
.
enum { dNeedLockMask = 0x4000, dNeedTimeMask = 0x2000, dNeedGoodByeMask = 0x1000, dStatEnableMask = 0x0800, dCtlEnableMask = 0x0400, dWritEnableMask = 0x0200, dReadEnableMask = 0x0100 };
dNeedLockMask
Set if driver must be locked in memory as soon as it is opened.
Available in Mac OS X v10.0 through Mac OS X v10.4.
Declared in Devices.h
.
dNeedTimeMask
Set if driver needs time for performing periodic tasks.
Available in Mac OS X v10.0 through Mac OS X v10.4.
Declared in Devices.h
.
dNeedGoodByeMask
Set if driver needs to be called before the application heap is initialized.
Available in Mac OS X v10.0 through Mac OS X v10.4.
Declared in Devices.h
.
dStatEnableMask
Set if driver responds to status requests.
Available in Mac OS X v10.0 through Mac OS X v10.4.
Declared in Devices.h
.
dCtlEnableMask
Set if driver responds to control requests.
Available in Mac OS X v10.0 through Mac OS X v10.4.
Declared in Devices.h
.
dWritEnableMask
Set if driver responds to write requests.
Available in Mac OS X v10.0 through Mac OS X v10.4.
Declared in Devices.h
.
dReadEnableMask
Set if driver responds to read requests.
Available in Mac OS X v10.0 through Mac OS X v10.4.
Declared in Devices.h
.
Define flags used in the driver header and device control entry.
enum { dReadEnable = 0, dWritEnable = 1, dCtlEnable = 2, dStatEnable = 3, dNeedGoodBye = 4, dNeedTime = 5, dNeedLock = 6 };
dReadEnable
Set if driver responds to read requests.
Available in Mac OS X v10.0 through Mac OS X v10.4.
Declared in Devices.h
.
dWritEnable
Set if driver responds to write requests.
Available in Mac OS X v10.0 through Mac OS X v10.4.
Declared in Devices.h
.
dCtlEnable
Set if driver responds to control requests.
Available in Mac OS X v10.0 through Mac OS X v10.4.
Declared in Devices.h
.
dStatEnable
Set if driver responds to status requests.
Available in Mac OS X v10.0 through Mac OS X v10.4.
Declared in Devices.h
.
dNeedGoodBye
Set if driver needs time for performing periodic tasks.
Available in Mac OS X v10.0 through Mac OS X v10.4.
Declared in Devices.h
.
dNeedTime
Set if driver needs time for performing periodic tasks.
Available in Mac OS X v10.0 through Mac OS X v10.4.
Declared in Devices.h
.
dNeedLock
Set if driver must be locked in memory as soon as it is opened.
Available in Mac OS X v10.0 through Mac OS X v10.4.
Declared in Devices.h
.
Define run-time flags used in the device control entry.
enum { dVMImmuneBit = 0, dOpened = 5, dRAMBased = 6, drvrActive = 7 };
dVMImmuneBit
Driver does not need VM protection.
Available in Mac OS X v10.0 through Mac OS X v10.4.
Declared in Devices.h
.
dOpened
Driver is open.
Available in Mac OS X v10.0 through Mac OS X v10.4.
Declared in Devices.h
.
dRAMBased
dCtlDriver
is
a handle (1) or pointer (0).
Available in Mac OS X v10.0 through Mac OS X v10.4.
Declared in Devices.h
.
drvrActive
Driver is currently processing a request.
Available in Mac OS X v10.0 through Mac OS X v10.4.
Declared in Devices.h
.
enum { dVMImmuneMask = 0x0001, dOpenedMask = 0x0020, dRAMBasedMask = 0x0040, drvrActiveMask = 0x0080 };
dVMImmuneMask
Driver does not need VM protection.
Available in Mac OS X v10.0 through Mac OS X v10.4.
Declared in Devices.h
.
dOpenedMask
Driver is open.
Available in Mac OS X v10.0 through Mac OS X v10.4.
Declared in Devices.h
.
dRAMBasedMask
dCtlDriver
is
a handle (1) or pointer (0).
Available in Mac OS X v10.0 through Mac OS X v10.4.
Declared in Devices.h
.
drvrActiveMask
Driver is currently processing a request.
Available in Mac OS X v10.0 through Mac OS X v10.4.
Declared in Devices.h
.
Define control codes for DeskAccessories.
enum { goodbye = -1, killCode = 1, accEvent = 64, accRun = 65, accCursor = 66, accMenu = 67, accUndo = 68, accCut = 70, accCopy = 71, accPaste = 72, accClear = 73 };
goodbye
Heap being reinitialized.
Available in Mac OS X v10.0 through Mac OS X v10.4.
Declared in Devices.h
.
killCode
KillIO requested.
Available in Mac OS X v10.0 through Mac OS X v10.4.
Declared in Devices.h
.
accEvent
Handle an event.
Available in Mac OS X v10.0 through Mac OS X v10.4.
Declared in Devices.h
.
accRun
Time for periodic action.
Available in Mac OS X v10.0 through Mac OS X v10.4.
Declared in Devices.h
.
accCursor
Change cursor shape.
Available in Mac OS X v10.0 through Mac OS X v10.4.
Declared in Devices.h
.
accMenu
Handle menu item.
Available in Mac OS X v10.0 through Mac OS X v10.4.
Declared in Devices.h
.
accUndo
Handle undo command.
Available in Mac OS X v10.0 through Mac OS X v10.4.
Declared in Devices.h
.
accCut
Handle cut command.
Available in Mac OS X v10.0 through Mac OS X v10.4.
Declared in Devices.h
.
accCopy
Handle copy command.
Available in Mac OS X v10.0 through Mac OS X v10.4.
Declared in Devices.h
.
accPaste
Handle paste command.
Available in Mac OS X v10.0 through Mac OS X v10.4.
Declared in Devices.h
.
accClear
Handle clear command.
Available in Mac OS X v10.0 through Mac OS X v10.4.
Declared in Devices.h
.
Define values of the message
parameter
to a Monitor 'mntr
'.
enum { initMsg = 1, okMsg = 2, cancelMsg = 3, hitMsg = 4, nulMsg = 5, updateMsg = 6, activateMsg = 7, deactivateMsg = 8, keyEvtMsg = 9, superMsg = 10, normalMsg = 11, startupMsg = 12 };
initMsg
Initialization.
Available in Mac OS X v10.0 through Mac OS X v10.4.
Declared in Devices.h
.
okMsg
User clicked OK button.
Available in Mac OS X v10.0 through Mac OS X v10.4.
Declared in Devices.h
.
cancelMsg
User clicked Cancel button.
Available in Mac OS X v10.0 through Mac OS X v10.4.
Declared in Devices.h
.
hitMsg
User clicked control in Options dialog.
Available in Mac OS X v10.0 through Mac OS X v10.4.
Declared in Devices.h
.
nulMsg
Periodic event.
Available in Mac OS X v10.0 through Mac OS X v10.4.
Declared in Devices.h
.
updateMsg
Update event.
Available in Mac OS X v10.0 through Mac OS X v10.4.
Declared in Devices.h
.
activateMsg
Not used.
Available in Mac OS X v10.0 through Mac OS X v10.4.
Declared in Devices.h
.
deactivateMsg
Not used.
Available in Mac OS X v10.0 through Mac OS X v10.4.
Declared in Devices.h
.
keyEvtMsg
Keyboard event.
Available in Mac OS X v10.0 through Mac OS X v10.4.
Declared in Devices.h
.
superMsg
Show superuser controls.
Available in Mac OS X v10.0 through Mac OS X v10.4.
Declared in Devices.h
.
normalMsg
Show only normal controls.
Available in Mac OS X v10.0 through Mac OS X v10.4.
Declared in Devices.h
.
startupMsg
Code has been loaded.
Available in Mac OS X v10.0 through Mac OS X v10.4.
Declared in Devices.h
.
enum { ioInProgress = 1, aRdCmd = 2, aWrCmd = 3, asyncTrpBit = 10, noQueueBit = 9 };
ioInProgress
Predefined value of ioResult while I/O is pending.
Available in Mac OS X v10.0 through Mac OS X v10.4.
Declared in Devices.h
.
aRdCmd
Low byte of ioTrap for Read calls.
Available in Mac OS X v10.0 through Mac OS X v10.4.
Declared in Devices.h
.
aWrCmd
Low byte of ioTrap for Write calls.
Available in Mac OS X v10.0 through Mac OS X v10.4.
Declared in Devices.h
.
asyncTrpBit
Trap word modifier.
Available in Mac OS X v10.0 through Mac OS X v10.4.
Declared in Devices.h
.
noQueueBit
Trap word modifier.
Available in Mac OS X v10.0 through Mac OS X v10.4.
Declared in Devices.h
.
enum { kOpenCommand = 0, kCloseCommand = 1, kReadCommand = 2, kWriteCommand = 3, kControlCommand = 4, kStatusCommand = 5, kKillIOCommand = 6, kInitializeCommand = 7, kFinalizeCommand = 8, kReplaceCommand = 9, kSupersededCommand = 10, kSuspendCommand = 11, kResumeCommand = 12 kPowerManagementCommand = 13 };
kOpenCommand
Available in Mac OS X v10.0 through Mac OS X v10.4.
Declared in Devices.h
.
kCloseCommand
Available in Mac OS X v10.0 through Mac OS X v10.4.
Declared in Devices.h
.
kReadCommand
Available in Mac OS X v10.0 through Mac OS X v10.4.
Declared in Devices.h
.
kWriteCommand
Available in Mac OS X v10.0 through Mac OS X v10.4.
Declared in Devices.h
.
kControlCommand
Available in Mac OS X v10.0 through Mac OS X v10.4.
Declared in Devices.h
.
kStatusCommand
Available in Mac OS X v10.0 through Mac OS X v10.4.
Declared in Devices.h
.
kKillIOCommand
Available in Mac OS X v10.0 through Mac OS X v10.4.
Declared in Devices.h
.
kInitializeCommand
Init driver and device.
Available in Mac OS X v10.0 through Mac OS X v10.4.
Declared in Devices.h
.
kFinalizeCommand
Shutdown driver and device.
Available in Mac OS X v10.0 through Mac OS X v10.4.
Declared in Devices.h
.
kReplaceCommand
Replace an old driver.
Available in Mac OS X v10.0 through Mac OS X v10.4.
Declared in Devices.h
.
kSupersededCommand
Prepare to be replaced by a new driver.
Available in Mac OS X v10.0 through Mac OS X v10.4.
Declared in Devices.h
.
kSuspendCommand
Prepare driver to go to sleep.
Available in Mac OS X v10.0 through Mac OS X v10.4.
Declared in Devices.h
.
kResumeCommand
Wake up sleeping driver.
Available in Mac OS X v10.0 through Mac OS X v10.4.
Declared in Devices.h
.
kPowerManagementCommand
Power management command, supercedes kSuspendCommand
and kResumeCommand
.
Available in Mac OS X v10.0 through Mac OS X v10.4.
Declared in Devices.h
.
The table below shows the most common result codes returned by the Device Manager.
© 2003, 2007 Apple Inc. All Rights Reserved. (Last updated: 2007-07-10)