ddeml.h 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369
  1. /**
  2. * This file has no copyright assigned and is placed in the Public Domain.
  3. * This file is part of the mingw-w64 runtime package.
  4. * No warranty is given; refer to the file DISCLAIMER.PD within this package.
  5. */
  6. #ifndef _INC_DDEMLH
  7. #define _INC_DDEMLH
  8. #include <_mingw_unicode.h>
  9. #ifdef __cplusplus
  10. extern "C" {
  11. #endif
  12. DECLARE_HANDLE(HCONVLIST);
  13. DECLARE_HANDLE(HCONV);
  14. DECLARE_HANDLE(HSZ);
  15. DECLARE_HANDLE(HDDEDATA);
  16. #define EXPENTRY CALLBACK
  17. typedef struct tagHSZPAIR {
  18. HSZ hszSvc;
  19. HSZ hszTopic;
  20. } HSZPAIR, *PHSZPAIR;
  21. typedef struct tagCONVCONTEXT {
  22. UINT cb;
  23. UINT wFlags;
  24. UINT wCountryID;
  25. int iCodePage;
  26. DWORD dwLangID;
  27. DWORD dwSecurity;
  28. SECURITY_QUALITY_OF_SERVICE qos;
  29. } CONVCONTEXT, *PCONVCONTEXT;
  30. typedef struct tagCONVINFO {
  31. DWORD cb;
  32. DWORD_PTR hUser;
  33. HCONV hConvPartner;
  34. HSZ hszSvcPartner;
  35. HSZ hszServiceReq;
  36. HSZ hszTopic;
  37. HSZ hszItem;
  38. UINT wFmt;
  39. UINT wType;
  40. UINT wStatus;
  41. UINT wConvst;
  42. UINT wLastError;
  43. HCONVLIST hConvList;
  44. CONVCONTEXT ConvCtxt;
  45. HWND hwnd;
  46. HWND hwndPartner;
  47. } CONVINFO, *PCONVINFO;
  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 CADV_LATEACK 0xFFFF
  66. #define ST_CONNECTED 0x0001
  67. #define ST_ADVISE 0x0002
  68. #define ST_ISLOCAL 0x0004
  69. #define ST_BLOCKED 0x0008
  70. #define ST_CLIENT 0x0010
  71. #define ST_TERMINATED 0x0020
  72. #define ST_INLIST 0x0040
  73. #define ST_BLOCKNEXT 0x0080
  74. #define ST_ISSELF 0x0100
  75. #define DDE_FACK 0x8000
  76. #define DDE_FBUSY 0x4000
  77. #define DDE_FDEFERUPD 0x4000
  78. #define DDE_FACKREQ 0x8000
  79. #define DDE_FRELEASE 0x2000
  80. #define DDE_FREQUESTED 0x1000
  81. #define DDE_FAPPSTATUS 0x00ff
  82. #define DDE_FNOTPROCESSED 0x0000
  83. #define DDE_FACKRESERVED (~(DDE_FACK | DDE_FBUSY | DDE_FAPPSTATUS))
  84. #define DDE_FADVRESERVED (~(DDE_FACKREQ | DDE_FDEFERUPD))
  85. #define DDE_FDATRESERVED (~(DDE_FACKREQ | DDE_FRELEASE | DDE_FREQUESTED))
  86. #define DDE_FPOKRESERVED (~(DDE_FRELEASE))
  87. #define MSGF_DDEMGR 0x8001
  88. #define CP_WINANSI 1004
  89. #define CP_WINUNICODE 1200
  90. #define XTYPF_NOBLOCK 0x0002
  91. #define XTYPF_NODATA 0x0004
  92. #define XTYPF_ACKREQ 0x0008
  93. #define XCLASS_MASK 0xFC00
  94. #define XCLASS_BOOL 0x1000
  95. #define XCLASS_DATA 0x2000
  96. #define XCLASS_FLAGS 0x4000
  97. #define XCLASS_NOTIFICATION 0x8000
  98. #define XTYP_ERROR (0x0000 | XCLASS_NOTIFICATION | XTYPF_NOBLOCK)
  99. #define XTYP_ADVDATA (0x0010 | XCLASS_FLAGS)
  100. #define XTYP_ADVREQ (0x0020 | XCLASS_DATA | XTYPF_NOBLOCK)
  101. #define XTYP_ADVSTART (0x0030 | XCLASS_BOOL)
  102. #define XTYP_ADVSTOP (0x0040 | XCLASS_NOTIFICATION)
  103. #define XTYP_EXECUTE (0x0050 | XCLASS_FLAGS)
  104. #define XTYP_CONNECT (0x0060 | XCLASS_BOOL | XTYPF_NOBLOCK)
  105. #define XTYP_CONNECT_CONFIRM (0x0070 | XCLASS_NOTIFICATION | XTYPF_NOBLOCK)
  106. #define XTYP_XACT_COMPLETE (0x0080 | XCLASS_NOTIFICATION)
  107. #define XTYP_POKE (0x0090 | XCLASS_FLAGS)
  108. #define XTYP_REGISTER (0x00A0 | XCLASS_NOTIFICATION | XTYPF_NOBLOCK)
  109. #define XTYP_REQUEST (0x00B0 | XCLASS_DATA)
  110. #define XTYP_DISCONNECT (0x00C0 | XCLASS_NOTIFICATION | XTYPF_NOBLOCK)
  111. #define XTYP_UNREGISTER (0x00D0 | XCLASS_NOTIFICATION | XTYPF_NOBLOCK)
  112. #define XTYP_WILDCONNECT (0x00E0 | XCLASS_DATA | XTYPF_NOBLOCK)
  113. #define XTYP_MASK 0x00F0
  114. #define XTYP_SHIFT 4
  115. #define TIMEOUT_ASYNC 0xFFFFFFFF
  116. #define QID_SYNC 0xFFFFFFFF
  117. #if defined(UNICODE)
  118. #define CP_WINNEUTRAL CP_WINUNICODE
  119. #else
  120. #define CP_WINNEUTRAL CP_WINANSI
  121. #endif
  122. #define SZDDESYS_TOPIC __MINGW_STRING_AW("System")
  123. #define SZDDESYS_ITEM_TOPICS __MINGW_STRING_AW("Topics")
  124. #define SZDDESYS_ITEM_SYSITEMS __MINGW_STRING_AW("SysItems")
  125. #define SZDDESYS_ITEM_RTNMSG __MINGW_STRING_AW("ReturnMessage")
  126. #define SZDDESYS_ITEM_STATUS __MINGW_STRING_AW("Status")
  127. #define SZDDESYS_ITEM_FORMATS __MINGW_STRING_AW("Formats")
  128. #define SZDDESYS_ITEM_HELP __MINGW_STRING_AW("Help")
  129. #define SZDDE_ITEM_ITEMLIST __MINGW_STRING_AW("TopicItemList")
  130. #define DdeInitialize __MINGW_NAME_AW(DdeInitialize)
  131. typedef HDDEDATA CALLBACK FNCALLBACK(UINT wType,UINT wFmt,HCONV hConv,HSZ hsz1,HSZ hsz2,HDDEDATA hData,ULONG_PTR dwData1,ULONG_PTR dwData2);
  132. typedef HDDEDATA (CALLBACK *PFNCALLBACK)(UINT wType,UINT wFmt,HCONV hConv,HSZ hsz1,HSZ hsz2,HDDEDATA hData,ULONG_PTR dwData1,ULONG_PTR dwData2);
  133. #define CBR_BLOCK ((HDDEDATA)-1)
  134. UINT WINAPI DdeInitializeA(LPDWORD pidInst,PFNCALLBACK pfnCallback,DWORD afCmd,DWORD ulRes);
  135. UINT WINAPI DdeInitializeW(LPDWORD pidInst,PFNCALLBACK pfnCallback,DWORD afCmd,DWORD ulRes);
  136. #define CBF_FAIL_SELFCONNECTIONS 0x00001000
  137. #define CBF_FAIL_CONNECTIONS 0x00002000
  138. #define CBF_FAIL_ADVISES 0x00004000
  139. #define CBF_FAIL_EXECUTES 0x00008000
  140. #define CBF_FAIL_POKES 0x00010000
  141. #define CBF_FAIL_REQUESTS 0x00020000
  142. #define CBF_FAIL_ALLSVRXACTIONS 0x0003f000
  143. #define CBF_SKIP_CONNECT_CONFIRMS 0x00040000
  144. #define CBF_SKIP_REGISTRATIONS 0x00080000
  145. #define CBF_SKIP_UNREGISTRATIONS 0x00100000
  146. #define CBF_SKIP_DISCONNECTS 0x00200000
  147. #define CBF_SKIP_ALLNOTIFICATIONS 0x003c0000
  148. #define APPCMD_CLIENTONLY __MSABI_LONG(0x00000010)
  149. #define APPCMD_FILTERINITS __MSABI_LONG(0x00000020)
  150. #define APPCMD_MASK __MSABI_LONG(0x00000FF0)
  151. #define APPCLASS_STANDARD __MSABI_LONG(0x00000000)
  152. #define APPCLASS_MASK __MSABI_LONG(0x0000000F)
  153. WINBOOL WINAPI DdeUninitialize(DWORD idInst);
  154. HCONVLIST WINAPI DdeConnectList(DWORD idInst,HSZ hszService,HSZ hszTopic,HCONVLIST hConvList,PCONVCONTEXT pCC);
  155. HCONV WINAPI DdeQueryNextServer(HCONVLIST hConvList,HCONV hConvPrev);
  156. WINBOOL WINAPI DdeDisconnectList(HCONVLIST hConvList);
  157. HCONV WINAPI DdeConnect(DWORD idInst,HSZ hszService,HSZ hszTopic,PCONVCONTEXT pCC);
  158. WINBOOL WINAPI DdeDisconnect(HCONV hConv);
  159. HCONV WINAPI DdeReconnect(HCONV hConv);
  160. UINT WINAPI DdeQueryConvInfo(HCONV hConv,DWORD idTransaction,PCONVINFO pConvInfo);
  161. WINBOOL WINAPI DdeSetUserHandle(HCONV hConv,DWORD id,DWORD_PTR hUser);
  162. WINBOOL WINAPI DdeAbandonTransaction(DWORD idInst,HCONV hConv,DWORD idTransaction);
  163. WINBOOL WINAPI DdePostAdvise(DWORD idInst,HSZ hszTopic,HSZ hszItem);
  164. WINBOOL WINAPI DdeEnableCallback(DWORD idInst,HCONV hConv,UINT wCmd);
  165. WINBOOL WINAPI DdeImpersonateClient(HCONV hConv);
  166. #define EC_ENABLEALL 0
  167. #define EC_ENABLEONE ST_BLOCKNEXT
  168. #define EC_DISABLE ST_BLOCKED
  169. #define EC_QUERYWAITING 2
  170. #define DNS_REGISTER 0x0001
  171. #define DNS_UNREGISTER 0x0002
  172. #define DNS_FILTERON 0x0004
  173. #define DNS_FILTEROFF 0x0008
  174. HDDEDATA WINAPI DdeNameService(DWORD idInst,HSZ hsz1,HSZ hsz2,UINT afCmd);
  175. HDDEDATA WINAPI DdeClientTransaction(LPBYTE pData,DWORD cbData,HCONV hConv,HSZ hszItem,UINT wFmt,UINT wType,DWORD dwTimeout,LPDWORD pdwResult);
  176. HDDEDATA WINAPI DdeCreateDataHandle(DWORD idInst,LPBYTE pSrc,DWORD cb,DWORD cbOff,HSZ hszItem,UINT wFmt,UINT afCmd);
  177. HDDEDATA WINAPI DdeAddData(HDDEDATA hData,LPBYTE pSrc,DWORD cb,DWORD cbOff);
  178. DWORD WINAPI DdeGetData(HDDEDATA hData,LPBYTE pDst,DWORD cbMax,DWORD cbOff);
  179. LPBYTE WINAPI DdeAccessData(HDDEDATA hData,LPDWORD pcbDataSize);
  180. WINBOOL WINAPI DdeUnaccessData(HDDEDATA hData);
  181. WINBOOL WINAPI DdeFreeDataHandle(HDDEDATA hData);
  182. #define HDATA_APPOWNED 0x0001
  183. UINT WINAPI DdeGetLastError(DWORD idInst);
  184. #define DMLERR_NO_ERROR 0
  185. #define DMLERR_FIRST 0x4000
  186. #define DMLERR_ADVACKTIMEOUT 0x4000
  187. #define DMLERR_BUSY 0x4001
  188. #define DMLERR_DATAACKTIMEOUT 0x4002
  189. #define DMLERR_DLL_NOT_INITIALIZED 0x4003
  190. #define DMLERR_DLL_USAGE 0x4004
  191. #define DMLERR_EXECACKTIMEOUT 0x4005
  192. #define DMLERR_INVALIDPARAMETER 0x4006
  193. #define DMLERR_LOW_MEMORY 0x4007
  194. #define DMLERR_MEMORY_ERROR 0x4008
  195. #define DMLERR_NOTPROCESSED 0x4009
  196. #define DMLERR_NO_CONV_ESTABLISHED 0x400a
  197. #define DMLERR_POKEACKTIMEOUT 0x400b
  198. #define DMLERR_POSTMSG_FAILED 0x400c
  199. #define DMLERR_REENTRANCY 0x400d
  200. #define DMLERR_SERVER_DIED 0x400e
  201. #define DMLERR_SYS_ERROR 0x400f
  202. #define DMLERR_UNADVACKTIMEOUT 0x4010
  203. #define DMLERR_UNFOUND_QUEUE_ID 0x4011
  204. #define DMLERR_LAST 0x4011
  205. HSZ WINAPI DdeCreateStringHandleA(DWORD idInst,LPCSTR psz,int iCodePage);
  206. HSZ WINAPI DdeCreateStringHandleW(DWORD idInst,LPCWSTR psz,int iCodePage);
  207. DWORD WINAPI DdeQueryStringA(DWORD idInst,HSZ hsz,LPSTR psz,DWORD cchMax,int iCodePage);
  208. DWORD WINAPI DdeQueryStringW(DWORD idInst,HSZ hsz,LPWSTR psz,DWORD cchMax,int iCodePage);
  209. WINBOOL WINAPI DdeFreeStringHandle(DWORD idInst,HSZ hsz);
  210. WINBOOL WINAPI DdeKeepStringHandle(DWORD idInst,HSZ hsz);
  211. int WINAPI DdeCmpStringHandles(HSZ hsz1,HSZ hsz2);
  212. #define DdeCreateStringHandle __MINGW_NAME_AW(DdeCreateStringHandle)
  213. #define DdeQueryString __MINGW_NAME_AW(DdeQueryString)
  214. #ifndef NODDEMLSPY
  215. typedef struct tagDDEML_MSG_HOOK_DATA {
  216. UINT_PTR uiLo;
  217. UINT_PTR uiHi;
  218. DWORD cbData;
  219. DWORD Data[8];
  220. } DDEML_MSG_HOOK_DATA,*PDDEML_MSG_HOOK_DATA;
  221. typedef struct tagMONMSGSTRUCT {
  222. UINT cb;
  223. HWND hwndTo;
  224. DWORD dwTime;
  225. HANDLE hTask;
  226. UINT wMsg;
  227. WPARAM wParam;
  228. LPARAM lParam;
  229. DDEML_MSG_HOOK_DATA dmhd;
  230. } MONMSGSTRUCT,*PMONMSGSTRUCT;
  231. typedef struct tagMONCBSTRUCT {
  232. UINT cb;
  233. DWORD dwTime;
  234. HANDLE hTask;
  235. DWORD dwRet;
  236. UINT wType;
  237. UINT wFmt;
  238. HCONV hConv;
  239. HSZ hsz1;
  240. HSZ hsz2;
  241. HDDEDATA hData;
  242. ULONG_PTR dwData1;
  243. ULONG_PTR dwData2;
  244. CONVCONTEXT cc;
  245. DWORD cbData;
  246. DWORD Data[8];
  247. } MONCBSTRUCT,*PMONCBSTRUCT;
  248. typedef struct tagMONHSZSTRUCTA {
  249. UINT cb;
  250. WINBOOL fsAction;
  251. DWORD dwTime;
  252. HSZ hsz;
  253. HANDLE hTask;
  254. CHAR str[1];
  255. } MONHSZSTRUCTA,*PMONHSZSTRUCTA;
  256. typedef struct tagMONHSZSTRUCTW {
  257. UINT cb;
  258. WINBOOL fsAction;
  259. DWORD dwTime;
  260. HSZ hsz;
  261. HANDLE hTask;
  262. WCHAR str[1];
  263. } MONHSZSTRUCTW,*PMONHSZSTRUCTW;
  264. __MINGW_TYPEDEF_AW(MONHSZSTRUCT)
  265. __MINGW_TYPEDEF_AW(PMONHSZSTRUCT)
  266. #define MH_CREATE 1
  267. #define MH_KEEP 2
  268. #define MH_DELETE 3
  269. #define MH_CLEANUP 4
  270. typedef struct tagMONERRSTRUCT {
  271. UINT cb;
  272. UINT wLastError;
  273. DWORD dwTime;
  274. HANDLE hTask;
  275. } MONERRSTRUCT,*PMONERRSTRUCT;
  276. typedef struct tagMONLINKSTRUCT {
  277. UINT cb;
  278. DWORD dwTime;
  279. HANDLE hTask;
  280. WINBOOL fEstablished;
  281. WINBOOL fNoData;
  282. HSZ hszSvc;
  283. HSZ hszTopic;
  284. HSZ hszItem;
  285. UINT wFmt;
  286. WINBOOL fServer;
  287. HCONV hConvServer;
  288. HCONV hConvClient;
  289. } MONLINKSTRUCT,*PMONLINKSTRUCT;
  290. typedef struct tagMONCONVSTRUCT {
  291. UINT cb;
  292. WINBOOL fConnect;
  293. DWORD dwTime;
  294. HANDLE hTask;
  295. HSZ hszSvc;
  296. HSZ hszTopic;
  297. HCONV hConvClient;
  298. HCONV hConvServer;
  299. } MONCONVSTRUCT,*PMONCONVSTRUCT;
  300. #define MAX_MONITORS 4
  301. #define APPCLASS_MONITOR __MSABI_LONG(0x00000001)
  302. #define XTYP_MONITOR (0x00F0 | XCLASS_NOTIFICATION | XTYPF_NOBLOCK)
  303. #define MF_HSZ_INFO 0x01000000
  304. #define MF_SENDMSGS 0x02000000
  305. #define MF_POSTMSGS 0x04000000
  306. #define MF_CALLBACKS 0x08000000
  307. #define MF_ERRORS 0x10000000
  308. #define MF_LINKS 0x20000000
  309. #define MF_CONV 0x40000000
  310. #define MF_MASK 0xFF000000
  311. #endif
  312. #ifdef __cplusplus
  313. }
  314. #endif
  315. #endif