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.

33 lines
984 B

  1. /* ==================================
  2. * COMPUTER GENERATED -- DO NOT EDIT
  3. * ==================================
  4. *
  5. * This file contains the definitions for all proxy functions this DLL supports.
  6. *
  7. * The proxies are very simple functions that should be optimizied into a
  8. * single JMP instruction without editing the stack at all.
  9. *
  10. * NOTE: While this works, this is a somewhat hackish approach that is based on how
  11. * the compiler optimizes the code. That said, the proxy will not work on Debug build currently
  12. * (that can be fixed by changing the appropriate compile flag that I am yet to locate).
  13. */
  14. #pragma warning( disable : 4244 )
  15. #include <windows.h>
  16. #define ADD_ORIGINAL(i, name) originalFunctions[i] = GetProcAddress(dll, #name)
  17. #define PROXY(i, name) \
  18. __declspec(dllexport) ULONG __stdcall name() \
  19. { \
  20. return originalFunctions[i](); \
  21. }
  22. FARPROC originalFunctions[${proxy_count}] = {0};
  23. void loadFunctions(HMODULE dll)
  24. {
  25. ${proxy_add}
  26. }
  27. ${proxy_def}