[NTOSKRNL]
[reactos.git] / reactos / lib / sdk / RunTmChk / i386 / _RTC_CheckEsp.S
1
2
3 #include <asm.inc>
4 .code
5
6 EXTERN __RTC_Failure:PROC
7
8 /*
9
10 This function is invoked like this:
11
12 mov esi, esp
13 // Do the actual function call
14 cmp esp, esi
15 call __RTC_CheckEsp
16
17 http://stackoverflow.com/questions/3914750/hows-rtc-checkesp-implemented
18 */
19 PUBLIC __RTC_CheckEsp
20 __RTC_CheckEsp:
21
22 /* We check if the zero flag is set, and if it is, everything is fine
23 and we return to the caller */
24 je __RTC_CheckEsp_return
25
26 push ebp
27 mov ebp, esp
28 pusha
29
30 // void _RTC_Failure(void* retaddr, int errnum);
31 push 0 // errnum
32 push dword ptr [esp + 4] // retaddr
33 call __RTC_Failure
34 add esp, 8
35 int 3
36
37 popa
38 pop ebp
39
40 __RTC_CheckEsp_return:
41 ret
42
43 END
44
45