2 * PROJECT: ReactOS Source Development Kit (SDK)
3 * LICENSE: BSD - See COPYING.ARM in the top level directory
4 * FILE: include/ddk/api/callconv.s
5 * PURPOSE: x86 Calling Convention Helpers
6 * PROGRAMMERS: ReactOS Portable Systems Group
9 /* INCLUDES *******************************************************************/
14 // This macro counts the number of arguments in the ArgList and returns
15 // the value in cCount.
17 // @param cCount - Count of arguments
18 // @param ArgList - Argument list
22 .macro CountArg cCount:req,ArgList:vararg
36 // This macro pushes the arguments in ArgList in the reverse order
37 // and returns the number of arguments in cCount
39 // @param cCount - Count of arguments
40 // @param ArgList - Argument list
44 .macro RevPush cCount:req,ArgList:vararg
47 CountArg cCount, ArgList
67 // This macro performs a function call using the STDCALL convention and applies
68 // the correct name decoration required based on the stack bytes
70 // @param Func - Function name
71 // @param N - Number of stack bytes for arguments
75 .macro stdCallCall Func:req,N:req
76 .ifdef __imp_&Func&@&N
77 call dword ptr [__imp_&Func&@&N]
86 // This macro pushes the arguments required for a function call using the
87 // STDCALL convention and then issues the call
89 // @param Func - Function name
90 // @param ArgList - Argument list
94 .macro stdCall Func:req,ArgList:vararg
100 stdCallCall Func, %(Bytes)