1
0
mirror of https://github.com/alliedmodders/metamod-source.git synced 2025-03-22 13:19:40 +01:00

- Removed unnecessary definitions from sh_pagealloc.h

- Added CallConv_StdCall
- Added CallConv_HasVarArgs and CallConv_HasVafmt

--HG--
branch : hookman_autogen
extra : convert_revision : svn%3Ac2935e3e-5518-0410-8daf-afa5dab7d4e3/branches/hookman_autogen%40552
This commit is contained in:
Pavol Marko 2007-11-09 21:14:37 +00:00
parent 50b2b0541a
commit f3f226444a
5 changed files with 24 additions and 15 deletions

View File

@ -202,9 +202,13 @@ namespace SourceHook
{
enum CallConvention
{
CallConv_Unknown, /**< Unknown -- no extra info available */
CallConv_ThisCall, /**< This call (object pointer required) */
CallConv_Cdecl, /**< Standard C call */
CallConv_Unknown, /**< Unknown -- no extra info available (0)*/
CallConv_ThisCall, /**< This call (object pointer required) (1)*/
CallConv_Cdecl, /**< C call (2)*/
CallConv_StdCall, /**< Windows "stdcall" (3)*/
CallConv_HasVarArgs = (1<<16), /**< Has variable arguments */
CallConv_HasVafmt = CallConv_HasVarArgs | (1<<17) /**< last params: const char*, ... */
};
int numOfParams; //!< number of parameters

View File

@ -202,9 +202,13 @@ namespace SourceHook
{
enum CallConvention
{
CallConv_Unknown, /**< Unknown -- no extra info available */
CallConv_ThisCall, /**< This call (object pointer required) */
CallConv_Cdecl, /**< Standard C call */
CallConv_Unknown, /**< Unknown -- no extra info available (0)*/
CallConv_ThisCall, /**< This call (object pointer required) (1)*/
CallConv_Cdecl, /**< C call (2)*/
CallConv_StdCall, /**< Windows "stdcall" (3)*/
CallConv_HasVarArgs = (1<<16), /**< Has variable arguments */
CallConv_HasVafmt = CallConv_HasVarArgs | (1<<17) /**< last params: const char*, ... */
};
int numOfParams; //!< number of parameters

View File

@ -3,9 +3,6 @@
# if /********/ defined _WIN32
# include <windows.h>
# define SH_MEM_READ 1
# define SH_MEM_WRITE 2
# define SH_MEM_EXEC 4
# elif /******/ defined __linux__
# include <sys/mman.h>
# include <unistd.h>
@ -23,7 +20,7 @@ namespace SourceHook
If we alloc with malloc and then set the page access type to read/exec only, other regions returned by
malloc that are in the same page would lose their write access as well and the process could crash.
Allocating one page per code generation session is usually a waste of memory and on some plattforms also
Allocating one page per code generation session is usually a waste of memory and on some platforms also
a waste of virtual address space (Windows VirtualAlloc has a granularity of 64K).

View File

@ -202,9 +202,13 @@ namespace SourceHook
{
enum CallConvention
{
CallConv_Unknown, /**< Unknown -- no extra info available */
CallConv_ThisCall, /**< This call (object pointer required) */
CallConv_Cdecl, /**< Standard C call */
CallConv_Unknown, /**< Unknown -- no extra info available (0)*/
CallConv_ThisCall, /**< This call (object pointer required) (1)*/
CallConv_Cdecl, /**< C call (2)*/
CallConv_StdCall, /**< Windows "stdcall" (3)*/
CallConv_HasVarArgs = (1<<16), /**< Has variable arguments */
CallConv_HasVafmt = CallConv_HasVarArgs | (1<<17) /**< last params: const char*, ... */
};
int numOfParams; //!< number of parameters

View File

@ -1630,8 +1630,8 @@ namespace SourceHook
AutoDetectRetType();
AutoDetectParamFlags();
if (m_Proto.GetConvention() != ProtoInfo::CallConv_Cdecl &&
m_Proto.GetConvention() != ProtoInfo::CallConv_ThisCall)
// Basically, we only support ThisCall/thiscall with varargs
if ((m_Proto.GetConvention() & (~ProtoInfo::CallConv_HasVafmt)) != ProtoInfo::CallConv_ThisCall)
{
return NULL;
}