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