Release 960805
[wine] / library / miscstubs.c
1 /*
2  * JBP (Jim Peterson <jspeter@birch.ee.vt.edu>): Lots of stubs needed for
3  *      libwine.a.
4  */
5
6 #include <stdarg.h>
7 #include <stdio.h>
8 #include <stdlib.h>
9 #include <string.h>
10 #include "windows.h"
11 #include "dde_mem.h"
12 #include "global.h"
13 #include "debug.h"
14 #include "xmalloc.h"
15
16 int CallTo32_LargeStack( int (*func)(), int nbargs, ...)
17 {
18   va_list arglist;
19   int i,a[32];
20
21   va_start(arglist,nbargs);
22
23   for(i=0; i<nbargs; i++) a[i]=va_arg(arglist,int);
24
25   switch(nbargs) /* Ewww... Icky.  But what can I do? */
26   {
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],
31                 a[7],a[8],a[9]);
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 16: 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]);
38   default: fprintf(stderr,"JBP: CallTo32_LargeStack called with unsupported "
39                           "number of arguments (%d).  Ignored.\n",nbargs);
40            return 0;
41   }
42 }
43
44 extern LRESULT AboutDlgProc(HWND,UINT,WPARAM,LPARAM);
45 extern LRESULT ColorDlgProc(HWND,UINT,WPARAM,LPARAM);
46 extern LRESULT ComboBoxWndProc(HWND,UINT,WPARAM,LPARAM);
47 extern LRESULT ComboLBoxWndProc(HWND,UINT,WPARAM,LPARAM);
48 extern LRESULT EditWndProc(HWND,UINT,WPARAM,LPARAM);
49 extern LRESULT FileOpenDlgProc(HWND,UINT,WPARAM,LPARAM);
50 extern LRESULT FileSaveDlgProc(HWND,UINT,WPARAM,LPARAM);
51 extern LRESULT FindTextDlgProc(HWND,UINT,WPARAM,LPARAM);
52 extern LRESULT ListBoxWndProc(HWND,UINT,WPARAM,LPARAM);
53 extern LRESULT MDIClientWndProc(HWND,UINT,WPARAM,LPARAM);
54 extern LRESULT PopupMenuWndProc(HWND,UINT,WPARAM,LPARAM);
55 extern LRESULT PrintDlgProc(HWND,UINT,WPARAM,LPARAM);
56 extern LRESULT PrintSetupDlgProc(HWND,UINT,WPARAM,LPARAM);
57 extern LRESULT ReplaceTextDlgProc(HWND,UINT,WPARAM,LPARAM);
58 extern LRESULT ScrollBarWndProc(HWND,UINT,WPARAM,LPARAM);
59 extern LRESULT StaticWndProc(HWND,UINT,WPARAM,LPARAM);
60 extern LRESULT SystemMessageBoxProc(HWND,UINT,WPARAM,LPARAM);
61 extern LRESULT TASK_Reschedule(void);
62
63 /***********************************************************************
64  *           MODULE_GetWndProcEntry16 (not a Windows API function)
65  *
66  * Return an entry point from the WPROCS dll.
67  */
68 FARPROC16 MODULE_GetWndProcEntry16( char *name )
69 {
70 #define MAP_STR_TO_PROC(str,proc) if(!strcmp(name,str))return (FARPROC16)proc
71   MAP_STR_TO_PROC("AboutDlgProc",AboutDlgProc);
72   MAP_STR_TO_PROC("ColorDlgProc",ColorDlgProc);
73   MAP_STR_TO_PROC("ComboBoxWndProc",ComboBoxWndProc);
74   MAP_STR_TO_PROC("ComboLBoxWndProc",ComboLBoxWndProc);
75   MAP_STR_TO_PROC("DefDlgProc",DefDlgProc16);
76   MAP_STR_TO_PROC("EditWndProc",EditWndProc);
77   MAP_STR_TO_PROC("FileOpenDlgProc",FileOpenDlgProc);
78   MAP_STR_TO_PROC("FileSaveDlgProc",FileSaveDlgProc);
79   MAP_STR_TO_PROC("FindTextDlgProc",FindTextDlgProc);
80   MAP_STR_TO_PROC("ListBoxWndProc",ListBoxWndProc);
81   MAP_STR_TO_PROC("MDIClientWndProc",MDIClientWndProc);
82   MAP_STR_TO_PROC("PopupMenuWndProc",PopupMenuWndProc);
83   MAP_STR_TO_PROC("PrintDlgProc",PrintDlgProc);
84   MAP_STR_TO_PROC("PrintSetupDlgProc",PrintSetupDlgProc);
85   MAP_STR_TO_PROC("ReplaceTextDlgProc",ReplaceTextDlgProc);
86   MAP_STR_TO_PROC("ScrollBarWndProc",ScrollBarWndProc);
87   MAP_STR_TO_PROC("StaticWndProc",StaticWndProc);
88   MAP_STR_TO_PROC("SystemMessageBoxProc",SystemMessageBoxProc);
89   MAP_STR_TO_PROC("TASK_Reschedule",TASK_Reschedule);
90   fprintf(stderr,"warning: No mapping for %s(), add one in library/miscstubs.c\n",name);
91   return NULL;
92 }
93
94 void DEBUG_EnterDebugger(void)
95 {
96 }
97