Release 970720
[wine/gsoc-2012-control.git] / include / stackframe.h
blob1e3711e33d332cb406ec8d66b85743919392e5b1
1 /*
2 * 16-bit mode stack frame layout
4 * Copyright 1995 Alexandre Julliard
5 */
7 #ifndef __WINE_STACKFRAME_H
8 #define __WINE_STACKFRAME_H
10 #include <windows.h>
11 #include "ldt.h"
13 #pragma pack(1)
15 /* 16-bit stack layout after CallFrom16() */
16 typedef struct
18 DWORD saved_ss_sp; /* saved previous 16-bit stack */
19 DWORD ebp; /* full 32-bit content of ebp */
20 WORD entry_ip; /* ip of entry point */
21 WORD ds; /* ds */
22 WORD entry_cs; /* cs of entry point */
23 WORD es; /* es */
24 DWORD entry_point WINE_PACKED; /* 32-bit entry point to call */
25 WORD bp; /* 16-bit bp */
26 WORD ip; /* return address */
27 WORD cs;
28 WORD args[1]; /* arguments to API function */
29 } STACK16FRAME;
31 /* 32-bit stack layout after CallTo16() */
32 typedef struct
34 DWORD saved_esp; /* saved previous 32-bit stack */
35 DWORD edi; /* saved registers */
36 DWORD esi;
37 DWORD edx;
38 DWORD ecx;
39 DWORD ebx;
40 DWORD ebp; /* saved 32-bit frame pointer */
41 DWORD retaddr; /* return address */
42 DWORD codeselector; /* code selector for return address */
43 DWORD args[1]; /* arguments to 16-bit function */
44 } STACK32FRAME;
46 #pragma pack(4)
48 /* Saved 16-bit stack for current process (Win16 only) */
49 extern DWORD IF1632_Saved16_ss_sp;
51 /* Saved 32-bit stack for current process (Win16 only) */
52 extern DWORD IF1632_Saved32_esp;
54 /* Original Unix stack */
55 extern DWORD IF1632_Original32_esp;
57 #define CURRENT_STACK16 ((STACK16FRAME *)PTR_SEG_TO_LIN(IF1632_Saved16_ss_sp))
59 #define CURRENT_DS (CURRENT_STACK16->ds)
61 #endif /* __WINE_STACKFRAME_H */