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.

102 lines
3.5 KiB

  1. /***************************************************************************
  2. *
  3. * vsb.h
  4. *
  5. * Copyright (c) 1991-1996 Microsoft Corporation. All Rights Reserved.
  6. *
  7. * This code provides VDD support for SB 2.0 sound output, specifically:
  8. * DSP 2.01+ (excluding SB-MIDI port)
  9. * Mixer Chip CT1335 (not strictly part of SB 2.0, but apps seem to like it)
  10. * FM Chip OPL2 (a.k.a. Adlib)
  11. *
  12. ***************************************************************************/
  13. /*****************************************************************************
  14. *
  15. * #defines
  16. *
  17. *****************************************************************************/
  18. #define VSBD_PATH TEXT("System\\CurrentControlSet\\Control\\VirtualDeviceDrivers\\SoundBlaster")
  19. #define LOOKAHEAD_VALUE TEXT("LookAhead")
  20. /*
  21. * Hardware and version information
  22. * In DOS terms: SET BLASTER=A220 I5 D1 T3
  23. */
  24. #define SB_VERSION 0x201 // SB 2.0 (DSP 2.01+)
  25. #define SB_INTERRUPT 0x05 // Interrupt 5
  26. #define SB_DMA_CHANNEL 0x01 // DMA Channel 1
  27. #define NO_DEVICE_FOUND 0xFFFF // returned if no device found
  28. /*****************************************************************************
  29. *
  30. * Function Prototypes
  31. *
  32. *****************************************************************************/
  33. /*
  34. * General function prototypes
  35. */
  36. void VddDbgOut(LPSTR lpszFormat, ...);
  37. BOOL WINAPI DllEntryPoint(HINSTANCE hInstance, DWORD reason, LPVOID reserved);
  38. BOOL InstallIoHook(HINSTANCE hInstance);
  39. void DeInstallIoHook(HINSTANCE hInstance);
  40. VOID VsbByteIn(WORD port, BYTE * data);
  41. VOID VsbByteOut(WORD port, BYTE data);
  42. VOID ResetAll(VOID);
  43. /*****************************************************************************
  44. *
  45. * Globals
  46. *
  47. *****************************************************************************/
  48. //
  49. // Definitions for MM api entry points. The functions will be linked
  50. // dynamically to avoid bringing winmm.dll in before wow32.
  51. //
  52. typedef MMRESULT (WINAPI* SETVOLUMEPROC)(HWAVEOUT, DWORD);
  53. typedef UINT (WINAPI* GETNUMDEVSPROC)(VOID);
  54. typedef MMRESULT (WINAPI* GETDEVCAPSPROC)(UINT, LPWAVEOUTCAPSW, UINT);
  55. typedef MMRESULT (WINAPI* OPENPROC)(LPHWAVEOUT, UINT, LPCWAVEFORMATEX, DWORD, DWORD, DWORD);
  56. typedef MMRESULT (WINAPI* RESETPROC)(HWAVEOUT);
  57. typedef MMRESULT (WINAPI* CLOSEPROC)(HWAVEOUT);
  58. typedef MMRESULT (WINAPI* GETPOSITIONPROC)(HWAVEOUT, LPMMTIME, UINT);
  59. typedef MMRESULT (WINAPI* WRITEPROC)(HWAVEOUT, LPWAVEHDR, UINT);
  60. typedef MMRESULT (WINAPI* PREPAREHEADERPROC)(HWAVEOUT, LPWAVEHDR, UINT);
  61. typedef MMRESULT (WINAPI* UNPREPAREHEADERPROC)(HWAVEOUT, LPWAVEHDR, UINT);
  62. /*****************************************************************************
  63. *
  64. * Debugging
  65. * Levels:
  66. * 1 - errors only
  67. * 2 - significant events
  68. * 3 - regular events
  69. * 4 - heaps o' information
  70. *
  71. *****************************************************************************/
  72. #if DBG
  73. extern int VddDebugLevel;
  74. #define dprintf( _x_ ) VddDbgOut _x_
  75. #define dprintf1( _x_ ) if (VddDebugLevel >= 1) VddDbgOut _x_
  76. #define dprintf2( _x_ ) if (VddDebugLevel >= 2) VddDbgOut _x_
  77. #define dprintf3( _x_ ) if (VddDebugLevel >= 3) VddDbgOut _x_
  78. #define dprintf4( _x_ ) if (VddDebugLevel >= 4) VddDbgOut _x_
  79. #else
  80. #define dprintf(x)
  81. #define dprintf1(x)
  82. #define dprintf2(x)
  83. #define dprintf3(x)
  84. #define dprintf4(x)
  85. #endif // DBG