Removed inclusion of winnt.h because the porting layer shouldn't
[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 /**************************************************
181
182         End of Message Types Section
183
184 ****************************************************/
185
186 /*****************************************************
187
188         DDE Codes for wStatus field
189
190 *****************************************************/
191
192 #define DDE_FACK                0x8000
193 #define DDE_FBUSY               0x4000
194 #define DDE_FDEFERUPD           0x4000
195 #define DDE_FACKREQ             0x8000
196 #define DDE_FRELEASE            0x2000
197 #define DDE_FREQUESTED          0x1000
198 #define DDE_FAPPSTATUS          0x00FF
199 #define DDE_FNOTPROCESSED       0x0000
200
201 #define DDE_FACKRESERVED        (~(DDE_FACK | DDE_FBUSY | DDE_FAPPSTATUS))
202 #define DDE_FADVRESERVED        (~(DDE_FACKREQ | DDE_FDEFERUPD))
203 #define DDE_FDATRESERVED        (~(DDE_FACKREQ | DDE_FRELEASE | DDE_FREQUESTED))
204 #define DDE_FPOKRESERVED        (~(DDE_FRELEASE))
205
206 /*****************************************************
207
208         End of wStatus codes
209
210 *****************************************************/
211
212 /****************************************************
213
214       Return Codes section again copied from SDK as must be same
215
216 *****************************************************/
217
218 #define     DMLERR_NO_ERROR                    0       /* must be 0 */
219
220 #define     DMLERR_FIRST                       0x4000
221
222 #define     DMLERR_ADVACKTIMEOUT               0x4000
223 #define     DMLERR_BUSY                        0x4001
224 #define     DMLERR_DATAACKTIMEOUT              0x4002
225 #define     DMLERR_DLL_NOT_INITIALIZED         0x4003
226 #define     DMLERR_DLL_USAGE                   0x4004
227 #define     DMLERR_EXECACKTIMEOUT              0x4005
228 #define     DMLERR_INVALIDPARAMETER            0x4006
229 #define     DMLERR_LOW_MEMORY                  0x4007
230 #define     DMLERR_MEMORY_ERROR                0x4008
231 #define     DMLERR_NOTPROCESSED                0x4009
232 #define     DMLERR_NO_CONV_ESTABLISHED         0x400a
233 #define     DMLERR_POKEACKTIMEOUT              0x400b
234 #define     DMLERR_POSTMSG_FAILED              0x400c
235 #define     DMLERR_REENTRANCY                  0x400d
236 #define     DMLERR_SERVER_DIED                 0x400e
237 #define     DMLERR_SYS_ERROR                   0x400f
238 #define     DMLERR_UNADVACKTIMEOUT             0x4010
239 #define     DMLERR_UNFOUND_QUEUE_ID            0x4011
240
241 #define     DMLERR_LAST                        0x4011
242
243 #define     HDATA_APPOWNED                     0x0001
244
245 /*****************************************************
246
247       End of Return Codes and Microsoft section
248
249 ******************************************************/
250
251
252
253 DECLARE_HANDLE(HCONVLIST);
254 DECLARE_HANDLE(HCONV);
255 DECLARE_HANDLE(HSZ);
256 DECLARE_HANDLE(HDDEDATA);
257
258
259
260 /*******************************************************
261
262         API Entry Points
263
264 *******************************************************/
265
266 typedef HDDEDATA CALLBACK (*PFNCALLBACK)(UINT, UINT, HCONV, HSZ, HSZ,
267                                          HDDEDATA, DWORD, DWORD);
268
269 /***************************************************
270
271         Externally visible data structures
272
273 ***************************************************/
274
275 typedef struct tagHSZPAIR
276 {
277     HSZ hszSvc;
278     HSZ hszTopic;
279 } HSZPAIR, *PHSZPAIR, *LPHSZPAIR;
280
281 typedef struct tagCONVCONTEXT
282 {
283     UINT  cb;
284     UINT  wFlags;
285     UINT  wCountryID;
286     INT   iCodePage;
287     DWORD   dwLangID;
288     DWORD   dwSecurity;
289 } CONVCONTEXT, *LPCONVCONTEXT;
290
291 typedef struct tagCONVINFO
292 {
293     DWORD               cb;
294     DWORD               hUser;
295     HCONV               hConvPartner;
296     HSZ                 hszSvcPartner;
297     HSZ                 hszServiceReq;
298     HSZ                 hszTopic;
299     HSZ                 hszItem;
300     UINT                wFmt;
301     UINT                wType;
302     UINT                wStatus;
303     UINT                wConvst;
304     UINT                wLastError;
305     HCONVLIST           hConvList;
306     CONVCONTEXT         ConvCtxt;
307     HWND                hwnd;
308     HWND                hwndPartner;
309 } CONVINFO, *LPCONVINFO;
310
311 /*            Interface Definitions             */
312
313
314 UINT    WINAPI DdeInitializeA(LPDWORD,PFNCALLBACK,DWORD,DWORD);
315 UINT    WINAPI DdeInitializeW(LPDWORD,PFNCALLBACK,DWORD,DWORD);
316 #define   DdeInitialize WINELIB_NAME_AW(DdeInitialize)
317 BOOL    WINAPI DdeUninitialize(DWORD);
318 HCONVLIST WINAPI DdeConnectList(DWORD,HSZ,HSZ,HCONVLIST,LPCONVCONTEXT);
319 HCONV     WINAPI DdeQueryNextServer(HCONVLIST, HCONV);
320 DWORD     WINAPI DdeQueryStringA(DWORD, HSZ, LPSTR, DWORD, INT);
321 DWORD     WINAPI DdeQueryStringW(DWORD, HSZ, LPWSTR, DWORD, INT);
322 #define   DdeQueryString WINELIB_NAME_AW(DdeQueryString)
323 BOOL      WINAPI DdeDisconnectList(HCONVLIST);
324 HCONV     WINAPI DdeConnect(DWORD,HSZ,HSZ,LPCONVCONTEXT);
325 BOOL      WINAPI DdeDisconnect(HCONV);
326 HDDEDATA  WINAPI DdeCreateDataHandle(DWORD,LPBYTE,DWORD,DWORD,HSZ,UINT,UINT);
327 HCONV     WINAPI DdeReconnect(HCONV);
328 HSZ       WINAPI DdeCreateStringHandleA(DWORD,LPCSTR,INT);
329 HSZ       WINAPI DdeCreateStringHandleW(DWORD,LPCWSTR,INT);
330 #define   DdeCreateStringHandle WINELIB_NAME_AW(DdeCreateStringHandle)
331 BOOL      WINAPI DdeFreeStringHandle(DWORD,HSZ);
332 BOOL      WINAPI DdeFreeDataHandle(HDDEDATA);
333 BOOL      WINAPI DdeKeepStringHandle(DWORD,HSZ);
334 HDDEDATA  WINAPI DdeClientTransaction(LPBYTE,DWORD,HCONV,HSZ,UINT,UINT,DWORD,LPDWORD);
335 BOOL      WINAPI DdeImpersonateClient(HCONV);
336 BOOL      WINAPI DdePostAdvise(DWORD,HSZ,HSZ);
337 HDDEDATA  WINAPI DdeAddData(HDDEDATA,LPBYTE,DWORD,DWORD);
338 DWORD     WINAPI DdeGetData(HDDEDATA,LPBYTE,DWORD,DWORD);
339 LPBYTE    WINAPI DdeAccessData(HDDEDATA,LPDWORD);
340 BOOL      WINAPI DdeUnaccessData(HDDEDATA);
341 BOOL      WINAPI DdeEnableCallback(DWORD,HCONV,UINT);
342 INT       WINAPI DdeCmpStringHandles(HSZ,HSZ);
343 BOOL      WINAPI DdeSetUserHandle(HCONV,DWORD,DWORD);
344
345 HDDEDATA  WINAPI DdeNameService(DWORD,HSZ,HSZ,UINT);
346 UINT      WINAPI DdeGetLastError(DWORD);
347 UINT      WINAPI DdeQueryConvInfo(HCONV,DWORD,LPCONVINFO);
348
349 #ifdef __cplusplus
350 } /* extern "C" */
351 #endif /* defined(__cplusplus) */
352
353 #endif  /* __WINE_DDEML_H */