Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
2c8a52eb
Commit
2c8a52eb
authored
Mar 15, 2003
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Implemented _chkesp, based on a patch by Jon Griffiths.
parent
f5be136c
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
48 additions
and
3 deletions
+48
-3
misc.c
dlls/msvcrt/misc.c
+48
-3
No files found.
dlls/msvcrt/misc.c
View file @
2c8a52eb
...
...
@@ -18,12 +18,14 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include "config.h"
#include "wine/port.h"
#include <stdlib.h>
#include "msvcrt.h"
#include "msvcrt/stdlib.h"
#include "wine/debug.h"
WINE_DEFAULT_DEBUG_CHANNEL
(
msvcrt
);
...
...
@@ -97,8 +99,51 @@ void* _lsearch(const void* match, void* start,
/*********************************************************************
* _chkesp (MSVCRT.@)
*
* Trap to a debugger if the value of the stack pointer has changed.
*
* PARAMS
* None.
*
* RETURNS
* Does not return.
*
* NOTES
* This function is available for iX86 only.
*
* When VC++ generates debug code, it stores the value of the stack pointer
* before calling any external function, and checks the value following
* the call. It then calls this function, which will trap if the values are
* not the same. Usually this means that the prototype used to call
* the function is incorrect. It can also mean that the .spec entry has
* the wrong calling convention or parameters.
*/
void
_chkesp
(
void
)
{
#ifdef __i386__
# ifdef __GNUC__
__ASM_GLOBAL_FUNC
(
_chkesp
,
"jnz 1f
\n\t
"
"ret
\n
"
"1:
\t
pushl %ebp
\n\t
"
"movl %esp,%ebp
\n\t
"
"pushl %eax
\n\t
"
"pushl %ecx
\n\t
"
"pushl %edx
\n\t
"
"call "
__ASM_NAME
(
"MSVCRT_chkesp_fail"
)
"
\n\t
"
"popl %edx
\n\t
"
"popl %ecx
\n\t
"
"popl %eax
\n\t
"
"popl %ebp
\n\t
"
"ret"
);
void
MSVCRT_chkesp_fail
(
void
)
{
ERR
(
"Stack pointer incorrect after last function call - Bad prototype/spec entry?
\n
"
);
DebugBreak
();
}
# else
/* __GNUC__ */
void
_chkesp
(
void
)
{
}
# endif
/* __GNUC__ */
#endif
/* __i386__ */
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment