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.

87 lines
2.3 KiB

  1. //
  2. // Copyright (c) 1999 Microsoft Corporation
  3. //
  4. // HIDCOM.EXE -- exploratory USB Phone Console Application
  5. //
  6. // audio.h -- audio magic
  7. //
  8. #ifndef _HIDCOM_AUDIO_H_
  9. #define _HIDCOM_AUDIO_H_
  10. #ifdef __cplusplus
  11. extern "C"
  12. {
  13. #endif
  14. #include <basetyps.h>
  15. #include <setupapi.h>
  16. //////////////////////////////////////////////////////////////////////////////
  17. //
  18. // DiscoverAssociatedWaveId
  19. //
  20. // This function searches for a wave device to match the HID device in the
  21. // PNP tree location specified in the passed in SP_DEVICE_INTERFACE_DATA
  22. // structure, obtained from the SetupKi API. It returns the wave id for
  23. // the matched device.
  24. //
  25. // It uses the helper function FindWaveIdFromHardwareIdString() to search for
  26. // the wave device based on a devinst DWORD and a hardware ID string. First,
  27. // it must obtain the devinst for the device; it does this by calling a SetupDi
  28. // function and looking up the devinst in a resulting structure. The hardware
  29. // ID string is then retrieved from the registry and trimmed, using the helper
  30. // function HardwareIdFromDevinst().
  31. //
  32. // See FindWaveIdFromHardwareIdString() for further comments on the search
  33. // algorithm.
  34. //
  35. // Arguments:
  36. // dwDevInst - IN - Device Instance of the HID device
  37. // fRender - IN - TRUE for wave out, FALSE for wave in
  38. // pdwWaveId - OUT - the wave id associated with this HID device
  39. //
  40. // Return values:
  41. // S_OK - succeeded and matched wave id
  42. // other from helper functions FindWaveIdFromHardwareIdString() or
  43. // or HardwareIdFromDevinst()
  44. //
  45. HRESULT DiscoverAssociatedWaveId(
  46. IN DWORD dwDevInst,
  47. IN BOOL fRender,
  48. OUT DWORD * pdwWaveId
  49. );
  50. //////////////////////////////////////////////////////////////////////////////
  51. //
  52. // ExamineWaveDevices
  53. //
  54. // This function is for debugging purposes only. It enumerates audio devices
  55. // using the Wave API and prints the device path string as well as the
  56. // device instance DWORD for each render or capture device.
  57. //
  58. // Arguments:
  59. // fRender - IN - true means examine wave out devices; false = wave in
  60. //
  61. // Return values:
  62. // E_OUTOFMEMORY
  63. // S_OK
  64. //
  65. HRESULT ExamineWaveDevices(
  66. IN BOOL fRender
  67. );
  68. #ifdef __cplusplus
  69. };
  70. #endif
  71. #endif // _HIDCOM_AUDIO_H_
  72. //
  73. // eof
  74. //