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.

55 lines
1.0 KiB

  1. /*++
  2. Copyright (c) 2000 Microsoft Corporation
  3. Module Name:
  4. EnlargeGetObject.cpp
  5. Abstract:
  6. Holy Quran (El Hozayfy and Mohamed Ayoub) V 1 calls GetObjectA()
  7. with the second parameter hard coded to 10 while it suppose to
  8. be the sizeof(BITMAP) i.e. 24
  9. This shim is app specific
  10. History:
  11. 04/17/2001 mhamid created
  12. --*/
  13. #include "precomp.h"
  14. IMPLEMENT_SHIM_BEGIN(EnlargeGetObjectBufferSize)
  15. #include "ShimHookMacro.h"
  16. APIHOOK_ENUM_BEGIN
  17. APIHOOK_ENUM_ENTRY(GetObjectA)
  18. APIHOOK_ENUM_END
  19. int
  20. APIHOOK(GetObjectA)(
  21. HGDIOBJ hgdiobj, // handle to graphics object
  22. int cbBuffer, // size of buffer for object information
  23. LPVOID lpvObject // buffer for object information
  24. )
  25. {
  26. if ((cbBuffer == 10) && (lpvObject != NULL))
  27. cbBuffer = sizeof(BITMAP);
  28. return ORIGINAL_API(GetObjectA)(hgdiobj, cbBuffer, lpvObject);
  29. }
  30. /*++
  31. Register hooked functions
  32. --*/
  33. HOOK_BEGIN
  34. APIHOOK_ENTRY(GDI32.DLL, GetObjectA)
  35. HOOK_END
  36. IMPLEMENT_SHIM_END