- added a dump of the palette creation flags
[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 } DRVCONFIGINFO32, *LPDRVCONFIGINFO32;
51
52 DECL_WINELIB_TYPE(DRVCONFIGINFO)
53 DECL_WINELIB_TYPE(LPDRVCONFIGINFO)
54
55 /* GetDriverInfo16 references this structure, so this a struct defined
56  * in the Win16 API.
57  * GetDriverInfo has been deprecated in Win32.
58  */
59 typedef struct
60 {
61     UINT16                      length;
62     HDRVR16                     hDriver;
63     HINSTANCE16                 hModule;
64     CHAR                        szAliasName[128];
65 } DRIVERINFOSTRUCT16, *LPDRIVERINFOSTRUCT16;
66
67 LRESULT WINAPI DefDriverProc16(DWORD dwDevID, HDRVR16 hDriv, UINT16 wMsg, 
68                                LPARAM dwParam1, LPARAM dwParam2);
69 LRESULT WINAPI DefDriverProc32(DWORD dwDriverIdentifier, HDRVR32 hdrvr,
70                                UINT32 Msg, LPARAM lParam1, LPARAM lParam2);
71 #define DefDriverProc WINELIB_NAME(DefDriverProc)
72 HDRVR16 WINAPI OpenDriver16(LPCSTR szDriverName, LPCSTR szSectionName,
73                             LPARAM lParam2);
74 HDRVR32 WINAPI OpenDriver32A(LPCSTR szDriverName, LPCSTR szSectionName,
75                              LPARAM lParam2);
76 HDRVR32 WINAPI OpenDriver32W(LPCWSTR szDriverName, LPCWSTR szSectionName,
77                              LPARAM lParam2);
78 #define OpenDriver WINELIB_NAME_AW(OpenDriver)
79 LRESULT WINAPI CloseDriver16(HDRVR16 hDriver, LPARAM lParam1, LPARAM lParam2);
80 LRESULT WINAPI CloseDriver32(HDRVR32 hDriver, LPARAM lParam1, LPARAM lParam2);
81 #define CloseDriver WINELIB_NAME(CloseDriver)
82 LRESULT WINAPI SendDriverMessage16( HDRVR16 hDriver, UINT16 message,
83                                     LPARAM lParam1, LPARAM lParam2 );
84 LRESULT WINAPI SendDriverMessage32( HDRVR32 hDriver, UINT32 message,
85                                     LPARAM lParam1, LPARAM lParam2 );
86 #define SendDriverMessage WINELIB_NAME(SendDriverMessage)
87 HMODULE16 WINAPI GetDriverModuleHandle16(HDRVR16 hDriver);
88 HMODULE32 WINAPI GetDriverModuleHandle32(HDRVR32 hDriver);
89 #define GetDriverModuleHandle WINELIB_NAME(GetDriverModuleHandle)
90
91 /* only win31 version for those below ? */
92 HDRVR16 WINAPI GetNextDriver(HDRVR16, DWORD);
93 BOOL16 WINAPI GetDriverInfo(HDRVR16, DRIVERINFOSTRUCT16 *);
94
95 /* The following definitions are WINE internals */
96 /* FIXME: This is a WINE internal struct and should be moved in include/wine directory */
97 /* Please note that WINE shares 16 and 32 bit drivers on a single list... */
98 /* Basically, we maintain an external double view on drivers, so that a 16 bit drivers 
99  * can be loaded/used... by 32 functions transparently 
100  */
101 typedef struct tagWINE_DRIVER
102 {
103     char                        szAliasName[128];
104     /* as usual LPWINE_DRIVER == hDriver32 */
105     HDRVR16                     hDriver16;
106     union {
107        struct {
108           HMODULE16             hModule;
109           DRIVERPROC16          lpDrvProc;
110        } d16;
111        struct {
112           HMODULE32             hModule;
113           DRIVERPROC32          lpDrvProc;
114        } d32;
115     } d;
116     DWORD                       dwDriverID;
117     DWORD                       dwFlags;
118     struct tagWINE_DRIVER*      lpPrevItem;
119     struct tagWINE_DRIVER*      lpNextItem;
120 } WINE_DRIVER, *LPWINE_DRIVER;
121
122 /* values for dwFlags */
123 #define WINE_DI_TYPE_MASK       0x00000007ul
124 #define WINE_DI_TYPE_16         0x00000001ul
125 #define WINE_DI_TYPE_32         0x00000002ul
126
127 LPWINE_DRIVER   DRIVER_RegisterDriver16(LPCSTR, HMODULE16, DRIVERPROC16, LPARAM);
128 LPWINE_DRIVER   DRIVER_RegisterDriver32(LPCSTR, HMODULE32, DRIVERPROC32, LPARAM);
129
130 #if 0
131 #errro "it's never used"
132 /* internal */
133 typedef struct
134 {
135     UINT32                      length;
136     HDRVR32                     hDriver;
137     HMODULE32                   hModule;
138     CHAR                        szAliasName[128];
139 } DRIVERINFOSTRUCT32A, *LPDRIVERINFOSTRUCT32A;
140 #endif
141
142 #endif  /* __WINE_DRIVER_H */