Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

459 lines
15 KiB

  1. /*****************************************************************************\
  2. * *
  3. * ddeml.h - DDEML API header file *
  4. * *
  5. * Version 1.0 *
  6. * *
  7. * Copyright (c) 1992, Microsoft Corp. All rights reserved. *
  8. * *
  9. \*****************************************************************************/
  10. #ifndef _INC_DDEML
  11. #define _INC_DDEML
  12. #ifndef RC_INVOKED
  13. #pragma pack(1)
  14. #endif /* RC_INVOKED */
  15. #ifdef __cplusplus
  16. extern "C" { /* Assume C declarations for C++ */
  17. #endif /* __cplusplus */
  18. #ifndef _INC_WINDOWS /* If not included with 3.1 headers... */
  19. #define LPCSTR LPSTR
  20. #define WINAPI FAR PASCAL
  21. #define CALLBACK FAR PASCAL
  22. #define UINT WORD
  23. #define LPARAM LONG
  24. #define WPARAM WORD
  25. #define LRESULT LONG
  26. #define HMODULE HANDLE
  27. #define HINSTANCE HANDLE
  28. #define HLOCAL HANDLE
  29. #define HGLOBAL HANDLE
  30. #endif /* _INC_WINDOWS */
  31. #ifndef DECLARE_HANDLE32
  32. #ifdef STRICT
  33. #define DECLARE_HANDLE32(name) struct name##__ { int unused; }; \
  34. typedef const struct name##__ _far* name
  35. #else /* STRICT */
  36. #define DECLARE_HANDLE32(name) typedef DWORD name
  37. #endif /* !STRICT */
  38. #endif /* !DECLARE_HANDLE32 */
  39. #define EXPENTRY WINAPI
  40. /******** public types ********/
  41. DECLARE_HANDLE32(HCONVLIST);
  42. DECLARE_HANDLE32(HCONV);
  43. DECLARE_HANDLE32(HSZ);
  44. DECLARE_HANDLE32(HDDEDATA);
  45. /* the following structure is for use with XTYP_WILDCONNECT processing. */
  46. typedef struct tagHSZPAIR
  47. {
  48. HSZ hszSvc;
  49. HSZ hszTopic;
  50. } HSZPAIR;
  51. typedef HSZPAIR FAR *PHSZPAIR;
  52. /* The following structure is used by DdeConnect() and DdeConnectList() and
  53. by XTYP_CONNECT and XTYP_WILDCONNECT callbacks. */
  54. typedef struct tagCONVCONTEXT
  55. {
  56. UINT cb; /* set to sizeof(CONVCONTEXT) */
  57. UINT wFlags; /* none currently defined. */
  58. UINT wCountryID; /* country code for topic/item strings used. */
  59. int iCodePage; /* codepage used for topic/item strings. */
  60. DWORD dwLangID; /* language ID for topic/item strings. */
  61. DWORD dwSecurity; /* Private security code. */
  62. } CONVCONTEXT;
  63. typedef CONVCONTEXT FAR *PCONVCONTEXT;
  64. /* The following structure is used by DdeQueryConvInfo(): */
  65. typedef struct tagCONVINFO
  66. {
  67. DWORD cb; /* sizeof(CONVINFO) */
  68. DWORD hUser; /* user specified field */
  69. HCONV hConvPartner; /* hConv on other end or 0 if non-ddemgr partner */
  70. HSZ hszSvcPartner; /* app name of partner if obtainable */
  71. HSZ hszServiceReq; /* AppName requested for connection */
  72. HSZ hszTopic; /* Topic name for conversation */
  73. HSZ hszItem; /* transaction item name or NULL if quiescent */
  74. UINT wFmt; /* transaction format or NULL if quiescent */
  75. UINT wType; /* XTYP_ for current transaction */
  76. UINT wStatus; /* ST_ constant for current conversation */
  77. UINT wConvst; /* XST_ constant for current transaction */
  78. UINT wLastError; /* last transaction error. */
  79. HCONVLIST hConvList; /* parent hConvList if this conversation is in a list */
  80. CONVCONTEXT ConvCtxt; /* conversation context */
  81. HWND hwnd; /* Added to allow access for NetDDE. */
  82. HWND hwndPartner; /* Added to allow access for NetDDE. */
  83. } CONVINFO;
  84. typedef CONVINFO FAR *PCONVINFO;
  85. /***** conversation states (usState) *****/
  86. #define XST_NULL 0 /* quiescent states */
  87. #define XST_INCOMPLETE 1
  88. #define XST_CONNECTED 2
  89. #define XST_INIT1 3 /* mid-initiation states */
  90. #define XST_INIT2 4
  91. #define XST_REQSENT 5 /* active conversation states */
  92. #define XST_DATARCVD 6
  93. #define XST_POKESENT 7
  94. #define XST_POKEACKRCVD 8
  95. #define XST_EXECSENT 9
  96. #define XST_EXECACKRCVD 10
  97. #define XST_ADVSENT 11
  98. #define XST_UNADVSENT 12
  99. #define XST_ADVACKRCVD 13
  100. #define XST_UNADVACKRCVD 14
  101. #define XST_ADVDATASENT 15
  102. #define XST_ADVDATAACKRCVD 16
  103. /* used in LOWORD(dwData1) of XTYP_ADVREQ callbacks... */
  104. #define CADV_LATEACK 0xFFFF
  105. /***** conversation status bits (fsStatus) *****/
  106. #define ST_CONNECTED 0x0001
  107. #define ST_ADVISE 0x0002
  108. #define ST_ISLOCAL 0x0004
  109. #define ST_BLOCKED 0x0008
  110. #define ST_CLIENT 0x0010
  111. #define ST_TERMINATED 0x0020
  112. #define ST_INLIST 0x0040
  113. #define ST_BLOCKNEXT 0x0080
  114. #define ST_ISSELF 0x0100
  115. /* DDE constants for wStatus field */
  116. #define DDE_FACK 0x8000
  117. #define DDE_FBUSY 0x4000
  118. #define DDE_FDEFERUPD 0x4000
  119. #define DDE_FACKREQ 0x8000
  120. #define DDE_FRELEASE 0x2000
  121. #define DDE_FREQUESTED 0x1000
  122. #define DDE_FACKRESERVED 0x3ff0
  123. #define DDE_FADVRESERVED 0x3fff
  124. #define DDE_FDATRESERVED 0x4fff
  125. #define DDE_FPOKRESERVED 0xdfff
  126. #define DDE_FAPPSTATUS 0x00ff
  127. #define DDE_FNOTPROCESSED 0x0000
  128. /***** message filter hook types *****/
  129. #define MSGF_DDEMGR 0x8001
  130. /***** codepage constants ****/
  131. #define CP_WINANSI 1004 /* default codepage for windows & old DDE convs. */
  132. /***** transaction types *****/
  133. #define XTYPF_NOBLOCK 0x0002 /* CBR_BLOCK will not work */
  134. #define XTYPF_NODATA 0x0004 /* DDE_FDEFERUPD */
  135. #define XTYPF_ACKREQ 0x0008 /* DDE_FACKREQ */
  136. #define XCLASS_MASK 0xFC00
  137. #define XCLASS_BOOL 0x1000
  138. #define XCLASS_DATA 0x2000
  139. #define XCLASS_FLAGS 0x4000
  140. #define XCLASS_NOTIFICATION 0x8000
  141. #define XTYP_ERROR (0x0000 | XCLASS_NOTIFICATION | XTYPF_NOBLOCK )
  142. #define XTYP_ADVDATA (0x0010 | XCLASS_FLAGS )
  143. #define XTYP_ADVREQ (0x0020 | XCLASS_DATA | XTYPF_NOBLOCK )
  144. #define XTYP_ADVSTART (0x0030 | XCLASS_BOOL )
  145. #define XTYP_ADVSTOP (0x0040 | XCLASS_NOTIFICATION)
  146. #define XTYP_EXECUTE (0x0050 | XCLASS_FLAGS )
  147. #define XTYP_CONNECT (0x0060 | XCLASS_BOOL | XTYPF_NOBLOCK)
  148. #define XTYP_CONNECT_CONFIRM (0x0070 | XCLASS_NOTIFICATION | XTYPF_NOBLOCK)
  149. #define XTYP_XACT_COMPLETE (0x0080 | XCLASS_NOTIFICATION )
  150. #define XTYP_POKE (0x0090 | XCLASS_FLAGS )
  151. #define XTYP_REGISTER (0x00A0 | XCLASS_NOTIFICATION | XTYPF_NOBLOCK)
  152. #define XTYP_REQUEST (0x00B0 | XCLASS_DATA )
  153. #define XTYP_DISCONNECT (0x00C0 | XCLASS_NOTIFICATION | XTYPF_NOBLOCK)
  154. #define XTYP_UNREGISTER (0x00D0 | XCLASS_NOTIFICATION | XTYPF_NOBLOCK)
  155. #define XTYP_WILDCONNECT (0x00E0 | XCLASS_DATA | XTYPF_NOBLOCK)
  156. #define XTYP_MASK 0x00F0
  157. #define XTYP_SHIFT 4 /* shift to turn XTYP_ into an index */
  158. /***** Timeout constants *****/
  159. #define TIMEOUT_ASYNC -1L
  160. /***** Transaction ID constants *****/
  161. #define QID_SYNC -1L
  162. /****** public strings used in DDE ******/
  163. #define SZDDESYS_TOPIC "System"
  164. #define SZDDESYS_ITEM_TOPICS "Topics"
  165. #define SZDDESYS_ITEM_SYSITEMS "SysItems"
  166. #define SZDDESYS_ITEM_RTNMSG "ReturnMessage"
  167. #define SZDDESYS_ITEM_STATUS "Status"
  168. #define SZDDESYS_ITEM_FORMATS "Formats"
  169. #define SZDDESYS_ITEM_HELP "Help"
  170. #define SZDDE_ITEM_ITEMLIST "TopicItemList"
  171. /****** API entry points ******/
  172. typedef HDDEDATA CALLBACK FNCALLBACK(UINT wType, UINT wFmt, HCONV hConv,
  173. HSZ hsz1, HSZ hsz2, HDDEDATA hData, DWORD dwData1, DWORD dwData2);
  174. typedef FNCALLBACK *PFNCALLBACK;
  175. #define CBR_BLOCK 0xffffffffL
  176. /* DLL registration functions */
  177. UINT WINAPI DdeInitialize(DWORD FAR* pidInst, PFNCALLBACK pfnCallback,
  178. DWORD afCmd, DWORD ulRes);
  179. /*
  180. * Callback filter flags for use with standard apps.
  181. */
  182. #define CBF_FAIL_SELFCONNECTIONS 0x00001000
  183. #define CBF_FAIL_CONNECTIONS 0x00002000
  184. #define CBF_FAIL_ADVISES 0x00004000
  185. #define CBF_FAIL_EXECUTES 0x00008000
  186. #define CBF_FAIL_POKES 0x00010000
  187. #define CBF_FAIL_REQUESTS 0x00020000
  188. #define CBF_FAIL_ALLSVRXACTIONS 0x0003f000
  189. #define CBF_SKIP_CONNECT_CONFIRMS 0x00040000
  190. #define CBF_SKIP_REGISTRATIONS 0x00080000
  191. #define CBF_SKIP_UNREGISTRATIONS 0x00100000
  192. #define CBF_SKIP_DISCONNECTS 0x00200000
  193. #define CBF_SKIP_ALLNOTIFICATIONS 0x003c0000
  194. /*
  195. * Application command flags
  196. */
  197. #define APPCMD_CLIENTONLY 0x00000010L
  198. #define APPCMD_FILTERINITS 0x00000020L
  199. #define APPCMD_MASK 0x00000FF0L
  200. /*
  201. * Application classification flags
  202. */
  203. #define APPCLASS_STANDARD 0x00000000L
  204. #define APPCLASS_MASK 0x0000000FL
  205. BOOL WINAPI DdeUninitialize(DWORD idInst);
  206. /* conversation enumeration functions */
  207. HCONVLIST WINAPI DdeConnectList(DWORD idInst, HSZ hszService, HSZ hszTopic,
  208. HCONVLIST hConvList, CONVCONTEXT FAR* pCC);
  209. HCONV WINAPI DdeQueryNextServer(HCONVLIST hConvList, HCONV hConvPrev);
  210. BOOL WINAPI DdeDisconnectList(HCONVLIST hConvList);
  211. /* conversation control functions */
  212. HCONV WINAPI DdeConnect(DWORD idInst, HSZ hszService, HSZ hszTopic,
  213. CONVCONTEXT FAR* pCC);
  214. BOOL WINAPI DdeDisconnect(HCONV hConv);
  215. HCONV WINAPI DdeReconnect(HCONV hConv);
  216. UINT WINAPI DdeQueryConvInfo(HCONV hConv, DWORD idTransaction, CONVINFO FAR* pConvInfo);
  217. BOOL WINAPI DdeSetUserHandle(HCONV hConv, DWORD id, DWORD hUser);
  218. BOOL WINAPI DdeAbandonTransaction(DWORD idInst, HCONV hConv, DWORD idTransaction);
  219. /* app server interface functions */
  220. BOOL WINAPI DdePostAdvise(DWORD idInst, HSZ hszTopic, HSZ hszItem);
  221. BOOL WINAPI DdeEnableCallback(DWORD idInst, HCONV hConv, UINT wCmd);
  222. #define EC_ENABLEALL 0
  223. #define EC_ENABLEONE ST_BLOCKNEXT
  224. #define EC_DISABLE ST_BLOCKED
  225. #define EC_QUERYWAITING 2
  226. HDDEDATA WINAPI DdeNameService(DWORD idInst, HSZ hsz1, HSZ hsz2, UINT afCmd);
  227. #define DNS_REGISTER 0x0001
  228. #define DNS_UNREGISTER 0x0002
  229. #define DNS_FILTERON 0x0004
  230. #define DNS_FILTEROFF 0x0008
  231. /* app client interface functions */
  232. HDDEDATA WINAPI DdeClientTransaction(void FAR* pData, DWORD cbData,
  233. HCONV hConv, HSZ hszItem, UINT wFmt, UINT wType,
  234. DWORD dwTimeout, DWORD FAR* pdwResult);
  235. /* data transfer functions */
  236. HDDEDATA WINAPI DdeCreateDataHandle(DWORD idInst, void FAR* pSrc, DWORD cb,
  237. DWORD cbOff, HSZ hszItem, UINT wFmt, UINT afCmd);
  238. HDDEDATA WINAPI DdeAddData(HDDEDATA hData, void FAR* pSrc, DWORD cb, DWORD cbOff);
  239. DWORD WINAPI DdeGetData(HDDEDATA hData, void FAR* pDst, DWORD cbMax, DWORD cbOff);
  240. BYTE FAR* WINAPI DdeAccessData(HDDEDATA hData, DWORD FAR* pcbDataSize);
  241. BOOL WINAPI DdeUnaccessData(HDDEDATA hData);
  242. BOOL WINAPI DdeFreeDataHandle(HDDEDATA hData);
  243. #define HDATA_APPOWNED 0x0001
  244. UINT WINAPI DdeGetLastError(DWORD idInst);
  245. #define DMLERR_NO_ERROR 0 /* must be 0 */
  246. #define DMLERR_FIRST 0x4000
  247. #define DMLERR_ADVACKTIMEOUT 0x4000
  248. #define DMLERR_BUSY 0x4001
  249. #define DMLERR_DATAACKTIMEOUT 0x4002
  250. #define DMLERR_DLL_NOT_INITIALIZED 0x4003
  251. #define DMLERR_DLL_USAGE 0x4004
  252. #define DMLERR_EXECACKTIMEOUT 0x4005
  253. #define DMLERR_INVALIDPARAMETER 0x4006
  254. #define DMLERR_LOW_MEMORY 0x4007
  255. #define DMLERR_MEMORY_ERROR 0x4008
  256. #define DMLERR_NOTPROCESSED 0x4009
  257. #define DMLERR_NO_CONV_ESTABLISHED 0x400a
  258. #define DMLERR_POKEACKTIMEOUT 0x400b
  259. #define DMLERR_POSTMSG_FAILED 0x400c
  260. #define DMLERR_REENTRANCY 0x400d
  261. #define DMLERR_SERVER_DIED 0x400e
  262. #define DMLERR_SYS_ERROR 0x400f
  263. #define DMLERR_UNADVACKTIMEOUT 0x4010
  264. #define DMLERR_UNFOUND_QUEUE_ID 0x4011
  265. #define DMLERR_LAST 0x4011
  266. HSZ WINAPI DdeCreateStringHandle(DWORD idInst, LPCSTR psz, int iCodePage);
  267. DWORD WINAPI DdeQueryString(DWORD idInst, HSZ hsz, LPSTR psz, DWORD cchMax, int iCodePage);
  268. BOOL WINAPI DdeFreeStringHandle(DWORD idInst, HSZ hsz);
  269. BOOL WINAPI DdeKeepStringHandle(DWORD idInst, HSZ hsz);
  270. int WINAPI DdeCmpStringHandles(HSZ hsz1, HSZ hsz2);
  271. #ifndef NODDEMLSPY
  272. /* */
  273. /* DDEML public debugging header file info */
  274. /* */
  275. typedef struct tagMONMSGSTRUCT
  276. {
  277. UINT cb;
  278. HWND hwndTo;
  279. DWORD dwTime;
  280. HANDLE hTask;
  281. UINT wMsg;
  282. WPARAM wParam;
  283. LPARAM lParam;
  284. } MONMSGSTRUCT;
  285. typedef struct tagMONCBSTRUCT
  286. {
  287. UINT cb;
  288. WORD wReserved;
  289. DWORD dwTime;
  290. HANDLE hTask;
  291. DWORD dwRet;
  292. UINT wType;
  293. UINT wFmt;
  294. HCONV hConv;
  295. HSZ hsz1;
  296. HSZ hsz2;
  297. HDDEDATA hData;
  298. DWORD dwData1;
  299. DWORD dwData2;
  300. } MONCBSTRUCT;
  301. typedef struct tagMONHSZSTRUCT
  302. {
  303. UINT cb;
  304. BOOL fsAction; /* MH_ value */
  305. DWORD dwTime;
  306. HSZ hsz;
  307. HANDLE hTask;
  308. WORD wReserved;
  309. char str[1];
  310. } MONHSZSTRUCT;
  311. #define MH_CREATE 1
  312. #define MH_KEEP 2
  313. #define MH_DELETE 3
  314. #define MH_CLEANUP 4
  315. typedef struct tagMONERRSTRUCT
  316. {
  317. UINT cb;
  318. UINT wLastError;
  319. DWORD dwTime;
  320. HANDLE hTask;
  321. } MONERRSTRUCT;
  322. typedef struct tagMONLINKSTRUCT
  323. {
  324. UINT cb;
  325. DWORD dwTime;
  326. HANDLE hTask;
  327. BOOL fEstablished;
  328. BOOL fNoData;
  329. HSZ hszSvc;
  330. HSZ hszTopic;
  331. HSZ hszItem;
  332. UINT wFmt;
  333. BOOL fServer;
  334. HCONV hConvServer;
  335. HCONV hConvClient;
  336. } MONLINKSTRUCT;
  337. typedef struct tagMONCONVSTRUCT
  338. {
  339. UINT cb;
  340. BOOL fConnect;
  341. DWORD dwTime;
  342. HANDLE hTask;
  343. HSZ hszSvc;
  344. HSZ hszTopic;
  345. HCONV hConvClient;
  346. HCONV hConvServer;
  347. } MONCONVSTRUCT;
  348. #define MAX_MONITORS 4
  349. #define APPCLASS_MONITOR 0x00000001L
  350. #define XTYP_MONITOR (0x00F0 | XCLASS_NOTIFICATION | XTYPF_NOBLOCK)
  351. /*
  352. * Callback filter flags for use with MONITOR apps - 0 implies no monitor
  353. * callbacks.
  354. */
  355. #define MF_HSZ_INFO 0x01000000
  356. #define MF_SENDMSGS 0x02000000
  357. #define MF_POSTMSGS 0x04000000
  358. #define MF_CALLBACKS 0x08000000
  359. #define MF_ERRORS 0x10000000
  360. #define MF_LINKS 0x20000000
  361. #define MF_CONV 0x40000000
  362. #define MF_MASK 0xFF000000
  363. #endif /* NODDEMLSPY */
  364. #ifdef __cplusplus
  365. }
  366. #endif
  367. #ifndef RC_INVOKED
  368. #pragma pack()
  369. #endif /* RC_INVOKED */
  370. #endif /* _INC_DDEML */
  371.