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.

111 lines
3.5 KiB

  1. #ifndef __h323ics_h323asn1_h
  2. #define __h323ics_h323asn1_h
  3. #include "q931msg.h"
  4. DWORD H225EncodePdu (
  5. IN DWORD PduType,
  6. IN PVOID PduStructure,
  7. OUT PUCHAR * ReturnBuffer,
  8. OUT PDWORD ReturnBufferLength);
  9. DWORD H225DecodePdu (
  10. IN PUCHAR Buffer,
  11. IN DWORD BufferLength,
  12. IN DWORD PduType,
  13. OUT PVOID * ReturnPduStructure);
  14. DWORD H225FreePdu (
  15. IN DWORD PduType,
  16. IN PVOID PduStructure);
  17. DWORD H225FreeBuffer (
  18. IN PUCHAR Buffer);
  19. DWORD H245EncodePdu (
  20. IN DWORD PduType,
  21. IN PVOID PduStructure,
  22. OUT PUCHAR * ReturnBuffer,
  23. OUT PDWORD ReturnBufferLength);
  24. DWORD H245DecodePdu (
  25. IN PUCHAR Buffer,
  26. IN DWORD BufferLength,
  27. IN DWORD PduType,
  28. OUT PVOID * ReturnPduStructure);
  29. DWORD H245FreePdu (
  30. IN DWORD PduType,
  31. IN PVOID PduStructure);
  32. DWORD H245FreeBuffer (
  33. IN PUCHAR Buffer);
  34. // These macros define declarations for inline functions.
  35. // This provides type safety when encoding and decoding certain PDUs.
  36. #define DECLARE_CODER_FUNCS(MODULE,STRUCTURE) \
  37. /* static */ __inline DWORD MODULE ## EncodePdu_ ## STRUCTURE \
  38. (STRUCTURE * PduStructure, OUT PUCHAR * ReturnBuffer, OUT PDWORD ReturnBufferLength) \
  39. { return MODULE ## EncodePdu (STRUCTURE ## _PDU, PduStructure, ReturnBuffer, ReturnBufferLength); } \
  40. /* static */ __inline DWORD MODULE ## DecodePdu_ ## STRUCTURE \
  41. (IN PUCHAR Buffer, IN DWORD BufferLength, OUT STRUCTURE ** ReturnPduStructure) \
  42. { return MODULE ## DecodePdu (Buffer, BufferLength, STRUCTURE ## _PDU, (PVOID *) ReturnPduStructure); } \
  43. /* static */ __inline DWORD MODULE ## FreePdu_ ## STRUCTURE \
  44. (IN STRUCTURE * PduStructure) \
  45. { return MODULE ## FreePdu (STRUCTURE ## _PDU, PduStructure); }
  46. DECLARE_CODER_FUNCS (H225, RasMessage)
  47. DECLARE_CODER_FUNCS (H225, H323_UserInformation)
  48. DECLARE_CODER_FUNCS (H245, MultimediaSystemControlMessage)
  49. void H323ASN1Initialize (void);
  50. void H323ASN1Shutdown (void);
  51. HRESULT EncodeQ931PDU(
  52. IN Q931_MESSAGE *pQ931msg,
  53. IN H323_UserInformation *pUserInformation,
  54. OUT BYTE **ppReturnEncodedData,
  55. OUT DWORD *pReturnEncodedDataLength
  56. );
  57. HRESULT EncodeH245PDU(
  58. IN MultimediaSystemControlMessage &rH245pdu,
  59. OUT BYTE **ppReturnEncodedData,
  60. OUT DWORD *pReturnEncodedDataLength);
  61. HRESULT DecodeQ931PDU(
  62. IN BYTE *pbData,
  63. IN DWORD dwDataLen,
  64. OUT Q931_MESSAGE **ppReturnQ931msg,
  65. OUT H323_UserInformation **ppReturnH323UserInfo);
  66. HRESULT DecodeH245PDU(
  67. IN LPBYTE Data,
  68. IN DWORD DataLength,
  69. OUT MultimediaSystemControlMessage **ppReturnH245pdu);
  70. HRESULT Q931EncodeCallProceedingMessage(
  71. IN WORD CallRefVal,
  72. IN OUT Q931_MESSAGE *pReturnQ931msg,
  73. IN OUT H323_UserInformation *pReturnH323UserInfo);
  74. HRESULT Q931EncodeReleaseCompleteMessage(
  75. IN WORD CallRefVal,
  76. IN OUT Q931_MESSAGE *pReturnQ931msg,
  77. IN OUT H323_UserInformation *pReturnH323UserInfo);
  78. // These functions should only be used for PDU structures generated
  79. // using the decode functions.
  80. // If you allocate the PDU structures yourself (for eg. CallProceeding PDU)
  81. // then you need to free it yourself depending on how you allocated the
  82. // structure.
  83. void FreeQ931PDU(
  84. IN Q931_MESSAGE *pQ931msg,
  85. IN H323_UserInformation *pH323UserInformation);
  86. void FreeH245PDU(
  87. MultimediaSystemControlMessage *pH245pdu);
  88. #endif // __h323ics_h323asn1_h