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.

502 lines
22 KiB

  1. /*==========================================================================
  2. *
  3. * Copyright (C) 1999 Microsoft Corporation. All Rights Reserved.
  4. *
  5. * File: dvclientengine.h
  6. * Content: Definition of class for DirectXVoice Client
  7. *
  8. * History:
  9. * Date By Reason
  10. * ==== == ======
  11. * 07/06/99 rodtoll Created it
  12. * 07/21/99 rodtoll Added flags field to entity data
  13. * 07/26/99 rodtoll Updated to support IDirectXVoiceNotify interface
  14. * 08/25/99 rodtoll General Cleanup/Modifications to support new
  15. * compression sub-system.
  16. * 08/30/99 rodtoll Added additional members to handle connect/disconnect timeout
  17. * 08/31/99 rodtoll Added new handle for new disconnect procedure
  18. * 09/03/99 rodtoll Re-work of playback core to support mixing to multiple buffers
  19. * for 3d support.
  20. * Re-worked playback to use position instead of notifications
  21. * allows for simpler handling of high CPU and 3d support
  22. * Implemented CreateUserBuffer/DeleteUserBuffer
  23. * 09/14/99 rodtoll Added members to support new notify masks
  24. * rodtoll Added CheckShouldSendMessage
  25. * rodtoll Added SendPlayerLevels
  26. * rodtoll Updated initialize for new parameters
  27. * rodtoll Added SetNotifyMask function
  28. * 09/18/99 rodtoll Added HandleThreadError to be called when an internal thread dies.
  29. * 09/27/99 rodtoll Added playback volume control
  30. * rodtoll Added reduction of playback volume when transmitting
  31. * 09/28/99 rodtoll Double notifications of local client when host migrates fixed.
  32. * rodtoll Added queue for notifications, notifications are added to the queue and
  33. * then signalled by the notify thread. (Prevents problems caused by notify
  34. * handlers taking a long time to return).
  35. * 09/29/99 pnewson Major AGC overhaul
  36. * 10/19/99 rodtoll Fix: Bug #113904 Shutdown Issues
  37. * Added handler for SESSIONLOST messages
  38. * 10/29/99 rodtoll Bug #113726 - Integrate Voxware Codecs, updating to use new
  39. * pluggable codec architecture.
  40. * 11/12/99 rodtoll Updated to use new playback and record classes and remove
  41. * old playback/record system. (Includes new waveIn/waveOut support)
  42. * rodtoll Updated to support new recording thread
  43. * rodtoll Added new echo suppression code
  44. * 11/17/99 rodtoll Fix: Bug #117177 - Calling Connect w/o voice session never returns
  45. * 11/23/99 rodtoll Updated Initialize/SetNotifyMask so error checking behaviour is consistant
  46. * 12/16/99 rodtoll Bug #117405 - 3D Sound APIs misleading - 3d sound apis renamed
  47. * The Delete3DSoundBuffer was re-worked to match the create
  48. * rodtoll Bug #122629 - Host migration broken in unusual configurations
  49. * Implemented new host migration scheme
  50. * 01/10/00 pnewson AGC and VA tuning
  51. * 01/14/2000 rodtoll Updated for new Set/GetTransmit target parameters
  52. * rodtoll Updated to support multiple targets
  53. * rodtoll Updated for new notification queueing
  54. * rodtoll Added FPM for handling notification memory
  55. * 01/21/00 rodtoll Bug #128897 - Disconnect timeout broken
  56. * 01/24/2000 rodtoll Bug #129427: Calling Destroy3DSoundBuffer for player who has
  57. * already disconnected resulted in an incorrect DVERR_NOTBUFFERED
  58. * error code.
  59. * 01/27/2000 rodtoll Bug #129934 - Update Create3DSoundBuffer to take DSBUFFERDESC
  60. * 02/17/2000 rodtoll Bug #133691 - Choppy audio - queue was not adapting
  61. * Added instrumentation
  62. * 03/28/2000 rodtoll Re-wrote nametable handling and locking -- more scalable
  63. * 03/29/2000 rodtoll Bug #30957 - Made conversion quality setting optional
  64. * rodtoll Bug #30753 - Added volatile to the class definition
  65. * 04/07/2000 rodtoll Bug #32179 - Prevent registration of > 1 interface
  66. * rodtoll Updated to use no copy sends, so handles pooling frames to be sent, proper
  67. * pulling of frames from pools and returns.
  68. * 05/17/2000 rodtoll Bug #35110 Simultaneous playback of 2 voices results in distorted playback
  69. * 06/21/2000 rodtoll Bug #35767 - Implement ability for Dsound effects processing if dpvoice buffers
  70. * Updated Connect and Create3DSoundBuffer to take buffers instead of descriptions
  71. * rodtoll Bug #36820 - Host migrates to wrong client when server is shut down before host's client disconnects
  72. * Caused because client attempts to register new server when there is one already
  73. * rodtoll Bug #37045 - Race conditions prevent acknowledgement of new host
  74. * Added send when new host is elected of settingsconfirm message
  75. * 06/27/2000 rodtoll Fixed window where outstanding sends being returned after we have deregistered
  76. * Voice now waits for all outstanding voice sends to complete before shutting down
  77. * rodtoll Added COM abstraction
  78. * 07/09/2000 rodtoll Added signature bytes
  79. * 07/12/2000 rodtoll Bug #39117 - Access violation while running VoicePosition. Several issues:
  80. * - Allow Destroy3DBuffer during disconnect
  81. * - Move nametable cleanup to before freesoundbufferlist
  82. * - Fixed code so always remove from list on DeleteSoundTarget
  83. * - Removed unneeded logic
  84. * 07/22/20000 rodtoll Bug #40296, 38858 - Crashes due to shutdown race condition
  85. * Now ensures that all threads from transport have left and that
  86. * all notificatinos have been processed before shutdown is complete.
  87. * 11/16/2000 rodtoll Bug #40587 - DPVOICE: Mixing server needs to use multi-processors
  88. * 01/26/2001 rodtoll WINBUG #293197 - DPVOICE: [STRESS} Stress applications cannot tell difference between out of memory and internal errors.
  89. * Remap DSERR_OUTOFMEMORY to DVERR_OUTOFMEMORY instead of DVERR_SOUNDINITFAILURE.
  90. * Remap DSERR_ALLOCATED to DVERR_PLAYBACKSYSTEMERROR instead of DVERR_SOUNDINITFAILURE.
  91. * 04/06/2001 kareemc Added Voice Defense
  92. * 04/11/2001 rodtoll WINBUG #221494 DPVOICE: Capped the # of queued recording events to prevent multiple wakeups resulting in false lockup
  93. * detection
  94. * 02/25/2002 rodtoll WINBUG #550009 - SECURITY: DPVOICE: Potential corruption of voice client state
  95. * - Harden receive pathways: i.e. confirm message sources from server, confirm message makes
  96. * sense w.r.t session settings, tighten validation, prevent duplicate disconnects from executing.
  97. * rodtoll WINBUG #550124 - SECURITY: DPVOICE: Shared memory region with NULL DACL
  98. * - Pull statistics exporting code
  99. * 06/13/2002 simonpow BUG #59944 Switched over to using Threadpool based timers rather than multimedia
  100. ***************************************************************************/
  101. #ifndef __DVCLIENTENGINE_H
  102. #define __DVCLIENTENGINE_H
  103. #define DVCSTATE_NOTINITIALIZED 0x00000000
  104. #define DVCSTATE_IDLE 0x00000001
  105. #define DVCSTATE_CONNECTING 0x00000002
  106. #define DVCSTATE_CONNECTED 0x00000003
  107. #define DVCSTATE_DISCONNECTING 0x00000004
  108. #define DVCECHOSTATE_IDLE 0x00000000
  109. #define DVCECHOSTATE_RECORDING 0x00000001
  110. #define DVCECHOSTATE_PLAYBACK 0x00000002
  111. struct DIRECTVOICECLIENTOBJECT;
  112. // Size in bytes of the fixed size elements
  113. #define DV_CLIENT_NOTIFY_ELEMENT_SIZE 16
  114. // Wakeup multiplier -- how many times / time we're supposed
  115. // to wakeup should we actually wake up
  116. #define DV_CLIENT_WAKEUP_MULTIPLER 4
  117. #if defined(DEBUG) || defined(DBG)
  118. #define CHECKLISTINTEGRITY CheckListIntegrity
  119. #else
  120. #define CHECKLISTINTEGRITY()
  121. #endif
  122. // CDirectVoiceClientEngine
  123. //
  124. // This class represents the IDirectXVoiceClient interface.
  125. //
  126. // The class is thread safe except for construction and
  127. // destruction. The class is protected with a Multiple-Reader
  128. // Single-Write lock.
  129. //
  130. #define VSIG_CLIENTENGINE 'ELCV'
  131. #define VSIG_CLIENTENGINE_FREE 'ELC_'
  132. //
  133. volatile class CDirectVoiceClientEngine: public CDirectVoiceEngine
  134. {
  135. protected:
  136. typedef enum { NOTIFY_FIXED, // Structure stored in fixed
  137. NOTIFY_DYNAMIC // Memory allocated in dynamic
  138. } ElementType;
  139. struct CNotifyElement
  140. {
  141. typedef VOID (*PNOTIFY_COMPLETE)(PVOID pvContext, CNotifyElement *pElement);
  142. DWORD m_dwType;
  143. union _Element
  144. {
  145. struct
  146. {
  147. LPVOID m_lpData;
  148. } dynamic;
  149. struct
  150. {
  151. BYTE m_bFixedHolder[DV_CLIENT_NOTIFY_ELEMENT_SIZE];
  152. } fixed;
  153. } m_element;
  154. DWORD m_dwDataSize;
  155. ElementType m_etElementType;
  156. PVOID pvContext;
  157. PNOTIFY_COMPLETE pNotifyFunc;
  158. CNotifyElement *m_lpNext;
  159. };
  160. struct TimerHandlerParam
  161. {
  162. HANDLE hPlaybackTimerEvent;
  163. volatile LONG lPlaybackCount;
  164. HANDLE hRecordTimerEvent;
  165. DNCRITICAL_SECTION csPlayCount;
  166. };
  167. public:
  168. CDirectVoiceClientEngine( DIRECTVOICECLIENTOBJECT *lpObject );
  169. ~CDirectVoiceClientEngine();
  170. public: // IDirectXVoiceClient Interface
  171. HRESULT Connect( LPDVSOUNDDEVICECONFIG lpSoundDeviceConfig, LPDVCLIENTCONFIG lpClientConfig, DWORD dwFlags );
  172. HRESULT Disconnect( DWORD dwFlags );
  173. HRESULT GetSessionDesc( LPDVSESSIONDESC lpSessionDescBuffer );
  174. HRESULT GetClientConfig( LPDVCLIENTCONFIG lpClientConfig );
  175. HRESULT SetClientConfig( LPDVCLIENTCONFIG lpClientConfig );
  176. HRESULT GetCaps( LPDVCAPS lpCaps );
  177. HRESULT GetCompressionTypes( LPVOID lpBuffer, LPDWORD lpdwSize, LPDWORD lpdwNumElements, DWORD dwFlags );
  178. HRESULT SetTransmitTarget( PDVID dvidTarget, DWORD dwNumTargets, DWORD dwFlags );
  179. HRESULT GetTransmitTarget( LPDVID lpdvidTargets, PDWORD pdwNumElements, DWORD dwFlags );
  180. HRESULT Create3DSoundBuffer( DVID dvidID, LPDIRECTSOUNDBUFFER lpdsBufferDesc, DWORD dwPriority, DWORD dwFlags, LPDIRECTSOUND3DBUFFER *lpBuffer );
  181. HRESULT Delete3DSoundBuffer( DVID dvidID, LPDIRECTSOUND3DBUFFER *lpBuffer );
  182. HRESULT SetNotifyMask( LPDWORD lpdwMessages, DWORD dwNumElements );
  183. HRESULT GetSoundDeviceConfig( PDVSOUNDDEVICECONFIG pSoundDeviceConfig, PDWORD pdwBufferSize );
  184. public: // CDirectVoiceEngine Members
  185. HRESULT Initialize( CDirectVoiceTransport *lpTransport, LPDVMESSAGEHANDLER lpdvHandler, LPVOID lpUserContext, LPDWORD lpdwMessages, DWORD dwNumElements );
  186. BOOL ReceiveSpeechMessage( DVID dvidSource, LPVOID lpMessage, DWORD dwSize );
  187. HRESULT StartTransportSession();
  188. HRESULT StopTransportSession();
  189. HRESULT AddPlayer( DVID dvID );
  190. HRESULT RemovePlayer( DVID dvID );
  191. HRESULT CreateGroup( DVID dvID );
  192. HRESULT DeleteGroup( DVID dvID );
  193. HRESULT AddPlayerToGroup( DVID dvidGroup, DVID dvidPlayer );
  194. HRESULT RemovePlayerFromGroup( DVID dvidGroup, DVID dvidPlayer );
  195. HRESULT MigrateHost( DVID dvidNewHost, LPDIRECTPLAYVOICESERVER lpdvServer );
  196. HRESULT MigrateHost_RunElection();
  197. inline DWORD GetCurrentState() const { return m_dwCurrentState; };
  198. BOOL InitClass();
  199. public: // packet validation
  200. inline static BOOL ValidateSessionType( DWORD dwSessionType );
  201. inline static BOOL ValidateSessionFlags( DWORD dwFlags );
  202. inline static BOOL ValidatePlayerFlags( DWORD dwFlags );
  203. inline static BOOL ValidatePlayerDVID( DVID dvid );
  204. inline BOOL ValidatePacketType( const DVPROTOCOLMSG_FULLMESSAGE* lpdvFullMessage ) const;
  205. protected: // Message handlers
  206. HRESULT InternalSetNotifyMask( LPDWORD lpdwMessages, DWORD dwNumElements );
  207. BOOL InternalCreateVoicePlayer( DVID dvidSource, PDVPROTOCOLMSG_PLAYERJOIN lpdvCreatePlayer, DWORD dwSize );
  208. BOOL QueueSpeech( DVID dvidSource, PDVPROTOCOLMSG_SPEECHHEADER pdvSpeechHeader, PBYTE pbData, DWORD dwSize );
  209. BOOL HandleConnectRefuse( DVID dvidSource, PDVPROTOCOLMSG_CONNECTREFUSE lpdvConnectRefuse, DWORD dwSize );
  210. BOOL HandleCreateVoicePlayer( DVID dvidSource, PDVPROTOCOLMSG_PLAYERJOIN lpdvCreatePlayer, DWORD dwSize );
  211. BOOL HandleDeleteVoicePlayer( DVID dvidSource, PDVPROTOCOLMSG_PLAYERQUIT lpdvDeletePlayer, DWORD dwSize );
  212. BOOL HandleSpeech( DVID dvidSource, PDVPROTOCOLMSG_SPEECHHEADER lpdvSpeech, DWORD dwSize );
  213. BOOL HandleSpeechWithFrom( DVID dvidSource, PDVPROTOCOLMSG_SPEECHWITHFROM lpdvSpeech, DWORD dwSize );
  214. BOOL HandleSpeechBounce( DVID dvidSource, PDVPROTOCOLMSG_SPEECHHEADER lpdvSpeech, DWORD dwSize );
  215. BOOL HandleConnectAccept( DVID dvidSource, PDVPROTOCOLMSG_CONNECTACCEPT lpdvConnectAccept, DWORD dwSize );
  216. BOOL HandleDisconnectConfirm( DVID dvidSource, PDVPROTOCOLMSG_DISCONNECT lpdvDisconnect, DWORD dwSize );
  217. BOOL HandleSetTarget( DVID dvidSource, PDVPROTOCOLMSG_SETTARGET lpdvSetTarget, DWORD dwSize );
  218. BOOL HandleSessionLost( DVID dvidSource, PDVPROTOCOLMSG_SESSIONLOST lpdvSessionLost, DWORD dwSize );
  219. BOOL HandlePlayerList( DVID dvidSource, PDVPROTOCOLMSG_PLAYERLIST lpdvPlayerList, DWORD dwSize );
  220. BOOL HandleHostMigrated( DVID dvidSource, PDVPROTOCOLMSG_HOSTMIGRATED lpdvHostMigrated, DWORD dwSize );
  221. BOOL HandleHostMigrateLeave( DVID dvidSource, PDVPROTOCOLMSG_HOSTMIGRATELEAVE lpdvHostMigrateLeave, DWORD dwSize );
  222. friend class CClientRecordSubSystem;
  223. protected:
  224. void CheckListIntegrity();
  225. void DoSessionLost(HRESULT hrReason);
  226. void DoSignalDisconnect(HRESULT hrDisconnectReason);
  227. void HandleThreadError( HRESULT hrResult );
  228. // Actually send the message to the client app
  229. void TransmitMessage( DWORD dwMessageType, LPVOID lpData, DWORD dwSize );
  230. void Cleanup();
  231. void DoDisconnect();
  232. void DoConnectResponse();
  233. void WaitForBufferReturns();
  234. void SetCurrentState( DWORD dwState );
  235. HRESULT InitializeSoundSystem();
  236. HRESULT ShutdownSoundSystem();
  237. HRESULT CheckForDuplicateObjects();
  238. HRESULT HandleLocalHostMigrateCreate();
  239. void SetConnectResult( HRESULT hrOriginalResult );
  240. HRESULT GetConnectResult() const;
  241. void SetupPlaybackBufferDesc( LPDSBUFFERDESC lpdsBufferDesc, LPDSBUFFERDESC lpdsBufferSource );
  242. HRESULT InitializeClientServer();
  243. void DeInitializeClientServer();
  244. void CheckForUserTimeout( DWORD dwCurTime );
  245. void SendPlayerLevels();
  246. BOOL CheckShouldSendMessage( DWORD dwMessageType );
  247. HRESULT CreateGeneralBuffer( );
  248. void UpdateActivePlayPendingList();
  249. void UpdateActiveNotifyPendingList();
  250. void CleanupNotifyLists();
  251. void CleanupPlaybackLists();
  252. static void __cdecl RecordThread( void *lpParam );
  253. static void __cdecl PlaybackThread( void *lpParam );
  254. static void __cdecl NotifyThread( void *lpParam );
  255. static void MixingWakeupProc(void * pvUserData );
  256. static PVOID ClientBufferAlloc( void *const pv, const DWORD dwSize );
  257. static void ClientBufferFree( void *const pv, void *const pvBuffer );
  258. PDVTRANSPORT_BUFFERDESC GetTransmitBuffer( DWORD dwSize, LPVOID *ppvContext );
  259. HRESULT SendComplete( PDVEVENTMSG_SENDCOMPLETE pSendComplete );
  260. void ReturnTransmitBuffer( PVOID pvContext );
  261. HRESULT Send_ConnectRequest();
  262. HRESULT Send_DisconnectRequest();
  263. HRESULT Send_SessionLost();
  264. HRESULT Send_SettingsConfirm();
  265. HRESULT SetPlaybackVolume( LONG lVolume );
  266. DWORD m_dwSignature;
  267. CFramePool *m_lpFramePool; // Pool of frames
  268. CDirectVoiceTransport *m_lpSessionTransport; // Transport for the session
  269. DVSOUNDDEVICECONFIG m_dvSoundDeviceConfig; // Sound device config
  270. DVCLIENTCONFIG m_dvClientConfig; // Sound general config
  271. DVSESSIONDESC m_dvSessionDesc; // Session configuration
  272. DVCAPS m_dvCaps; // Caps
  273. LPDVMESSAGEHANDLER m_lpMessageHandler; // User message handler
  274. LPVOID m_lpUserContext; // User context for message handler
  275. DVID m_dvidServer; // DVID of the server
  276. PDVID m_pdvidTargets; // DVID of the current target(s) (Protected by m_csTargetLock)
  277. DWORD m_dwNumTargets; // # of targets (Protected by m_csTargetLock)
  278. DWORD m_dwTargetVersion; // Increment each time targets are changed
  279. DNCRITICAL_SECTION m_csTargetLock; // If you need write/read lock, always take it before this lock
  280. HRESULT InternalSetTransmitTarget( PDVID pdvidTargets, DWORD dwNumTargets );
  281. HRESULT CheckForAndRemoveTarget( DVID dvidID );
  282. volatile DWORD m_dwCurrentState; // Current engine state
  283. CFrame *m_tmpFrame; // Tmp frame for receiving
  284. LPDIRECTPLAYVOICESERVER m_lpdvServerMigrated; // Stores reference to migrated host
  285. DWORD m_dwActiveCount;
  286. DWORD m_dwEchoState;
  287. DNCRITICAL_SECTION m_lockPlaybackMode;
  288. DNCRITICAL_SECTION m_csCleanupProtect; // Used to ensure only only cleanup instance is active
  289. protected: // Buffer maintenance
  290. HRESULT AddSoundTarget( CSoundTarget *lpcsTarget );
  291. HRESULT DeleteSoundTarget( DVID dvidID );
  292. HRESULT FindSoundTarget( DVID dvidID, CSoundTarget **lpcsTarget );
  293. HRESULT InitSoundTargetList();
  294. HRESULT FreeSoundTargetList();
  295. protected: // Notification queue
  296. // Queue up a notification for the user
  297. HRESULT NotifyQueue_Add( DWORD dwMessageType, LPVOID lpData, DWORD dwDataSize, PVOID pvContext = NULL, CNotifyElement::PNOTIFY_COMPLETE pNotifyFunc = NULL );
  298. HRESULT NotifyQueue_Get( CNotifyElement **pneElement );
  299. HRESULT NotifyQueue_Init();
  300. HRESULT NotifyQueue_Free();
  301. HRESULT NotifyQueue_ElementFree( CNotifyElement *lpElement );
  302. HRESULT NotifyQueue_IndicateNext();
  303. void NotifyQueue_Disable();
  304. void NotifyQueue_Enable();
  305. void NotifyQueue_Flush();
  306. static void NotifyComplete_SyncWait( PVOID pvContext, CNotifyElement *pElement );
  307. static void NotifyComplete_LocalPlayer( PVOID pvContext, CNotifyElement *pElement );
  308. static void NotifyComplete_RemotePlayer( PVOID pvContext, CNotifyElement *pElement );
  309. DNCRITICAL_SECTION m_csNotifyQueueLock; // Notification queue
  310. BOOL m_fNotifyQueueEnabled;
  311. CNotifyElement *m_lpNotifyList; // List of notifications
  312. HANDLE m_hNewNotifyElement; // Semaphore signalled when new event is queued
  313. HRESULT SendConnectResult();
  314. HRESULT SendDisconnectResult();
  315. protected:
  316. HRESULT SetupInitialBuffers();
  317. HRESULT SetupSpeechBuffer();
  318. HRESULT FreeBuffers();
  319. protected: // Statistics
  320. void ClientStats_Reset();
  321. void ClientStats_Begin();
  322. void ClientStats_End();
  323. void ClientStats_Dump();
  324. void ClientStats_Dump_Record();
  325. void ClientStats_Dump_Playback();
  326. void ClientStats_Dump_Receive();
  327. static void ClientStats_Dump_Transmit();
  328. ClientStatistics m_stats;
  329. ClientStatistics *m_pStatsBlob;
  330. protected: // Sound System Information
  331. CAudioPlaybackBuffer *m_audioPlaybackBuffer; // Audio playback buffer
  332. CAudioRecordDevice *m_audioRecordDevice; // Audio record device
  333. CAudioPlaybackDevice *m_audioPlaybackDevice; // Audio Playback Device
  334. CAudioRecordBuffer *m_audioRecordBuffer; // Audio Record Buffer;
  335. HANDLE m_hNotifyDone; // Signalled when notify thread dies
  336. HANDLE m_hNotifyTerminate; // Signalled to terminate notify thread
  337. HANDLE m_hNotifyChange; // Signalled when notification interval changes
  338. HANDLE m_hRecordDone; // Record thread done signal
  339. HANDLE m_hRecordTerminate; // Record thread stop signal
  340. HANDLE m_hPlaybackDone; // Playback thread done signal
  341. HANDLE m_hPlaybackTerminate; // Playback thread terminate signal
  342. HANDLE m_hConnectAck; // Signalled when connect complete
  343. HANDLE m_hDisconnectAck; // Signalled when disconnect complete
  344. HRESULT m_hrDisconnectResult; // Result of the disconnect result
  345. HRESULT m_hrConnectResult; // Result of the connection request
  346. HRESULT m_hrOriginalConnectResult; // Original Connect Result (Untranslated)
  347. DVID m_dvidLocal; // Local DVID
  348. DNCRITICAL_SECTION m_csClassLock;
  349. BOOL m_fCritSecInited;
  350. protected:
  351. // Compression Control Data
  352. LPDVFULLCOMPRESSIONINFO m_lpdvfCompressionInfo; // Information about current compression type
  353. // Memory pointed to is owned by dvcdb.cpp
  354. DWORD m_dwCompressedFrameSize;
  355. // Size of a compressed frame
  356. DWORD m_dwUnCompressedFrameSize;
  357. // Size of an uncompressed frame
  358. DWORD m_dwNumPerBuffer; // # of frames / directsound buffer
  359. CFramePool *m_pFramePool; // Frame pool
  360. DIRECTVOICECLIENTOBJECT *m_lpObject; // Cached pointer to the COM interface
  361. DWORD m_dwSynchBegin; // GetTickCount at Connect/Disconnect start
  362. HANDLE m_hNotifySynch; // Notified when connect/disconnect completes
  363. HANDLE m_hNotifyDisconnect; // Signalled
  364. HANDLE m_hNotifyConnect; // Connect
  365. HANDLE m_hRecordThreadHandle;
  366. HANDLE m_hPlaybackThreadHandle;
  367. DNCRITICAL_SECTION m_csBufferLock; // Lock to protect playback mixing buffers
  368. CSoundTarget *m_lpstBufferList; // Other Playback Mixing Buffers
  369. CSoundTarget *m_lpstGeneralBuffer; // General Playback Mixing Buffer
  370. LPDWORD m_lpdwMessageElements; // Buffer with notifiers
  371. DWORD m_dwNumMessageElements; // Number of notifiers
  372. DNCRITICAL_SECTION m_csNotifyLock; // Lock on list of notifiers
  373. DSBUFFERDESC m_dsBufferDesc;
  374. TimerHandlerParam m_thTimerInfo;
  375. DvTimer * m_pTimer;
  376. DWORD m_dwLastConnectSent;
  377. DWORD m_dwHostOrderID;
  378. DWORD m_dwMigrateHostOrderID; // Host Order ID of current host
  379. PVOID m_pvLocalPlayerContext;
  380. DIRECTSOUNDMIXER_SRCQUALITY m_dwOriginalRecordQuality;
  381. DIRECTSOUNDMIXER_SRCQUALITY m_dwOriginalPlayQuality;
  382. CFixedPool m_fpNotifications; // Frame pool for notifications
  383. BYTE m_bLastPeak; // Last frame peak
  384. BYTE m_bLastPlaybackPeak; // Last peak on playback
  385. BYTE m_bMsgNum; // Last msg # transmitted
  386. BYTE m_bSeqNum; // Last sequence # transmitted
  387. BOOL m_bLastTransmitted; // Was last frame sent?
  388. BOOL m_fSessionLost; // Flag indicating session was lost
  389. BOOL m_fLocalPlayerNotify; // Has notification been sent for local player
  390. BOOL m_fLocalPlayerAvailable;
  391. BOOL m_fConnectAsync; // Are we connecting async?
  392. BOOL m_fDisconnectAsync; // Are we disconnecting async?
  393. CVoiceNameTable m_voiceNameTable;
  394. DWORD m_dwPlayActiveCount;
  395. CBilink m_blPlayActivePlayers;
  396. CBilink m_blPlayAddPlayers;
  397. DNCRITICAL_SECTION m_csPlayAddList;
  398. CBilink m_blNotifyActivePlayers;
  399. CBilink m_blNotifyAddPlayers;
  400. DNCRITICAL_SECTION m_csNotifyAddList;
  401. CFixedPool m_fpPlayers;
  402. DNCRITICAL_SECTION m_csTransmitBufferLock;
  403. CFixedPool m_BufferDescPool;
  404. CFixedPool* m_pBufferPools;
  405. DWORD *m_pdwBufferPoolSizes;
  406. DWORD m_dwNumPools;
  407. LONG m_iPlayerListReceived; // Have we received a playerlist message for this session?
  408. // RESET this before host migration processing!!
  409. BOOL m_fDisconnecting; // Flag used to guard against multiple, simultaneous disconnects running
  410. };
  411. #endif