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.

171 lines
7.4 KiB

  1. /*==========================================================================;
  2. *
  3. * Copyright (C) 1999 Microsoft Corporation. All Rights Reserved.
  4. *
  5. * File: fdtcfg.cpp
  6. * Content: Configuration of the full duplex test app
  7. * History:
  8. * Date By Reason
  9. * ============
  10. * 08/20/99 pnewson created
  11. * 10/28/99 pnewson Bug #114176 updated DVSOUNDDEVICECONFIG struct
  12. * 11/04/99 pnewson Bug #115279 removed unused const global
  13. * fixed infinite timeouts
  14. * 11/30/99 pnewson default device mapping support
  15. * 01/21/2000 pnewson changed registry key names
  16. * 03/03/2000 rodtoll Updated to handle alternative gamevoice build.
  17. * 04/18/2000 rodtoll Bug #32649 Voice wizard failing
  18. * Changed secondary format for tests from stereo --> mono
  19. * 03/01/2002 simonpow Added gc_szLaunchAppName to support fully specifying
  20. * exe path when calling CreateProcess
  21. ***************************************************************************/
  22. #include "dxvtlibpch.h"
  23. // the name of the DLL where the direct voice functions reside
  24. #if !defined(DBG) || !defined( DIRECTX_REDIST )
  25. const char gc_szDVoiceDLLName[] = "dpvoice.dll";
  26. #else
  27. // For redist debug builds we append a 'd' to the name to allow both debug and retail to be installed on the system
  28. const char gc_szDVoiceDLLName[] = "dpvoiced.dll";
  29. #endif // !defined(DBG) || !defined( DIRECTX_REDIST )
  30. // the name of the DLL where the required resources are (could be different
  31. // from the DLL above, hence the second name...)
  32. #if !defined(DBG) || !defined( DIRECTX_REDIST )
  33. const char gc_szResDLLName[] = "dpvoice.dll";
  34. #else
  35. // For redist debug builds we append a 'd' to the name to allow both debug and retail to be installed on the system
  36. const char gc_szResDLLName[] = "dpvoiced.dll";
  37. #endif // !defined(DBG) || !defined( DIRECTX_REDIST )
  38. // the name of the DirectSound DLL
  39. const char gc_szDSoundDLLName[] = "dsound.dll";
  40. // the name of the GetDeviceID DirectSound function
  41. const char gc_szGetDeviceIDFuncName[] = "GetDeviceID";
  42. // command line related definitions
  43. const TCHAR gc_szLaunchAppName[] = _T("dpvsetup.exe");
  44. const TCHAR gc_szPriorityCommand[] = _T("dpvsetup.exe -p");
  45. const TCHAR gc_szFullDuplexCommand[] = _T("dpvsetup.exe -f");
  46. // registry related definitions
  47. const WCHAR gc_wszKeyName_AudioConfig[] = DPVOICE_REGISTRY_BASE DPVOICE_REGISTRY_AUDIOCONFIG;
  48. const WCHAR gc_wszValueName_Started[] = L"Started";
  49. const WCHAR gc_wszValueName_FullDuplex[] = L"FullDuplex";
  50. const WCHAR gc_wszValueName_HalfDuplex[] = L"HalfDuplex";
  51. const WCHAR gc_wszValueName_MicDetected[] = L"MicDetected";
  52. // the name of the mutex used to ensure only one app instance
  53. // uses a GUID to ensure uniqueness
  54. const TCHAR gc_szMutexName[] = _T("A5EBE0E0-57B5-4e8f-AE94-976EAD62355C");
  55. // the event names
  56. // uses GUIDs to ensure uniqueness
  57. const TCHAR gc_szPriorityEventName[] = _T("85D97F8C-7131-4d14-95E2-056843FADC34");
  58. const TCHAR gc_szFullDuplexEventName[] = _T("CB6DD850-BA0A-4e9f-924A-8FECAFCF502F");
  59. const TCHAR gc_szPriorityReplyEventName[] = _T("C4AEDED9-7B39-46db-BFF2-DE19A766B42B");
  60. const TCHAR gc_szFullDuplexReplyEventName[] = _T("53E6CF94-CE39-40a5-9BEF-EB5DE9307A77");
  61. // The shared memory names and sizes. Again, guids for names
  62. // Shared memory sizes do not need to be big. We're just passing
  63. // back and forth some WAVEFORMATEX structures and return codes.
  64. // 1 k should be more than adequate.
  65. const TCHAR gc_szPriorityShMemName[] = _T("E814F4FC-5DAC-4149-8B98-8899A1BF66A7");
  66. const DWORD gc_dwPriorityShMemSize = 1024;
  67. const TCHAR gc_szFullDuplexShMemName[] = _T("3CBCA2AD-C462-4f3a-85FE-9766D02E5E53");
  68. const DWORD gc_dwFullDuplexShMemSize = 1024;
  69. // the send mutex names
  70. const TCHAR gc_szPrioritySendMutex[] = _T("855EF6EE-48D4-4968-8D3D-8D29E865E370");
  71. const TCHAR gc_szFullDuplexSendMutex[] = _T("05DACF95-EFE9-4f3c-9A92-2A7F5C2A7A51");
  72. // the error message and caption to use if the FormatMessage function fails
  73. const TCHAR gc_szUnknownMessage[]
  74. = _T("An error has occured, but the program was unable to retrive the text of the error message");
  75. const TCHAR gc_szUnknownMessageCaption[]
  76. = _T("Error");
  77. // While there is officially a global for each timeout, they are all
  78. // the same value right now. This define is here to make it simple
  79. // to change the timeouts to INFINITE and back for debugging.
  80. //
  81. // Uncomment the timeout you want to use.
  82. #ifdef DEBUG
  83. #define GENERIC_TIMEOUT 10000
  84. //#define GENERIC_TIMEOUT INFINITE
  85. #else
  86. #define GENERIC_TIMEOUT 10000
  87. #endif
  88. // The number of milliseconds we will wait for the child processes
  89. // to exit before we timeout.
  90. const DWORD gc_dwChildWaitTimeout = GENERIC_TIMEOUT;
  91. // The number of milliseconds we will wait for the child processes
  92. // to startup and signal the supervisor before we timeout.
  93. const DWORD gc_dwChildStartupTimeout = GENERIC_TIMEOUT;
  94. // The number of milliseconds a process will wait to receive a command,
  95. // or wait for the reply from a command.
  96. const DWORD gc_dwCommandReceiveTimeout = GENERIC_TIMEOUT;
  97. const DWORD gc_dwCommandReplyTimeout = GENERIC_TIMEOUT;
  98. // The number of milliseconds a process will wait to acquire the
  99. // mutex used to make a SendCommand() call.
  100. const DWORD gc_dwSendMutexTimeout = GENERIC_TIMEOUT;
  101. // The number of milliseconds to wait for a dialog box to spawn
  102. const DWORD gc_dwDialogTimeout = GENERIC_TIMEOUT;
  103. // In the loopback test, how long to wait for the loopback test
  104. // thread proc to exit.
  105. const DWORD gc_dwLoopbackTestThreadTimeout = GENERIC_TIMEOUT;
  106. // The number of milliseconds of audio in a DirectSound buffer
  107. const DWORD gc_dwFrameSize = 50;
  108. // The array of wave formats to try
  109. const WAVEFORMATEX gc_rgwfxPrimaryFormats[] =
  110. {
  111. { WAVE_FORMAT_PCM, 2, 44100, 4*44100, 4, 16, 0 },
  112. { WAVE_FORMAT_PCM, 2, 22050, 4*22050, 4, 16, 0 },
  113. { WAVE_FORMAT_PCM, 2, 11025, 4*11025, 4, 16, 0 },
  114. { WAVE_FORMAT_PCM, 2, 8000, 4* 8000, 4, 16, 0 },
  115. { WAVE_FORMAT_PCM, 1, 44100, 2*44100, 2, 16, 0 },
  116. { WAVE_FORMAT_PCM, 1, 22050, 2*22050, 2, 16, 0 },
  117. { WAVE_FORMAT_PCM, 1, 11025, 2*11025, 2, 16, 0 },
  118. { WAVE_FORMAT_PCM, 1, 8000, 2* 8000, 2, 16, 0 },
  119. { WAVE_FORMAT_PCM, 2, 44100, 2*44100, 2, 8, 0 },
  120. { WAVE_FORMAT_PCM, 2, 22050, 2*22050, 2, 8, 0 },
  121. { WAVE_FORMAT_PCM, 2, 11025, 2*11025, 2, 8, 0 },
  122. { WAVE_FORMAT_PCM, 2, 8000, 2* 8000, 2, 8, 0 },
  123. { WAVE_FORMAT_PCM, 1, 44100, 1*44100, 1, 8, 0 },
  124. { WAVE_FORMAT_PCM, 1, 22050, 1*22050, 1, 8, 0 },
  125. { WAVE_FORMAT_PCM, 1, 11025, 1*11025, 1, 8, 0 },
  126. { WAVE_FORMAT_PCM, 1, 8000, 1* 8000, 1, 8, 0 },
  127. { 0, 0, 0, 0, 0, 0, 0 } // Note: make sure this remains the last format!
  128. };
  129. const WAVEFORMATEX gc_wfxSecondaryFormat =
  130. { WAVE_FORMAT_PCM, 1, 22050, 2* 22050, 2, 16, 0 };
  131. const WAVEFORMATEX gc_rgwfxCaptureFormats[] =
  132. {
  133. { WAVE_FORMAT_PCM, 1, 8000, 2* 8000, 2, 16, 0 },
  134. { WAVE_FORMAT_PCM, 1, 11025, 2*11025, 2, 16, 0 },
  135. { WAVE_FORMAT_PCM, 1, 22050, 2*22050, 2, 16, 0 },
  136. { WAVE_FORMAT_PCM, 1, 44100, 2*44100, 2, 16, 0 },
  137. { WAVE_FORMAT_PCM, 1, 8000, 1* 8000, 1, 8, 0 },
  138. { WAVE_FORMAT_PCM, 1, 11025, 1*11025, 1, 8, 0 },
  139. { WAVE_FORMAT_PCM, 1, 22050, 1*22050, 1, 8, 0 },
  140. { WAVE_FORMAT_PCM, 1, 44100, 1*44100, 1, 8, 0 },
  141. { 0, 0, 0, 0, 0, 0, 0 } // Note: make sure this remains the last format!
  142. };
  143. // the devices to test if the user passes null to CheckAudioSetup
  144. const GUID gc_guidDefaultCaptureDevice = GUID_NULL;
  145. const GUID gc_guidDefaultRenderDevice = GUID_NULL;