home *** CD-ROM | disk | FTP | other *** search
/ Amiga Format CD 2 / amigaformatcd02.iso / comms / netsoftware / nethandler.lha / NetHandler / server / volume.c < prev   
Encoding:
C/C++ Source or Header  |  1989-09-16  |  1.8 KB  |  62 lines

  1. /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
  2. /* |_o_o|\\ Copyright (c) 1987 The Software Distillery.  All Rights Reserved */
  3. /* |. o.| || This program may not be distributed without the permission of   */
  4. /* | .  | || the authors:                                          BBS:      */
  5. /* | o  | ||   John Toebes     Dave Baker                                    */
  6. /* |  . |//                                                                  */
  7. /* ======                                                                    */
  8. /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
  9. /* Volume Manipulation */
  10. /* RmtCurentVol  RmtRenameDisk RmtDiskInfo RmtInfo */
  11.  
  12. #include "server.h"
  13.  
  14. void RmtInfo(global, pkt)
  15. GLOBAL global;
  16. struct DosPacket *pkt;
  17. {
  18.    BUG(("RmtInfo\n"));
  19.  
  20.    if(!global->infodata &&
  21.       !(global->infodata = (struct InfoData *)
  22.              DosAllocMem(global, sizeof(struct InfoData))))
  23.    {
  24.       BUG(("******* OUT OF MEMORY - can't get InfoData\n"));
  25.       global->RP.Arg1 = DOS_FALSE;
  26.       global->RP.Arg2 = ERROR_NO_FREE_STORE;
  27.       return;
  28.    }
  29.    pkt->dp_Arg1 = global->RP.Arg1;
  30.    pkt->dp_Arg2 = (LONG)global->infodata;
  31.  
  32.    Dispatch(global);
  33.  
  34.    MQ(global->infodata, global->RP.Data, sizeof(struct InfoData));
  35.  
  36.    global->RP.DLen = sizeof(struct InfoData);
  37. }
  38.  
  39. void RmtNetKludge(global, pkt)
  40. GLOBAL global;
  41. struct DosPacket *pkt;
  42. {
  43.    struct MsgPort *newport;
  44.  
  45.    if(!(newport=(struct MsgPort *)DeviceProc(global->RP.Data)))
  46.    {
  47.       BUG(("********DeviceProc of %s Failed\n", global->RP.Data));
  48.       BUGGETC
  49.       pkt->dp_Res1 = DOS_FALSE;
  50.       pkt->dp_Res2 = ERROR_OBJECT_NOT_FOUND;
  51.       return;
  52.    }
  53.    global->RP.RDevice = (RPTR)(global->dosport = newport);
  54.    pkt->dp_Res1 = DOS_TRUE;
  55.    pkt->dp_Res2 = 0L;
  56.  
  57.    global->n.run++;
  58.  
  59.    BUG(("RmtNetKludge: New RDevice %lx\n", newport));
  60. }
  61.  
  62.