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.

81 lines
1.3 KiB

  1. /*++
  2. Copyright (c) 2001 Microsoft Corporation
  3. Module Name:
  4. Summoner.cpp
  5. Abstract:
  6. They don't correctly detect 3DFX Voodoo cards. This fix changes the driver
  7. name from 3dfx to something else.
  8. Notes:
  9. This is an app specific shim.
  10. History:
  11. 05/22/2001 linstev Created
  12. --*/
  13. #include "precomp.h"
  14. IMPLEMENT_SHIM_BEGIN(Summoner)
  15. #include "ShimHookMacro.h"
  16. #include "LegalStr.h"
  17. APIHOOK_ENUM_BEGIN
  18. APIHOOK_ENUM_ENTRY_DIRECTX_COMSERVER()
  19. APIHOOK_ENUM_END
  20. IMPLEMENT_DIRECTX_COMSERVER_HOOKS()
  21. /*++
  22. Change the driver name for GetDeviceIdentifier
  23. --*/
  24. HRESULT
  25. COMHOOK(IDirectDraw7, GetDeviceIdentifier)(
  26. PVOID pThis,
  27. LPDDDEVICEIDENTIFIER2 lpDeviceIdentifier,
  28. UINT dwFlags
  29. )
  30. {
  31. HRESULT hReturn;
  32. _pfn_IDirectDraw7_GetDeviceIdentifier pfnOld =
  33. ORIGINAL_COM(IDirectDraw7, GetDeviceIdentifier, pThis);
  34. if (SUCCEEDED(hReturn = (*pfnOld)(pThis, lpDeviceIdentifier, dwFlags))) {
  35. //
  36. // Check the driver name
  37. //
  38. if (_stricmp(lpDeviceIdentifier->szDriver, "3dfxvs.dll") == 0) {
  39. //
  40. // This app doesn't like 3dfx for some reason
  41. //
  42. strcpy(lpDeviceIdentifier->szDriver, "temp.dll");
  43. }
  44. }
  45. return hReturn;
  46. }
  47. /*++
  48. Register hooked functions
  49. --*/
  50. HOOK_BEGIN
  51. APIHOOK_ENTRY_DIRECTX_COMSERVER()
  52. COMHOOK_ENTRY(DirectDraw, IDirectDraw7, GetDeviceIdentifier, 27)
  53. HOOK_END
  54. IMPLEMENT_SHIM_END