blob: 400ce5bb8be2c1e320108d3a6a1425ce0f76ad1c [file] [log] [blame]
Alexandre Julliard17216f51997-10-12 16:30:17 +00001/*
2 * DDEML library definitions
3 *
4 * Copyright 1997 Alexandre Julliard
Alexandre Julliarda0b2b1d1997-11-16 17:38:29 +00005 * Copyright 1997 Len White
Alexandre Julliard0799c1a2002-03-09 23:29:33 +00006 *
7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Lesser General Public
9 * License as published by the Free Software Foundation; either
10 * version 2.1 of the License, or (at your option) any later version.
11 *
12 * This library is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Lesser General Public License for more details.
16 *
17 * You should have received a copy of the GNU Lesser General Public
18 * License along with this library; if not, write to the Free Software
Jonathan Ernst360a3f92006-05-18 14:49:52 +020019 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
Alexandre Julliard17216f51997-10-12 16:30:17 +000020 */
21
Patrik Stridvall857eb391999-06-12 18:36:54 +000022#ifndef __WINE_DDEML_H
23#define __WINE_DDEML_H
Alexandre Julliard17216f51997-10-12 16:30:17 +000024
Patrik Stridvall14da7b11999-06-12 10:53:06 +000025#ifdef __cplusplus
26extern "C" {
27#endif /* defined(__cplusplus) */
28
Jean-Claude Cotec65f4a41998-12-25 08:46:42 +000029/* Codepage Constants
30 */
Keith Matthews39796471999-03-13 12:53:39 +000031
Jean-Claude Cotec65f4a41998-12-25 08:46:42 +000032#define CP_WINANSI 1004
33#define CP_WINUNICODE 1200
34
Vincent Béron9a624912002-05-31 23:06:46 +000035/* DDE synchronisation constants
Keith Matthews39796471999-03-13 12:53:39 +000036 */
37
Paul Quinn1beaae51998-12-15 15:38:36 +000038#define MSGF_DDEMGR 0x8001
Keith Matthews39796471999-03-13 12:53:39 +000039
Keith Matthews39796471999-03-13 12:53:39 +000040#define QID_SYNC 0xFFFFFFFF
41
42/* Type variation for MS deliberate departures from ANSI standards
43 */
44
45#define EXPENTRY CALLBACK
46
Eric Pouech6a03ac02001-06-22 23:02:48 +000047#define SZDDESYS_TOPIC TEXT("System")
48#define SZDDESYS_ITEM_TOPICS TEXT("Topics")
49#define SZDDESYS_ITEM_SYSITEMS TEXT("SysItems")
50#define SZDDESYS_ITEM_RTNMSG TEXT("ReturnMessage")
51#define SZDDESYS_ITEM_STATUS TEXT("Status")
52#define SZDDESYS_ITEM_FORMATS TEXT("Formats")
53#define SZDDESYS_ITEM_HELP TEXT("Help")
54#define SZDDE_ITEM_ITEMLIST TEXT("TopicItemList")
55
Keith Matthewse32abe81999-01-28 16:26:39 +000056/***************************************************
57
58 FLAGS Section - copied from Microsoft SDK as must be standard, probably Copyright Microsoft Corporation
59
60***************************************************/
61
Eric Pouech6a03ac02001-06-22 23:02:48 +000062#define XST_NULL 0
63#define XST_INCOMPLETE 1
64#define XST_CONNECTED 2
65#define XST_INIT1 3
66#define XST_INIT2 4
67#define XST_REQSENT 5
68#define XST_DATARCVD 6
69#define XST_POKESENT 7
70#define XST_POKEACKRCVD 8
71#define XST_EXECSENT 9
72#define XST_EXECACKRCVD 10
73#define XST_ADVSENT 11
74#define XST_UNADVSENT 12
75#define XST_ADVACKRCVD 13
76#define XST_UNADVACKRCVD 14
77#define XST_ADVDATASENT 15
78#define XST_ADVDATAACKRCVD 16
79
80#define ST_CONNECTED 0x0001
81#define ST_ADVISE 0x0002
82#define ST_ISLOCAL 0x0004
83#define ST_BLOCKED 0x0008
84#define ST_CLIENT 0x0010
85#define ST_TERMINATED 0x0020
86#define ST_INLIST 0x0040
87#define ST_BLOCKNEXT 0x0080
88#define ST_ISSELF 0x0100
89
Keith Matthewse32abe81999-01-28 16:26:39 +000090/*
Dmitry Timoshkov37d39962003-05-19 23:27:16 +000091 * DdeEnableCallback function codes
92 */
93
94#define EC_ENABLEALL 0
95#define EC_ENABLEONE ST_BLOCKNEXT
96#define EC_DISABLE ST_BLOCKED
97#define EC_QUERYWAITING 2
98
99/*
Keith Matthewse32abe81999-01-28 16:26:39 +0000100 * Callback filter flags for use with standard apps.
101 */
102
103#define CBF_FAIL_SELFCONNECTIONS 0x00001000
104#define CBF_FAIL_CONNECTIONS 0x00002000
105#define CBF_FAIL_ADVISES 0x00004000
106#define CBF_FAIL_EXECUTES 0x00008000
107#define CBF_FAIL_POKES 0x00010000
108#define CBF_FAIL_REQUESTS 0x00020000
109#define CBF_FAIL_ALLSVRXACTIONS 0x0003f000
110
111#define CBF_SKIP_CONNECT_CONFIRMS 0x00040000
112#define CBF_SKIP_REGISTRATIONS 0x00080000
113#define CBF_SKIP_UNREGISTRATIONS 0x00100000
114#define CBF_SKIP_DISCONNECTS 0x00200000
115#define CBF_SKIP_ALLNOTIFICATIONS 0x003c0000
116
Dmitry Timoshkov411aee52004-06-14 16:58:02 +0000117#define CBR_BLOCK ((HDDEDATA)~0UL)
Keith Matthews39796471999-03-13 12:53:39 +0000118
Keith Matthewse32abe81999-01-28 16:26:39 +0000119/*
120 * Application command flags
121 */
122#define APPCMD_CLIENTONLY 0x00000010L
123#define APPCMD_FILTERINITS 0x00000020L
124#define APPCMD_MASK 0x00000FF0L
125
126/*
127 * Application classification flags
128 */
129
130#define APPCLASS_STANDARD 0x00000000L
131#define APPCLASS_MONITOR 0x00000001L
132#define APPCLASS_MASK 0x0000000FL
133
134/*
135 * Callback filter flags for use with MONITOR apps - 0 implies no monitor
136 * callbacks.
137 */
138#define MF_HSZ_INFO 0x01000000
139#define MF_SENDMSGS 0x02000000
140#define MF_POSTMSGS 0x04000000
141#define MF_CALLBACKS 0x08000000
142#define MF_ERRORS 0x10000000
143#define MF_LINKS 0x20000000
144#define MF_CONV 0x40000000
145
146#define MF_MASK 0xFF000000
147
148/*
149 * DdeNameService service name flags
150 */
151
152#define DNS_REGISTER 0x0001
153#define DNS_UNREGISTER 0x0002
154#define DNS_FILTERON 0x0004
155#define DNS_FILTEROFF 0x0008
156
157
158/****************************************************
159
160 End of Flags section
161
162****************************************************/
163
164/****************************************************
165
Keith Matthews39796471999-03-13 12:53:39 +0000166 Message Types Section
167
168****************************************************/
169
170#define XTYPF_NOBLOCK 0x0002 /* CBR_NOBLOCK will not work */
171#define XTYPF_NODATA 0x0004 /* DDE_FDEFERUPD */
172#define XTYPF_ACKREQ 0x0008 /* DDE_FACKREQ */
173
174#define XCLASS_MASK 0xFC00
175#define XCLASS_BOOL 0x1000
176#define XCLASS_DATA 0x2000
177#define XCLASS_FLAGS 0x4000
178#define XCLASS_NOTIFICATION 0x8000
179
Francois Gouget7bb78422000-03-19 14:21:23 +0000180#define XTYP_ERROR (0x0000 | XCLASS_NOTIFICATION | XTYPF_NOBLOCK)
Keith Matthews39796471999-03-13 12:53:39 +0000181#define XTYP_ADVDATA (0x0010 | XCLASS_FLAGS)
Francois Gouget7bb78422000-03-19 14:21:23 +0000182#define XTYP_ADVREQ (0x0020 | XCLASS_DATA | XTYPF_NOBLOCK)
183#define XTYP_ADVSTART (0x0030 | XCLASS_BOOL)
184#define XTYP_ADVSTOP (0x0040 | XCLASS_NOTIFICATION)
185#define XTYP_EXECUTE (0x0050 | XCLASS_FLAGS)
186#define XTYP_CONNECT (0x0060 | XCLASS_BOOL | XTYPF_NOBLOCK)
187#define XTYP_CONNECT_CONFIRM (0x0070 | XCLASS_NOTIFICATION | XTYPF_NOBLOCK)
Keith Matthews39796471999-03-13 12:53:39 +0000188#define XTYP_XACT_COMPLETE (0x0080 | XCLASS_NOTIFICATION )
Francois Gouget7bb78422000-03-19 14:21:23 +0000189#define XTYP_POKE (0x0090 | XCLASS_FLAGS)
Keith Matthews39796471999-03-13 12:53:39 +0000190#define XTYP_REGISTER (0x00A0 | XCLASS_NOTIFICATION | XTYPF_NOBLOCK )
191#define XTYP_REQUEST (0x00B0 | XCLASS_DATA )
192#define XTYP_DISCONNECT (0x00C0 | XCLASS_NOTIFICATION | XTYPF_NOBLOCK )
193#define XTYP_UNREGISTER (0x00D0 | XCLASS_NOTIFICATION | XTYPF_NOBLOCK )
Francois Gouget7bb78422000-03-19 14:21:23 +0000194#define XTYP_WILDCONNECT (0x00E0 | XCLASS_DATA | XTYPF_NOBLOCK)
James Hawkins58639cc2007-10-04 00:28:45 -0500195#define XTYP_MONITOR (0x00F0 | XCLASS_NOTIFICATION | XTYPF_NOBLOCK)
Francois Gouget7bb78422000-03-19 14:21:23 +0000196
197#define XTYP_MASK 0x00F0
198#define XTYP_SHIFT 4
Keith Matthews39796471999-03-13 12:53:39 +0000199
Eric Pouech6a03ac02001-06-22 23:02:48 +0000200#define TIMEOUT_ASYNC 0xFFFFFFFF
201
Eric Pouech78a41342001-08-09 22:07:22 +0000202#define CADV_LATEACK 0xFFFF
203
Keith Matthews39796471999-03-13 12:53:39 +0000204/**************************************************
205
206 End of Message Types Section
207
208****************************************************/
209
210/*****************************************************
211
212 DDE Codes for wStatus field
213
214*****************************************************/
215
216#define DDE_FACK 0x8000
217#define DDE_FBUSY 0x4000
218#define DDE_FDEFERUPD 0x4000
219#define DDE_FACKREQ 0x8000
220#define DDE_FRELEASE 0x2000
221#define DDE_FREQUESTED 0x1000
222#define DDE_FAPPSTATUS 0x00FF
223#define DDE_FNOTPROCESSED 0x0000
224
Eric Pouech6a03ac02001-06-22 23:02:48 +0000225#define DDE_FACKRESERVED (~(DDE_FACK | DDE_FBUSY | DDE_FAPPSTATUS))
226#define DDE_FADVRESERVED (~(DDE_FACKREQ | DDE_FDEFERUPD))
227#define DDE_FDATRESERVED (~(DDE_FACKREQ | DDE_FRELEASE | DDE_FREQUESTED))
228#define DDE_FPOKRESERVED (~(DDE_FRELEASE))
Keith Matthews39796471999-03-13 12:53:39 +0000229
230/*****************************************************
231
232 End of wStatus codes
233
234*****************************************************/
235
236/****************************************************
237
Keith Matthewse32abe81999-01-28 16:26:39 +0000238 Return Codes section again copied from SDK as must be same
239
240*****************************************************/
241
242#define DMLERR_NO_ERROR 0 /* must be 0 */
243
244#define DMLERR_FIRST 0x4000
245
246#define DMLERR_ADVACKTIMEOUT 0x4000
247#define DMLERR_BUSY 0x4001
248#define DMLERR_DATAACKTIMEOUT 0x4002
249#define DMLERR_DLL_NOT_INITIALIZED 0x4003
250#define DMLERR_DLL_USAGE 0x4004
251#define DMLERR_EXECACKTIMEOUT 0x4005
252#define DMLERR_INVALIDPARAMETER 0x4006
253#define DMLERR_LOW_MEMORY 0x4007
254#define DMLERR_MEMORY_ERROR 0x4008
255#define DMLERR_NOTPROCESSED 0x4009
256#define DMLERR_NO_CONV_ESTABLISHED 0x400a
257#define DMLERR_POKEACKTIMEOUT 0x400b
258#define DMLERR_POSTMSG_FAILED 0x400c
259#define DMLERR_REENTRANCY 0x400d
260#define DMLERR_SERVER_DIED 0x400e
261#define DMLERR_SYS_ERROR 0x400f
262#define DMLERR_UNADVACKTIMEOUT 0x4010
263#define DMLERR_UNFOUND_QUEUE_ID 0x4011
264
265#define DMLERR_LAST 0x4011
266
Eric Pouech6a03ac02001-06-22 23:02:48 +0000267#define HDATA_APPOWNED 0x0001
268
Keith Matthewse32abe81999-01-28 16:26:39 +0000269/*****************************************************
270
271 End of Return Codes and Microsoft section
272
273******************************************************/
274
275
Paul Quinn1beaae51998-12-15 15:38:36 +0000276
Eric Pouech6a03ac02001-06-22 23:02:48 +0000277DECLARE_HANDLE(HCONVLIST);
278DECLARE_HANDLE(HCONV);
279DECLARE_HANDLE(HSZ);
280DECLARE_HANDLE(HDDEDATA);
Alexandre Julliard17216f51997-10-12 16:30:17 +0000281
Keith Matthews39796471999-03-13 12:53:39 +0000282
Keith Matthews89c377c1999-04-06 07:02:23 +0000283
Keith Matthews39796471999-03-13 12:53:39 +0000284/*******************************************************
285
286 API Entry Points
287
288*******************************************************/
289
Patrik Stridvallf94462f2002-01-31 23:22:07 +0000290typedef HDDEDATA (CALLBACK *PFNCALLBACK)(UINT, UINT, HCONV, HSZ, HSZ,
Dmitry Timoshkov85ef4562004-04-26 23:29:44 +0000291 HDDEDATA, ULONG_PTR, ULONG_PTR);
Alexandre Julliard17216f51997-10-12 16:30:17 +0000292
Keith Matthewse32abe81999-01-28 16:26:39 +0000293/***************************************************
294
295 Externally visible data structures
296
297***************************************************/
298
Eric Pouech6a03ac02001-06-22 23:02:48 +0000299typedef struct tagHSZPAIR
300{
301 HSZ hszSvc;
302 HSZ hszTopic;
Alexandre Julliard0ca46dc2002-12-19 01:18:49 +0000303} HSZPAIR, *PHSZPAIR;
Eric Pouech6a03ac02001-06-22 23:02:48 +0000304
305typedef struct tagCONVCONTEXT
Alexandre Julliard17216f51997-10-12 16:30:17 +0000306{
Alexandre Julliarda3960291999-02-26 11:11:13 +0000307 UINT cb;
308 UINT wFlags;
309 UINT wCountryID;
310 INT iCodePage;
Alexandre Julliard17216f51997-10-12 16:30:17 +0000311 DWORD dwLangID;
312 DWORD dwSecurity;
Alexandre Julliard0ca46dc2002-12-19 01:18:49 +0000313} CONVCONTEXT, *PCONVCONTEXT;
Alexandre Julliard17216f51997-10-12 16:30:17 +0000314
Eric Pouech6a03ac02001-06-22 23:02:48 +0000315typedef struct tagCONVINFO
Keith Matthews39796471999-03-13 12:53:39 +0000316{
317 DWORD cb;
318 DWORD hUser;
319 HCONV hConvPartner;
320 HSZ hszSvcPartner;
321 HSZ hszServiceReq;
322 HSZ hszTopic;
323 HSZ hszItem;
Keith Matthews39796471999-03-13 12:53:39 +0000324 UINT wFmt;
325 UINT wType;
326 UINT wStatus;
327 UINT wConvst;
328 UINT wLastError;
329 HCONVLIST hConvList;
330 CONVCONTEXT ConvCtxt;
331 HWND hwnd;
332 HWND hwndPartner;
Alexandre Julliard0ca46dc2002-12-19 01:18:49 +0000333} CONVINFO, *PCONVINFO;
Keith Matthewse32abe81999-01-28 16:26:39 +0000334
Keith Matthews89c377c1999-04-06 07:02:23 +0000335/* Interface Definitions */
Keith Matthewse32abe81999-01-28 16:26:39 +0000336
Alexandre Julliard17216f51997-10-12 16:30:17 +0000337
Alexandre Julliarda3960291999-02-26 11:11:13 +0000338UINT WINAPI DdeInitializeA(LPDWORD,PFNCALLBACK,DWORD,DWORD);
339UINT WINAPI DdeInitializeW(LPDWORD,PFNCALLBACK,DWORD,DWORD);
Alexandre Julliard17216f51997-10-12 16:30:17 +0000340#define DdeInitialize WINELIB_NAME_AW(DdeInitialize)
Alexandre Julliarda3960291999-02-26 11:11:13 +0000341BOOL WINAPI DdeUninitialize(DWORD);
Alexandre Julliard0ca46dc2002-12-19 01:18:49 +0000342HCONVLIST WINAPI DdeConnectList(DWORD,HSZ,HSZ,HCONVLIST,PCONVCONTEXT);
Alexandre Julliarda3960291999-02-26 11:11:13 +0000343HCONV WINAPI DdeQueryNextServer(HCONVLIST, HCONV);
344DWORD WINAPI DdeQueryStringA(DWORD, HSZ, LPSTR, DWORD, INT);
345DWORD WINAPI DdeQueryStringW(DWORD, HSZ, LPWSTR, DWORD, INT);
Jean-Claude Cotec65f4a41998-12-25 08:46:42 +0000346#define DdeQueryString WINELIB_NAME_AW(DdeQueryString)
Alexandre Julliard83f52d12000-09-26 22:20:14 +0000347BOOL WINAPI DdeDisconnectList(HCONVLIST);
Alexandre Julliard0ca46dc2002-12-19 01:18:49 +0000348HCONV WINAPI DdeConnect(DWORD,HSZ,HSZ,PCONVCONTEXT);
Alexandre Julliard83f52d12000-09-26 22:20:14 +0000349BOOL WINAPI DdeDisconnect(HCONV);
Alexandre Julliarda3960291999-02-26 11:11:13 +0000350HDDEDATA WINAPI DdeCreateDataHandle(DWORD,LPBYTE,DWORD,DWORD,HSZ,UINT,UINT);
Alexandre Julliard17216f51997-10-12 16:30:17 +0000351HCONV WINAPI DdeReconnect(HCONV);
Alexandre Julliarda3960291999-02-26 11:11:13 +0000352HSZ WINAPI DdeCreateStringHandleA(DWORD,LPCSTR,INT);
353HSZ WINAPI DdeCreateStringHandleW(DWORD,LPCWSTR,INT);
Alexandre Julliard17216f51997-10-12 16:30:17 +0000354#define DdeCreateStringHandle WINELIB_NAME_AW(DdeCreateStringHandle)
Alexandre Julliard83f52d12000-09-26 22:20:14 +0000355BOOL WINAPI DdeFreeStringHandle(DWORD,HSZ);
356BOOL WINAPI DdeFreeDataHandle(HDDEDATA);
357BOOL WINAPI DdeKeepStringHandle(DWORD,HSZ);
358HDDEDATA WINAPI DdeClientTransaction(LPBYTE,DWORD,HCONV,HSZ,UINT,UINT,DWORD,LPDWORD);
Vincent Béron9a624912002-05-31 23:06:46 +0000359BOOL WINAPI DdeAbandonTransaction(DWORD idInst, HCONV hConv, DWORD idTransaction);
Francois Gouget326e2ba2000-06-18 17:26:44 +0000360BOOL WINAPI DdeImpersonateClient(HCONV);
Alexandre Julliard83f52d12000-09-26 22:20:14 +0000361BOOL WINAPI DdePostAdvise(DWORD,HSZ,HSZ);
Francois Gouget326e2ba2000-06-18 17:26:44 +0000362HDDEDATA WINAPI DdeAddData(HDDEDATA,LPBYTE,DWORD,DWORD);
Alexandre Julliarda0b2b1d1997-11-16 17:38:29 +0000363DWORD WINAPI DdeGetData(HDDEDATA,LPBYTE,DWORD,DWORD);
Alexandre Julliarda3960291999-02-26 11:11:13 +0000364LPBYTE WINAPI DdeAccessData(HDDEDATA,LPDWORD);
Alexandre Julliard83f52d12000-09-26 22:20:14 +0000365BOOL WINAPI DdeUnaccessData(HDDEDATA);
366BOOL WINAPI DdeEnableCallback(DWORD,HCONV,UINT);
Patrik Stridvall98fde732000-03-24 20:43:33 +0000367INT WINAPI DdeCmpStringHandles(HSZ,HSZ);
Francois Gouget326e2ba2000-06-18 17:26:44 +0000368BOOL WINAPI DdeSetUserHandle(HCONV,DWORD,DWORD);
Alexandre Julliarda0b2b1d1997-11-16 17:38:29 +0000369
Alexandre Julliarda3960291999-02-26 11:11:13 +0000370HDDEDATA WINAPI DdeNameService(DWORD,HSZ,HSZ,UINT);
Alexandre Julliard83f52d12000-09-26 22:20:14 +0000371UINT WINAPI DdeGetLastError(DWORD);
Alexandre Julliard0ca46dc2002-12-19 01:18:49 +0000372UINT WINAPI DdeQueryConvInfo(HCONV,DWORD,PCONVINFO);
Alexandre Julliard17216f51997-10-12 16:30:17 +0000373
Patrik Stridvall14da7b11999-06-12 10:53:06 +0000374#ifdef __cplusplus
375} /* extern "C" */
376#endif /* defined(__cplusplus) */
377
Patrik Stridvall857eb391999-06-12 18:36:54 +0000378#endif /* __WINE_DDEML_H */