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.

151 lines
4.3 KiB

  1. #include "stdafx.h"
  2. #include "Direct.h"
  3. #include "dms.h"
  4. #include "dSoundFXI3DL2SourceObj.h"
  5. extern void *g_dxj_DirectSoundFXI3DL2Source;
  6. ///////////////////////////////////////////////////////////////////
  7. // InternalAddRef
  8. ///////////////////////////////////////////////////////////////////
  9. DWORD C_dxj_DirectSoundFXI3DL2SourceObject::InternalAddRef(){
  10. DWORD i;
  11. i=CComObjectRoot::InternalAddRef();
  12. DPF2(1,"DirectSoundFXI3DL2Source [%d] AddRef %d \n",creationid,i);
  13. return i;
  14. }
  15. ///////////////////////////////////////////////////////////////////
  16. // InternalRelease
  17. ///////////////////////////////////////////////////////////////////
  18. DWORD C_dxj_DirectSoundFXI3DL2SourceObject::InternalRelease(){
  19. DWORD i;
  20. i=CComObjectRoot::InternalRelease();
  21. DPF2(1,"DirectSoundFXI3DL2Source [%d] Release %d \n",creationid,i);
  22. return i;
  23. }
  24. ///////////////////////////////////////////////////////////////////
  25. // C_dxj_DirectSoundFXI3DL2SourceObject
  26. ///////////////////////////////////////////////////////////////////
  27. C_dxj_DirectSoundFXI3DL2SourceObject::C_dxj_DirectSoundFXI3DL2SourceObject(){
  28. DPF1(1,"Constructor Creation DirectSoundFXI3DL2Source Object[%d] \n ",g_creationcount);
  29. m__dxj_DirectSoundFXI3DL2Source = NULL;
  30. parent = NULL;
  31. pinterface = NULL;
  32. nextobj = g_dxj_DirectSoundFXI3DL2Source;
  33. creationid = ++g_creationcount;
  34. g_dxj_DirectSoundFXI3DL2Source = (void *)this;
  35. }
  36. ///////////////////////////////////////////////////////////////////
  37. // ~C_dxj_DirectSoundFXI3DL2SourceObject
  38. ///////////////////////////////////////////////////////////////////
  39. C_dxj_DirectSoundFXI3DL2SourceObject::~C_dxj_DirectSoundFXI3DL2SourceObject()
  40. {
  41. DPF(1,"Entering ~C_dxj_DirectSoundFXI3DL2SourceObject destructor \n");
  42. C_dxj_DirectSoundFXI3DL2SourceObject *prev=NULL;
  43. for(C_dxj_DirectSoundFXI3DL2SourceObject *ptr=(C_dxj_DirectSoundFXI3DL2SourceObject *)g_dxj_DirectSoundFXI3DL2Source ; ptr; ptr=(C_dxj_DirectSoundFXI3DL2SourceObject *)ptr->nextobj)
  44. {
  45. if(ptr == this)
  46. {
  47. if(prev)
  48. prev->nextobj = ptr->nextobj;
  49. else
  50. g_dxj_DirectSoundFXI3DL2Source = (void*)ptr->nextobj;
  51. DPF(1,"DirectSoundFXI3DL2SourceObject found in g_dxj list now removed\n");
  52. break;
  53. }
  54. prev = ptr;
  55. }
  56. if(m__dxj_DirectSoundFXI3DL2Source){
  57. int count = IUNK(m__dxj_DirectSoundFXI3DL2Source)->Release();
  58. #ifdef DEBUG
  59. char buffer[256];
  60. wsprintf(buffer,"DirectX IDirectSoundFXI3DL2Source Ref count [%d] \n",count);
  61. #endif
  62. if(count==0) m__dxj_DirectSoundFXI3DL2Source = NULL;
  63. }
  64. if(parent) IUNK(parent)->Release();
  65. }
  66. HRESULT C_dxj_DirectSoundFXI3DL2SourceObject::InternalGetObject(IUnknown **pUnk){
  67. *pUnk=(IUnknown*)m__dxj_DirectSoundFXI3DL2Source;
  68. return S_OK;
  69. }
  70. HRESULT C_dxj_DirectSoundFXI3DL2SourceObject::InternalSetObject(IUnknown *pUnk){
  71. m__dxj_DirectSoundFXI3DL2Source=(LPDIRECTSOUNDFXI3DL2SOURCE8)pUnk;
  72. return S_OK;
  73. }
  74. HRESULT C_dxj_DirectSoundFXI3DL2SourceObject::SetAllParameters(DSFXI3DL2SOURCE_CDESC *params)
  75. {
  76. HRESULT hr;
  77. if (FAILED( hr = m__dxj_DirectSoundFXI3DL2Source->SetAllParameters((DSFXI3DL2Source*) params) ))
  78. return hr;
  79. return S_OK;
  80. }
  81. HRESULT C_dxj_DirectSoundFXI3DL2SourceObject::GetAllParameters(DSFXI3DL2SOURCE_CDESC *params)
  82. {
  83. HRESULT hr;
  84. if (FAILED( hr = m__dxj_DirectSoundFXI3DL2Source->GetAllParameters((DSFXI3DL2Source*) params) ))
  85. return hr;
  86. return S_OK;
  87. }
  88. HRESULT C_dxj_DirectSoundFXI3DL2SourceObject::SetObstructionPreset(long lObstruction)
  89. {
  90. HRESULT hr;
  91. if (FAILED( hr = m__dxj_DirectSoundFXI3DL2Source->SetObstructionPreset((DWORD) lObstruction) ))
  92. return hr;
  93. return S_OK;
  94. }
  95. HRESULT C_dxj_DirectSoundFXI3DL2SourceObject::GetObstructionPreset(long *ret)
  96. {
  97. HRESULT hr;
  98. if (FAILED( hr = m__dxj_DirectSoundFXI3DL2Source->GetObstructionPreset((DWORD*) ret) ))
  99. return hr;
  100. return S_OK;
  101. }
  102. HRESULT C_dxj_DirectSoundFXI3DL2SourceObject::SetOcclusionPreset(long lOcclusion)
  103. {
  104. HRESULT hr;
  105. if (FAILED( hr = m__dxj_DirectSoundFXI3DL2Source->SetOcclusionPreset((DWORD) lOcclusion) ))
  106. return hr;
  107. return S_OK;
  108. }
  109. HRESULT C_dxj_DirectSoundFXI3DL2SourceObject::GetOcclusionPreset(long *ret)
  110. {
  111. HRESULT hr;
  112. if (FAILED( hr = m__dxj_DirectSoundFXI3DL2Source->GetOcclusionPreset((DWORD*) ret) ))
  113. return hr;
  114. return S_OK;
  115. }