Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

340 lines
10 KiB

  1. /*
  2. * invoklst.h
  3. *
  4. * Copyright (c) 1995 by DataBeam Corporation, Lexington, KY
  5. *
  6. * Abstract:
  7. * This is the interface file for the class CInvokeSpecifierListContainer.
  8. * This class manages the data associated with an Application Invoke
  9. * Request or Indication. This includes a list of applications to be
  10. * invoked. The CInvokeSpecifierListContainer data container utilizes a
  11. * CSessKeyContainer container to buffer part of the data associated with each
  12. * application invoke specifier. Each application invoke specifier also
  13. * includes a capability ID whose data is buffered internally by the
  14. * using a CCapIDContainer container. The list of application
  15. * invoke specifiers is maintained internally by the class through the use
  16. * of a Rogue Wave list container.
  17. *
  18. * Caveats:
  19. * None.
  20. *
  21. * Author:
  22. * blp/jbo
  23. */
  24. #ifndef _APPLICATION_INVOKE_SPECIFIER_LIST_
  25. #define _APPLICATION_INVOKE_SPECIFIER_LIST_
  26. #include "capid.h"
  27. #include "sesskey.h"
  28. #include "arost.h"
  29. /*
  30. * This is the internal structure used to hold the data associated with each
  31. * invoke specifier.
  32. */
  33. typedef struct
  34. {
  35. CSessKeyContainer *session_key;
  36. CAppCapItemList ExpectedCapItemList;
  37. MCSChannelType startup_channel_type;
  38. BOOL must_be_invoked;
  39. }
  40. INVOKE_SPECIFIER;
  41. /*
  42. * These are the typedefs for the Rogue Wave list which is used to hold the
  43. * invoke specifier info structures.
  44. */
  45. class CInvokeSpecifierList : public CList
  46. {
  47. DEFINE_CLIST(CInvokeSpecifierList, INVOKE_SPECIFIER*)
  48. };
  49. /*
  50. * Class definition:
  51. */
  52. class CInvokeSpecifierListContainer : public CRefCount
  53. {
  54. public:
  55. CInvokeSpecifierListContainer(UINT cProtEntities, PGCCAppProtocolEntity *, PGCCError);
  56. CInvokeSpecifierListContainer(PApplicationProtocolEntityList, PGCCError);
  57. ~CInvokeSpecifierListContainer(void);
  58. UINT LockApplicationInvokeSpecifierList(void);
  59. void UnLockApplicationInvokeSpecifierList(void);
  60. UINT GetApplicationInvokeSpecifierList(USHORT *pcProtEntities, LPBYTE memory);
  61. UINT GetApplicationInvokeSpecifierList(ULONG *pcProtEntities, LPBYTE pMemory)
  62. {
  63. USHORT c;
  64. UINT nRet = GetApplicationInvokeSpecifierList(&c, pMemory);
  65. *pcProtEntities = c;
  66. return nRet;
  67. }
  68. GCCError GetApplicationInvokeSpecifierListPDU(PApplicationProtocolEntityList *);
  69. void FreeApplicationInvokeSpecifierListPDU(void);
  70. protected:
  71. CInvokeSpecifierList m_InvokeSpecifierList;
  72. UINT m_cbDataSize;
  73. PApplicationProtocolEntityList m_pAPEListPDU;
  74. BOOL m_fValidAPEListPDU;
  75. private:
  76. GCCError SaveAPICapabilities(INVOKE_SPECIFIER *, UINT cCaps, PGCCApplicationCapability *);
  77. GCCError SavePDUCapabilities(INVOKE_SPECIFIER *, PSetOfExpectedCapabilities);
  78. UINT GetApplicationCapability(APP_CAP_ITEM *, PGCCApplicationCapability, LPBYTE memory);
  79. GCCError ConvertInvokeSpecifierInfoToPDU(INVOKE_SPECIFIER *, PApplicationProtocolEntityList);
  80. GCCError ConvertExpectedCapabilityDataToPDU(APP_CAP_ITEM *, PSetOfExpectedCapabilities);
  81. };
  82. /*
  83. * Comments explaining the public and private class member functions
  84. */
  85. /*
  86. * CInvokeSpecifierListContainer (
  87. * USHORT number_of_protocol_entities,
  88. * PGCCAppProtocolEntity * app_protocol_entity_list,
  89. * PGCCError return_value);
  90. *
  91. * Public member function of CInvokeSpecifierListContainer.
  92. *
  93. * Function Description:
  94. * This is a constructor for the CInvokeSpecifierListContainer class.
  95. * This constructor is used to create an CInvokeSpecifierListContainer
  96. * object from a list of "API" application protocol entities.
  97. *
  98. * Formal Parameters:
  99. * number_of_protocol_entities (i) The number of "APE"s in the list.
  100. * app_protocol_entity_list (i) The list of API "APE"s.
  101. * return_value (o) Error return value.
  102. *
  103. * Return Value:
  104. * GCC_NO_ERROR - Function completed successfully.
  105. * GCC_ALLOCATION_FAILURE - A resource allocation error occurred.
  106. * GCC_BAD_SESSION_KEY - An APE contained an invalid session key.
  107. * GCC_BAD_CAPABILITY_ID - An API contained an invalid capability ID.
  108. *
  109. * Side Effects:
  110. * None.
  111. *
  112. * Caveats:
  113. * None.
  114. */
  115. /*
  116. * CInvokeSpecifierListContainer (
  117. * PApplicationProtocolEntityList app_protocol_entity_list,
  118. * PGCCError return_value);
  119. *
  120. * Public member function of CInvokeSpecifierListContainer.
  121. *
  122. * Function Description:
  123. * This is a constructor for the CInvokeSpecifierListContainer class.
  124. * This constructor is used to create an CInvokeSpecifierListContainer
  125. * object from a "PDU" ApplicationProtocolEntityList.
  126. *
  127. * Formal Parameters:
  128. * app_protocol_entity_list (i) The list of PDU "APE"s.
  129. * return_value (o) Error return value.
  130. *
  131. * Return Value:
  132. * GCC_NO_ERROR - Function completed successfully.
  133. * GCC_ALLOCATION_FAILURE - A resource allocation error occurred.
  134. * GCC_BAD_SESSION_KEY - An APE contained an invalid session key.
  135. * GCC_BAD_CAPABILITY_ID - An API contained an invalid capability ID.
  136. *
  137. * Side Effects:
  138. * None.
  139. *
  140. * Caveats:
  141. * None.
  142. */
  143. /*
  144. * ~CInvokeSpecifierListContainer ();
  145. *
  146. * Public member function of CInvokeSpecifierListContainer.
  147. *
  148. * Function Description:
  149. * This is the destructor for the CInvokeSpecifierListContainer class.
  150. * It is responsible for freeing any memory allocated to hold the
  151. * invoke data.
  152. *
  153. * Formal Parameters:
  154. * None.
  155. *
  156. * Return Value:
  157. * None.
  158. *
  159. * Side Effects:
  160. * None.
  161. *
  162. * Caveats:
  163. * None.
  164. */
  165. /*
  166. * UINT LockApplicationInvokeSpecifierList ();
  167. *
  168. * Public member function of CInvokeSpecifierListContainer.
  169. *
  170. * Function Description:
  171. * This routine is used to "lock" the "API" data for this object. This
  172. * results in the lock count for this object being incremented. When the
  173. * lock count transitions from 0 to 1, a calculation is made to determine
  174. * how much memory will be needed to hold any "API" data which will
  175. * be referenced by, but not held in, the list of GCCAppProtocolEntity
  176. * structures which is filled in on a call to GetApplicationInvoke-
  177. * SpecifierList. This is the value returned by this routine in order to
  178. * allow the calling object to allocate that amount of memory in
  179. * preparation for the call to GetApplicationInvokeSpecifierList.
  180. *
  181. * Formal Parameters:
  182. * None.
  183. *
  184. * Return Value:
  185. * The amount of memory which will be needed to hold "API" data
  186. * which is a list of GCCAppProtocolEntity structures.
  187. *
  188. * Side Effects:
  189. * The internal lock count is incremented.
  190. *
  191. * Caveats:
  192. * The internal lock count is used in conjuction with an internal "free"
  193. * flag as a mechanism for ensuring that this object remains in existance
  194. * until all interested parties are through with it. The object remains
  195. * valid (unless explicity deleted) until the lock count is zero and the
  196. * "free" flag is set through a call to FreeApplicationInvokeSpecifierList.
  197. * This allows other objects to lock this object and be sure that it
  198. * remains valid until they call UnLock which will decrement the internal
  199. * lock count. A typical usage scenerio for this object would be: An
  200. * CInvokeSpecifierListContainer object is constructed and then passed off
  201. * to any interested parties through a function call. On return from the
  202. * function call, the FreeApplicationInvokeSpecifierList call is made which
  203. * will set the internal "free" flag. If no other parties have locked the
  204. * object with a Lock call, then the CInvokeSpecifierListContainer object
  205. * will automatically delete itself when the FreeApplicationInvoke-
  206. * SpecifierList call is made. If, however, any number of other parties
  207. * has locked the object, it will remain in existence until each of them
  208. * has unlocked the object through a call to UnLock.
  209. */
  210. /*
  211. * UINT GetApplicationInvokeSpecifierList (
  212. * PUShort number_of_protocol_entities,
  213. * LPSTR memory);
  214. *
  215. * Public member function of CInvokeSpecifierListContainer.
  216. *
  217. * Function Description:
  218. * This routine is used to retrieve the application invoke specifier list
  219. * from the CInvokeSpecifierListContainer object in the "API" form of a
  220. * list of PGCCAppProtocolEntity structures.
  221. *
  222. * Formal Parameters:
  223. * number_of_protocol_entities (o) The number of APEs in the list.
  224. * memory (o) The memory used to hold the
  225. * APE data.
  226. *
  227. * Return Value:
  228. * The amount of memory which will be needed to hold "API" data
  229. * which is a list of GCCAppProtocolEntity structures.
  230. *
  231. * Side Effects:
  232. * None.
  233. *
  234. * Caveats:
  235. * None.
  236. */
  237. /*
  238. * void UnLockApplicationInvokeSpecifierList ();
  239. *
  240. * Public member function of CInvokeSpecifierListContainer.
  241. *
  242. * Function Description:
  243. * This routine is used to "unlock" the "API" data for this object. This
  244. * results in the lock count for this object being decremented. When the
  245. * lock count transitions from 1 to 0, a check is made to determine
  246. * whether the object has been freed through a call to
  247. * FreeApplicationInvokeSpecifierList. If so, the object will
  248. * automatically delete itself.
  249. *
  250. * Formal Parameters:
  251. * None.
  252. *
  253. * Return Value:
  254. * None.
  255. *
  256. * Side Effects:
  257. * The internal lock count is decremented.
  258. *
  259. * Caveats:
  260. * None.
  261. */
  262. /*
  263. * GCCError GetApplicationInvokeSpecifierListPDU (
  264. * PApplicationProtocolEntityList * protocol_entity_list);
  265. *
  266. * Public member function of CInvokeSpecifierListContainer.
  267. *
  268. * Function Description:
  269. * This routine is used to retrieve the object key data from the
  270. * CInvokeSpecifierListContainer object in the "PDU" form of a list of
  271. * PApplicationProtocolEntityList structures.
  272. *
  273. * Formal Parameters:
  274. * protocol_entity_list (o) The list of structures to fill in.
  275. *
  276. * Return Value:
  277. * GCC_NO_ERROR - No error.
  278. * GCC_ALLOCATION_FAILURE - A resource allocation error occurred.
  279. *
  280. * Side Effects:
  281. * The first time this routine is called, data is allocated internally to
  282. * hold the PDU form.
  283. *
  284. * Caveats:
  285. * None.
  286. */
  287. /*
  288. * void FreeApplicationInvokeSpecifierListPDU ();
  289. *
  290. * Public member function of CInvokeSpecifierListContainer.
  291. *
  292. * Function Description:
  293. * This routine is used to "free" the "PDU" data allocated for this object
  294. * which is held internally.
  295. *
  296. * Formal Parameters:
  297. * None.
  298. *
  299. * Return Value:
  300. * None.
  301. *
  302. * Side Effects:
  303. * The internal flag is set to indicate that the PDU form of data no
  304. * longer is valid for this object.
  305. *
  306. * Caveats:
  307. * None.
  308. */
  309. #endif