home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / ddkx86v5.zip / DDKX86 / SRC / DEV / RESOURCE / RESMGR / RSMLDEV.C < prev    next >
Encoding:
C/C++ Source or Header  |  1995-04-14  |  4.7 KB  |  159 lines

  1. /*DDK*************************************************************************/
  2. /*                                                                           */
  3. /* COPYRIGHT    Copyright (C) 1995 IBM Corporation                           */
  4. /*                                                                           */
  5. /*    The following IBM OS/2 WARP source code is provided to you solely for  */
  6. /*    the purpose of assisting you in your development of OS/2 WARP device   */
  7. /*    drivers. You may use this code in accordance with the IBM License      */
  8. /*    Agreement provided in the IBM Device Driver Source Kit for OS/2. This  */
  9. /*    Copyright statement may not be removed.                                */
  10. /*                                                                           */
  11. /*****************************************************************************/
  12.  
  13. /**************************************************************************
  14.  *
  15.  * SOURCE FILE NAME =  RSMLDEV.C
  16.  *
  17.  * DESCRIPTIVE NAME =  Resource Management Driver - LDEV Node Serivces
  18.  *
  19.  *
  20.  *
  21.  * VERSION = V1.01
  22.  *
  23.  * DATE
  24.  *
  25.  * DESCRIPTION :
  26.  *
  27.  * Purpose:
  28.  *
  29.  *
  30.  *
  31.  * FUNCTIONS  :
  32.  *
  33.  * NOTES
  34.  *
  35.  *
  36.  * STRUCTURES
  37.  *
  38.  * EXTERNAL REFERENCES
  39.  *
  40.  *
  41.  *
  42.  * EXTERNAL FUNCTIONS
  43.  *
  44. */
  45. #define  INCL_NOBASEAPI
  46. #define  INCL_NOPMAPI
  47. #define  INCL_DOSERRORS
  48. #include <os2.h>
  49.  
  50. #include <dskinit.h>
  51.  
  52. #include "dhcalls.h"
  53.  
  54. #include "strat2.h"
  55. #include "scsi.h"
  56. #include "reqpkt.h"
  57.  
  58. #define RMCode SwapCode
  59. #include "rmcalls.h"
  60. #include "rmioctl.h"
  61.  
  62. #include "rsmcons.h"
  63. #include "rsmtypes.h"
  64. #include "rsmproto.h"
  65. #include "rsmextrn.h"
  66.  
  67. /*--------------------------------------------------------*/
  68. /*                                                        */
  69. /* RMCreateLDEVNode                                       */
  70. /*                                                        */
  71. /*                                                        */
  72. /*                                                        */
  73. /*--------------------------------------------------------*/
  74.  
  75. PRMNODE FAR f_RMCreateLDEVNode( PLDEVSTRUCT pLDS )
  76. {
  77.   return ( RMCreateLDEVNode( pLDS ) );
  78. }
  79.  
  80. PRMNODE NEAR RMCreateLDEVNode( PLDEVSTRUCT pLDS )
  81. {
  82.   return( RMCreateStdNode( LDEV_NODE_COOKIE, pLDS ) );
  83. }
  84.  
  85. /*--------------------------------------------------------*/
  86. /*                                                        */
  87. /* RMLinkLDEVNode                                         */
  88. /*                                                        */
  89. /*                                                        */
  90. /*                                                        */
  91. /*--------------------------------------------------------*/
  92.  
  93. USHORT FAR f_RMLinkLDEVNode( PRMNODE pLDevParent, PRMNODE pLDev,
  94.                              PRMNODE pDevAssoc )
  95. {
  96.   return ( RMLinkLDEVNode( pLDevParent, pLDev, pDevAssoc ) );
  97. }
  98.  
  99. USHORT NEAR RMLinkLDEVNode( PRMNODE pLDevParent, PRMNODE pLDev,
  100.                             PRMNODE pDevAssoc )
  101. {
  102.  
  103.   if ( pLDev->pDevParent )
  104.   {
  105.     _asm int 3
  106.     return ( 1 );
  107.   }
  108.   if ( pLDev->pDevAssoc )
  109.   {
  110.     _asm int 3
  111.     return ( 1 );
  112.   }
  113.  
  114.   RMAddChild( pLDevParent, pLDev );
  115.  
  116.   return ( 0 );
  117. }
  118.  
  119.  
  120. /*--------------------------------------------------------*/
  121. /*                                                        */
  122. /* RMDeleteLDEVNode                                       */
  123. /*                                                        */
  124. /*                                                        */
  125. /*                                                        */
  126. /*--------------------------------------------------------*/
  127.  
  128. USHORT FAR f_RMDeleteLDEVNode( PRMNODE pNodeDel )
  129. {
  130.   return ( RMDeleteLDEVNode( pNodeDel ) );
  131. }
  132.  
  133. USHORT NEAR RMDeleteLDEVNode( PRMNODE pNodeDel )
  134. {
  135.   PRMNODE       pDevNode;
  136.  
  137.   /*-----------------------------------------------*/
  138.   /* Mark associated device node as nolonger being */
  139.   /* referenced by LDev Node                       */
  140.   /*-----------------------------------------------*/
  141.  
  142.   cRMNodes++;       /* Fix up for decrement in RMDeleteRMNode */
  143.   cRMLNodes--;
  144.   return( RMDeleteRMNode( pNodeDel ) );
  145. }
  146.  
  147. /*--------------------------------------------------------*/
  148. /*                                                        */
  149. /* RMCreateSysNameNode                                    */
  150. /*                                                        */
  151. /*                                                        */
  152. /*                                                        */
  153. /*--------------------------------------------------------*/
  154.  
  155. PRMNODE NEAR RMCreateSysNameNode( PSYSNAMESTRUCT pSDS )
  156. {
  157.   return ( RMCreateStdNode( SYS_NODE_COOKIE, pSDS ) );
  158. }
  159.