home *** CD-ROM | disk | FTP | other *** search
-
- #include <exec/types.h>
- #include <libraries/dosextens.h>
- #include "HH:MoreDos.h"
- #include "HH:Template.h"
-
- /*************************************************************/
- /* NeonSoft (C) 06-04-'88 */
- /* UnMount.c */
- /*************************************************************/
-
- TEXT *dv;
-
- TEMPLATE Template[] = {
- { A_FLAG, "DEV", &dv },
- { EOTP }
- };
-
- extern struct DosLibrary *DOSBase;
-
- VOID
- program()
- {
- struct RootNode *rn;
- struct DosInfo *di;
- struct DeviceList *dl;
-
- rn = DOSBase->dl_Root;
- di = BADDR(rn->rn_Info);
-
- if (!(dl=FindDevice(di->di_DevInfo,dv))) {
- if (FindDevice(di->di_Devices,dv)) {
- printf("Error, %ls already unmounted!\n",dv);
- quit(RETURN_WARN);
- } else {
- printf("Error, %ls not found!\n",dv);
- quit(RETURN_FAIL);
- }
- } else if (((struct DeviceList *)BADDR(dl))->dl_Type!=DLT_DEVICE) {
- printf("Error, %ls not a device!\n",dv);
- quit(RETURN_ERROR);
- }
-
- InsertDevice(&di->di_Devices,RemoveDevice(&di->di_DevInfo,dl));
-
- quit(RETURN_OK);
- }
-
-