Fixed some issues reported by winapi_check.
[wine] / include / ddeml.h
1 /*
2  * DDEML library definitions
3  *
4  * Copyright 1997 Alexandre Julliard
5  * Copyright 1997 Len White
6  */
7
8 #ifndef __WINE_DDEML_H
9 #define __WINE_DDEML_H
10
11 #include "windef.h"
12
13 #ifdef __cplusplus
14 extern "C" {
15 #endif /* defined(__cplusplus) */
16
17 /* Codepage Constants
18  */
19
20 #define CP_WINANSI      1004
21 #define CP_WINUNICODE   1200
22
23 /* DDE synchronisation constants 
24  */
25
26 #define MSGF_DDEMGR 0x8001
27
28 #define QID_SYNC16      -1L
29 #define QID_SYNC        0xFFFFFFFF
30
31 /*   Type variation for MS  deliberate departures from ANSI standards
32  */
33
34 #define EXPENTRY CALLBACK
35
36 /***************************************************
37
38       FLAGS Section - copied from Microsoft SDK as must be standard, probably Copyright Microsoft Corporation
39
40 ***************************************************/
41
42 /*
43  * Callback filter flags for use with standard apps.
44  */
45
46 #define     CBF_FAIL_SELFCONNECTIONS     0x00001000
47 #define     CBF_FAIL_CONNECTIONS         0x00002000
48 #define     CBF_FAIL_ADVISES             0x00004000
49 #define     CBF_FAIL_EXECUTES            0x00008000
50 #define     CBF_FAIL_POKES               0x00010000
51 #define     CBF_FAIL_REQUESTS            0x00020000
52 #define     CBF_FAIL_ALLSVRXACTIONS      0x0003f000
53
54 #define     CBF_SKIP_CONNECT_CONFIRMS    0x00040000
55 #define     CBF_SKIP_REGISTRATIONS       0x00080000
56 #define     CBF_SKIP_UNREGISTRATIONS     0x00100000
57 #define     CBF_SKIP_DISCONNECTS         0x00200000
58 #define     CBF_SKIP_ALLNOTIFICATIONS    0x003c0000
59
60 #define     CBR_BLOCK                    0xFFFFFFFFL
61
62 /*
63  * Application command flags
64  */
65 #define     APPCMD_CLIENTONLY            0x00000010L
66 #define     APPCMD_FILTERINITS           0x00000020L
67 #define     APPCMD_MASK                  0x00000FF0L
68
69 /*
70  * Application classification flags
71  */
72
73 #define     APPCLASS_STANDARD            0x00000000L
74 #define     APPCLASS_MONITOR             0x00000001L
75 #define     APPCLASS_MASK                0x0000000FL
76
77 /*
78  * Callback filter flags for use with MONITOR apps - 0 implies no monitor
79  * callbacks.
80  */
81 #define     MF_HSZ_INFO                  0x01000000
82 #define     MF_SENDMSGS                  0x02000000
83 #define     MF_POSTMSGS                  0x04000000
84 #define     MF_CALLBACKS                 0x08000000
85 #define     MF_ERRORS                    0x10000000
86 #define     MF_LINKS                     0x20000000
87 #define     MF_CONV                      0x40000000
88
89 #define     MF_MASK                      0xFF000000
90
91 /*
92  *      DdeNameService service name flags
93  */
94
95 #define     DNS_REGISTER                 0x0001
96 #define     DNS_UNREGISTER               0x0002
97 #define     DNS_FILTERON                 0x0004
98 #define     DNS_FILTEROFF                0x0008
99
100
101 /****************************************************
102
103       End of Flags section
104
105 ****************************************************/
106
107 /****************************************************
108
109         Message Types Section
110
111 ****************************************************/
112
113 #define XTYPF_NOBLOCK           0x0002          /* CBR_NOBLOCK will not work */
114 #define XTYPF_NODATA            0x0004          /* DDE_FDEFERUPD  */
115 #define XTYPF_ACKREQ            0x0008          /* DDE_FACKREQ */
116
117 #define XCLASS_MASK             0xFC00
118 #define XCLASS_BOOL             0x1000
119 #define XCLASS_DATA             0x2000
120 #define XCLASS_FLAGS            0x4000
121 #define XCLASS_NOTIFICATION     0x8000
122
123 #define XTYP_ERROR              (0x0000 | XCLASS_NOTIFICATION | XTYPF_NOBLOCK)
124 #define XTYP_ADVDATA            (0x0010 | XCLASS_FLAGS)
125 #define XTYP_ADVREQ             (0x0020 | XCLASS_DATA | XTYPF_NOBLOCK)
126 #define XTYP_ADVSTART           (0x0030 | XCLASS_BOOL)
127 #define XTYP_ADVSTOP            (0x0040 | XCLASS_NOTIFICATION)
128 #define XTYP_EXECUTE            (0x0050 | XCLASS_FLAGS)
129 #define XTYP_CONNECT            (0x0060 | XCLASS_BOOL | XTYPF_NOBLOCK)
130 #define XTYP_CONNECT_CONFIRM    (0x0070 | XCLASS_NOTIFICATION | XTYPF_NOBLOCK)
131 #define XTYP_XACT_COMPLETE      (0x0080 | XCLASS_NOTIFICATION )
132 #define XTYP_POKE               (0x0090 | XCLASS_FLAGS)
133 #define XTYP_REGISTER           (0x00A0 | XCLASS_NOTIFICATION | XTYPF_NOBLOCK )
134 #define XTYP_REQUEST            (0x00B0 | XCLASS_DATA )
135 #define XTYP_DISCONNECT         (0x00C0 | XCLASS_NOTIFICATION | XTYPF_NOBLOCK )
136 #define XTYP_UNREGISTER         (0x00D0 | XCLASS_NOTIFICATION | XTYPF_NOBLOCK )
137 #define XTYP_WILDCONNECT        (0x00E0 | XCLASS_DATA | XTYPF_NOBLOCK)
138
139 #define XTYP_MASK               0x00F0
140 #define XTYP_SHIFT              4
141
142 /**************************************************
143
144         End of Message Types Section
145
146 ****************************************************/
147
148 /*****************************************************
149
150         DDE Codes for wStatus field
151
152 *****************************************************/
153
154 #define DDE_FACK                0x8000
155 #define DDE_FBUSY               0x4000
156 #define DDE_FDEFERUPD           0x4000
157 #define DDE_FACKREQ             0x8000
158 #define DDE_FRELEASE            0x2000
159 #define DDE_FREQUESTED          0x1000
160 #define DDE_FAPPSTATUS          0x00FF
161 #define DDE_FNOTPROCESSED       0x0000
162
163
164 /*****************************************************
165
166         End of wStatus codes
167
168 *****************************************************/
169
170 /****************************************************
171
172       Return Codes section again copied from SDK as must be same
173
174 *****************************************************/
175
176 #define     DMLERR_NO_ERROR                    0       /* must be 0 */
177
178 #define     DMLERR_FIRST                       0x4000
179
180 #define     DMLERR_ADVACKTIMEOUT               0x4000
181 #define     DMLERR_BUSY                        0x4001
182 #define     DMLERR_DATAACKTIMEOUT              0x4002
183 #define     DMLERR_DLL_NOT_INITIALIZED         0x4003
184 #define     DMLERR_DLL_USAGE                   0x4004
185 #define     DMLERR_EXECACKTIMEOUT              0x4005
186 #define     DMLERR_INVALIDPARAMETER            0x4006
187 #define     DMLERR_LOW_MEMORY                  0x4007
188 #define     DMLERR_MEMORY_ERROR                0x4008
189 #define     DMLERR_NOTPROCESSED                0x4009
190 #define     DMLERR_NO_CONV_ESTABLISHED         0x400a
191 #define     DMLERR_POKEACKTIMEOUT              0x400b
192 #define     DMLERR_POSTMSG_FAILED              0x400c
193 #define     DMLERR_REENTRANCY                  0x400d
194 #define     DMLERR_SERVER_DIED                 0x400e
195 #define     DMLERR_SYS_ERROR                   0x400f
196 #define     DMLERR_UNADVACKTIMEOUT             0x4010
197 #define     DMLERR_UNFOUND_QUEUE_ID            0x4011
198
199 #define     DMLERR_LAST                        0x4011
200
201 /*****************************************************
202
203       End of Return Codes and Microsoft section
204
205 ******************************************************/
206
207
208
209 typedef DWORD HCONVLIST;
210 typedef DWORD HCONV;
211 typedef DWORD HSZ;
212 typedef DWORD HDDEDATA;
213
214
215
216 /*******************************************************
217
218         API Entry Points
219
220 *******************************************************/
221
222 typedef HDDEDATA (CALLBACK *PFNCALLBACK16)(UINT16,UINT16,HCONV,HSZ,HSZ,
223                                            HDDEDATA,DWORD,DWORD);
224 typedef HDDEDATA (CALLBACK *PFNCALLBACK)(UINT,UINT,HCONV,HSZ,HSZ,
225                                            HDDEDATA,DWORD,DWORD);
226
227 /***************************************************
228
229         Externally visible data structures
230
231 ***************************************************/
232
233 typedef struct
234 {
235     UINT16  cb;
236     UINT16  wFlags;
237     UINT16  wCountryID;
238     INT16   iCodePage;
239     DWORD   dwLangID;
240     DWORD   dwSecurity;
241 } CONVCONTEXT16, *LPCONVCONTEXT16;
242
243 typedef struct
244 {
245     UINT  cb;
246     UINT  wFlags;
247     UINT  wCountryID;
248     INT   iCodePage;
249     DWORD   dwLangID;
250     DWORD   dwSecurity;
251 } CONVCONTEXT, *LPCONVCONTEXT;
252
253 typedef struct
254 {
255     DWORD               cb;
256     DWORD               hUser;
257     HCONV               hConvPartner;
258     HSZ                 hszSvcPartner;
259     HSZ                 hszServiceReq;
260     HSZ                 hszTopic;
261     HSZ                 hszItem;
262     UINT16              wFmt;
263     UINT16              wType;
264     UINT16              wStatus;
265     UINT16              wConvst;
266     UINT16              wLastError;
267     HCONVLIST           hConvList;
268     CONVCONTEXT16       ConvCtxt;
269 } CONVINFO16, *LPCONVINFO16;
270
271 typedef struct
272 {
273     DWORD               cb;
274     DWORD               hUser;
275     HCONV               hConvPartner;
276     HSZ                 hszSvcPartner;
277     HSZ                 hszServiceReq;
278     HSZ                 hszTopic;
279     HSZ                 hszItem;
280     UINT                wFmt;
281     UINT                wType;
282     UINT                wStatus;
283     UINT                wConvst;
284     UINT                wLastError;
285     HCONVLIST           hConvList;
286     CONVCONTEXT         ConvCtxt;
287     HWND                hwnd;
288     HWND                hwndPartner;
289 } CONVINFO, *LPCONVINFO;
290
291 /*            Interface Definitions             */
292
293
294 UINT16    WINAPI DdeInitialize16(LPDWORD,PFNCALLBACK16,DWORD,DWORD);
295 UINT    WINAPI DdeInitializeA(LPDWORD,PFNCALLBACK,DWORD,DWORD);
296 UINT    WINAPI DdeInitializeW(LPDWORD,PFNCALLBACK,DWORD,DWORD);
297 #define   DdeInitialize WINELIB_NAME_AW(DdeInitialize)
298 BOOL16    WINAPI DdeUninitialize16(DWORD);
299 BOOL    WINAPI DdeUninitialize(DWORD);
300 HCONVLIST WINAPI DdeConnectList16(DWORD,HSZ,HSZ,HCONVLIST,LPCONVCONTEXT16);
301 HCONVLIST WINAPI DdeConnectList(DWORD,HSZ,HSZ,HCONVLIST,LPCONVCONTEXT);
302 HCONV     WINAPI DdeQueryNextServer16(HCONVLIST, HCONV);
303 HCONV     WINAPI DdeQueryNextServer(HCONVLIST, HCONV);
304 DWORD     WINAPI DdeQueryStringA(DWORD, HSZ, LPSTR, DWORD, INT);
305 DWORD     WINAPI DdeQueryStringW(DWORD, HSZ, LPWSTR, DWORD, INT);
306 #define   DdeQueryString WINELIB_NAME_AW(DdeQueryString)
307 BOOL16    WINAPI DdeDisconnectList16(HCONVLIST);
308 BOOL    WINAPI DdeDisconnectList(HCONVLIST);
309 HCONV     WINAPI DdeConnect16(DWORD,HSZ,HSZ,LPCONVCONTEXT16);
310 HCONV     WINAPI DdeConnect(DWORD,HSZ,HSZ,LPCONVCONTEXT);
311 BOOL16    WINAPI DdeDisconnect16(HCONV);
312 BOOL    WINAPI DdeDisconnect(HCONV);
313 BOOL16    WINAPI DdeSetUserHandle16(HCONV,DWORD,DWORD);
314 HDDEDATA  WINAPI DdeCreateDataHandle16(DWORD,LPBYTE,DWORD,DWORD,HSZ,UINT16,UINT16);
315 HDDEDATA  WINAPI DdeCreateDataHandle(DWORD,LPBYTE,DWORD,DWORD,HSZ,UINT,UINT);
316 HCONV     WINAPI DdeReconnect(HCONV);
317 HSZ       WINAPI DdeCreateStringHandle16(DWORD,LPCSTR,INT16);
318 HSZ       WINAPI DdeCreateStringHandleA(DWORD,LPCSTR,INT);
319 HSZ       WINAPI DdeCreateStringHandleW(DWORD,LPCWSTR,INT);
320 #define   DdeCreateStringHandle WINELIB_NAME_AW(DdeCreateStringHandle)
321 BOOL16    WINAPI DdeFreeStringHandle16(DWORD,HSZ);
322 BOOL    WINAPI DdeFreeStringHandle(DWORD,HSZ);
323 BOOL16    WINAPI DdeFreeDataHandle16(HDDEDATA);
324 BOOL    WINAPI DdeFreeDataHandle(HDDEDATA);
325 BOOL16    WINAPI DdeKeepStringHandle16(DWORD,HSZ);
326 BOOL    WINAPI DdeKeepStringHandle(DWORD,HSZ);
327 HDDEDATA  WINAPI DdeClientTransaction16(LPVOID,DWORD,HCONV,HSZ,UINT16,
328                                         UINT16,DWORD,LPDWORD);
329 HDDEDATA  WINAPI DdeClientTransaction(LPBYTE,DWORD,HCONV,HSZ,UINT,
330                                         UINT,DWORD,LPDWORD);
331 BOOL16    WINAPI DdeAbandonTransaction16(DWORD,HCONV,DWORD);
332 BOOL16    WINAPI DdePostAdvise16(DWORD,HSZ,HSZ);
333 BOOL    WINAPI DdePostAdvise(DWORD,HSZ,HSZ);
334 HDDEDATA  WINAPI DdeAddData16(HDDEDATA,LPBYTE,DWORD,DWORD);
335 DWORD     WINAPI DdeGetData(HDDEDATA,LPBYTE,DWORD,DWORD);
336 LPBYTE    WINAPI DdeAccessData16(HDDEDATA,LPDWORD);
337 LPBYTE    WINAPI DdeAccessData(HDDEDATA,LPDWORD);
338 BOOL16    WINAPI DdeUnaccessData16(HDDEDATA);
339 BOOL    WINAPI DdeUnaccessData(HDDEDATA);
340 BOOL16    WINAPI DdeEnableCallback16(DWORD,HCONV,UINT16);
341 BOOL    WINAPI DdeEnableCallback(DWORD,HCONV,UINT);
342 INT16     WINAPI DdeCmpStringHandles16(HSZ,HSZ);
343 INT       WINAPI DdeCmpStringHandles(HSZ,HSZ);
344
345 HDDEDATA  WINAPI DdeNameService16(DWORD,HSZ,HSZ,UINT16);
346 HDDEDATA  WINAPI DdeNameService(DWORD,HSZ,HSZ,UINT);
347 UINT16    WINAPI DdeGetLastError16(DWORD);
348 UINT    WINAPI DdeGetLastError(DWORD);
349 UINT16    WINAPI DdeQueryConvInfo16(HCONV,DWORD,LPCONVINFO16);
350 UINT      WINAPI DdeQueryConvInfo(HCONV,DWORD,LPCONVINFO);
351
352 #ifdef __cplusplus
353 } /* extern "C" */
354 #endif /* defined(__cplusplus) */
355
356 #endif  /* __WINE_DDEML_H */