Реферат: Перехват методов COM интерфейсов
std::cout << "method " << n << " postrocess, result "
<< std::hex << hr << std::endl;
return hr;
}
private:
#pragma pack(push,1)
struct CallInfo
{
void* p;
int n;
HRESULT hr;
DWORD_PTR ret_addr;
};
#pragma pack(pop)
private:
static void __cdecl store(int n, DWORD_PTR ret_addr, void* p)
{
CallInfo i = { p, n, 0, ret_addr };
storage.push(i);
}
static void __cdecl restore(HRESULT hr, CallInfo* pi)
{
*pi = storage.pop();
pi->hr = hr;
}
static void thunk();
private:
ThunkVtbl* vptr;
void* m_p;