ddeml.h 12 KB

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