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.

92 lines
3.0 KiB

  1. #include "resource.h" // main symbols
  2. #include "dplobby8.h"
  3. #define typedef__dxj_DirectPlayLobbyClient IDirectPlay8LobbyClient*
  4. /////////////////////////////////////////////////////////////////////////////
  5. // Direct Net Peer
  6. //REVIEW -- using pointers to ID's is necessary because some compilers don't like
  7. //references as template arguments.
  8. class C_dxj_DirectPlayLobbyClientObject :
  9. #ifdef USING_IDISPATCH
  10. public CComDualImpl<I_dxj_DirectPlayLobbyClient, &IID_I_dxj_DirectPlayLobbyClient, &LIBID_DIRECTLib>,
  11. public ISupportErrorInfo,
  12. #else
  13. public I_dxj_DirectPlayLobbyClient,
  14. #endif
  15. public CComObjectRoot
  16. {
  17. public:
  18. C_dxj_DirectPlayLobbyClientObject() ;
  19. virtual ~C_dxj_DirectPlayLobbyClientObject() ;
  20. BEGIN_COM_MAP(C_dxj_DirectPlayLobbyClientObject)
  21. COM_INTERFACE_ENTRY(I_dxj_DirectPlayLobbyClient)
  22. #ifdef USING_IDISPATCH
  23. COM_INTERFACE_ENTRY(IDispatch)
  24. COM_INTERFACE_ENTRY(ISupportErrorInfo)
  25. #endif
  26. END_COM_MAP()
  27. DECLARE_AGGREGATABLE(C_dxj_DirectPlayLobbyClientObject)
  28. #ifdef USING_IDISPATCH
  29. // ISupportsErrorInfo
  30. STDMETHOD(InterfaceSupportsErrorInfo)(REFIID riid);
  31. #endif
  32. // I_dxj_DirectPlayLobbyClient
  33. public:
  34. /* [hidden] */ HRESULT STDMETHODCALLTYPE InternalSetObject(
  35. /* [in] */ IUnknown __RPC_FAR *lpdd);
  36. /* [hidden] */ HRESULT STDMETHODCALLTYPE InternalGetObject(
  37. /* [retval][out] */ IUnknown __RPC_FAR *__RPC_FAR *lpdd);
  38. HRESULT STDMETHODCALLTYPE RegisterMessageHandler(I_dxj_DirectPlayLobbyEvent *lobbyEvent);
  39. HRESULT STDMETHODCALLTYPE GetCountLocalPrograms(BSTR GuidApplication,long *lCount);
  40. HRESULT STDMETHODCALLTYPE GetLocalProgram(long lProgID, DPL_APPLICATION_INFO_CDESC *app);
  41. HRESULT STDMETHODCALLTYPE ConnectApplication(DPL_CONNECT_INFO_CDESC *ConnectionInfo,long lTimeOut,long lFlags, long *hApplication);
  42. HRESULT STDMETHODCALLTYPE Send(long Target,SAFEARRAY **Buffer,long lBufferSize,long lFlags);
  43. HRESULT STDMETHODCALLTYPE ReleaseApplication(long Application);
  44. HRESULT STDMETHODCALLTYPE Close();
  45. HRESULT STDMETHODCALLTYPE UnRegisterMessageHandler();
  46. HRESULT STDMETHODCALLTYPE GetConnectionSettings(long hLobbyClient, long lFlags, DPL_CONNECTION_SETTINGS_CDESC *ConnectionSettings);
  47. HRESULT STDMETHODCALLTYPE SetConnectionSettings(long hTarget, long lFlags, DPL_CONNECTION_SETTINGS_CDESC *ConnectionSettings, I_dxj_DirectPlayAddress *HostAddress, I_dxj_DirectPlayAddress *Device);
  48. HRESULT STDMETHODCALLTYPE GetVBConnSettings(DPL_CONNECTION_SETTINGS *OldCon, DPL_CONNECTION_SETTINGS_CDESC *NewCon);
  49. ////////////////////////////////////////////////////////////////////////
  50. //
  51. // note: this is public for the callbacks
  52. DECL_VARIABLE(_dxj_DirectPlayLobbyClient);
  53. private:
  54. DPL_APPLICATION_INFO *m_ProgInfo;
  55. DWORD m_dwAppCount;
  56. BOOL m_fInit;
  57. HRESULT STDMETHODCALLTYPE GetProgs(GUID *guidApp);
  58. public:
  59. DX3J_GLOBAL_LINKS(_dxj_DirectPlayLobbyClient);
  60. DWORD InternalAddRef();
  61. DWORD InternalRelease();
  62. // We need these for our user data vars
  63. void *m_pUserData;
  64. DWORD m_dwUserDataSize;
  65. BOOL m_fHandleEvents;
  66. IStream *m_pEventStream;
  67. };