home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / cset21v6.zip / MMPM2TK / TK / FSSHT / SHGPROT.C < prev    next >
C/C++ Source or Header  |  1993-02-25  |  5KB  |  89 lines

  1. /****************************************************************************/
  2. /*                                                                          */
  3. /*                    Copyright (c) IBM Corporation 1992, 1993              */
  4. /*                           All Rights Reserved                            */
  5. /*                                                                          */
  6. /* SOURCE FILE NAME: SHGPROT.C                                              */
  7. /*                                                                          */
  8. /* DESCRIPTIVE NAME:  Stream Handler Get Protocol routine                   */
  9. /*                                                                          */
  10. /* FUNCTION: Get the protocols installed for this stream handler.           */
  11. /*                                                                          */
  12. /* ENTRY POINTS: ShcGetProtocol                                             */
  13. /*                                                                          */
  14. /*************************** END OF SPECIFICATIONS **************************/
  15. #define  INCL_NOPMAPI                  /* no PM include files required */
  16. #define  INCL_DOSSEMAPHORES
  17. #define  INCL_DOSPROCESS
  18. #include <os2.h>
  19. #include <os2me.h>
  20. #include <hhpheap.h>
  21. #include <shi.h>
  22.  
  23. /************************** START OF SPECIFICATIONS *************************/
  24. /*                                                                          */
  25. /* SUBROUTINE NAME: ShcGetProtocol                                          */
  26. /*                                                                          */
  27. /* DESCRIPTIVE NAME: Stream Handler Command Get Protocol                    */
  28. /*                                                                          */
  29. /* FUNCTION: This returns a SPCB indicated by the key passed in.            */
  30. /*                                                                          */
  31. /* NOTES:                                                                   */
  32. /*                                                                          */
  33. /* ENTRY POINT: ShcGetProtocol                                              */
  34. /*   LINKAGE:   CALL NEAR (0:32)                                            */
  35. /*                                                                          */
  36. /* INPUT: Pointer to shc get protocol parameter block (PARM_GPROT)          */
  37. /*        containing:                                                       */
  38. /*   ULONG   ulFunction  Handler command function SHC_GET_PROTOCOLS         */
  39. /*   HID     hid         handler ID                                         */
  40. /*   SPCBKEY spcbkey     key of SPCB                                        */
  41. /*   PSBCB   pspcb       pointer to SPCB (output)                           */
  42. /*                                                                          */
  43. /* EXIT-NORMAL: NO_ERROR (0)                                                */
  44. /*                                                                          */
  45. /* EXIT-ERROR:                                                              */
  46. /*   ERROR_INVALID_SPCBKEY                                                  */
  47. /*                                                                          */
  48. /* SIDE EFFECTS:                                                            */
  49. /*                                                                          */
  50. /* INTERNAL REFERENCES:                                                     */
  51. /*        ROUTINES: None                                                    */
  52. /*                                                                          */
  53. /* EXTERNAL REFERENCES:                                                     */
  54. /*   ROUTINES:                                                              */
  55. /*     ShFindESPCB                                                          */
  56. /*                                                                          */
  57. /*   DATA STRUCTURES:                                                       */
  58. /*     ESPCB                                                                */
  59. /*                                                                          */
  60. /*************************** END OF SPECIFICATIONS **************************/
  61.  
  62. RC ShcGetProtocol(pgpparm)
  63. PPARM_GPROT pgpparm;
  64.  
  65. { /* Start of ShcGetProtocol */
  66.  
  67. RC rc = NO_ERROR;                       /* local return code */
  68. PESPCB pTempEspcb;
  69.  
  70.   ENTERCRITX(rc);
  71.  
  72.   /*
  73.    * Locate the spcb and return it
  74.    */
  75.   pTempEspcb = ShFindESPCB(pgpparm->spcbkey,0L);
  76.   if (pTempEspcb)
  77.     {
  78.       *pgpparm->pspcb = pTempEspcb->spcb;
  79.     }
  80.   else
  81.     {
  82.       rc = ERROR_INVALID_SPCBKEY;
  83.     }
  84.  
  85.   EXITCRIT;
  86.   return(rc);
  87.  
  88. } /* End of ShcGetProtocol */
  89.