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