Check for NULL in lstrcpy* (Windows uses real exception handlers).
[wine.git] / include / ddeml.h
blobcf76a8d0238408b1db32696423013a31d644c89b
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 "wintypes.h"
13 /* Codepage Constants
15 #define CP_WINANSI 1004
16 #define CP_WINUNICODE 1200
18 #define MSGF_DDEMGR 0x8001
19 /***************************************************
21 FLAGS Section - copied from Microsoft SDK as must be standard, probably Copyright Microsoft Corporation
23 ***************************************************/
26 * Callback filter flags for use with standard apps.
29 #define CBF_FAIL_SELFCONNECTIONS 0x00001000
30 #define CBF_FAIL_CONNECTIONS 0x00002000
31 #define CBF_FAIL_ADVISES 0x00004000
32 #define CBF_FAIL_EXECUTES 0x00008000
33 #define CBF_FAIL_POKES 0x00010000
34 #define CBF_FAIL_REQUESTS 0x00020000
35 #define CBF_FAIL_ALLSVRXACTIONS 0x0003f000
37 #define CBF_SKIP_CONNECT_CONFIRMS 0x00040000
38 #define CBF_SKIP_REGISTRATIONS 0x00080000
39 #define CBF_SKIP_UNREGISTRATIONS 0x00100000
40 #define CBF_SKIP_DISCONNECTS 0x00200000
41 #define CBF_SKIP_ALLNOTIFICATIONS 0x003c0000
44 * Application command flags
46 #define APPCMD_CLIENTONLY 0x00000010L
47 #define APPCMD_FILTERINITS 0x00000020L
48 #define APPCMD_MASK 0x00000FF0L
51 * Application classification flags
54 #define APPCLASS_STANDARD 0x00000000L
55 #define APPCLASS_MONITOR 0x00000001L
56 #define APPCLASS_MASK 0x0000000FL
59 * Callback filter flags for use with MONITOR apps - 0 implies no monitor
60 * callbacks.
62 #define MF_HSZ_INFO 0x01000000
63 #define MF_SENDMSGS 0x02000000
64 #define MF_POSTMSGS 0x04000000
65 #define MF_CALLBACKS 0x08000000
66 #define MF_ERRORS 0x10000000
67 #define MF_LINKS 0x20000000
68 #define MF_CONV 0x40000000
70 #define MF_MASK 0xFF000000
73 * DdeNameService service name flags
76 #define DNS_REGISTER 0x0001
77 #define DNS_UNREGISTER 0x0002
78 #define DNS_FILTERON 0x0004
79 #define DNS_FILTEROFF 0x0008
82 /****************************************************
84 End of Flags section
86 ****************************************************/
88 /****************************************************
90 Return Codes section again copied from SDK as must be same
92 *****************************************************/
94 #define DMLERR_NO_ERROR 0 /* must be 0 */
96 #define DMLERR_FIRST 0x4000
98 #define DMLERR_ADVACKTIMEOUT 0x4000
99 #define DMLERR_BUSY 0x4001
100 #define DMLERR_DATAACKTIMEOUT 0x4002
101 #define DMLERR_DLL_NOT_INITIALIZED 0x4003
102 #define DMLERR_DLL_USAGE 0x4004
103 #define DMLERR_EXECACKTIMEOUT 0x4005
104 #define DMLERR_INVALIDPARAMETER 0x4006
105 #define DMLERR_LOW_MEMORY 0x4007
106 #define DMLERR_MEMORY_ERROR 0x4008
107 #define DMLERR_NOTPROCESSED 0x4009
108 #define DMLERR_NO_CONV_ESTABLISHED 0x400a
109 #define DMLERR_POKEACKTIMEOUT 0x400b
110 #define DMLERR_POSTMSG_FAILED 0x400c
111 #define DMLERR_REENTRANCY 0x400d
112 #define DMLERR_SERVER_DIED 0x400e
113 #define DMLERR_SYS_ERROR 0x400f
114 #define DMLERR_UNADVACKTIMEOUT 0x4010
115 #define DMLERR_UNFOUND_QUEUE_ID 0x4011
117 #define DMLERR_LAST 0x4011
119 /*****************************************************
121 End of Return Codes and Microsoft section
123 ******************************************************/
127 typedef DWORD HCONVLIST;
128 typedef DWORD HCONV;
129 typedef DWORD HSZ;
130 typedef DWORD HDDEDATA;
131 typedef CHAR *LPTSTR;
133 typedef HDDEDATA (CALLBACK *PFNCALLBACK16)(UINT16,UINT16,HCONV,HSZ,HSZ,
134 HDDEDATA,DWORD,DWORD);
135 typedef HDDEDATA (CALLBACK *PFNCALLBACK32)(UINT32,UINT32,HCONV,HSZ,HSZ,
136 HDDEDATA,DWORD,DWORD);
137 DECL_WINELIB_TYPE(PFNCALLBACK)
139 /***************************************************
141 Externally visible data structures
143 ***************************************************/
145 typedef struct
147 UINT16 cb;
148 UINT16 wFlags;
149 UINT16 wCountryID;
150 INT16 iCodePage;
151 DWORD dwLangID;
152 DWORD dwSecurity;
153 } CONVCONTEXT16, *LPCONVCONTEXT16;
155 typedef struct
157 UINT32 cb;
158 UINT32 wFlags;
159 UINT32 wCountryID;
160 INT32 iCodePage;
161 DWORD dwLangID;
162 DWORD dwSecurity;
163 } CONVCONTEXT32, *LPCONVCONTEXT32;
165 // Internal data structures
167 /* entry for handle table */
168 typedef struct DDE_HANDLE_ENTRY {
169 BOOL16 Monitor; // have these two as full Booleans cos they'll be tested frequently
170 BOOL16 Client_only; // bit wasteful of space but it will be faster
171 BOOL16 Unicode; /* Flag to indicate Win32 API used to initialise */
172 BOOL16 Win16; /* flag to indicate Win16 API used to initialize */
173 LPDWORD Instance_id; // needed to track monitor usage
174 struct DDE_HANDLE_ENTRY *Next_Entry;
175 PFNCALLBACK32 CallBack;
176 DWORD CBF_Flags;
177 DWORD Monitor_flags;
178 UINT32 Txn_count; // count transactions open to simplify closure
179 } DDE_HANDLE_ENTRY;
181 // Interface Definitions
183 DECL_WINELIB_TYPE(CONVCONTEXT)
184 DECL_WINELIB_TYPE(LPCONVCONTEXT)
186 UINT16 WINAPI DdeInitialize16(LPDWORD,PFNCALLBACK16,DWORD,DWORD);
187 UINT32 WINAPI DdeInitialize32A(LPDWORD,PFNCALLBACK32,DWORD,DWORD);
188 UINT32 WINAPI DdeInitialize32W(LPDWORD,PFNCALLBACK32,DWORD,DWORD);
189 #define DdeInitialize WINELIB_NAME_AW(DdeInitialize)
190 BOOL16 WINAPI DdeUninitialize16(DWORD);
191 BOOL32 WINAPI DdeUninitialize32(DWORD);
192 #define DdeUninitialize WINELIB_NAME(DdeUninitialize)
193 HCONVLIST WINAPI DdeConnectList16(DWORD,HSZ,HSZ,HCONVLIST,LPCONVCONTEXT16);
194 HCONVLIST WINAPI DdeConnectList32(DWORD,HSZ,HSZ,HCONVLIST,LPCONVCONTEXT32);
195 #define DdeConnectList WINELIB_NAME(DdeConnectList)
196 HCONV WINAPI DdeQueryNextServer16(HCONVLIST, HCONV);
197 HCONV WINAPI DdeQueryNextServer32(HCONVLIST, HCONV);
198 #define DdeQueryNextServer WINELIB_NAME(DdeQueryNextServer)
199 DWORD WINAPI DdeQueryString32A(DWORD, HSZ, LPSTR, DWORD, INT32);
200 DWORD WINAPI DdeQueryString32W(DWORD, HSZ, LPWSTR, DWORD, INT32);
201 #define DdeQueryString WINELIB_NAME_AW(DdeQueryString)
202 BOOL16 WINAPI DdeDisconnectList16(HCONVLIST);
203 BOOL32 WINAPI DdeDisconnectList32(HCONVLIST);
204 #define DdeDisConnectList WINELIB_NAME(DdeDisconnectList)
205 HCONV WINAPI DdeConnect16(DWORD,HSZ,HSZ,LPCONVCONTEXT16);
206 HCONV WINAPI DdeConnect32(DWORD,HSZ,HSZ,LPCONVCONTEXT32);
207 #define DdeConnect WINELIB_NAME(DdeConnect)
208 BOOL16 WINAPI DdeDisconnect16(HCONV);
209 BOOL32 WINAPI DdeDisconnect32(HCONV);
210 #define DdeDisconnect WINELIB_NAME(DdeDisconnect)
211 BOOL16 WINAPI DdeSetUserHandle(HCONV,DWORD,DWORD);
212 HDDEDATA WINAPI DdeCreateDataHandle16(DWORD,LPBYTE,DWORD,DWORD,HSZ,UINT16,UINT16);
213 HDDEDATA WINAPI DdeCreateDataHandle32(DWORD,LPBYTE,DWORD,DWORD,HSZ,UINT32,UINT32);
214 #define DdeCreateDataHandle WINELIB_NAME(DdeCreateDataHandle)
215 HCONV WINAPI DdeReconnect(HCONV);
216 HSZ WINAPI DdeCreateStringHandle16(DWORD,LPCSTR,INT16);
217 HSZ WINAPI DdeCreateStringHandle32A(DWORD,LPCSTR,INT32);
218 HSZ WINAPI DdeCreateStringHandle32W(DWORD,LPCWSTR,INT32);
219 #define DdeCreateStringHandle WINELIB_NAME_AW(DdeCreateStringHandle)
220 BOOL16 WINAPI DdeFreeStringHandle16(DWORD,HSZ);
221 BOOL32 WINAPI DdeFreeStringHandle32(DWORD,HSZ);
222 #define DdeFreeStringHandle WINELIB_NAME(DdeFreeStringHandle)
223 BOOL16 WINAPI DdeFreeDataHandle16(HDDEDATA);
224 BOOL32 WINAPI DdeFreeDataHandle32(HDDEDATA);
225 #define DdeFreeDataHandle WINELIB_NAME(DdeFreeDataHandle)
226 BOOL16 WINAPI DdeKeepStringHandle16(DWORD,HSZ);
227 BOOL32 WINAPI DdeKeepStringHandle32(DWORD,HSZ);
228 #define DdeKeepStringHandle WINELIB_NAME(DdeKeepStringHandle)
229 HDDEDATA WINAPI DdeClientTransaction16(LPVOID,DWORD,HCONV,HSZ,UINT16,
230 UINT16,DWORD,LPDWORD);
231 HDDEDATA WINAPI DdeClientTransaction32(LPBYTE,DWORD,HCONV,HSZ,UINT32,
232 UINT32,DWORD,LPDWORD);
233 #define DdeClientTransaction WINELIB_NAME(DdeClientTransaction)
234 BOOL16 WINAPI DdeAbandonTransaction(DWORD,HCONV,DWORD);
235 BOOL16 WINAPI DdePostAdvise16(DWORD,HSZ,HSZ);
236 BOOL32 WINAPI DdePostAdvise32(DWORD,HSZ,HSZ);
237 #define DdePostAdvise WINELIB_NAME(DdePostAdvise)
238 HDDEDATA WINAPI DdeAddData(HDDEDATA,LPBYTE,DWORD,DWORD);
239 DWORD WINAPI DdeGetData(HDDEDATA,LPBYTE,DWORD,DWORD);
240 LPBYTE WINAPI DdeAccessData16(HDDEDATA,LPDWORD);
241 LPBYTE WINAPI DdeAccessData32(HDDEDATA,LPDWORD);
242 #define DdeAccessData WINELIB_NAME(DdeAccessData)
243 BOOL16 WINAPI DdeUnaccessData16(HDDEDATA);
244 BOOL32 WINAPI DdeUnaccessData32(HDDEDATA);
245 #define DdeUnaccessData WINELIB_NAME(DdeUnaccessData)
246 BOOL16 WINAPI DdeEnableCallback16(DWORD,HCONV,UINT16);
247 BOOL32 WINAPI DdeEnableCallback32(DWORD,HCONV,UINT32);
248 #define DdeEnableCallback WINELIB_NAME(DdeEnableCallback)
249 int WINAPI DdeCmpStringHandles16(HSZ,HSZ);
250 int WINAPI DdeCmpStringHandles32(HSZ,HSZ);
251 #define DdeCmpStringHandles WINELIB_NAME(DdeCmpStringHandles)
253 HDDEDATA WINAPI DdeNameService16(DWORD,HSZ,HSZ,UINT16);
254 HDDEDATA WINAPI DdeNameService32(DWORD,HSZ,HSZ,UINT32);
255 #define DdeNameService WINELIB_NAME(DdeNameService)
256 UINT16 WINAPI DdeGetLastError16(DWORD);
257 UINT32 WINAPI DdeGetLastError32(DWORD);
258 #define DdeGetLastError WINELIB_NAME(DdeGetLastError)
260 #endif /* __WINE__DDEML_H */