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.

87 lines
2.5 KiB

  1. // cuserdta.hpp
  2. // Data structure for managing user data.
  3. #ifndef USERDATA_INC
  4. #define USERDATA_INC
  5. #include <nmutil.h>
  6. #include <oblist.h>
  7. #include <confdbg.h>
  8. #include <confguid.h>
  9. extern "C"
  10. {
  11. #include <t120.h>
  12. }
  13. // GetUserData extracts user data from a T120 event message.
  14. // The caller passes in the T120 data structures and the GUID
  15. // associated with the user data, and receives back a pointer to
  16. // the buffer containing the user data.
  17. // This buffer will be invalidated by the user returning from
  18. // the event. If the user data consisted just
  19. // of the GUID, then *pnData == NULL and *ppData == NULL.
  20. HRESULT NMINTERNAL GetUserData(unsigned short nRecords,
  21. GCCUserData ** ppUserData,
  22. GUID * pGUID,
  23. unsigned short * pnData,
  24. PVOID * ppData);
  25. /*************************************************************************
  26. NAME: USER_DATA
  27. INTERFACE: USER_DATA(object ID)
  28. Construct the container for the list.
  29. ~USER_DATA_GUID()
  30. Destructor automatically releases data allocated.
  31. AddUserData()
  32. Add some user data to the list, keyed by a unique
  33. GUID. If the GUID is already in the list, then its
  34. data will be overwritten.
  35. GetUserData()
  36. Used in conjunction with GetNumUserData() to put the
  37. user data into a T120 request.
  38. GetNumUserData()
  39. See GetUserData().
  40. PARENT: None
  41. USES: None
  42. CAVEATS: 1) The user data binary information must fit in an unsigned
  43. short field, less the bytes for the GUID header and byte count.
  44. NOTES: None.
  45. HISTORY:
  46. 06/04/96 lens Created
  47. **************************************************************************/
  48. class USER_DATA_LIST : COBLIST
  49. {
  50. public:
  51. USER_DATA_LIST();
  52. ~USER_DATA_LIST();
  53. DWORD AddUserData(GUID * pGUID, unsigned short nData, PVOID pData);
  54. DWORD GetUserDataList(unsigned short * pnRecords,
  55. GCCUserData *** pppUserData);
  56. HRESULT GetUserData(REFGUID rguid, BYTE ** ppb, ULONG *pcb);
  57. inline unsigned short GetNumUserData(){return (numEntries);}
  58. void DeleteEntry(GUID * pGUID);
  59. private:
  60. void * RemoveAt(POSITION Position);
  61. BOOL Compare(void* pItemToCompare, void* pComparator);
  62. unsigned short numEntries;
  63. GCCUserData ** pUserDataArray;
  64. };
  65. #endif /* ndef USERDATA_INC */