Leaked source code of windows server 2003
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.

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