2 * 16-bit mode stack frame layout
4 * Copyright 1995 Alexandre Julliard
7 #ifndef WINE_STACKFRAME_H
8 #define WINE_STACKFRAME_H
17 /* 16-bit stack layout after CallFrom16() */
20 WORD saved_ss
; /* saved previous 16-bit stack */
22 WORD entry_ip
; /* ip of entry point */
24 WORD entry_cs
; /* cs of entry point */
26 DWORD entry_point WINE_PACKED
; /* 32-bit entry point to call */
27 WORD bp
; /* 16-bit bp */
28 WORD ip
; /* return address */
30 WORD args
[1]; /* arguments to API function */
33 /* 32-bit stack layout after CallTo16() */
36 DWORD saved_esp
; /* saved previous 32-bit stack */
37 DWORD edi
; /* saved registers */
42 DWORD ebp
; /* saved 32-bit frame pointer */
43 DWORD retaddr
; /* return address */
44 DWORD codeselector
; /* code selector for return address */
45 DWORD args
[1]; /* arguments to 16-bit function */
52 /* Saved 16-bit stack for current process (Win16 only) */
53 extern WORD IF1632_Saved16_ss
;
54 extern WORD IF1632_Saved16_sp
;
56 /* Saved 32-bit stack for current process (Win16 only) */
57 extern DWORD IF1632_Saved32_esp
;
58 extern SEGPTR IF1632_Stack32_base
;
60 /* Original Unix stack */
61 extern DWORD IF1632_Original32_esp
;
64 #define CURRENT_STACK16 \
65 ((STACK16FRAME *)PTR_SEG_OFF_TO_LIN(IF1632_Saved16_ss,IF1632_Saved16_sp))
67 #define CURRENT_DS (CURRENT_STACK16->ds)
69 /* Make a segmented pointer from a pointer to a variable located */
70 /* on the 32-bit stack for the current task. */
72 #define MAKE_SEGPTR(ptr) \
73 ((SEGPTR)IF1632_Stack32_base + \
74 ((DWORD)(ptr) - (DWORD)PTR_SEG_TO_LIN(IF1632_Stack32_base)))
76 SEGPTR
MAKE_SEGPTR(void *ptr
);
78 #define CURRENT_STACK16 error.error
79 #define CURRENT_DS ((WORD)GetTaskDS())
80 #define MAKE_SEGPTR(ptr) ((SEGPTR)ptr)
83 #endif /* WINE_STACKFRAME_H */