Depending on the size of the prototype, the PRE_1 macro generates a prototype to the class declaration header file on the fly. On the end of it,
there is a stub to return to the class declaration, as PRE_1, but I don't quite understand why the stub_1 function is returned. My thought was because the function was a windows api, which uses stdcall, and it needs the caller to clean up the stack and the callee should return the size of the stack to the caller, so there are 1 parameters in Direct3DCreate9, so upon returning from the call, the caller is responsible to clean 4 bytes on the stack. So in 32bit mode, the stub is defined as __declspec(naked) and has some inline assembly which can't be compiled in 64bit mode.
How do I work around it? I did try to write a separate asm file, but firstly with stdcalls I really don't know how to define a stdcall procedure in assembly and the retn mneonmics is even not supported

Thanks
Jack

Code:
class A 
{ 
   PRE_1( Direct3DCreate9, UINT );
};

#define PRE_1( FuncName, Param0 ) static LPVOID Pre_##FuncName( SPROXYENTRYSTRUCT* pEntry, KHOOK* pHook )\
{\
    pEntry->eax = (REGTYPE)this_->_##FuncName\
    (\
    (PFN_##FuncName)pHook->GetUnhooked(),\
    (##Param0)pEntry->parameters[ 0 ] \
    );\
    return stub_1; \
}

void __declspec(naked) stub_1()
{ 
    __asm{
       retn    4
    }
 
}