.code
MACRO(DEFINE_WRAPPER_FUNC, n, off, x)
+#ifdef _M_IX86
PUBLIC _wrapper_func_&n&
_wrapper_func_&n&:
-mov eax, [esp+4]
-mov eax, [eax+4]
-mov [esp+4], eax
-mov eax, [eax]
-jmp dword ptr [eax+off]
+ mov eax, [esp+4]
+ mov eax, [eax+4]
+ mov [esp+4], eax
+ mov eax, [eax]
+ jmp dword ptr [eax+off]
+#elif defined(_M_AMD64)
+PUBLIC wrapper_func_&n&
+wrapper_func_&n&:
+ mov rcx, [rcx+4]
+ mov rax, [rcx]
+ jmp qword ptr [rax+off]
+#else
+#error Unimplemented
+#endif
ENDM
DEFINE_WRAPPER_FUNC 3, 12, 24
DEFINE_WRAPPER_FUNC 90, 360, 720
DEFINE_WRAPPER_FUNC 91, 364, 728
DEFINE_WRAPPER_FUNC 92, 368, 736
-DEFINE_WRAPPER_FUNC 93, 372, 744)
+DEFINE_WRAPPER_FUNC 93, 372, 744
DEFINE_WRAPPER_FUNC 94, 376, 752
DEFINE_WRAPPER_FUNC 95, 380, 760
DEFINE_WRAPPER_FUNC 96, 384, 768