home *** CD-ROM | disk | FTP | other *** search
/ Gold Fish 2 / goldfish_vol2_cd1.bin / files / util / wb / forceicon / source / forceicon.c < prev    next >
C/C++ Source or Header  |  1994-08-19  |  32KB  |  1,249 lines

  1. /*
  2. Auto:        smake    ForceIcon
  3. */
  4.  
  5. /* $Revision Header built automatically *************** (do not edit) ************
  6. **
  7. ** © Copyright by GuntherSoft
  8. **
  9. ** File             : SnakeSYS:CPrgs/Utils/ForceIcon.c
  10. ** Created on       : Wednesday, 20.10.93 15:55:50
  11. ** Created by       : Kai Iske
  12. ** Current revision : V1.0
  13. **
  14. **
  15. ** Purpose
  16. ** -------
  17. **   - Forces Disk Icons to a specified position.
  18. **     Usefull for CD-Rom users
  19. **
  20. ** Revision V1.0
  21. ** --------------
  22. ** created on Wednesday, 20.10.93 15:55:50  by  Kai Iske.   LogMessage :
  23. **     --- Initial release ---
  24. **
  25. *********************************************************************************/
  26.  
  27.  
  28. /**********************************************************************/
  29. /*                      Routines for this module                      */
  30. /**********************************************************************/
  31. static struct    FIconSema    *FindFIconSema(void);
  32. static void            RemoveFIconSema(struct FIconSema *FIconSema);
  33. static ULONG    __saveds __asm    MyGetIcon(register __a0 UBYTE *Name, register __a1 struct DiskObject *DObj, register __a2 struct FreeList *FList, register __a6 struct Library *IconBase);
  34. static ULONG    __saveds __asm    MyPutIcon(register __a0 UBYTE *Name, register __a1 struct DiskObject *DObj, register __a6 struct Library *IconBase);
  35. static ULONG    __asm        DoForce(register __a0 UBYTE *Name, register __a1 struct DiskObject *DObj, register __a2 struct FreeList *FList, register __a6 struct Library *IconBase);
  36. static BOOL            StoreIconPos(struct DiskObject *Icon);
  37. static ULONG    __saveds __asm    MyLock(register __d1 UBYTE *Name, register __d2 ULONG Mode, register __a6 struct DosLibrary *DOSBase);
  38. static BOOL            OpenAll(void);
  39. static void            CloseAll(void);
  40.  
  41.  
  42.  
  43.  
  44. /**********************************************************************/
  45. /*                    Functions of files included                     */
  46. /**********************************************************************/
  47.     // LoadPrefs.h
  48.  
  49. static void            LoadPrefs(struct FIconSema *FIconSema);
  50.  
  51.     // VolList.h
  52.  
  53. static BOOL            GetDevVolList(struct List *VolList);
  54. static BOOL            GetDosEntries(struct List *VolList, ULONG Mode);
  55. static void            FreeDevVolList(struct List *VolList);
  56. static void            SortList(struct List *VolList, BOOL DisplayType);
  57. static void            SortPartialList(struct List *VolList, UWORD Left, UWORD Right);
  58. static APTR            GetListEntry(struct List *List, WORD EntryNum);
  59. static BOOL            MyStrCmp(char *FromName, char *ToName);
  60.  
  61.     // Error.h
  62.  
  63. static void    __stdargs    DisplayError(LONG ErrCode, ULONG Arg1, ...);
  64.  
  65.     // PoolVec.h
  66.  
  67. static APTR            AllocVecPool(struct FIconSema *FIconSema, ULONG Size);
  68. static void            FreeVecPool(struct FIconSema *FIconSema, APTR Addr);
  69.  
  70.     // CheckToolTypes.h
  71.  
  72. static void            CheckToolTypes(struct WBStartup *WBenchMsg);
  73.  
  74.  
  75.  
  76.  
  77. /**********************************************************************/
  78. /*                           Library bases                            */
  79. /**********************************************************************/
  80. struct    ExecBase        *SysBase;
  81. struct    IntuitionBase        *IntuitionBase    = NULL;
  82. struct    DosLibrary        *DOSBase    = NULL;
  83. struct    Library            *IconBase    = NULL;
  84. struct    Library            *UtilityBase    = NULL;
  85. struct    Library            *IFFParseBase    = NULL;
  86.  
  87.  
  88.  
  89.  
  90.  
  91.  
  92. /**********************************************************************/
  93. /*                         "No-StartUp vars"                          */
  94. /**********************************************************************/
  95. static const char        _VER[]        = "\0$VER: ForceIcon "REVISION" ("REVDATE")\0";
  96. char                _ProgramName[]    = "ForceIcon";
  97. LONG                _OSERR        = 0;
  98.  
  99.  
  100.  
  101.  
  102.  
  103. /**********************************************************************/
  104. /*                           Our variables                            */
  105. /**********************************************************************/
  106. static    ULONG    __asm        (*OldGetIcon)(register __a0 UBYTE *, register __a1 struct DiskObject *, register __a2 struct FreeList *, register __a6 struct Library *);
  107. static    ULONG    __asm        (*OldPutIcon)(register __a0 UBYTE *, register __a1 struct DiskObject *, register __a6 struct Library *);
  108. static    ULONG    __asm        (*OldLock)(register __d1 UBYTE *, register __d2 ULONG, register __a6 struct DosLibrary *);
  109. static    ULONG    __asm        (*CheckGetIcon)(register __a0 UBYTE *, register __a1 struct DiskObject *, register __a2 struct FreeList *, register __a6 struct Library *);
  110. static    ULONG    __asm        (*CheckPutIcon)(register __a0 UBYTE *, register __a1 struct DiskObject *, register __a6 struct Library *);
  111. static    ULONG    __asm        (*CheckLock)(register __d1 UBYTE *, register __d2 ULONG, register __a6 struct DosLibrary *);
  112.  
  113. static    struct    FIconSema    *FIconSema    = NULL;        // Pointer to our rendezvous semaphore
  114.  
  115. static    LONG            SnapNotify    = 2;        // How to notify a snap
  116.  
  117.  
  118.  
  119.  
  120.  
  121.  
  122. /**********************************************************************/
  123. /*                      This is our main program                      */
  124. /**********************************************************************/
  125. ULONG __saveds main(void)
  126. {
  127.     struct    Process        *MyProc;
  128.     struct    WBStartup    *WBenchMsg    = NULL;
  129.     BOOL            QuitIT        = FALSE;
  130.  
  131.  
  132.  
  133.         // Get SysBase
  134.  
  135.     SysBase    = *((struct ExecBase **)0x4L);
  136.  
  137.  
  138.         // Get address of our process
  139.  
  140.     MyProc = (struct Process *)FindTask(NULL);
  141.  
  142.  
  143.  
  144.         // Determine where we were started from
  145.  
  146.     if(!MyProc->pr_CLI)
  147.     {
  148.         WaitPort(&MyProc->pr_MsgPort);
  149.         WBenchMsg = (struct WBStartup *)GetMsg(&MyProc->pr_MsgPort);
  150.     }
  151.  
  152.  
  153.  
  154.         // Don`t run under OS < 37
  155.  
  156.     if(((struct Library *)SysBase)->lib_Version >= 37)
  157.     {
  158.             // Open libraries
  159.  
  160.         if(OpenAll())
  161.         {
  162.                 // Prefs Program there ???
  163.  
  164.             if((FIconSema = FindFIconSema()))
  165.             {
  166.  
  167.                     // Check ToolTypes
  168.  
  169.                 CheckToolTypes(WBenchMsg);
  170.  
  171.  
  172.                 Disable();
  173.                     // Patch icon.library functions
  174.  
  175.                 OldGetIcon        = (ULONG *)SetFunction(IconBase, -0x0000002a, &MyGetIcon);
  176.                 OldPutIcon        = (ULONG *)SetFunction(IconBase, -0x00000030, &MyPutIcon);
  177.  
  178.                     // Patch dos.library functions
  179.  
  180.                 OldLock            = (ULONG *)SetFunction(DOSBase, -0x00000054, &MyLock);
  181.                 Enable();
  182.  
  183.  
  184.  
  185.                     // Ok, patches placed.
  186.                     // Make all connected drives diskchange
  187.  
  188.                 {
  189.                     struct    List    ChangeList;
  190.  
  191.                     ObtainSemaphore(&FIconSema->FIconSema);
  192.  
  193.                     NewList(&ChangeList);
  194.  
  195.                         // Create list of connected devices
  196.  
  197.                     if(GetDosEntries(&ChangeList, LDF_VOLUMES))
  198.                     {
  199.                         struct    DosList        *DList;
  200.                         struct    VolEntry    *ThisEntry,
  201.                                     *ListEntry;
  202.                         struct    DevProc        *DevProc;
  203.                         char            DevName[130];
  204.                         BOOL            FoundDev,
  205.                                     DoDskCh;
  206.  
  207.                         while((ThisEntry = (struct VolEntry *)RemHead(&ChangeList)))
  208.                         {
  209.                             FoundDev    = FALSE;
  210.                             DoDskCh        = FALSE;
  211.  
  212.                                 // Find name of device this volume resides in
  213.  
  214.                             if((DList = LockDosList(LDF_DEVICES|LDF_READ)))
  215.                             {
  216.                                 while((DList = NextDosEntry(DList, LDF_DEVICES|LDF_READ)))
  217.                                 {
  218.                                     if(ThisEntry->DriverTask == DList->dol_Task && !FoundDev)
  219.                                     {
  220.                                         setmem(DevName, 130, 0);
  221.                                         strncpy(DevName, ((char *)BADDR(DList->dol_Name) + 1), *((char *)BADDR(DList->dol_Name)));
  222.                                         FoundDev    = TRUE;
  223.                                     }
  224.                                 }
  225.                                 UnLockDosList(LDF_DEVICES|LDF_READ);
  226.                             }
  227.  
  228.                                 // Found corresponding device ???
  229.  
  230.                             if(FoundDev)
  231.                             {
  232.                                     // Check whether to diskchange
  233.  
  234.                                 ListEntry    = (struct VolEntry *)FIconSema->VolumeList.lh_Head;
  235.                                 while(ListEntry->Link.ln_Succ && !DoDskCh)
  236.                                 {
  237.                                     if(ListEntry->Link.ln_Type == LDF_DEVICES)
  238.                                         DoDskCh    = (MyStrCmp(ListEntry->VolName, DevName) == 0);
  239.                                     else
  240.                                         DoDskCh    = (MyStrCmp(ListEntry->VolName, ThisEntry->VolName) == 0);
  241.  
  242.                                     ListEntry = (struct VolEntry *)ListEntry->Link.ln_Succ;
  243.                                 }
  244.  
  245.                                 if(DoDskCh)
  246.                                 {
  247.                                     strcat(DevName, ":");
  248.  
  249.                                     if(ThisEntry->DriverTask && (DevProc = GetDeviceProc(DevName, NULL)))
  250.                                     {
  251.                                         if(TypeOfMem(DevProc->dvp_Port))
  252.                                         {
  253.                                             if(DoPkt(DevProc->dvp_Port, ACTION_INHIBIT, DOSTRUE, NULL, NULL, NULL, NULL))
  254.                                                 DoPkt(DevProc->dvp_Port, ACTION_INHIBIT, DOSFALSE, NULL, NULL, NULL, NULL);
  255.                                         }
  256.                                         FreeDeviceProc(DevProc);
  257.                                     }
  258.                                 }
  259.                             }
  260.  
  261.                             FreeVecPool(FIconSema, ThisEntry);
  262.                         }
  263.                     }
  264.  
  265.                     ReleaseSemaphore(&FIconSema->FIconSema);
  266.                 }
  267.  
  268.                     // Wait for termination
  269.  
  270.                 while(!QuitIT)
  271.                 {
  272.                     ULONG    MySig;
  273.  
  274.                     MySig    = Wait(SIGBREAKF_CTRL_C|SIGBREAKF_CTRL_D);
  275.  
  276.                         // User snapped icon?
  277.  
  278.                     if(MySig & SIGBREAKF_CTRL_D)
  279.                     {
  280.                         if(FIconSema->PrefsTask)
  281.                             Signal(FIconSema->PrefsTask, SIGBREAKF_CTRL_F);
  282.  
  283.                         if(SnapNotify == 2)
  284.                             DisplayError(ERR_SNAPEDICON, NULL);
  285.                         else if(SnapNotify == 1)
  286.                             DisplayBeep(NULL);
  287.                     }
  288.                     else
  289.                     {
  290.                             // Ok, we are to quit
  291.  
  292.                         QuitIT    = TRUE;
  293.  
  294.  
  295.                         Disable();
  296.  
  297.                             // Try to re-install old vectors
  298.  
  299.                         CheckGetIcon        = SetFunction(IconBase, -0x0000002a, OldGetIcon);
  300.                         CheckPutIcon        = SetFunction(IconBase, -0x00000030, OldPutIcon);
  301.                         CheckLock        = SetFunction(DOSBase, -0x00000054, OldLock);
  302.  
  303.                         if((CheckGetIcon != &MyGetIcon) || (CheckPutIcon != &MyPutIcon) || (CheckLock != &MyLock))
  304.                         {
  305.                             QuitIT = FALSE;
  306.  
  307.                                 // Re-install patches created by someone else
  308.  
  309.                             SetFunction(IconBase, -0x0000002a, CheckGetIcon);
  310.                             SetFunction(IconBase, -0x00000030, CheckPutIcon);
  311.                             SetFunction(DOSBase, -0x00000054, CheckLock);
  312.                         }
  313.  
  314.                         Enable();
  315.  
  316.                         if(!QuitIT)
  317.                         {
  318.                             if(CheckGetIcon != &MyGetIcon)
  319.                                 DisplayError(ERR_PATCH, (ULONG)"GetIcon()", NULL);
  320.                             else if(CheckPutIcon != &MyPutIcon)
  321.                                 DisplayError(ERR_PATCH, (ULONG)"PutIcon()", NULL);
  322.                             else if(CheckLock != &MyLock)
  323.                                 DisplayError(ERR_PATCH, (ULONG)"Lock()", NULL);
  324.                         }
  325.                     }
  326.                 }
  327.             }
  328.             RemoveFIconSema(FIconSema);
  329.         }
  330.     }
  331.  
  332.  
  333.         // Close libs
  334.  
  335.     CloseAll();
  336.  
  337.  
  338.         // Send back WBStartUp Message
  339.  
  340.     if(WBenchMsg)
  341.     {
  342.         Forbid();
  343.         ReplyMsg((struct Message *)WBenchMsg);
  344.     }
  345.     return(0);
  346. }
  347.  
  348.  
  349.  
  350.  
  351. /**********************************************************************/
  352. /*                        Functionreplacements                        */
  353. /**********************************************************************/
  354. void chkabort(void){;}
  355. void __stdargs _XCEXIT(LONG Val){;}
  356.  
  357.  
  358.  
  359.  
  360.  
  361. /**********************************************************************/
  362. /*                      My new GetIcon function                       */
  363. /**********************************************************************/
  364. static ULONG __saveds __asm MyGetIcon(register __a0 UBYTE *Name, register __a1 struct DiskObject *DObj, register __a2 struct FreeList *FList, register __a6 struct Library *IconBase)
  365. {
  366.     struct    Process        *MyProc = (struct Process *)FindTask(NULL);
  367.     ULONG    RetVal;
  368.  
  369.         // Calling process a real process and is it Workbench ?
  370.  
  371.     if((MyProc->pr_Task.tc_Node.ln_Type == NT_PROCESS) && !strcmp(MyProc->pr_Task.tc_Node.ln_Name, "Workbench"))
  372.     {
  373.             if(!stricmp(Name, "Disk"))
  374.                 RetVal = DoForce(Name, DObj, FList, IconBase);
  375.             else
  376.                 RetVal = OldGetIcon(Name, DObj, FList, IconBase);
  377.     }
  378.     else
  379.         RetVal = OldGetIcon(Name, DObj, FList, IconBase);
  380.  
  381.     return(RetVal);
  382. }
  383.  
  384.  
  385.  
  386.  
  387. /**********************************************************************/
  388. /*                      My new PutIcon function                       */
  389. /**********************************************************************/
  390. static ULONG __saveds __asm MyPutIcon(register __a0 UBYTE *Name, register __a1 struct DiskObject *DObj, register __a6 struct Library *IconBase)
  391. {
  392.     struct    Process        *MyProc = (struct Process *)FindTask(NULL);
  393.     ULONG    RetVal;
  394.  
  395.         // Calling process a real process and is it Workbench ?
  396.  
  397.     if((MyProc->pr_Task.tc_Node.ln_Type == NT_PROCESS) && !strcmp(MyProc->pr_Task.tc_Node.ln_Name, "Workbench"))
  398.     {
  399.             if(!stricmp(Name, "Disk"))
  400.             {
  401.                 if(!StoreIconPos(DObj))
  402.                     RetVal    = OldPutIcon(Name, DObj, IconBase);
  403.                 else
  404.                 {
  405.                     Signal(FIconSema->ServerTask, SIGBREAKF_CTRL_D);
  406.                     RetVal    = TRUE;
  407.                 }
  408.             }
  409.             else
  410.                 RetVal = OldPutIcon(Name, DObj, IconBase);
  411.     }
  412.     else
  413.         RetVal = OldPutIcon(Name, DObj, IconBase);
  414.  
  415.     return(RetVal);
  416. }
  417.  
  418.  
  419.  
  420.  
  421.  
  422. /**********************************************************************/
  423. /*                       Main forcement routine                       */
  424. /**********************************************************************/
  425. static ULONG __asm DoForce(register __a0 UBYTE *Name, register __a1 struct DiskObject *DObj, register __a2 struct FreeList *FList, register __a6 struct Library *IconBase)
  426. {
  427.     struct    FileLock    *Dir;
  428.     struct    DosList        *DList;
  429.     char            *VolName,
  430.                 *DevName    = NULL,
  431.                 *IconName;
  432.     BPTR            MyLock,
  433.                 CheckLock;
  434.     LONG            Left,
  435.                 Top,
  436.                 WinWidth,
  437.                 WinHeight,
  438.                 WinFlags;
  439.     WORD            WinX,
  440.                 WinY;
  441.     ULONG            RetVal        = 0;
  442.     BOOL            Found        = FALSE,
  443.                 UseAltIcon,
  444.                 UseIconPos,
  445.                 UseWindow,
  446.                 UseFlags;
  447.  
  448.  
  449.  
  450.  
  451.  
  452.         // Get our semaphore
  453.  
  454.     ObtainSemaphore(&FIconSema->FIconSema);
  455.  
  456.  
  457.         // Get buffers
  458.  
  459.     if((VolName = AllocMem(130, MEMF_CLEAR)) && (DevName = AllocMem(130, MEMF_CLEAR)))
  460.     {
  461.             // Switch to current dir
  462.  
  463.         MyLock    = CurrentDir(NULL);
  464.         Dir    = (struct FileLock *)BADDR(MyLock);
  465.         DList    = (struct DosList *)BADDR(Dir->fl_Volume);
  466.  
  467.             // Get name of volume inserted
  468.  
  469.         strncpy(VolName, ((char *)BADDR(DList->dol_Name) + 1), *((char *)BADDR(DList->dol_Name)));
  470.  
  471.             // Reset current dir
  472.  
  473.         CurrentDir(MyLock);
  474.  
  475.             // Get Name of Device
  476.  
  477.         if((DList = LockDosList(LDF_DEVICES|LDF_READ)))
  478.         {
  479.             while((DList = NextDosEntry(DList, LDF_DEVICES|LDF_READ)))
  480.             {
  481.                 if(Dir->fl_Task == DList->dol_Task)
  482.                     strncpy(DevName, ((char *)BADDR(DList->dol_Name) + 1), *((char *)BADDR(DList->dol_Name)));
  483.             }
  484.             UnLockDosList(LDF_DEVICES|LDF_READ);
  485.         }
  486.  
  487.             // Really to load from ROOT ???
  488.  
  489.         if(!(CheckLock = ParentDir(MyLock)))
  490.         {
  491.                 // Do we have patches waiting ???
  492.  
  493.             if(!IsListEmpty(&FIconSema->VolumeList))
  494.             {
  495.                 struct    VolEntry    *ThisEntry = (struct VolEntry *)FIconSema->VolumeList.lh_Head;
  496.  
  497.                 do
  498.                 {
  499.                         // This one to patch ???
  500.  
  501.                     if(ThisEntry->Link.ln_Type == LDF_DEVICES && !MyStrCmp(ThisEntry->VolName, DevName))
  502.                         Found = TRUE;
  503.  
  504.                     else if(ThisEntry->Link.ln_Type == LDF_VOLUMES && !MyStrCmp(ThisEntry->VolName, VolName))
  505.                         Found = TRUE;
  506.  
  507.                     else
  508.                         ThisEntry = (struct VolEntry *)ThisEntry->Link.ln_Succ;
  509.  
  510.                 } while(!Found && ThisEntry->Link.ln_Succ);
  511.  
  512.                     // Object to be patched ?
  513.  
  514.                 if(Found)
  515.                 {
  516.                         // Set vars for icon substitution
  517.  
  518.                     UseAltIcon    = (ThisEntry->UseAlt == MODE_USE);
  519.                     IconName    = ThisEntry->IconName;
  520.  
  521.                         // Set vars for icon placement
  522.  
  523.                     UseIconPos    = (ThisEntry->IconPos == MODE_USE);
  524.                     Left        = ThisEntry->Left;
  525.                     Top        = ThisEntry->Top;
  526.  
  527.                         // Set vars for window settings
  528.  
  529.                     UseWindow    = (ThisEntry->UseWin == MODE_USE);
  530.                     WinX        = ThisEntry->WinX;
  531.                     WinY        = ThisEntry->WinY;
  532.                     WinWidth    = ThisEntry->WinWidth;
  533.                     WinHeight    = ThisEntry->WinHeight;
  534.  
  535.                         // Set vars for window flags
  536.  
  537.                     UseFlags    = (ThisEntry->UseFlags == MODE_USE);
  538.                     WinFlags    = ThisEntry->WinFlags;
  539.  
  540.  
  541.                         // This entry a volume and are we allowed to obtain settings from device ???
  542.  
  543.                     if(ThisEntry->Link.ln_Type == LDF_VOLUMES)
  544.                     {
  545.                         struct    VolEntry    *DevEntry    = (struct VolEntry *)FIconSema->VolumeList.lh_Head;
  546.                         BOOL            FoundMyDev    = FALSE;
  547.  
  548.                             // Search for device-entry corresponding to volume
  549.  
  550.                         while(DevEntry->Link.ln_Succ && !FoundMyDev)
  551.                         {
  552.                             if(DevEntry->Link.ln_Type == LDF_DEVICES && !MyStrCmp(DevEntry->VolName, DevName))
  553.                                 FoundMyDev    = TRUE;
  554.                             else
  555.                                 DevEntry    = (struct VolEntry *)DevEntry->Link.ln_Succ;
  556.                         }
  557.  
  558.                             // Got a device entry for this volume ???
  559.  
  560.                         if(FoundMyDev)
  561.                         {
  562.                                 // Use alternative icon for volume ???
  563.  
  564.                             if(ThisEntry->UseAlt == MODE_INHERIT)
  565.                             {
  566.                                     // no, use one for device entry ???
  567.                                     // If so, set pointer to new iconname
  568.  
  569.                                 if(DevEntry->UseAlt == MODE_USE)
  570.                                 {
  571.                                     UseAltIcon    = TRUE;
  572.                                     IconName    = DevEntry->IconName;
  573.                                 }
  574.                             }
  575.  
  576.                                 // Use alternative position for volume ???
  577.  
  578.                             if(ThisEntry->IconPos == MODE_INHERIT)
  579.                             {
  580.                                     // no, use one for device entry ???
  581.                                     // if so, set vars
  582.  
  583.                                 if(DevEntry->IconPos == MODE_USE)
  584.                                 {
  585.                                     UseIconPos    = TRUE;
  586.                                     Left        = DevEntry->Left;
  587.                                     Top        = DevEntry->Top;
  588.                                 }
  589.                             }
  590.  
  591.                                 // Use settings of window ???
  592.  
  593.                             if(ThisEntry->UseWin == MODE_INHERIT)
  594.                             {
  595.                                     // no, use one for device entry ???
  596.                                     // if so, set vars
  597.  
  598.                                 if(DevEntry->UseWin == MODE_USE)
  599.                                 {
  600.                                     UseWindow    = TRUE;
  601.                                     WinX        = DevEntry->WinX;
  602.                                     WinY        = DevEntry->WinY;
  603.                                     WinWidth    = DevEntry->WinWidth;
  604.                                     WinHeight    = DevEntry->WinHeight;
  605.                                 }
  606.                             }
  607.  
  608.                                 // Use settings of flags
  609.  
  610.                             if(ThisEntry->UseFlags == MODE_INHERIT)
  611.                             {
  612.                                     // no, use one for device entry ???
  613.                                     // if so, set vars
  614.  
  615.                                 if(DevEntry->UseFlags == MODE_USE)
  616.                                 {
  617.                                     UseFlags    = TRUE;
  618.                                     WinFlags    = DevEntry->WinFlags;
  619.                                 }
  620.                             }
  621.                         }
  622.                     }
  623.  
  624.  
  625.                         // Alternative icon ???
  626.  
  627.                     if(UseAltIcon)
  628.                     {
  629.                         char    *EndPtr;
  630.  
  631.                             // Check for name and remove extension
  632.  
  633.                         strcpy(VolName, IconName);
  634.                         strlwr(VolName);
  635.                         if((EndPtr = strstr(VolName, ".info")))
  636.                         {
  637.                             BPTR    TestLock;
  638.  
  639.                             setmem(VolName, 130, 0);
  640.                             strncpy(VolName, IconName, (EndPtr - VolName));
  641.  
  642.                                 // Try to get supplied name
  643.  
  644.                             if((TestLock = Lock(IconName, ACCESS_READ)))
  645.                             {
  646.                                 UnLock(TestLock);
  647.  
  648.                                     // Try to read in this icon
  649.  
  650.                                 if(!(RetVal = OldGetIcon(VolName, DObj, FList, IconBase)))
  651.                                     RetVal = OldGetIcon(Name, DObj, FList, IconBase);
  652.                                 else
  653.                                 {
  654.                                     BOOL    GotData    = FALSE;
  655.  
  656.                                         // Ok, we`ve loaded a new icon, so set appropriate flags ;)
  657.  
  658.                                     if(DObj->do_Type == WBTOOL || DObj->do_Type == WBPROJECT)
  659.                                     {
  660.                                             // Try to set drawerdata for tool and project icons
  661.  
  662.                                         if((DObj->do_DrawerData = AllocMem(sizeof(struct DrawerData), MEMF_CLEAR|MEMF_PUBLIC)))
  663.                                             GotData    = TRUE;
  664.                                     }
  665.                                     else
  666.                                         GotData = TRUE;
  667.  
  668.                                     if(GotData)
  669.                                     {
  670.                                         struct    DrawerData    *DDat = DObj->do_DrawerData;
  671.  
  672.                                             // Fill in structure
  673.  
  674.                                         DDat->dd_NewWindow.LeftEdge    = ThisEntry->LeftEdge;
  675.                                         DDat->dd_NewWindow.TopEdge    = ThisEntry->TopEdge;
  676.                                         DDat->dd_NewWindow.Width    = ThisEntry->Width;
  677.                                         DDat->dd_NewWindow.Height    = ThisEntry->Height;
  678.                                         DDat->dd_NewWindow.DetailPen    = 255;
  679.                                         DDat->dd_NewWindow.BlockPen    = 255;
  680.                                         DDat->dd_NewWindow.Flags    = WFLG_HASZOOM|WFLG_WINDOWTICKED|WFLG_REPORTMOUSE|WFLG_SIMPLE_REFRESH|WFLG_SIZEBRIGHT|WFLG_SIZEBBOTTOM|WFLG_CLOSEGADGET|WFLG_DEPTHGADGET|WFLG_DRAGBAR|WFLG_SIZEGADGET;
  681.                                         DDat->dd_NewWindow.MinWidth    = 90;
  682.                                         DDat->dd_NewWindow.MinHeight    = 40;
  683.                                         DDat->dd_NewWindow.MaxWidth    = 0xffff;
  684.                                         DDat->dd_NewWindow.MaxHeight    = 0xffff;
  685.                                         DDat->dd_NewWindow.Type        = WBENCHSCREEN;
  686.                                         DDat->dd_CurrentX        = ThisEntry->CurrentX;
  687.                                         DDat->dd_CurrentY        = ThisEntry->CurrentY;
  688.                                         DDat->dd_Flags            = ThisEntry->Flags;
  689.                                         DDat->dd_ViewModes        = ThisEntry->ViewMode;
  690.  
  691.                                             // A Ok, set new type of icon
  692.  
  693.                                         DObj->do_Type = WBDISK;
  694.                                     }
  695.                                 }
  696.                             }
  697.                             else
  698.                                 RetVal = OldGetIcon(Name, DObj, FList, IconBase);
  699.                         }
  700.                         else
  701.                             RetVal = OldGetIcon(Name, DObj, FList, IconBase);
  702.                     }
  703.                     else
  704.                         RetVal = OldGetIcon(Name, DObj, FList, IconBase);
  705.  
  706.                     if(RetVal)
  707.                     {
  708.                         struct    Screen    *WBScreen    = LockPubScreen("Workbench");
  709.  
  710.                             // Patch position ???
  711.  
  712.                         if(WBScreen)
  713.                         {
  714.                                 // Do so
  715.  
  716.                             DObj->do_CurrentX = ((UseIconPos) ? (Left < 0 ? WBScreen->Width + Left : Left) : NO_ICON_POSITION);
  717.                             DObj->do_CurrentY = ((UseIconPos) ? (Top < 0 ? WBScreen->Height + Top - WBScreen->BarHeight - 1 : Top - WBScreen->BarHeight - 1) : NO_ICON_POSITION);
  718.  
  719.                             UnlockPubScreen(NULL, WBScreen);
  720.                         }
  721.  
  722.                             // Use window ???
  723.  
  724.                         if(UseWindow)
  725.                         {
  726.                             DObj->do_DrawerData->dd_NewWindow.LeftEdge    = WinX;
  727.                             DObj->do_DrawerData->dd_NewWindow.TopEdge    = WinY;
  728.                             DObj->do_DrawerData->dd_NewWindow.Width        = WinWidth;
  729.                             DObj->do_DrawerData->dd_NewWindow.Height    = WinHeight;
  730.                         }
  731.  
  732.                             // Set Flags ???
  733.  
  734.                         if(UseFlags)
  735.                         {
  736.                             DObj->do_DrawerData->dd_Flags            = (WinFlags > 3 ? 2 : 0);
  737.                             DObj->do_DrawerData->dd_ViewModes        = (WinFlags > 3 ? WinFlags - 3 : WinFlags + 1);
  738.                         }
  739.                     }
  740.                 }
  741.             }
  742.         }
  743.         else
  744.             UnLock(CheckLock);
  745.     }
  746.  
  747.     if(VolName)
  748.         FreeMem(VolName, 130);
  749.  
  750.     if(DevName)
  751.         FreeMem(DevName, 130);
  752.  
  753.  
  754.         // No entry found and not the orig. icon read -> use supplied name
  755.  
  756.     if(!Found && !RetVal)
  757.         RetVal = OldGetIcon(Name, DObj, FList, IconBase);
  758.  
  759.         // Release that fine semaphore
  760.  
  761.     ReleaseSemaphore(&FIconSema->FIconSema);
  762.  
  763.     return(RetVal);
  764. }
  765.  
  766.  
  767.  
  768.  
  769.  
  770. /**********************************************************************/
  771. /*                        My new Lock routine                         */
  772. /**********************************************************************/
  773. static ULONG __saveds __asm MyLock(register __d1 UBYTE *Name, register __d2 ULONG Mode, register __a6 struct DosLibrary *DOSBase)
  774. {
  775.     struct    Process        *MyProc        = (struct Process *)FindTask(NULL);
  776.     struct    FileLock    *Dir;
  777.     struct    DosList        *DList;
  778.     char            *VolName,
  779.                 *DevName    = NULL,
  780.                 *IconName;
  781.     BPTR            MyLock,
  782.                 CheckLock;
  783.     ULONG            RetVal        = NULL;
  784.     BOOL            Found        = FALSE,
  785.                 UseAltIcon;
  786.  
  787.  
  788.  
  789.         // Get buffers
  790.  
  791.     if((VolName = AllocMem(130, MEMF_CLEAR|MEMF_PUBLIC)) && (DevName = AllocMem(130, MEMF_CLEAR|MEMF_PUBLIC)))
  792.     {
  793.             // Calling process a real process and is it Workbench ?
  794.  
  795.         if((MyProc->pr_Task.tc_Node.ln_Type == NT_PROCESS) && TypeOfMem(MyProc->pr_Task.tc_Node.ln_Name) && !strcmp(MyProc->pr_Task.tc_Node.ln_Name, "Workbench"))
  796.         {
  797.  
  798.                 // Trying to load a Disk.info ???
  799.  
  800.             if(TypeOfMem(Name) && !stricmp(Name, "Disk.info"))
  801.             {
  802.                     // Get my semaphore
  803.  
  804.                 ObtainSemaphore(&FIconSema->FIconSema);
  805.  
  806.                     // Switch to current dir
  807.  
  808.                 MyLock    = CurrentDir(NULL);
  809.                 Dir    = (struct FileLock *)BADDR(MyLock);
  810.                 DList    = (struct DosList *)BADDR(Dir->fl_Volume);
  811.  
  812.                     // Get name of volume inserted
  813.  
  814.                 strncpy(VolName, ((char *)BADDR(DList->dol_Name) + 1), *((char *)BADDR(DList->dol_Name)));
  815.  
  816.                     // Reset current dir
  817.  
  818.                 CurrentDir(MyLock);
  819.  
  820.                     // Get Name of Device
  821.  
  822.                 if((DList = LockDosList(LDF_DEVICES|LDF_READ)))
  823.                 {
  824.                     while((DList = NextDosEntry(DList, LDF_DEVICES|LDF_READ)))
  825.                     {
  826.                         if(Dir->fl_Task == DList->dol_Task)
  827.                             strncpy(DevName, ((char *)BADDR(DList->dol_Name) + 1), *((char *)BADDR(DList->dol_Name)));
  828.                     }
  829.                     UnLockDosList(LDF_DEVICES|LDF_READ);
  830.                 }
  831.  
  832.                     // Really load from ROOT ?
  833.  
  834.                 if(!(CheckLock = ParentDir(MyLock)))
  835.                 {
  836.                         // Do we have patches waiting ???
  837.  
  838.                     if(!IsListEmpty(&FIconSema->VolumeList))
  839.                     {
  840.                         struct    VolEntry    *ThisEntry = (struct VolEntry *)FIconSema->VolumeList.lh_Head;
  841.  
  842.                         do
  843.                         {
  844.                                 // This one to patch ???
  845.  
  846.                             if(ThisEntry->Link.ln_Type == LDF_DEVICES && !MyStrCmp(ThisEntry->VolName, DevName))
  847.                                 Found = TRUE;
  848.  
  849.                             else if(ThisEntry->Link.ln_Type == LDF_VOLUMES && !MyStrCmp(ThisEntry->VolName, VolName))
  850.                                 Found = TRUE;
  851.  
  852.                             else
  853.                                 ThisEntry = (struct VolEntry *)ThisEntry->Link.ln_Succ;
  854.  
  855.                         } while(!Found && ThisEntry->Link.ln_Succ);
  856.  
  857.                             // Object to be patched ?
  858.  
  859.                         if(Found)
  860.                         {
  861.                                 // Set vars for icon substitution
  862.  
  863.                             UseAltIcon    = (ThisEntry->UseAlt == MODE_USE);
  864.                             IconName    = ThisEntry->IconName;
  865.  
  866.                                 // This entry a volume and are we allowed to obtain settings from a device ???
  867.  
  868.                             if(ThisEntry->Link.ln_Type == LDF_VOLUMES)
  869.                             {
  870.                                 struct    VolEntry    *DevEntry    = (struct VolEntry *)FIconSema->VolumeList.lh_Head;
  871.                                 BOOL            FoundMyDev    = FALSE;
  872.  
  873.                                     // Search for device-entry corresponding to volume
  874.  
  875.                                 while(DevEntry->Link.ln_Succ && !FoundMyDev)
  876.                                 {
  877.                                     if(DevEntry->Link.ln_Type == LDF_DEVICES && !MyStrCmp(DevEntry->VolName, DevName))
  878.                                         FoundMyDev    = TRUE;
  879.                                     else
  880.                                         DevEntry    = (struct VolEntry *)DevEntry->Link.ln_Succ;
  881.                                 }
  882.  
  883.                                     // Got a device entry for this volume ???
  884.  
  885.                                 if(FoundMyDev)
  886.                                 {
  887.                                         // Use alternative icon for volume ???
  888.  
  889.                                     if(ThisEntry->UseAlt == MODE_INHERIT)
  890.                                     {
  891.                                             // no, use one for device entry ???
  892.                                             // If so, set pointer to new iconname
  893.  
  894.                                         if(DevEntry->UseAlt == MODE_USE)
  895.                                         {
  896.                                             UseAltIcon    = TRUE;
  897.                                             IconName    = DevEntry->IconName;
  898.                                         }
  899.                                     }
  900.                                 }
  901.                             }
  902.  
  903.                                 // If an alternative icon is to be used
  904.                                 // lock this one, otherwise lock Disk.info
  905.  
  906.                             if(UseAltIcon)
  907.                             {
  908.                                 struct    DiskObject    *OldDiskObject;
  909.                                 WORD    OldLeft        = 50,
  910.                                     OldTop        = 50,
  911.                                     OldWidth     = 400,
  912.                                     OldHeight    = 100;
  913.                                 LONG    OldCurrentX    = 0,
  914.                                     OldCurrentY    = 0;
  915.                                 ULONG    OldFlags    = 0x0;
  916.                                 UWORD    OldViewMode    = 1;
  917.  
  918.                                 if(!(RetVal = OldLock(IconName, Mode, DOSBase)))
  919.                                     RetVal = OldLock(Name, Mode, DOSBase);
  920.                                 else
  921.                                 {
  922.                                         // Get original Disk.info file, in order to obtain
  923.                                         // the correct window position and size
  924.  
  925.                                     strcat(DevName, ":Disk");
  926.                                     if(!(OldDiskObject = GetDiskObject(DevName)))
  927.                                     {
  928.                                         strcat(VolName, ":Disk");
  929.                                         OldDiskObject = GetDiskObject(VolName);
  930.                                     }
  931.  
  932.                                     if(OldDiskObject)
  933.                                     {
  934.                                         OldLeft        = OldDiskObject->do_DrawerData->dd_NewWindow.LeftEdge;
  935.                                         OldTop        = OldDiskObject->do_DrawerData->dd_NewWindow.TopEdge;
  936.                                         OldWidth    = OldDiskObject->do_DrawerData->dd_NewWindow.Width;
  937.                                         OldHeight    = OldDiskObject->do_DrawerData->dd_NewWindow.Height;
  938.                                         OldCurrentX    = OldDiskObject->do_DrawerData->dd_CurrentX;
  939.                                         OldCurrentY    = OldDiskObject->do_DrawerData->dd_CurrentY;
  940.                                         OldFlags    = OldDiskObject->do_DrawerData->dd_Flags;
  941.                                         OldViewMode    = OldDiskObject->do_DrawerData->dd_ViewModes;
  942.  
  943.                                         FreeDiskObject(OldDiskObject);
  944.                                     }
  945.  
  946.                                     ThisEntry->LeftEdge    = OldLeft;
  947.                                     ThisEntry->TopEdge    = OldTop;
  948.                                     ThisEntry->Width    = OldWidth;
  949.                                     ThisEntry->Height    = OldHeight;
  950.                                     ThisEntry->CurrentX    = OldCurrentX;
  951.                                     ThisEntry->CurrentY    = OldCurrentY;
  952.                                     ThisEntry->Flags    = OldFlags;
  953.                                     ThisEntry->ViewMode    = OldViewMode;
  954.                                 }
  955.                             }
  956.                             else
  957.                                 Found = FALSE;
  958.                         }
  959.                     }
  960.                 }
  961.                 else
  962.                     UnLock(CheckLock);
  963.  
  964.                 ReleaseSemaphore(&FIconSema->FIconSema);
  965.             }
  966.         }
  967.     }
  968.  
  969.     if(VolName)
  970.         FreeMem(VolName, 130);
  971.  
  972.     if(DevName)
  973.         FreeMem(DevName, 130);
  974.  
  975.  
  976.     if(!Found)
  977.         RetVal = OldLock(Name, Mode, DOSBase);
  978.  
  979.     return(RetVal);
  980. }
  981.  
  982.  
  983.  
  984.  
  985.  
  986.  
  987. /**********************************************************************/
  988. /*               Store icons position of the info file                */
  989. /**********************************************************************/
  990. static BOOL StoreIconPos(struct DiskObject *Icon)
  991. {
  992.     struct    FileLock    *Dir;
  993.     struct    DosList        *DList;
  994.     struct    VolEntry    *ThisEntry;
  995.     char            *VolName;
  996.     BPTR            MyLock,
  997.                 CheckLock;
  998.     BOOL            Found        = FALSE,
  999.                 RetVal        = FALSE,
  1000.                 Created        = FALSE,
  1001.                 IsReadOnly    = FALSE;
  1002.  
  1003.  
  1004.  
  1005.         // Get our semaphore
  1006.  
  1007.     ObtainSemaphore(&FIconSema->FIconSema);
  1008.  
  1009.  
  1010.         // Get buffers
  1011.  
  1012.     if((VolName = AllocMem(130, MEMF_CLEAR)))
  1013.     {
  1014.             // Switch to current dir
  1015.  
  1016.         MyLock    = CurrentDir(NULL);
  1017.         Dir    = (struct FileLock *)BADDR(MyLock);
  1018.         DList    = (struct DosList *)BADDR(Dir->fl_Volume);
  1019.  
  1020.             // Get name of volume inserted
  1021.  
  1022.         strncpy(VolName, ((char *)BADDR(DList->dol_Name) + 1), *((char *)BADDR(DList->dol_Name)));
  1023.  
  1024.             // Reset current dir
  1025.  
  1026.         CurrentDir(MyLock);
  1027.  
  1028.             // Get Name of Device
  1029.  
  1030.         if((DList = LockDosList(LDF_DEVICES|LDF_READ)))
  1031.         {
  1032.             while((DList = NextDosEntry(DList, LDF_DEVICES|LDF_READ)))
  1033.             {
  1034.                 if(Dir->fl_Task == DList->dol_Task)
  1035.                 {
  1036.                     struct    InfoData    __aligned    InfoData;
  1037.  
  1038.                         // Get information about drive
  1039.  
  1040.                     if(DoPkt(Dir->fl_Task, ACTION_DISK_INFO, MKBADDR(&InfoData), NULL, NULL, NULL, NULL))
  1041.                     {
  1042.                             // Is drive write protected?
  1043.  
  1044.                         if(InfoData.id_DiskState == ID_WRITE_PROTECTED)
  1045.                             IsReadOnly    = TRUE;
  1046.                     }
  1047.                 }
  1048.             }
  1049.             UnLockDosList(LDF_DEVICES|LDF_READ);
  1050.         }
  1051.  
  1052.  
  1053.  
  1054.             // Really to load from ROOT ???
  1055.  
  1056.         if(!(CheckLock = ParentDir(MyLock)))
  1057.         {
  1058.                 // Do we have patches waiting ???
  1059.  
  1060.             if(!IsListEmpty(&FIconSema->VolumeList))
  1061.             {
  1062.                 ThisEntry = (struct VolEntry *)FIconSema->VolumeList.lh_Head;
  1063.  
  1064.                 do
  1065.                 {
  1066.                         // This one to patch ???
  1067.  
  1068.                     if(ThisEntry->Link.ln_Type == LDF_VOLUMES && !MyStrCmp(ThisEntry->VolName, VolName))
  1069.                         Found = TRUE;
  1070.  
  1071.                     else
  1072.                         ThisEntry = (struct VolEntry *)ThisEntry->Link.ln_Succ;
  1073.  
  1074.                 } while(!Found && ThisEntry->Link.ln_Succ);
  1075.             }
  1076.  
  1077.  
  1078.                 // Object to be patched found? If not, create new entry (VOLUME)
  1079.  
  1080.             if(!Found)
  1081.             {
  1082.                     // Clear pointer
  1083.  
  1084.                 ThisEntry    = NULL;
  1085.  
  1086.                     // Device really is READONLY?
  1087.  
  1088.                 if(IsReadOnly)
  1089.                 {
  1090.                         // Try to create new entry
  1091.  
  1092.                     if((ThisEntry = AllocVecPool(FIconSema, sizeof(struct VolEntry))))
  1093.                     {
  1094.                             // Fill in structure and set flag
  1095.  
  1096.                         ThisEntry->Link.ln_Name    = ThisEntry->VolName;
  1097.                         ThisEntry->Link.ln_Type    = LDF_VOLUMES;
  1098.                         strcpy(ThisEntry->VolName, VolName);
  1099.                         Created        = TRUE;
  1100.                     }
  1101.                 }
  1102.             }
  1103.  
  1104.                 // Got an entry?
  1105.  
  1106.             if(ThisEntry)
  1107.             {
  1108.                 struct    Screen    *WBScreen    = LockPubScreen("Workbench");
  1109.  
  1110.                     // Got screen?
  1111.  
  1112.                 if(WBScreen)
  1113.                 {
  1114.                         // Created new entry? Add to list
  1115.  
  1116.                     if(Created)
  1117.                         AddHead(&FIconSema->VolumeList, (struct Node *)ThisEntry);
  1118.  
  1119.                         // Set vars for icon placement
  1120.  
  1121.                     ThisEntry->Left        = Icon->do_CurrentX;
  1122.                     ThisEntry->Top        = Icon->do_CurrentY + WBScreen->BarHeight + 1;
  1123.                     ThisEntry->IconPos    = MODE_USE;
  1124.                     RetVal            = TRUE;
  1125.  
  1126.                         // Unlock screen
  1127.  
  1128.                     UnlockPubScreen(NULL, WBScreen);
  1129.                 }
  1130.                 else
  1131.                 {
  1132.                         // Failure and created entry?
  1133.                         // Free memory associated
  1134.  
  1135.                     if(Created)
  1136.                         FreeVecPool(FIconSema, ThisEntry);
  1137.                 }
  1138.             }
  1139.         }
  1140.         else
  1141.             UnLock(CheckLock);
  1142.     }
  1143.  
  1144.     if(VolName)
  1145.         FreeMem(VolName, 130);
  1146.  
  1147.         // Release that fine semaphore
  1148.  
  1149.     ReleaseSemaphore(&FIconSema->FIconSema);
  1150.  
  1151.     return(RetVal);
  1152. }
  1153.  
  1154.  
  1155.  
  1156.  
  1157.  
  1158.  
  1159.  
  1160.  
  1161.  
  1162. /**********************************************************************/
  1163. /*                           Open libraries                           */
  1164. /**********************************************************************/
  1165. static BOOL OpenAll(void)
  1166. {
  1167.     if(!(IntuitionBase = (struct IntuitionBase *)OpenLibrary("intuition.library", 37)))
  1168.     {
  1169.         DisplayError(ERR_OPEN, (ULONG)"intuition.library", 37);
  1170.         return(FALSE);
  1171.     }
  1172.  
  1173.     if(!(DOSBase = (struct DosLibrary *)OpenLibrary("dos.library", 37)))
  1174.     {
  1175.         DisplayError(ERR_OPEN, (ULONG)"dos.library", 37);
  1176.         return(FALSE);
  1177.     }
  1178.  
  1179.     if(!(IconBase = OpenLibrary("icon.library", 37)))
  1180.     {
  1181.         DisplayError(ERR_OPEN, (ULONG)"icon.library", 37);
  1182.         return(FALSE);
  1183.     }
  1184.  
  1185.     if(!(UtilityBase = OpenLibrary("utility.library", 37)))
  1186.     {
  1187.         DisplayError(ERR_OPEN, (ULONG)"utility.library", 37);
  1188.         return(FALSE);
  1189.     }
  1190.  
  1191.     if(!(IFFParseBase = OpenLibrary("iffparse.library", 37)))
  1192.     {
  1193.         DisplayError(ERR_OPEN, (ULONG)"iffparse.library", 37);
  1194.         return(FALSE);
  1195.     }
  1196.  
  1197.     if(!(AslBase = OpenLibrary("asl.library", 36)))
  1198.     {
  1199.         DisplayError(ERR_OPEN, (ULONG)"asl.library", 36);
  1200.         return(FALSE);
  1201.     }
  1202.  
  1203.     return(TRUE);
  1204. }
  1205.  
  1206.  
  1207.  
  1208.  
  1209.  
  1210.  
  1211.  
  1212.  
  1213. /**********************************************************************/
  1214. /*                          Close libraries                           */
  1215. /**********************************************************************/
  1216. static void CloseAll(void)
  1217. {
  1218.     if(AslBase)
  1219.         CloseLibrary(AslBase);
  1220.  
  1221.     if(IFFParseBase)
  1222.         CloseLibrary(IFFParseBase);
  1223.  
  1224.     if(UtilityBase)
  1225.         CloseLibrary(UtilityBase);
  1226.  
  1227.     if(IconBase)
  1228.         CloseLibrary(IconBase);
  1229.  
  1230.     if(DOSBase)
  1231.         CloseLibrary((struct Library *)DOSBase);
  1232.  
  1233.     if(IntuitionBase)
  1234.         CloseLibrary((struct Library *)IntuitionBase);
  1235. }
  1236.  
  1237.  
  1238.  
  1239.  
  1240. /**********************************************************************/
  1241. /*       Now include the LoadRoutine and the VolumeList routine       */
  1242. /**********************************************************************/
  1243. #include    "LoadPrefs.h"
  1244. #include    "VolList.h"
  1245. #include    "Error.h"
  1246. #include    "Rendezvous.h"
  1247. #include    "CheckToolTypes.h"
  1248. #include    "PoolVec.h"
  1249.