ReactOS Fundraising Campaign 2012
 
€ 4,410 / € 30,000

Information | Donate

Home | Info | Community | Development | myReactOS | Contact Us

  1. Home
  2. Community
  3. Development
  4. myReactOS
  5. Fundraiser 2012

  1. Main Page
  2. Alphabetical List
  3. Data Structures
  4. Directories
  5. File List
  6. Data Fields
  7. Globals
  8. Related Pages

ReactOS Development > Doxygen

stack.c
Go to the documentation of this file.
00001 #include <precomp.h>
00002 
00003 /*********************************************************************
00004 *              _chkesp (MSVCRT.@)
00005 *
00006 * Trap to a debugger if the value of the stack pointer has changed.
00007 *
00008 * PARAMS
00009 *  None.
00010 *
00011 * RETURNS
00012 *  Does not return.
00013 *
00014 * NOTES
00015 *  This function is available for iX86 only.
00016 *
00017 *  When VC++ generates debug code, it stores the value of the stack pointer
00018 *  before calling any external function, and checks the value following
00019 *  the call. It then calls this function, which will trap if the values are
00020 *  not the same. Usually this means that the prototype used to call
00021 *  the function is incorrect.  It can also mean that the .spec entry has
00022 *  the wrong calling convention or parameters.
00023 */
00024 
00025 #ifdef __i386__
00026 
00027 void _chkesp_failed(void)
00028 {
00029     ERR("stack got corrupted!\n");
00030     __debugbreak();
00031 }
00032 
00033 #endif  /* __i386__ */
00034 
00035 /*********************************************************************
00036  * _resetstkoflw (MSVCRT.@)
00037  */
00038 int CDECL _resetstkoflw(void)
00039 {
00040     int stack_addr;
00041 
00042     /* causes stack fault that updates NtCurrentTeb()->Tib.StackLimit */
00043     return VirtualProtect( &stack_addr, 1, PAGE_GUARD|PAGE_READWRITE, NULL );
00044 }

Generated on Sun May 27 2012 04:23:25 for ReactOS by doxygen 1.7.6.1

ReactOS is a registered trademark or a trademark of ReactOS Foundation in the United States and other countries.