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.

194 lines
5.2 KiB

  1. #ifndef _T120_APPLET_H_
  2. #define _T120_APPLET_H_
  3. #include "iapplet.h"
  4. #include <it120app.h>
  5. #include "resource.h"
  6. class CNmAppletObj;
  7. class CNmAppletSession : public IAppletSession
  8. {
  9. public:
  10. CNmAppletSession(CNmAppletObj *, IT120AppletSession *, BOOL fAutoJoin = FALSE);
  11. ~CNmAppletSession(void);
  12. /* ------ IUnknown ------ */
  13. STDMETHODIMP QueryInterface(REFIID iid, void **ppv);
  14. STDMETHODIMP_(ULONG) AddRef(void);
  15. STDMETHODIMP_(ULONG) Release(void);
  16. /* ------ Basic Info ------ */
  17. STDMETHODIMP GetConfID(AppletConfID *pnConfID);
  18. STDMETHODIMP IsThisNodeTopProvider(BOOL *pfTopProvider);
  19. /* ------ Join Conference ------ */
  20. STDMETHODIMP Join(IN AppletSessionRequest *pRequest);
  21. STDMETHODIMP Leave(void);
  22. /* ------ Send Data ------ */
  23. STDMETHODIMP SendData(BOOL fUniformSend,
  24. AppletChannelID nChannelID,
  25. AppletPriority ePriority,
  26. ULONG cbBufSize,
  27. BYTE *pBuffer); // size_is(cbBufSize)
  28. /* ------ Invoke Applet ------ */
  29. STDMETHODIMP InvokeApplet(AppletRequestTag *pnReqTag,
  30. AppletProtocolEntity *pAPE,
  31. ULONG cNodes,
  32. AppletNodeID aNodeIDs[]); // size_is(cNodes)
  33. /* ------ Inquiry ------ */
  34. STDMETHODIMP InquireRoster(AppletSessionKey *pSessionKey);
  35. /* ------ Registry Services ------ */
  36. STDMETHODIMP RegistryRequest(AppletRegistryRequest *pRequest);
  37. /* ------ Channel Services ------ */
  38. STDMETHODIMP ChannelRequest(AppletChannelRequest *pRequest);
  39. /* ------ Token Services ------ */
  40. STDMETHODIMP TokenRequest(AppletTokenRequest *pRequest);
  41. /* ------ Notification registration / unregistration------ */
  42. STDMETHODIMP Advise(IAppletSessionNotify *pNotify, DWORD *pdwCookie);
  43. STDMETHODIMP UnAdvise(DWORD dwCookie);
  44. void T120Callback(T120AppletSessionMsg *);
  45. private:
  46. LONG m_cRef;
  47. CNmAppletObj *m_pApplet;
  48. IT120AppletSession *m_pT120Session;
  49. T120JoinSessionRequest *m_pT120SessReq;
  50. IAppletSessionNotify *m_pNotify;
  51. CNmAppletSession *m_pSessionObj;
  52. BOOL m_fAutoJoin;
  53. };
  54. class ATL_NO_VTABLE CNmAppletObj :
  55. public CComObjectRootEx<CComSingleThreadModel>,
  56. public CComCoClass<CNmAppletObj, &CLSID_NmApplet>,
  57. public IApplet
  58. {
  59. public:
  60. CNmAppletObj(void);
  61. ~CNmAppletObj(void);
  62. public:
  63. DECLARE_REGISTRY_RESOURCEID(IDR_NMAPPLET)
  64. DECLARE_NOT_AGGREGATABLE(CNmAppletObj)
  65. BEGIN_COM_MAP(CNmAppletObj)
  66. COM_INTERFACE_ENTRY(IApplet)
  67. END_COM_MAP()
  68. /* ------ Initialization ------ */
  69. STDMETHODIMP Initialize(void);
  70. /* ------ Auto Join ------ */
  71. STDMETHODIMP RegisterAutoJoin(AppletSessionRequest *pRequest);
  72. STDMETHODIMP UnregisterAutoJoin(void);
  73. /* ------ Session ------ */
  74. STDMETHODIMP CreateSession(IAppletSession **ppSession, AppletConfID nConfID);
  75. /* ------ Notification registration / unregistration------ */
  76. STDMETHODIMP Advise(IAppletNotify *pNotify, DWORD *pdwCookie);
  77. STDMETHODIMP UnAdvise(DWORD dwCookie);
  78. void T120Callback(T120AppletMsg *);
  79. private:
  80. LONG m_cRef;
  81. IT120Applet *m_pT120Applet;
  82. T120JoinSessionRequest *m_pT120AutoJoinReq;
  83. IAppletNotify *m_pNotify;
  84. CNmAppletObj *m_pAppletObj;
  85. T120ConfID m_nPendingConfID;
  86. };
  87. HRESULT GetHrResult(T120Result rc);
  88. AppletReason GetAppletReason(T120Reason rc);
  89. T120JoinSessionRequest * AllocateJoinSessionRequest(AppletSessionRequest *);
  90. void FreeJoinSessionRequest(T120JoinSessionRequest *);
  91. BOOL ConvertCollapsedCaps(T120AppCap ***papDst, AppletCapability **apSrc, ULONG cItems);
  92. void FreeCollapsedCaps(T120AppCap **apDst, ULONG cItems);
  93. BOOL DuplicateCollapsedCap(T120AppCap *pDst, T120AppCap *pSrc);
  94. void FreeCollapsedCap(T120AppCap *pDst);
  95. BOOL DuplicateCapID(T120CapID *pDst, T120CapID *pSrc);
  96. void FreeCapID(T120CapID *pDst);
  97. BOOL ConvertNonCollapsedCaps(T120NonCollCap ***papDst, AppletCapability2 **apSrc, ULONG cItems);
  98. void FreeNonCollapsedCaps(T120NonCollCap **apDst, ULONG cItems);
  99. BOOL DuplicateNonCollapsedCap(T120NonCollCap *pDst, T120NonCollCap *pSrc);
  100. void FreeNonCollapsedCap(T120NonCollCap *pDst);
  101. BOOL DuplicateRegistryKey(T120RegistryKey *pDst, T120RegistryKey *pSrc);
  102. void FreeRegistryKey(T120RegistryKey *pDst);
  103. BOOL DuplicateSessionKey(T120SessionKey *pDst, T120SessionKey *pSrc);
  104. void FreeSessionKey(T120SessionKey *pDst);
  105. BOOL DuplicateObjectKey(T120ObjectKey *pDst, T120ObjectKey *pSrc);
  106. void FreeObjectKey(T120ObjectKey *pDst);
  107. BOOL DuplicateOSTR(OSTR *pDst, OSTR *pSrc);
  108. void FreeOSTR(OSTR *pDst);
  109. void AppletRegistryRequestToT120One(AppletRegistryRequest *, T120RegistryRequest *);
  110. #ifdef _DEBUG
  111. void CheckStructCompatible(void);
  112. #else
  113. #define CheckStructCompatible()
  114. #endif
  115. #endif // _T120_APPLET_H_
  116.