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.

80 lines
1.5 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. APIHOOK_ENUM_BEGIN
  17. APIHOOK_ENUM_ENTRY_DIRECTX_COMSERVER()
  18. APIHOOK_ENUM_END
  19. IMPLEMENT_DIRECTX_COMSERVER_HOOKS()
  20. /*++
  21. Change the driver name for GetDeviceIdentifier
  22. --*/
  23. HRESULT
  24. COMHOOK(IDirectDraw7, GetDeviceIdentifier)(
  25. PVOID pThis,
  26. LPDDDEVICEIDENTIFIER2 lpDeviceIdentifier,
  27. UINT dwFlags
  28. )
  29. {
  30. HRESULT hReturn;
  31. _pfn_IDirectDraw7_GetDeviceIdentifier pfnOld =
  32. ORIGINAL_COM(IDirectDraw7, GetDeviceIdentifier, pThis);
  33. if (SUCCEEDED(hReturn = (*pfnOld)(pThis, lpDeviceIdentifier, dwFlags))) {
  34. //
  35. // Check the driver name
  36. //
  37. if (_stricmp(lpDeviceIdentifier->szDriver, "3dfxvs.dll") == 0) {
  38. //
  39. // This app doesn't like 3dfx for some reason
  40. //
  41. StringCchCopyA(lpDeviceIdentifier->szDriver, MAX_DDDEVICEID_STRING, "temp.dll");
  42. }
  43. }
  44. return hReturn;
  45. }
  46. /*++
  47. Register hooked functions
  48. --*/
  49. HOOK_BEGIN
  50. APIHOOK_ENTRY_DIRECTX_COMSERVER()
  51. COMHOOK_ENTRY(DirectDraw, IDirectDraw7, GetDeviceIdentifier, 27)
  52. HOOK_END
  53. IMPLEMENT_SHIM_END