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 1 - Device Manager / Device Manager Reference
Device Manager Functions / Writing and Installing Device Drivers


DriverRemove

You can use the DriverRemove function to remove a device driver's device control entry from the unit table and release the driver resource.

pascal OSErr DriverRemove(short refNum); 
refNum
The driver reference number.
DESCRIPTION
The DriverRemove function removes a device driver's device control entry from the unit table and releases the driver resource. You specify the device driver using the refNum parameter. You must close the device driver before calling DriverRemove.

If the driver is closed, DriverRemove calls the Memory Manager function DisposeHandle to release the device control entry, then sets the corresponding handle in the unit table to nil. If the driver's dRAMBased flag is set, DriverRemove calls the Resource Manager function ReleaseResource to release the driver resource.

SPECIAL CONSIDERATIONS
The DriverRemove function may move memory; you should not call it at interrupt time.

ASSEMBLY-LANGUAGE INFORMATION
The trap macro for the DriverRemove function is _DrvrRemove (0xA03E).

You place the driver reference number in register D0. When _DrvrRemove returns, register D0 contains the result code.
Registers on entry
D0The driver reference number
Registers on exit
D0Result code

RESULT CODES
noErr0No error
dRemovErr-25Attempt to remove an open driver

Previous Book Contents Book Index Next

© Apple Computer, Inc.
3 JUL 1996