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.

111 lines
4.6 KiB

  1. /*==========================================================================
  2. *
  3. * Copyright (C) 1999 Microsoft Corporation. All Rights Reserved.
  4. *
  5. * File: dvdxtran.h
  6. * Content: Definition of transport class providing DirectXVoice transport
  7. * through the IDirectXVoiceTransport interface.
  8. *
  9. * History:
  10. * Date By Reason
  11. * ==== == ======
  12. * 07/23/99 rodtoll Modified from dvdptran.h
  13. * 08/03/99 rodtoll Modified to conform to new base class and minor fixes
  14. * for dplay integration.
  15. * 11/23/99 rodtoll Split CheckForValid into Group and Player
  16. * 01/14/2000 rodtoll Renamed SendToID to SendToIDS and updated parameter list
  17. * to accept multiple targets.
  18. * rodtoll Added GetNumPlayers call
  19. * 03/28/2000 rodtoll Moved nametable from here to upper level classes
  20. * rodtoll Removed uneeded functions/members
  21. * 04/07/2000 rodtoll Updated to support new DP <--> DPV interface
  22. * rodtoll Updated to support no copy sends
  23. * rodtoll Bug #32179 - Prevent multiple client/server registrations on transport
  24. * 06/21/2000 rodtoll Bug #36820 - Host migrates to wrong client when client/server are on same interface
  25. * Condition exists where host sends leave message, client attempts to start new host
  26. * which fails because old host still registered. Now deregistering is two step
  27. * process DisableReceiveHook then DestroyTransport.
  28. *
  29. ***************************************************************************/
  30. #ifndef __DVDPTRANSPORT_H
  31. #define __DVDPTRANSPORT_H
  32. // CDirectVoiceDirectXTransport
  33. //
  34. // Implements the transport system using the IDirectXVoiceTransport
  35. // interface that will be implemented by both DirectPlay and
  36. // DirectNet.
  37. //
  38. // This class handles the interaction between an DirectPlayVoice engine
  39. // and the transport level.
  40. //
  41. volatile class CDirectVoiceDirectXTransport : public CDirectVoiceTransport
  42. {
  43. public:
  44. CDirectVoiceDirectXTransport( LPDIRECTPLAYVOICETRANSPORT lpTransport );
  45. ~CDirectVoiceDirectXTransport();
  46. HRESULT Initialize();
  47. public:
  48. HRESULT AddPlayerEntry( DVID dvidPlayer, LPVOID lpData );
  49. HRESULT DeletePlayerEntry( DVID dvidPlayer );
  50. HRESULT GetPlayerEntry( DVID dvidPlayer, CVoicePlayer **lplpPlayer );
  51. HRESULT MigrateHost( DVID dvidNewHost );
  52. DWORD GetMaxPlayers( );
  53. inline LPDIRECTPLAYVOICETRANSPORT GetTransportInterface( ) { return m_lpTransport; };
  54. DVID GetLocalID();
  55. inline DVID GetServerID() { return m_dpidServer; };
  56. public:
  57. HRESULT SendToServer( PDVTRANSPORT_BUFFERDESC pBufferDesc, LPVOID pvContext, DWORD dwFlags );
  58. HRESULT SendToAll( PDVTRANSPORT_BUFFERDESC pBufferDesc, LPVOID pvContext, DWORD dwFlags );
  59. HRESULT SendToIDS( UNALIGNED DVID * pdvidTargets, DWORD dwNumTargets, PDVTRANSPORT_BUFFERDESC pBufferDesc, LPVOID pvContext, DWORD dwFlags );
  60. public: // Remote Server Synchronization functions
  61. HRESULT CreateGroup( LPDVID dvidGroup );
  62. HRESULT DeleteGroup( DVID dvidGroup );
  63. HRESULT AddPlayerToGroup( LPDVID dvidGroup, DVID dvidPlayer );
  64. HRESULT RemovePlayerFromGroup( DVID dvidGroup, DVID dvidPlayer );
  65. BOOL ConfirmValidEntity( DVID dvid );
  66. BOOL ConfirmValidGroup( DVID dvid );
  67. BOOL ConfirmLocalHost( );
  68. BOOL ConfirmSessionActive();
  69. BOOL IsPlayerInGroup( DVID dvidGroup, DVID dvidPlayer );
  70. HRESULT GetTransportSettings( LPDWORD lpdwSessionType, LPDWORD lpdwFlags );
  71. HRESULT EnableReceiveHook( LPDIRECTVOICEOBJECT dvObject, DWORD dwObjectType );
  72. HRESULT DisableReceiveHook( );
  73. HRESULT WaitForDetachCompletion( );
  74. void DestroyTransport( );
  75. // Debug / Test Only
  76. //HRESULT SetInfo( DPID dpidServer, DPID dpidClient );
  77. protected:
  78. HRESULT SendHelper( UNALIGNED DVID * pdvidTargets, DWORD dwNumTargets, PDVTRANSPORT_BUFFERDESC pBufferDesc, PVOID pvContext, DWORD dwFlags );
  79. protected:
  80. LPDIRECTPLAYVOICETRANSPORT m_lpTransport; // Transport interface
  81. DPID m_dpidServer; // DPID of the session host
  82. BOOL m_bLocalServer; // Is the host on same interface as the client
  83. BOOL m_bActiveSession; // Is there a session active on the transport
  84. DWORD m_dwTransportFlags; // Flags describing the session
  85. CDirectVoiceEngine *m_lpVoiceEngine; // Engine this transport is working for
  86. DWORD m_dwMaxPlayers; // Maximum # of players this session can have
  87. BOOL m_initialized; // Has this object been initialized?
  88. DVTRANSPORTINFO m_dvTransportInfo; // Information about the transport
  89. DPID m_dpidLocalPlayer; // DPID of the local client
  90. DWORD m_dwDuumy;
  91. DWORD m_dwObjectType;
  92. BOOL m_fAdvised;
  93. std::map<DWORD,LPVOID>::iterator m_mPlayerIterator;
  94. };
  95. #endif