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.

85 lines
1.7 KiB

  1. /*++
  2. Copyright (c) 2001 Microsoft Corporation
  3. Module Name:
  4. LinksExtreme.cpp
  5. Abstract:
  6. This app cannot recognise the MIDI technology flags properly.
  7. The app's internal logic cannot handle the last two technology
  8. flags viz. MOD_WAVETABLE and MOD_SWSYNTH. If these flags are
  9. returned by the call to MidiOutGetDevCapsA API, the app shows
  10. a messagebox and restarts after playing for a while.(AV's).
  11. Notes:
  12. This is specific to this app.
  13. History:
  14. 06/20/2001 prashkud Created
  15. --*/
  16. #include "precomp.h"
  17. IMPLEMENT_SHIM_BEGIN(LinksExtreme)
  18. #include "ShimHookMacro.h"
  19. APIHOOK_ENUM_BEGIN
  20. APIHOOK_ENUM_ENTRY(midiOutGetDevCapsA)
  21. APIHOOK_ENUM_END
  22. /*++
  23. This stub function fixes the returned wTechnology flags.
  24. --*/
  25. MMRESULT
  26. APIHOOK(midiOutGetDevCapsA)(
  27. UINT_PTR uDeviceID,
  28. LPMIDIOUTCAPSA pmoc,
  29. UINT cbmoc
  30. )
  31. {
  32. MMRESULT mRes = ORIGINAL_API(midiOutGetDevCapsA)(
  33. uDeviceID,
  34. pmoc,
  35. cbmoc);
  36. if (mRes == MMSYSERR_NOERROR)
  37. {
  38. if ((pmoc->wTechnology & MOD_WAVETABLE) ||
  39. (pmoc->wTechnology & MOD_SWSYNTH))
  40. {
  41. pmoc->wTechnology &= ~MOD_WAVETABLE;
  42. pmoc->wTechnology &= ~MOD_SWSYNTH;
  43. // Use any of the first five wTechnology flags !!
  44. pmoc->wTechnology |= MOD_FMSYNTH;
  45. LOGN( eDbgLevelInfo,
  46. "[midiOutGetDevCapsA] Fixed the wTechnology flags" );
  47. }
  48. }
  49. return mRes;
  50. }
  51. /*++
  52. Register hooked functions
  53. --*/
  54. HOOK_BEGIN
  55. APIHOOK_ENTRY(WINMM.DLL, midiOutGetDevCapsA)
  56. HOOK_END
  57. IMPLEMENT_SHIM_END