get-graphics-offsets.h 746 B

123456789101112131415161718192021222324252627282930313233
  1. #pragma once
  2. #include <stdint.h>
  3. #include <stdbool.h>
  4. #ifdef OBS_LEGACY
  5. #include "../graphics-hook-info.h"
  6. #else
  7. #include <graphics-hook-info.h>
  8. #endif
  9. #define DUMMY_WNDCLASS "get_addrs_wndclass"
  10. #ifdef __cplusplus
  11. extern "C" {
  12. #else
  13. #if defined(_MSC_VER) && !defined(inline)
  14. #define inline __inline
  15. #endif
  16. #endif
  17. static inline uint32_t vtable_offset(HMODULE module, void *cls, unsigned int offset)
  18. {
  19. uintptr_t *vtable = *(uintptr_t **)cls;
  20. return (uint32_t)(vtable[offset] - (uintptr_t)module);
  21. }
  22. extern void get_dxgi_offsets(struct dxgi_offsets *offsets, struct dxgi_offsets2 *offsets2);
  23. extern void get_d3d9_offsets(struct d3d9_offsets *offsets);
  24. extern void get_d3d8_offsets(struct d3d8_offsets *offsets);
  25. #ifdef __cplusplus
  26. }
  27. #endif