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.

138 lines
4.8 KiB

  1. /*==========================================================================
  2. *
  3. * Copyright (C) 1999 Microsoft Corporation. All Rights Reserved.
  4. *
  5. * File: trnotify.cpp
  6. * Content: Implementation of the IDirectXVoiceNotify interface
  7. *
  8. * History:
  9. * Date By Reason
  10. * ==== == ======
  11. * 07/26/99 rodtoll Created
  12. * 08/03/99 rodtoll Updated with new parameters for Initialize
  13. * Updated for new initialization order
  14. * 08/05/99 rodtoll Added hook for host migration
  15. * 08/05/99 rodtoll Added new receive parameter
  16. * 08/10/99 rodtoll Initial host migration
  17. * 08/31/99 rodtoll Updated to use new debug libs
  18. * 09/14/99 rodtoll Updated to reflect new parameters for Initialize call
  19. * 09/20/99 rodtoll Updated to check for out of memory errors
  20. * 09/28/99 rodtoll Added release on server interface created by host migration
  21. * 10/05/99 rodtoll Additional comments
  22. * 10/19/99 rodtoll Fix: Bug #113904 - Shutdown issues
  23. * - Added reference count for notify interface, allows
  24. * determination if stopsession should be called from release
  25. * - Fixed host migration break caused by Fix.
  26. * 10/25/99 rodtoll Fix: Bug #114098 - Release/Addref failure from multiple threads
  27. * 12/16/99 rodtoll Fix: Bug #122629 - Updated for new host migration
  28. * 04/07/2000 rodtoll Updated to match changes in DP <--> DPV interface
  29. * 07/22/20000 rodtoll Bug #40296, 38858 - Crashes due to shutdown race condition
  30. * Now ensures that all threads from transport have left and that
  31. * all notificatinos have been processed before shutdown is complete.
  32. * 01/04/2001 rodtoll WinBug #94200 - Remove stray comments
  33. * 02/28/2002 rodtoll WINBUG #550105 - SECURITY: DPVOICE: Dead code
  34. * - Remove DV_HostMigrate
  35. *
  36. ***************************************************************************/
  37. #include "dxvoicepch.h"
  38. extern HRESULT DVC_Create(LPDIRECTVOICECLIENTOBJECT *piDVC);
  39. extern HRESULT DVS_Create(LPDIRECTVOICESERVEROBJECT *piDVS);
  40. #undef DPF_MODNAME
  41. #define DPF_MODNAME "DV_NotifyEvent"
  42. STDMETHODIMP DV_NotifyEvent( LPDIRECTVOICENOTIFYOBJECT lpDVN, DWORD dwNotifyType, DWORD_PTR dwParam1, DWORD_PTR dwParam2)
  43. {
  44. switch( dwNotifyType )
  45. {
  46. case DVEVENT_MIGRATEHOST:
  47. lpDVN->lpDV->lpDVEngine->MigrateHost( 0, NULL );
  48. break;
  49. case DVEVENT_STARTSESSION:
  50. lpDVN->lpDV->lpDVEngine->StartTransportSession();
  51. break;
  52. case DVEVENT_STOPSESSION:
  53. lpDVN->lpDV->lpDVEngine->StopTransportSession();
  54. break;
  55. case DVEVENT_ADDPLAYER:
  56. lpDVN->lpDV->lpDVEngine->AddPlayer( (DVID) dwParam1 );
  57. break;
  58. case DVEVENT_REMOVEPLAYER:
  59. lpDVN->lpDV->lpDVEngine->RemovePlayer( (DVID) dwParam1 );
  60. break;
  61. case DVEVENT_CREATEGROUP:
  62. lpDVN->lpDV->lpDVEngine->CreateGroup( (DVID) dwParam1 );
  63. break;
  64. case DVEVENT_DELETEGROUP:
  65. lpDVN->lpDV->lpDVEngine->DeleteGroup( (DVID) dwParam1 );
  66. break;
  67. case DVEVENT_ADDPLAYERTOGROUP:
  68. lpDVN->lpDV->lpDVEngine->AddPlayerToGroup( (DVID) dwParam1, (DVID) dwParam2 );
  69. break;
  70. case DVEVENT_REMOVEPLAYERFROMGROUP:
  71. lpDVN->lpDV->lpDVEngine->RemovePlayerFromGroup( (DVID) dwParam1, (DVID) dwParam2 );
  72. break;
  73. case DVEVENT_SENDCOMPLETE:
  74. lpDVN->lpDV->lpDVEngine->SendComplete( (PDVEVENTMSG_SENDCOMPLETE) dwParam1 );
  75. break;
  76. }
  77. return DV_OK;
  78. }
  79. #undef DPF_MODNAME
  80. #define DPF_MODNAME "DV_ReceiveSpeechMessage"
  81. STDMETHODIMP DV_ReceiveSpeechMessage( LPDIRECTVOICENOTIFYOBJECT lpDVN, DVID dvidSource, DVID dvidTo, LPVOID lpMessage, DWORD dwSize )
  82. {
  83. lpDVN->lpDV->lpDVEngine->ReceiveSpeechMessage( dvidSource, lpMessage, dwSize );
  84. return DV_OK;
  85. }
  86. #undef DPF_MODNAME
  87. #define DPF_MODNAME "DV_Notify_Initialize"
  88. STDMETHODIMP DV_Notify_Initialize( LPDIRECTVOICENOTIFYOBJECT lpDVN )
  89. {
  90. return lpDVN->lpDV->lpDVTransport->Initialize();
  91. }
  92. #undef DPF_MODNAME
  93. #define DPF_MODNAME "DV_Notify_AddRef"
  94. STDMETHODIMP DV_Notify_AddRef(LPDIRECTVOICENOTIFYOBJECT lpDVN )
  95. {
  96. lpDVN->lpDV->lpDVTransport->AddRef();
  97. return 0;
  98. }
  99. #undef DPF_MODNAME
  100. #define DPF_MODNAME "DVC_Notify_Release"
  101. STDAPI DVC_Notify_Release(LPDIRECTVOICENOTIFYOBJECT lpDVN )
  102. {
  103. lpDVN->lpDV->lpDVTransport->Release();
  104. return 0;
  105. }
  106. #undef DPF_MODNAME
  107. #define DPF_MODNAME "DVC_Notify_QueryInterface"
  108. STDMETHODIMP DVC_Notify_QueryInterface(LPDIRECTVOICENOTIFYOBJECT lpDVN, REFIID riid, LPVOID * ppvObj )
  109. {
  110. return DVC_QueryInterface( (LPDIRECTVOICECLIENTOBJECT) lpDVN->lpDV, riid, ppvObj );
  111. }
  112. #undef DPF_MODNAME
  113. #define DPF_MODNAME "DVS_Notify_QueryInterface"
  114. STDMETHODIMP DVS_Notify_QueryInterface(LPDIRECTVOICENOTIFYOBJECT lpDVN, REFIID riid, LPVOID * ppvObj )
  115. {
  116. return DVS_QueryInterface( (LPDIRECTVOICESERVEROBJECT) lpDVN->lpDV, riid, ppvObj );
  117. }
  118. #undef DPF_MODNAME
  119. #define DPF_MODNAME "DVS_Notify_Release"
  120. STDAPI DVS_Notify_Release(LPDIRECTVOICENOTIFYOBJECT lpDVN )
  121. {
  122. lpDVN->lpDV->lpDVTransport->Release();
  123. return 0;
  124. }