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.

198 lines
4.3 KiB

  1. /****************************************************************************
  2. *
  3. * registry.h
  4. *
  5. * Copyright (c) 1992-1994 Microsoft Corporation
  6. *
  7. * This file contains public definitions for maintaining registry information
  8. * for drivers managing kernel driver registry related data.
  9. ****************************************************************************/
  10. /****************************************************************************
  11. Our registry access data
  12. ****************************************************************************/
  13. typedef struct {
  14. SC_HANDLE ServiceManagerHandle; // Handle to the service controller
  15. LPTSTR DriverName; // Name of driver
  16. TCHAR TempKeySaveFileName[MAX_PATH]; // Where parameters key is saved
  17. } REG_ACCESS, *PREG_ACCESS;
  18. /****************************************************************************
  19. Test if configuration etc can be supported
  20. ****************************************************************************/
  21. #define DrvAccess(RegAccess) ((RegAccess)->ServiceManagerHandle != NULL)
  22. /****************************************************************************
  23. Driver types
  24. ****************************************************************************/
  25. typedef enum {
  26. SoundDriverTypeNormal = 1,
  27. SoundDriverTypeSynth /* Go in the synth group */
  28. } SOUND_KERNEL_MODE_DRIVER_TYPE;
  29. /****************************************************************************
  30. Function prototypes
  31. ****************************************************************************/
  32. /*
  33. * Create a new key
  34. */
  35. HKEY DrvCreateDeviceKey(LPCTSTR DriverName);
  36. /*
  37. * Open a subkey under our driver's node
  38. */
  39. HKEY DrvOpenRegKey(LPCTSTR DriverName,
  40. LPCTSTR Path);
  41. /*
  42. * Create a services node for our driver if there isn't one already,
  43. * otherwise open the existing one. Returns ERROR_SUCCESS if OK.
  44. */
  45. BOOL
  46. DrvCreateServicesNode(PTCHAR DriverName,
  47. SOUND_KERNEL_MODE_DRIVER_TYPE DriverType,
  48. PREG_ACCESS RegAccess,
  49. BOOL Create);
  50. /*
  51. * Close down our connection to the services manager
  52. */
  53. VOID
  54. DrvCloseServiceManager(
  55. PREG_ACCESS RegAccess);
  56. /*
  57. * Delete the services node for our driver
  58. */
  59. BOOL
  60. DrvDeleteServicesNode(
  61. PREG_ACCESS RegAccess);
  62. /*
  63. * Save the parameters subkey
  64. */
  65. BOOL DrvSaveParametersKey(PREG_ACCESS RegAccess);
  66. /*
  67. * Restore the parameters subkey
  68. */
  69. BOOL DrvRestoreParametersKey(PREG_ACCESS RegAccess);
  70. /*
  71. * Create the 'Parameters' subkey
  72. */
  73. LONG
  74. DrvCreateParamsKey(
  75. PREG_ACCESS RegAccess);
  76. /*
  77. * Open the key to a numbered device (starts at 0)
  78. */
  79. HKEY DrvOpenDeviceKey(LPCTSTR DriverName, UINT n);
  80. /*
  81. * Set a device parameter
  82. */
  83. #define DrvSetDeviceParameter(a, b, c) \
  84. DrvSetDeviceIdParameter(a, 0, b, c)
  85. LONG
  86. DrvSetDeviceIdParameter(
  87. PREG_ACCESS RegAccess,
  88. UINT DeviceNumber,
  89. PTCHAR ValueName,
  90. DWORD Value);
  91. /*
  92. * Read current parameter setting
  93. */
  94. #define DrvQueryDeviceParameter(a, b, c) \
  95. DrvQueryDeviceIdParameter(a, 0, b, c)
  96. LONG
  97. DrvQueryDeviceIdParameter(
  98. PREG_ACCESS RegAccess,
  99. UINT DeviceNumber,
  100. PTCHAR ValueName,
  101. PDWORD pValue);
  102. /*
  103. * Try loading a kernel driver
  104. */
  105. BOOL
  106. DrvLoadKernelDriver(
  107. PREG_ACCESS RegAccess);
  108. /*
  109. * Try unloading a kernel driver
  110. */
  111. BOOL
  112. DrvUnloadKernelDriver(
  113. PREG_ACCESS RegAccess);
  114. /*
  115. * See if driver is loaded
  116. */
  117. BOOL
  118. DrvIsDriverLoaded(
  119. PREG_ACCESS RegAccess);
  120. /*
  121. * Do driver (installation+) configuration
  122. */
  123. BOOL DrvConfigureDriver(
  124. PREG_ACCESS RegAccess,
  125. LPTSTR DriverName,
  126. SOUND_KERNEL_MODE_DRIVER_TYPE
  127. DriverType,
  128. BOOL (* SetParms )(PVOID),
  129. PVOID Context);
  130. /*
  131. * Remove a driver
  132. */
  133. LRESULT DrvRemoveDriver(
  134. PREG_ACCESS RegAccess);
  135. /*
  136. * Number of card instances installed for a given driver
  137. */
  138. LONG
  139. DrvNumberOfDevices(
  140. PREG_ACCESS RegAccess,
  141. LPDWORD NumberOfDevices);
  142. /*
  143. * Set the midi mapper setup to use
  144. */
  145. VOID DrvSetMapperName(LPTSTR SetupName);
  146. /*
  147. * Find which interrupts and DMA Channels are free
  148. */
  149. BOOL GetInterruptsAndDMA(
  150. LPDWORD InterruptsInUse,
  151. LPDWORD DmaChannelsInUse,
  152. LPCTSTR IgnoreDriver
  153. );