Source code of Windows XP (NT5)
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.

106 lines
3.3 KiB

  1. /***************************************************************************/
  2. /** Microsoft Windows **/
  3. /** Copyright(c) Microsoft Corp., 1995-1996 **/
  4. /***************************************************************************/
  5. /****************************************************************************
  6. cuserdta.hpp
  7. June 96 LenS
  8. T120 user data/object ID infrastructure.
  9. ****************************************************************************/
  10. #ifndef USERDATA_INC
  11. #define USERDATA_INC
  12. #include <nmutil.h>
  13. #include <oblist.h>
  14. #include <confdbg.h>
  15. #include <confguid.h>
  16. // H.221 utility functions
  17. VOID CreateH221AppKeyFromGuid(LPBYTE lpb, GUID * pguid);
  18. BOOL GetGuidFromH221AppKey(LPTSTR pszGuid, LPOSTR pOctStr);
  19. // GetUserData extracts user data from a T120 event message.
  20. // The caller passes in the T120 data structures and the GUID
  21. // associated with the user data, and receives back a pointer to
  22. // the buffer containing the user data.
  23. // This buffer will be invalidated by the user returning from
  24. // the event. If the user data consisted just
  25. // of the GUID, then *pnData == NULL and *ppData == NULL.
  26. HRESULT NMINTERNAL GetUserData(UINT nRecords,
  27. GCCUserData ** ppUserData,
  28. GUID * pGUID,
  29. UINT * pnData,
  30. PVOID * ppData);
  31. /*************************************************************************
  32. NAME: USER_DATA
  33. SYNOPSIS: This class is used internally by the Node Controller to
  34. contruct a user data list. Each entry is GUID based with
  35. binary data following that is uninterpreted by the
  36. Node Controller and T120.
  37. INTERFACE: USER_DATA(object ID)
  38. Construct the container for the list.
  39. ~USER_DATA_GUID()
  40. Destructor automatically releases data allocated.
  41. AddUserData()
  42. Add some user data to the list, keyed by a unique
  43. GUID. If the GUID is already in the list, then its
  44. data will be overwritten.
  45. GetUserData()
  46. Used in conjunction with GetNumUserData() to put the
  47. user data into a T120 request.
  48. GetNumUserData()
  49. See GetUserData().
  50. PARENT: None
  51. USES: None
  52. CAVEATS: 1) The user data binary information must fit in an unsigned
  53. short field, less the bytes for the GUID header and byte count.
  54. NOTES: None.
  55. HISTORY:
  56. 06/04/96 lens Created
  57. **************************************************************************/
  58. class CNCUserDataList : private CList
  59. {
  60. public:
  61. CNCUserDataList(void);
  62. ~CNCUserDataList(void);
  63. HRESULT AddUserData(GUID * pGUID, UINT nData, PVOID pData);
  64. HRESULT GetUserDataList(UINT * pnRecords, GCCUserData *** pppUserData);
  65. GCCUserData **GetUserData(void);
  66. GCCUserData *GetUserGUIDData(GUID * pGUID);
  67. void DeleteEntry(GUID * pGUID);
  68. private:
  69. BOOL Append(GCCUserData* pData) { return CList::Append((LPVOID) pData); }
  70. BOOL Remove(GCCUserData* pData) { return CList::Remove((LPVOID) pData); }
  71. GCCUserData* Iterate(void) { return (GCCUserData*) CList::Iterate(); }
  72. GCCUserData ** m_apUserData;
  73. };
  74. #endif /* ndef USERDATA_INC */