call_thunk
call_thunk copied to clipboard
Take the member function of the C++ class as the callback function of the C function
例子: 这样线程将不会被执行。 call_thunk::thunk thunk(obj, &TestClass::fun); CreateThread ( NULL , 0 , (LPTHREAD_START_ROUTINE )thunk, NULL , 0 , NULL ); return; 这样线程才会成功执行 call_thunk::thunk thunk(obj, &TestClass::fun); CreateThread ( NULL , 0 ,...
Does x64 require __fastcall?
I tried call_thunk with Visual Studio 2019 with some errors. May you try to build call_thunk with Visual Studio 2019? Thanks!
Thank you for the useful library. Not really an issue, just an observation that with C++11 and templates the library can be expanded to allow thunks to arbitrary std::function objects.
thunk_code_x64.cpp line 257 if(argc > 4) should be modified to if(argc >= 4) otherwise, the stack space will be destroyed