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.

96 lines
4.1 KiB

  1. /*==========================================================================
  2. *
  3. * Copyright (C) 1999 Microsoft Corporation. All Rights Reserved.
  4. *
  5. * File: dvtransport.h
  6. * Content: Base class for dp/dnet abstraction
  7. *
  8. * History:
  9. * Date By Reason
  10. * ==== == ======
  11. * 07/06/99 rodtoll Created It
  12. * 07/22/99 rodtoll Updated to reflect new player table routines
  13. * 07/23/99 rodtoll Added group membership checks and player id retrieval
  14. * 07/26/99 rodtoll Modified EnableReceiveHook for use with new interfaces
  15. * 08/03/99 rodtoll Changed abstraction for new init order
  16. * 11/23/99 rodtoll Split CheckForValid into Group and Player
  17. * 01/14/2000 rodtoll Renamed SendToID to SendToIDS and updated parameter list
  18. * to accept multiple targets.
  19. * rodtoll Added GetNumPlayers call
  20. * 03/28/2000 rodtoll Moved nametable from here to upper level classes
  21. * rodtoll Updated Advise to have interface specify if it's a client or server when advising/unadvising
  22. * 04/07/2000 rodtoll Bug #32179 - Registering more then one server/and/or/client
  23. * rodtoll Updated sends to take new buffer descs for no copy sends
  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. * 07/22/20000 rodtoll Bug #40296, 38858 - Crashes due to shutdown race condition
  29. * Now ensures that all threads from transport have left and that
  30. * all notificatinos have been processed before shutdown is complete.
  31. * 01/22/2001 rodtoll WINBUG #288437 - IA64 Pointer misalignment due to wire packets
  32. *
  33. ***************************************************************************/
  34. #ifndef __DVTRANSPORT_H
  35. #define __DVTRANSPORT_H
  36. class CDirectVoiceEngine;
  37. class CVoicePlayer;
  38. class CDirectVoiceTransport;
  39. struct DIRECTVOICEOBJECT;
  40. // CDirectVoiceTransport
  41. //
  42. // Abstracts the transport system so that the sends and group management
  43. // features of DPlay/DirectNet are indpendent.
  44. class CDirectVoiceTransport
  45. {
  46. // Voice player table management
  47. public:
  48. CDirectVoiceTransport(): m_lRefCount(0) {};
  49. virtual ~CDirectVoiceTransport() {};
  50. inline void Release() { InterlockedDecrement( &m_lRefCount ); };
  51. inline void AddRef() { InterlockedIncrement( &m_lRefCount ); };
  52. virtual HRESULT AddPlayerEntry( DVID dvidPlayer, LPVOID lpData ) = 0;
  53. virtual HRESULT DeletePlayerEntry( DVID dvidPlayer ) = 0;
  54. virtual HRESULT GetPlayerEntry( DVID dvidPlayer, CVoicePlayer **lplpPlayer ) = 0;
  55. virtual HRESULT Initialize() = 0;
  56. virtual HRESULT MigrateHost( DVID dvidNewHost ) = 0;
  57. virtual DVID GetLocalID() = 0;
  58. virtual DVID GetServerID() = 0;
  59. public:
  60. virtual HRESULT SendToServer( PDVTRANSPORT_BUFFERDESC pBufferDesc, LPVOID pvContext, DWORD dwFlags ) = 0;
  61. virtual HRESULT SendToAll( PDVTRANSPORT_BUFFERDESC pBufferDesc, LPVOID pvContext, DWORD dwFlags ) = 0;
  62. virtual HRESULT SendToIDS( UNALIGNED DVID * pdvidTargets, DWORD dwNumTargets, PDVTRANSPORT_BUFFERDESC pBufferDesc, LPVOID pvContext, DWORD dwFlags ) = 0;
  63. virtual DWORD GetMaxPlayers( )= 0;
  64. public: // Remote Server Synchronization functions
  65. virtual HRESULT CreateGroup( LPDVID dvidGroup ) = 0;
  66. virtual HRESULT DeleteGroup( DVID dvidGroup ) = 0;
  67. virtual HRESULT AddPlayerToGroup( LPDVID dvidGroup, DVID dvidPlayer ) = 0;
  68. virtual HRESULT RemovePlayerFromGroup( DVID dvidGroup, DVID dvidPlayer ) = 0;
  69. public: // Hooks into the transport
  70. virtual BOOL IsPlayerInGroup( DVID dvidGroup, DVID dvidPlayer ) = 0;
  71. virtual BOOL ConfirmValidEntity( DVID dvid ) = 0;
  72. virtual BOOL ConfirmValidGroup( DVID dvid ) = 0;
  73. virtual HRESULT EnableReceiveHook( DIRECTVOICEOBJECT *dvObject, DWORD dwObjectType ) = 0;
  74. virtual HRESULT DisableReceiveHook( ) = 0;
  75. virtual HRESULT WaitForDetachCompletion() = 0;
  76. virtual void DestroyTransport() = 0;
  77. virtual BOOL ConfirmLocalHost( ) = 0;
  78. virtual BOOL ConfirmSessionActive( ) = 0;
  79. virtual HRESULT GetTransportSettings( LPDWORD lpdwSessionType, LPDWORD lpdwFlags ) = 0;
  80. public:
  81. LONG m_lRefCount;
  82. };
  83. #endif