Upgrade build scripts to AMBuild 2 (
bug 5970, r=ds).
1 /* ======== SourceHook ========
2 * Copyright (C) 2004-2010 Metamod:Source Development Team
3 * No warranties of any kind
7 * Author(s): Pavol "PM OnoTo" Marko
8 * ============================
11 #ifndef __SOURCEHOOK_IMPL_CVFNPTR_H__
12 #define __SOURCEHOOK_IMPL_CVFNPTR_H__
15 #include "sh_memory.h"
16 #include "sh_pagealloc.h"
17 #include "sourcehook_impl_cleanuptask.h"
25 static CPageAlloc ms_AlignedPageAllocator;
30 void *m_OrigCallThunk; // See Init() method
32 List<CHookManager*> m_HookMans;
33 List<CIface> m_IfaceList;
36 typedef void* Descriptor;
42 inline bool operator==(const Descriptor &other);
43 inline void *GetPtr() const;
44 inline void *GetOrigEntry() const;
45 void *GetOrigCallAddr() const;
46 inline List<CIface> &GetIfaceList();
47 inline const List<CIface> &GetIfaceList() const;
48 CIface *FindIface(void *iface);
49 CIface &GetIface(void *iface);
50 bool Patch(void *newValue);
53 ICleanupTask *GetCleanupTask();
55 void AddHookMan(CHookManager *pHookMan);
56 // If this returns false, it means that there is no hook manager left
57 // to use and that this vfnptr should be removed.
58 bool HookManRemoved(CHookManager *pHookMan);
61 // *** Implementation ***
63 inline bool CVfnPtr::operator==(const Descriptor &other)
65 return m_Ptr == other;
68 inline void *CVfnPtr::GetPtr() const
73 inline void *CVfnPtr::GetOrigEntry() const
78 inline List<CIface> &CVfnPtr::GetIfaceList()
83 inline const List<CIface> &CVfnPtr::GetIfaceList() const