Fixed off-by-one error if bitblt width or height is negative.
[wine/hacks.git] / include / ddeml.h
blob091bdc11b6706a786f881a2db63e3492571ffb82
1 /*
2 * DDEML library definitions
4 * Copyright 1997 Alexandre Julliard
5 * Copyright 1997 Len White
6 */
8 #ifndef __WINE__DDEML_H
9 #define __WINE__DDEML_H
11 #include "windef.h"
13 /* Codepage Constants
16 #define CP_WINANSI 1004
17 #define CP_WINUNICODE 1200
19 /* DDE synchronisation constants
22 #define MSGF_DDEMGR 0x8001
24 #define QID_SYNC16 -1L
25 #define QID_SYNC 0xFFFFFFFF
27 /* Type variation for MS deliberate departures from ANSI standards
30 #define EXPENTRY CALLBACK
32 /***************************************************
34 FLAGS Section - copied from Microsoft SDK as must be standard, probably Copyright Microsoft Corporation
36 ***************************************************/
39 * Callback filter flags for use with standard apps.
42 #define CBF_FAIL_SELFCONNECTIONS 0x00001000
43 #define CBF_FAIL_CONNECTIONS 0x00002000
44 #define CBF_FAIL_ADVISES 0x00004000
45 #define CBF_FAIL_EXECUTES 0x00008000
46 #define CBF_FAIL_POKES 0x00010000
47 #define CBF_FAIL_REQUESTS 0x00020000
48 #define CBF_FAIL_ALLSVRXACTIONS 0x0003f000
50 #define CBF_SKIP_CONNECT_CONFIRMS 0x00040000
51 #define CBF_SKIP_REGISTRATIONS 0x00080000
52 #define CBF_SKIP_UNREGISTRATIONS 0x00100000
53 #define CBF_SKIP_DISCONNECTS 0x00200000
54 #define CBF_SKIP_ALLNOTIFICATIONS 0x003c0000
56 #define CBR_BLOCK 0xFFFFFFFFL
59 * Application command flags
61 #define APPCMD_CLIENTONLY 0x00000010L
62 #define APPCMD_FILTERINITS 0x00000020L
63 #define APPCMD_MASK 0x00000FF0L
66 * Application classification flags
69 #define APPCLASS_STANDARD 0x00000000L
70 #define APPCLASS_MONITOR 0x00000001L
71 #define APPCLASS_MASK 0x0000000FL
74 * Callback filter flags for use with MONITOR apps - 0 implies no monitor
75 * callbacks.
77 #define MF_HSZ_INFO 0x01000000
78 #define MF_SENDMSGS 0x02000000
79 #define MF_POSTMSGS 0x04000000
80 #define MF_CALLBACKS 0x08000000
81 #define MF_ERRORS 0x10000000
82 #define MF_LINKS 0x20000000
83 #define MF_CONV 0x40000000
85 #define MF_MASK 0xFF000000
88 * DdeNameService service name flags
91 #define DNS_REGISTER 0x0001
92 #define DNS_UNREGISTER 0x0002
93 #define DNS_FILTERON 0x0004
94 #define DNS_FILTEROFF 0x0008
97 /****************************************************
99 End of Flags section
101 ****************************************************/
103 /****************************************************
105 Message Types Section
107 ****************************************************/
109 #define XTYPF_NOBLOCK 0x0002 /* CBR_NOBLOCK will not work */
110 #define XTYPF_NODATA 0x0004 /* DDE_FDEFERUPD */
111 #define XTYPF_ACKREQ 0x0008 /* DDE_FACKREQ */
113 #define XCLASS_MASK 0xFC00
114 #define XCLASS_BOOL 0x1000
115 #define XCLASS_DATA 0x2000
116 #define XCLASS_FLAGS 0x4000
117 #define XCLASS_NOTIFICATION 0x8000
119 #define XTYP_ADVDATA (0x0010 | XCLASS_FLAGS)
120 #define XTYP_XACT_COMPLETE (0x0080 | XCLASS_NOTIFICATION )
121 #define XTYP_REGISTER (0x00A0 | XCLASS_NOTIFICATION | XTYPF_NOBLOCK )
122 #define XTYP_REQUEST (0x00B0 | XCLASS_DATA )
123 #define XTYP_DISCONNECT (0x00C0 | XCLASS_NOTIFICATION | XTYPF_NOBLOCK )
124 #define XTYP_UNREGISTER (0x00D0 | XCLASS_NOTIFICATION | XTYPF_NOBLOCK )
126 /**************************************************
128 End of Message Types Section
130 ****************************************************/
132 /*****************************************************
134 DDE Codes for wStatus field
136 *****************************************************/
138 #define DDE_FACK 0x8000
139 #define DDE_FBUSY 0x4000
140 #define DDE_FDEFERUPD 0x4000
141 #define DDE_FACKREQ 0x8000
142 #define DDE_FRELEASE 0x2000
143 #define DDE_FREQUESTED 0x1000
144 #define DDE_FAPPSTATUS 0x00FF
145 #define DDE_FNOTPROCESSED 0x0000
148 /*****************************************************
150 End of wStatus codes
152 *****************************************************/
154 /****************************************************
156 Return Codes section again copied from SDK as must be same
158 *****************************************************/
160 #define DMLERR_NO_ERROR 0 /* must be 0 */
162 #define DMLERR_FIRST 0x4000
164 #define DMLERR_ADVACKTIMEOUT 0x4000
165 #define DMLERR_BUSY 0x4001
166 #define DMLERR_DATAACKTIMEOUT 0x4002
167 #define DMLERR_DLL_NOT_INITIALIZED 0x4003
168 #define DMLERR_DLL_USAGE 0x4004
169 #define DMLERR_EXECACKTIMEOUT 0x4005
170 #define DMLERR_INVALIDPARAMETER 0x4006
171 #define DMLERR_LOW_MEMORY 0x4007
172 #define DMLERR_MEMORY_ERROR 0x4008
173 #define DMLERR_NOTPROCESSED 0x4009
174 #define DMLERR_NO_CONV_ESTABLISHED 0x400a
175 #define DMLERR_POKEACKTIMEOUT 0x400b
176 #define DMLERR_POSTMSG_FAILED 0x400c
177 #define DMLERR_REENTRANCY 0x400d
178 #define DMLERR_SERVER_DIED 0x400e
179 #define DMLERR_SYS_ERROR 0x400f
180 #define DMLERR_UNADVACKTIMEOUT 0x4010
181 #define DMLERR_UNFOUND_QUEUE_ID 0x4011
183 #define DMLERR_LAST 0x4011
185 /*****************************************************
187 End of Return Codes and Microsoft section
189 ******************************************************/
193 typedef DWORD HCONVLIST;
194 typedef DWORD HCONV;
195 typedef DWORD HSZ;
196 typedef DWORD HDDEDATA;
197 typedef CHAR *LPTSTR;
200 /*******************************************************
202 API Entry Points
204 *******************************************************/
206 typedef HDDEDATA (CALLBACK *PFNCALLBACK16)(UINT16,UINT16,HCONV,HSZ,HSZ,
207 HDDEDATA,DWORD,DWORD);
208 typedef HDDEDATA (CALLBACK *PFNCALLBACK)(UINT,UINT,HCONV,HSZ,HSZ,
209 HDDEDATA,DWORD,DWORD);
211 /***************************************************
213 Externally visible data structures
215 ***************************************************/
217 typedef struct
219 UINT16 cb;
220 UINT16 wFlags;
221 UINT16 wCountryID;
222 INT16 iCodePage;
223 DWORD dwLangID;
224 DWORD dwSecurity;
225 } CONVCONTEXT16, *LPCONVCONTEXT16;
227 typedef struct
229 UINT cb;
230 UINT wFlags;
231 UINT wCountryID;
232 INT iCodePage;
233 DWORD dwLangID;
234 DWORD dwSecurity;
235 } CONVCONTEXT, *LPCONVCONTEXT;
237 typedef struct
239 DWORD cb;
240 DWORD hUser;
241 HCONV hConvPartner;
242 HSZ hszSvcPartner;
243 HSZ hszServiceReq;
244 HSZ hszTopic;
245 HSZ hszItem;
246 UINT16 wFmt;
247 UINT16 wType;
248 UINT16 wStatus;
249 UINT16 wConvst;
250 UINT16 wLastError;
251 HCONVLIST hConvList;
252 CONVCONTEXT16 ConvCtxt;
253 } CONVINFO16, *LPCONVINFO16;
255 typedef struct
257 DWORD cb;
258 DWORD hUser;
259 HCONV hConvPartner;
260 HSZ hszSvcPartner;
261 HSZ hszServiceReq;
262 HSZ hszTopic;
263 HSZ hszItem;
264 UINT wFmt;
265 UINT wType;
266 UINT wStatus;
267 UINT wConvst;
268 UINT wLastError;
269 HCONVLIST hConvList;
270 CONVCONTEXT ConvCtxt;
271 HWND hwnd;
272 HWND hwndPartner;
273 } CONVINFO, *LPCONVINFO;
274 // Internal data structures
276 /* entry for handle table */
277 typedef struct DDE_HANDLE_ENTRY {
278 BOOL16 Monitor; // have these two as full Booleans cos they'll be tested frequently
279 BOOL16 Client_only; // bit wasteful of space but it will be faster
280 BOOL16 Unicode; /* Flag to indicate Win32 API used to initialise */
281 BOOL16 Win16; /* flag to indicate Win16 API used to initialize */
282 DWORD Instance_id; // needed to track monitor usage
283 struct DDE_HANDLE_ENTRY *Next_Entry;
284 PFNCALLBACK CallBack;
285 DWORD CBF_Flags;
286 DWORD Monitor_flags;
287 UINT Txn_count; // count transactions open to simplify closure
288 } DDE_HANDLE_ENTRY;
290 // Interface Definitions
293 UINT16 WINAPI DdeInitialize16(LPDWORD,PFNCALLBACK16,DWORD,DWORD);
294 UINT WINAPI DdeInitializeA(LPDWORD,PFNCALLBACK,DWORD,DWORD);
295 UINT WINAPI DdeInitializeW(LPDWORD,PFNCALLBACK,DWORD,DWORD);
296 #define DdeInitialize WINELIB_NAME_AW(DdeInitialize)
297 BOOL16 WINAPI DdeUninitialize16(DWORD);
298 BOOL WINAPI DdeUninitialize(DWORD);
299 HCONVLIST WINAPI DdeConnectList16(DWORD,HSZ,HSZ,HCONVLIST,LPCONVCONTEXT16);
300 HCONVLIST WINAPI DdeConnectList(DWORD,HSZ,HSZ,HCONVLIST,LPCONVCONTEXT);
301 HCONV WINAPI DdeQueryNextServer16(HCONVLIST, HCONV);
302 HCONV WINAPI DdeQueryNextServer(HCONVLIST, HCONV);
303 DWORD WINAPI DdeQueryStringA(DWORD, HSZ, LPSTR, DWORD, INT);
304 DWORD WINAPI DdeQueryStringW(DWORD, HSZ, LPWSTR, DWORD, INT);
305 #define DdeQueryString WINELIB_NAME_AW(DdeQueryString)
306 BOOL16 WINAPI DdeDisconnectList16(HCONVLIST);
307 BOOL WINAPI DdeDisconnectList(HCONVLIST);
308 HCONV WINAPI DdeConnect16(DWORD,HSZ,HSZ,LPCONVCONTEXT16);
309 HCONV WINAPI DdeConnect(DWORD,HSZ,HSZ,LPCONVCONTEXT);
310 BOOL16 WINAPI DdeDisconnect16(HCONV);
311 BOOL WINAPI DdeDisconnect(HCONV);
312 BOOL16 WINAPI DdeSetUserHandle16(HCONV,DWORD,DWORD);
313 HDDEDATA WINAPI DdeCreateDataHandle16(DWORD,LPBYTE,DWORD,DWORD,HSZ,UINT16,UINT16);
314 HDDEDATA WINAPI DdeCreateDataHandle(DWORD,LPBYTE,DWORD,DWORD,HSZ,UINT,UINT);
315 HCONV WINAPI DdeReconnect(HCONV);
316 HSZ WINAPI DdeCreateStringHandle16(DWORD,LPCSTR,INT16);
317 HSZ WINAPI DdeCreateStringHandleA(DWORD,LPCSTR,INT);
318 HSZ WINAPI DdeCreateStringHandleW(DWORD,LPCWSTR,INT);
319 #define DdeCreateStringHandle WINELIB_NAME_AW(DdeCreateStringHandle)
320 BOOL16 WINAPI DdeFreeStringHandle16(DWORD,HSZ);
321 BOOL WINAPI DdeFreeStringHandle(DWORD,HSZ);
322 BOOL16 WINAPI DdeFreeDataHandle16(HDDEDATA);
323 BOOL WINAPI DdeFreeDataHandle(HDDEDATA);
324 BOOL16 WINAPI DdeKeepStringHandle16(DWORD,HSZ);
325 BOOL WINAPI DdeKeepStringHandle(DWORD,HSZ);
326 HDDEDATA WINAPI DdeClientTransaction16(LPVOID,DWORD,HCONV,HSZ,UINT16,
327 UINT16,DWORD,LPDWORD);
328 HDDEDATA WINAPI DdeClientTransaction(LPBYTE,DWORD,HCONV,HSZ,UINT,
329 UINT,DWORD,LPDWORD);
330 BOOL16 WINAPI DdeAbandonTransaction16(DWORD,HCONV,DWORD);
331 BOOL16 WINAPI DdePostAdvise16(DWORD,HSZ,HSZ);
332 BOOL WINAPI DdePostAdvise(DWORD,HSZ,HSZ);
333 HDDEDATA WINAPI DdeAddData16(HDDEDATA,LPBYTE,DWORD,DWORD);
334 DWORD WINAPI DdeGetData(HDDEDATA,LPBYTE,DWORD,DWORD);
335 LPBYTE WINAPI DdeAccessData16(HDDEDATA,LPDWORD);
336 LPBYTE WINAPI DdeAccessData(HDDEDATA,LPDWORD);
337 BOOL16 WINAPI DdeUnaccessData16(HDDEDATA);
338 BOOL WINAPI DdeUnaccessData(HDDEDATA);
339 BOOL16 WINAPI DdeEnableCallback16(DWORD,HCONV,UINT16);
340 BOOL WINAPI DdeEnableCallback(DWORD,HCONV,UINT);
341 int WINAPI DdeCmpStringHandles16(HSZ,HSZ);
342 int WINAPI DdeCmpStringHandles(HSZ,HSZ);
344 HDDEDATA WINAPI DdeNameService16(DWORD,HSZ,HSZ,UINT16);
345 HDDEDATA WINAPI DdeNameService(DWORD,HSZ,HSZ,UINT);
346 UINT16 WINAPI DdeGetLastError16(DWORD);
347 UINT WINAPI DdeGetLastError(DWORD);
349 #endif /* __WINE__DDEML_H */