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.

127 lines
3.5 KiB

  1. //---------------------------------------------------------------------------
  2. //
  3. // Module: util.h
  4. //
  5. // Description:
  6. //
  7. //
  8. //@@BEGIN_MSINTERNAL
  9. // Development Team:
  10. // Mike McLaughlin
  11. //
  12. // History: Date Author Comment
  13. //
  14. //@@END_MSINTERNAL
  15. //---------------------------------------------------------------------------
  16. //
  17. // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
  18. // KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
  19. // IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
  20. // PURPOSE.
  21. //
  22. // Copyright (c) 1996-1999 Microsoft Corporation. All Rights Reserved.
  23. //
  24. //---------------------------------------------------------------------------
  25. //---------------------------------------------------------------------------
  26. // Constants and Macros
  27. //---------------------------------------------------------------------------
  28. #ifdef UNDER_NT
  29. #define HKEY_CURRENT_USER_ROOT
  30. #else
  31. #define HKEY_CURRENT_USER_ROOT L"\\Registry\\User\\"
  32. #endif
  33. #define HKEY_LOCAL_MACHINE_ROOT L"\\Registry\\Machine\\"
  34. #define REGSTR_PATH_MULTIMEDIA \
  35. HKEY_CURRENT_USER_ROOT \
  36. L"Software\\Microsoft\\Windows\\CurrentVersion\\Multimedia"
  37. #define REGSTR_PATH_MULTIMEDIA_AUDIO \
  38. HKEY_CURRENT_USER_ROOT \
  39. L"Software\\Microsoft\\Multimedia\\Audio"
  40. #define REGSTR_PATH_MULTIMEDIA_AUDIO_FORMATS \
  41. HKEY_CURRENT_USER_ROOT \
  42. L"Software\\Microsoft\\Multimedia\\Audio\\WaveFormats"
  43. #define REGSTR_VAL_DEFAULT_PLAYBACK_FORMAT L"DefaultPlaybackFormat"
  44. #define REGSTR_VAL_DEFAULT_RECORD_FORMAT L"DefaultFormat"
  45. #define REGSTR_PATH_MULTIMEDIA_AUDIO_DEFAULT_DEVICE \
  46. HKEY_CURRENT_USER_ROOT \
  47. L"Software\\Microsoft\\Multimedia\\Sound Mapper"
  48. #define REGSTR_PATH_MULTIMEDIA_MIDI_DEFAULT_DEVICE \
  49. HKEY_CURRENT_USER_ROOT \
  50. L"Software\\Microsoft\\Windows\\CurrentVersion\\Multimedia\\MIDIMap"
  51. #define REGSTR_PATH_MEDIARESOURCES_MIDI \
  52. HKEY_LOCAL_MACHINE_ROOT \
  53. L"SYSTEM\\CurrentControlSet\\Control\\MediaResources\\MIDI\\"
  54. #define REGSTR_VAL_DEFAULT_PLAYBACK_DEVICE L"Playback"
  55. #define REGSTR_VAL_DEFAULT_RECORD_DEVICE L"Record"
  56. #define REGSTR_VAL_DEFAULT_MIDI_DEVICE L"CurrentInstrument"
  57. //---------------------------------------------------------------------------
  58. // Global Data
  59. //---------------------------------------------------------------------------
  60. //---------------------------------------------------------------------------
  61. // Data structures
  62. //---------------------------------------------------------------------------
  63. //---------------------------------------------------------------------------
  64. // Local prototypes
  65. //---------------------------------------------------------------------------
  66. NTSTATUS
  67. GetRegistryDefault(
  68. PSHINGLE_INSTANCE pShingleInstance,
  69. PDEVICE_NODE *ppDeviceNode
  70. );
  71. #ifdef REGISTRY_PREFERRED_DEVICE // this registry code doesn't work under NT
  72. ENUMFUNC
  73. FindFriendlyName(
  74. PSHINGLE_INSTANCE pShingleInstance,
  75. PDEVICE_NODE *ppDeviceNode,
  76. PGRAPH_NODE pGraphNode,
  77. PWSTR pwstr
  78. );
  79. #endif
  80. #ifndef UNDER_NT // this registry code doesn't work under NT
  81. NTSTATUS
  82. GetRegistryPlaybackRecordFormat(
  83. PWAVEFORMATEX pWaveFormatEx,
  84. BOOL fPlayback
  85. );
  86. #endif
  87. NTSTATUS
  88. OpenRegistryKey(
  89. PCWSTR pcwstr,
  90. PHANDLE pHandle,
  91. HANDLE hRootDir = NULL
  92. );
  93. NTSTATUS
  94. QueryRegistryValue(
  95. HANDLE hkey,
  96. PCWSTR pcwstrValueName,
  97. PKEY_VALUE_FULL_INFORMATION *ppkvfi
  98. );
  99. //---------------------------------------------------------------------------
  100. // End of File: registry.h
  101. //---------------------------------------------------------------------------