We got passed a NULL Dialect ptr and accessed it unprotected.
[wine] / include / driver.h
1 /*
2  * Drivers definitions
3  */
4
5 #ifndef __WINE_DRIVER_H
6 #define __WINE_DRIVER_H
7
8 #define DRV_LOAD                0x0001
9 #define DRV_ENABLE              0x0002
10 #define DRV_OPEN                0x0003
11 #define DRV_CLOSE               0x0004
12 #define DRV_DISABLE             0x0005
13 #define DRV_FREE                0x0006
14 #define DRV_CONFIGURE           0x0007
15 #define DRV_QUERYCONFIGURE      0x0008
16 #define DRV_INSTALL             0x0009
17 #define DRV_REMOVE              0x000A
18 #define DRV_EXITSESSION         0x000B
19 #define DRV_EXITAPPLICATION     0x000C
20 #define DRV_POWER               0x000F
21
22 #define DRV_RESERVED            0x0800
23 #define DRV_USER                0x4000
24
25 #define DRVCNF_CANCEL           0x0000
26 #define DRVCNF_OK               0x0001
27 #define DRVCNF_RESTART          0x0002
28
29 #define DRVEA_NORMALEXIT        0x0001
30 #define DRVEA_ABNORMALEXIT      0x0002
31
32 #define DRV_SUCCESS             0x0001
33 #define DRV_FAILURE             0x0000
34
35 #define GND_FIRSTINSTANCEONLY   0x00000001
36
37 #define GND_FORWARD             0x00000000
38 #define GND_REVERSE             0x00000002
39
40 typedef struct {
41     DWORD                       dwDCISize;
42     LPCSTR                      lpszDCISectionName;
43     LPCSTR                      lpszDCIAliasName;
44 } DRVCONFIGINFO16, *LPDRVCONFIGINFO16;
45
46 typedef struct {
47     DWORD                       dwDCISize;
48     LPCWSTR                     lpszDCISectionName;
49     LPCWSTR                     lpszDCIAliasName;
50 } DRVCONFIGINFO, *LPDRVCONFIGINFO;
51
52
53 /* GetDriverInfo16 references this structure, so this a struct defined
54  * in the Win16 API.
55  * GetDriverInfo has been deprecated in Win32.
56  */
57 typedef struct
58 {
59     UINT16                      length;
60     HDRVR16                     hDriver;
61     HINSTANCE16                 hModule;
62     CHAR                        szAliasName[128];
63 } DRIVERINFOSTRUCT16, *LPDRIVERINFOSTRUCT16;
64
65 LRESULT WINAPI DefDriverProc16(DWORD dwDevID, HDRVR16 hDriv, UINT16 wMsg, 
66                                LPARAM dwParam1, LPARAM dwParam2);
67 LRESULT WINAPI DefDriverProc(DWORD dwDriverIdentifier, HDRVR hdrvr,
68                                UINT Msg, LPARAM lParam1, LPARAM lParam2);
69 HDRVR16 WINAPI OpenDriver16(LPCSTR szDriverName, LPCSTR szSectionName,
70                             LPARAM lParam2);
71 HDRVR WINAPI OpenDriverA(LPCSTR szDriverName, LPCSTR szSectionName,
72                              LPARAM lParam2);
73 HDRVR WINAPI OpenDriverW(LPCWSTR szDriverName, LPCWSTR szSectionName,
74                              LPARAM lParam2);
75 #define OpenDriver WINELIB_NAME_AW(OpenDriver)
76 LRESULT WINAPI CloseDriver16(HDRVR16 hDriver, LPARAM lParam1, LPARAM lParam2);
77 LRESULT WINAPI CloseDriver(HDRVR hDriver, LPARAM lParam1, LPARAM lParam2);
78 LRESULT WINAPI SendDriverMessage16( HDRVR16 hDriver, UINT16 message,
79                                     LPARAM lParam1, LPARAM lParam2 );
80 LRESULT WINAPI SendDriverMessage( HDRVR hDriver, UINT message,
81                                     LPARAM lParam1, LPARAM lParam2 );
82 HMODULE16 WINAPI GetDriverModuleHandle16(HDRVR16 hDriver);
83 HMODULE WINAPI GetDriverModuleHandle(HDRVR hDriver);
84
85 /* only win31 version for those below ? */
86 HDRVR16 WINAPI GetNextDriver16(HDRVR16, DWORD);
87 BOOL16 WINAPI GetDriverInfo16(HDRVR16, DRIVERINFOSTRUCT16 *);
88
89 /* The following definitions are WINE internals */
90 /* FIXME: This is a WINE internal struct and should be moved in include/wine directory */
91 /* Please note that WINE shares 16 and 32 bit drivers on a single list... */
92 /* Basically, we maintain an external double view on drivers, so that a 16 bit drivers 
93  * can be loaded/used... by 32 functions transparently 
94  */
95 typedef struct tagWINE_DRIVER
96 {
97     char                        szAliasName[128];
98     /* as usual LPWINE_DRIVER == hDriver32 */
99     HDRVR16                     hDriver16;
100     union {
101        struct {
102           HMODULE16             hModule;
103           DRIVERPROC16          lpDrvProc;
104        } d16;
105        struct {
106           HMODULE               hModule;
107           DRIVERPROC            lpDrvProc;
108        } d32;
109     } d;
110     DWORD                       dwDriverID;
111     DWORD                       dwFlags;
112     struct tagWINE_DRIVER*      lpPrevItem;
113     struct tagWINE_DRIVER*      lpNextItem;
114 } WINE_DRIVER, *LPWINE_DRIVER;
115
116 /* values for dwFlags */
117 #define WINE_DI_TYPE_MASK       0x00000007ul
118 #define WINE_DI_TYPE_16         0x00000001ul
119 #define WINE_DI_TYPE_32         0x00000002ul
120
121 LPWINE_DRIVER   DRIVER_RegisterDriver16(LPCSTR, HMODULE16, DRIVERPROC16, LPARAM);
122 LPWINE_DRIVER   DRIVER_RegisterDriver32(LPCSTR, HMODULE, DRIVERPROC, LPARAM);
123
124 #if 0
125 #errro "it's never used"
126 /* internal */
127 typedef struct
128 {
129     UINT                        length;
130     HDRVR                       hDriver;
131     HMODULE                     hModule;
132     CHAR                        szAliasName[128];
133 } DRIVERINFOSTRUCTA, *LPDRIVERINFOSTRUCTA;
134 #endif
135
136 #endif  /* __WINE_DRIVER_H */