diff -r 2efe13dab607 -r deec66cea8cc sourcehook/test/sourcehook_test.h --- a/sourcehook/test/sourcehook_test.h Fri Nov 09 21:14:37 2007 +0000 +++ b/sourcehook/test/sourcehook_test.h Sat Nov 10 16:10:55 2007 +0000 @@ -34,3 +34,16 @@ void Test_UnloadPlugin(SourceHook::ISourceHook *shptr, SourceHook::Plugin plug); void Test_PausePlugin(SourceHook::ISourceHook *shptr, SourceHook::Plugin plug); void Test_UnpausePlugin(SourceHook::ISourceHook *shptr, SourceHook::Plugin plug); + +SourceHook::IHookManagerAutoGen *Test_HMAG_Factory(SourceHook::ISourceHook *pSHPtr); +void Test_HMAG_Delete(SourceHook::IHookManagerAutoGen *ptr); + +struct CHMAGAutoDestruction +{ + SourceHook::IHookManagerAutoGen *m_Ptr; + CHMAGAutoDestruction(SourceHook::IHookManagerAutoGen *ptr) : m_Ptr(ptr) {} + ~CHMAGAutoDestruction() { Test_HMAG_Delete(m_Ptr); } +}; + + +#define GET_HMAG(var, shptr) var = Test_HMAG_Factory(shptr); CHMAGAutoDestruction __hmagautodestruction(var);