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.

105 lines
2.9 KiB

  1. /*
  2. IMSession.h
  3. */
  4. #ifndef __IMSESSION__
  5. #define __IMSESSION__
  6. #include "resource.h"
  7. #include "sessions.h"
  8. #include "mdispid.h"
  9. #include "wincrypt.h"
  10. #include "statusdlg.h"
  11. EXTERN_C const IID DIID_DMsgrSessionEvents;
  12. EXTERN_C const IID DIID_DMsgrSessionManagerEvents;
  13. EXTERN_C const IID LIBID_MsgrSessionManager;
  14. class CIMSession;
  15. #include "Shared.h"
  16. #include "sessevnt.h"
  17. #include "sessmgrevnt.h"
  18. #define IDC_IMSession 100
  19. class ATL_NO_VTABLE CIMSession :
  20. public CComObjectRootEx<CComSingleThreadModel>,
  21. public CComCoClass<CIMSession, &CLSID_IMSession>,
  22. public IDispatchImpl<IIMSession, &IID_IIMSession, &LIBID_RCBDYCTLLib>
  23. {
  24. public:
  25. CIMSession();
  26. ~CIMSession();
  27. DECLARE_REGISTRY_RESOURCEID(IDR_IMSESSION)
  28. DECLARE_PROTECT_FINAL_CONSTRUCT()
  29. BEGIN_COM_MAP(CIMSession)
  30. COM_INTERFACE_ENTRY(IIMSession)
  31. COM_INTERFACE_ENTRY(IDispatch)
  32. END_COM_MAP()
  33. public:
  34. STDMETHOD(put_OnSessionStatus)(/*[in]*/ IDispatch * pfn);
  35. STDMETHOD(HSC_Invite)(IDispatch *pUser);
  36. STDMETHOD(get_ReceivedUserTicket)(/*[out,retval]*/ BSTR* pNewTicket);
  37. STDMETHOD(GetLaunchingSession)(LONG lID);
  38. STDMETHOD(SendOutExpertTicket)(BSTR pbstrData);
  39. STDMETHOD(ProcessContext)(BSTR pContext);
  40. STDMETHOD(CloseRA)();
  41. STDMETHOD(get_User)(IDispatch** ppVal);
  42. STDMETHOD(Hook)(IMsgrSession*, HWND);
  43. STDMETHOD(Notify)(int);
  44. STDMETHOD(ContextDataProperty)(BSTR pName, BSTR* ppValue);
  45. STDMETHOD(get_IsInviter)(BOOL* pVal);
  46. STDMETHOD(UninitObjects)();
  47. public:
  48. IMsgrSessionManager* m_pSessMgr;
  49. IMsgrSession* m_pSessObj;
  50. IMsgrLock* m_pMsgrLockKey;
  51. IDispatch* m_pInvitee;
  52. CSessionMgrEvent* m_pSessionMgrEvent;
  53. BOOL m_bIsHSC;
  54. CComPtr<IDispatch> m_pfnSessionStatus;
  55. private:
  56. CComObject<CSessionEvent>* m_pSessionEvent;
  57. CComBSTR m_bstrSalemTicket;
  58. CComBSTR m_bstrContextData;
  59. BOOL m_bIsInviter;
  60. HCRYPTPROV m_hCryptProv;
  61. HCRYPTKEY m_hPublicKey;
  62. int m_iState;
  63. DWORD GetExchangeRegValue();
  64. BOOL m_bExchangeUser;
  65. CStatusDlg m_StatusDlg;
  66. public:
  67. CComBSTR m_bstrExpertTicket;
  68. HWND m_hWnd;
  69. BOOL m_bLocked;
  70. public:
  71. HRESULT InitCSP(BOOL bGenPublicKey=TRUE);
  72. HRESULT InitSessionEvent(IMsgrSession* pSessObj);
  73. HRESULT DoSessionStatus(int);
  74. HRESULT GetKeyExportString(HCRYPTKEY hKey, HCRYPTKEY hExKey, DWORD dwBlobType, BSTR* pBlob, DWORD *pdwCount);
  75. HRESULT ExtractSalemTicket(BSTR pContext);
  76. HRESULT BinaryToString(LPBYTE pBinBuf, DWORD dwLen, BSTR* pBlob, DWORD *pdwCount);
  77. HRESULT StringToBinary(BSTR pBlob, DWORD dwCount, LPBYTE *ppBuf, DWORD* pdwLen);
  78. HRESULT GenEncryptdNoviceBlob(BSTR pPublicKeyBlob, BSTR pSalemTicket, BSTR* pBlob);
  79. HRESULT InviterSendSalemTicket(BSTR pContext);
  80. HRESULT ProcessNotify(BSTR);
  81. HRESULT OnLockResult(BOOL, LONG);
  82. HRESULT OnLockChallenge(BSTR, LONG);
  83. HRESULT Invite(IDispatch*);
  84. };
  85. #endif // __IMSession__