CloseDriver
CloseDriver Close a device driver
#include <Devices.h> Device Manager
short refNum ; device driver reference; as obtained via
returns Error Code; 0=no error
CloseDriver closes the device driver indicated by the reference number
after first completing any pending I/O. Lastly, the memory used by the driver
is released.
refNum is the reference number of an open device driver. See OpenDriver
.
Returns: an operating system Error Code. It will be one of:
noErr (0) No error
badUnitErr (-21) refNum doesn't match unit table
unitEmptyErr (-22) refNum specifies NIL handle in unit table
dRemoveErr (-25) Tried to remove open driver

Notes: We are warned not to try closing a driver before checking the
consequences of closing it. Individual driver close routines are listed in the
Manager specific to that topic, for example, see the Print Manager for
information on PrDrvrClose.