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.

72 lines
1.3 KiB

  1. /*++
  2. Copyright (c) 2000 Microsoft Corporation
  3. Module Name:
  4. CheckTAPIVersionParameters.cpp
  5. Abstract:
  6. Hooks the call to lineNegotiateAPIVersion so that device 0 doesn't fail
  7. causing the application to stop querying devices.
  8. Notes:
  9. This is an app specific shim. Could potentially be general, but requires
  10. research.
  11. History:
  12. 07/17/2000 a-brienw Created
  13. --*/
  14. #include "precomp.h"
  15. IMPLEMENT_SHIM_BEGIN(ViperRacing)
  16. #include "ShimHookMacro.h"
  17. APIHOOK_ENUM_BEGIN
  18. APIHOOK_ENUM_ENTRY(lineNegotiateAPIVersion)
  19. APIHOOK_ENUM_END
  20. /*++
  21. Hook lineNegotiateAPIVersion to reverse the order of the devices.
  22. --*/
  23. LONG
  24. APIHOOK(lineNegotiateAPIVersion)(
  25. HLINEAPP hLineApp,
  26. DWORD dwDeviceID,
  27. DWORD dwAPILowVersion,
  28. DWORD dwAPIHighVersion,
  29. LPDWORD lpdwAPIVersion,
  30. LPLINEEXTENSIONID lpExtensionID
  31. )
  32. {
  33. if (dwDeviceID == 0) dwDeviceID = 1;
  34. return ORIGINAL_API(lineNegotiateAPIVersion)(
  35. hLineApp,
  36. dwDeviceID,
  37. dwAPILowVersion,
  38. dwAPIHighVersion,
  39. lpdwAPIVersion,
  40. lpExtensionID);
  41. }
  42. /*++
  43. Register hooked functions
  44. --*/
  45. HOOK_BEGIN
  46. APIHOOK_ENTRY(TAPI32.DLL, lineNegotiateAPIVersion)
  47. HOOK_END
  48. IMPLEMENT_SHIM_END