2 * JBP (Jim Peterson <jspeter@birch.ee.vt.edu>): Lots of stubs needed for
16 int CallTo32_LargeStack( int (*func
)(), int nbargs
, ...)
21 va_start(arglist
,nbargs
);
23 for(i
=0; i
<nbargs
; i
++) a
[i
]=va_arg(arglist
,int);
25 switch(nbargs
) /* Ewww... Icky. But what can I do? */
27 case 5: return func(a
[0],a
[1],a
[2],a
[3],a
[4]);
28 case 6: return func(a
[0],a
[1],a
[2],a
[3],a
[4],a
[5]);
29 case 8: return func(a
[0],a
[1],a
[2],a
[3],a
[4],a
[5],a
[6],a
[7]);
30 case 10: return func(a
[0],a
[1],a
[2],a
[3],a
[4],a
[5],a
[6],
32 case 11: return func(a
[0],a
[1],a
[2],a
[3],a
[4],a
[5],a
[6],
33 a
[7],a
[8],a
[9],a
[10]);
34 case 14: return func(a
[0],a
[1],a
[2],a
[3],a
[4],a
[5],a
[6],
35 a
[7],a
[8],a
[9],a
[10],a
[11],a
[12],a
[13]);
36 case 17: return func(a
[0],a
[1],a
[2],a
[3],a
[4],a
[5],a
[6],
37 a
[7],a
[8],a
[9],a
[10],a
[11],a
[12],a
[13],a
[14],a
[15],a
[16]);
38 default: fprintf(stderr
,"JBP: CallTo32_LargeStack called with unsupported "
39 "number of arguments (%d). Ignored.\n",nbargs
);
44 WORD
CallTo16_word_ ( FARPROC func
, WORD arg
) { return func(arg
); }
46 extern LRESULT
ACTIVATEAPP_callback(HWND
,UINT
,WPARAM
,LPARAM
);
47 extern LRESULT
AboutDlgProc(HWND
,UINT
,WPARAM
,LPARAM
);
48 extern LRESULT
ButtonWndProc(HWND
,UINT
,WPARAM
,LPARAM
);
49 extern LRESULT
CARET_Callback(HWND
,UINT
,WPARAM
,LPARAM
);
50 extern LRESULT
ColorDlgProc(HWND
,UINT
,WPARAM
,LPARAM
);
51 extern LRESULT
ComboBoxWndProc(HWND
,UINT
,WPARAM
,LPARAM
);
52 extern LRESULT
ComboLBoxWndProc(HWND
,UINT
,WPARAM
,LPARAM
);
53 extern LRESULT
DesktopWndProc(HWND
,UINT
,WPARAM
,LPARAM
);
54 extern LRESULT
EditWndProc(HWND
,UINT
,WPARAM
,LPARAM
);
55 extern LRESULT
FileOpenDlgProc(HWND
,UINT
,WPARAM
,LPARAM
);
56 extern LRESULT
FileSaveDlgProc(HWND
,UINT
,WPARAM
,LPARAM
);
57 extern LRESULT
FindTextDlgProc(HWND
,UINT
,WPARAM
,LPARAM
);
58 extern LRESULT
ListBoxWndProc(HWND
,UINT
,WPARAM
,LPARAM
);
59 extern LRESULT
MDIClientWndProc(HWND
,UINT
,WPARAM
,LPARAM
);
60 extern LRESULT
PopupMenuWndProc(HWND
,UINT
,WPARAM
,LPARAM
);
61 extern LRESULT
PrintDlgProc(HWND
,UINT
,WPARAM
,LPARAM
);
62 extern LRESULT
PrintSetupDlgProc(HWND
,UINT
,WPARAM
,LPARAM
);
63 extern LRESULT
ReplaceTextDlgProc(HWND
,UINT
,WPARAM
,LPARAM
);
64 extern LRESULT
ScrollBarWndProc(HWND
,UINT
,WPARAM
,LPARAM
);
65 extern LRESULT
StaticWndProc(HWND
,UINT
,WPARAM
,LPARAM
);
66 extern LRESULT
SystemMessageBoxProc(HWND
,UINT
,WPARAM
,LPARAM
);
67 extern LRESULT
TASK_Reschedule(HWND
,UINT
,WPARAM
,LPARAM
);
69 LRESULT
ErrorProc(HWND hWnd
,UINT msg
,WPARAM wParam
,LPARAM lParam
)
71 fprintf(stderr
,"ERROR: ErrorProc() called!\n");
75 /***********************************************************************
76 * MODULE_GetWndProcEntry16 (not a Windows API function)
78 * Return an entry point from the WPROCS dll.
80 WNDPROC
MODULE_GetWndProcEntry16( char *name
)
82 #define MAP_STR_TO_PROC(str,proc) if(!strcmp(name,str))return proc
83 MAP_STR_TO_PROC("ActivateAppProc",ACTIVATEAPP_callback
);
84 MAP_STR_TO_PROC("AboutDlgProc",AboutDlgProc
);
85 MAP_STR_TO_PROC("ButtonWndProc",ButtonWndProc
);
86 MAP_STR_TO_PROC("CARET_Callback",CARET_Callback
);
87 MAP_STR_TO_PROC("ColorDlgProc",ColorDlgProc
);
88 MAP_STR_TO_PROC("ComboBoxWndProc",ComboBoxWndProc
);
89 MAP_STR_TO_PROC("ComboLBoxWndProc",ComboLBoxWndProc
);
90 MAP_STR_TO_PROC("DefDlgProc",DefDlgProc
);
91 MAP_STR_TO_PROC("DesktopWndProc",DesktopWndProc
);
92 MAP_STR_TO_PROC("EditWndProc",EditWndProc
);
93 MAP_STR_TO_PROC("FileOpenDlgProc",FileOpenDlgProc
);
94 MAP_STR_TO_PROC("FileSaveDlgProc",FileSaveDlgProc
);
95 MAP_STR_TO_PROC("FindTextDlgProc",FindTextDlgProc
);
96 MAP_STR_TO_PROC("ListBoxWndProc",ListBoxWndProc
);
97 MAP_STR_TO_PROC("MDIClientWndProc",MDIClientWndProc
);
98 MAP_STR_TO_PROC("PopupMenuWndProc",PopupMenuWndProc
);
99 MAP_STR_TO_PROC("PrintDlgProc",PrintDlgProc
);
100 MAP_STR_TO_PROC("PrintSetupDlgProc",PrintSetupDlgProc
);
101 MAP_STR_TO_PROC("ReplaceTextDlgProc",ReplaceTextDlgProc
);
102 MAP_STR_TO_PROC("ScrollBarWndProc",ScrollBarWndProc
);
103 MAP_STR_TO_PROC("StaticWndProc",StaticWndProc
);
104 MAP_STR_TO_PROC("SystemMessageBoxProc",SystemMessageBoxProc
);
105 MAP_STR_TO_PROC("TASK_Reschedule",TASK_Reschedule
);
106 fprintf(stderr
,"warning: No mapping for %s(), add one in library/miscstubs.c\n",name
);
110 /***********************************************************************
111 * MODULE_GetWndProcEntry32 (not a Windows API function)
113 * Return an entry point from the WPROCS32 dll.
115 WNDPROC
MODULE_GetWndProcEntry32( char *name
)
117 return MODULE_GetWndProcEntry16( name
);
120 void DEBUG_EnterDebugger(void)