Legacy Documentclose button

Important: The information in this document is obsolete and should not be used for new development.

Previous Book Contents Book Index Next

Inside Macintosh: Devices /
Chapter 6 - Power Manager / Power Manager Reference
Power Manager Dispatch Routines / Controlling the Hard Disk


HardDiskQInstall

You can use the HardDiskQInstall function to notify your software when power to the internal hard disk is about to be turned off.

OSErr HardDiskQInstall(HDQueueElement *theElement);
theElement
A pointer to an element for the hard disk power down queue.
DESCRIPTION
The HardDiskQInstall function installs an element into the hard disk power down queue to provide notification to your software when the internal hard disk is about to be powered off. For example, this feature might be used by the driver for an external battery-powered hard disk. When power to the internal hard disk is turned off, the external hard disk could be turned off as well.

When power to the internal hard disk is about to be turned off, the software calls the routine pointed to by the hdProc field so that it can do any special processing. The routine is passed a pointer to its queue element so that, for example, the routine can reference its variables.

Before calling HardDiskQInstall, the calling program must set the hdQType field to HDPwrQType or the queue element won't be added to the queue and HardDiskQInstall will return an error.

ASSEMBLY-LANGUAGE INFORMATION
The trap is _PowerMgrDispatch ($A09E). The selector value for HardDiskQInstall is 10 ($0A) in the low word of register D0. The pointer to the HDQueue element is passed in register A0. The result code is returned in the low word of register D0.

RESULT CODES
noErr0No error
SEE ALSO
The HDQueueElement structure is defined in "Hard Disk Queue Structure," on page 6-27.

The application-defined hard disk spindown function is described in "Hard Disk Spindown Function," on page 6-66.


Previous Book Contents Book Index Next

© Apple Computer, Inc.
3 JUL 1996