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.

728 lines
24 KiB

  1. /****************************** Module Header ******************************\
  2. * Module Name: DDEMLP.H
  3. *
  4. * Private header for DDE manager DLL.
  5. *
  6. * Created: 12/16/88 by Sanford Staab
  7. * Modified for Win 3.0: 5/31/90 by Rich Gartland, Aldus
  8. * Cleaned up: 11/14/90 Sanford Staab
  9. *
  10. * Copyright (c) 1988, 1989 Microsoft Corporation
  11. * Copyright (c) 1990 Aldus Corporation
  12. \***************************************************************************/
  13. #define NOGDICAPMASKS
  14. #define NOVIRTUALKEYCODES
  15. #define NOSYSMETRICS
  16. #define NOKEYSTATES
  17. #define OEMRESOURCE
  18. #define NOCOLOR
  19. // #define NOCTLMGR
  20. #define NODRAWTEXT
  21. // #define NOMETAFILE
  22. #define NOMINMAX
  23. #define NOSCROLL
  24. #define NOSOUND
  25. #define NOCOMM
  26. #define NOKANJI
  27. #define NOHELP
  28. #define NOPROFILER
  29. #include <windows.h>
  30. #include <dde.h>
  31. #define DDEMLDB
  32. #include <ddeml.h>
  33. #ifdef DEBUG
  34. extern int bDbgFlags;
  35. #define DBF_STOPONTRACE 0x01
  36. #define DBF_TRACETERM 0x02
  37. #define DBF_LOGALLOCS 0x04
  38. #define DBF_TRACEATOMS 0x08
  39. #define DBF_TRACEAPI 0x10
  40. #define TRACETERM(x) if (bDbgFlags & DBF_TRACETERM) { \
  41. char szT[100]; \
  42. wsprintf##x; \
  43. OutputDebugString(szT); \
  44. if (bDbgFlags & DBF_STOPONTRACE) { \
  45. DebugBreak(); \
  46. } \
  47. }
  48. #define TRACETERMBREAK(x) if (bDbgFlags & DBF_TRACETERM) { \
  49. char szT[100]; \
  50. wsprintf##x; \
  51. OutputDebugString(szT); \
  52. DebugBreak(); \
  53. }
  54. VOID TraceApiIn(LPSTR psz);
  55. #define TRACEAPIIN(x) if (bDbgFlags & DBF_TRACEAPI) { \
  56. char szT[100]; \
  57. wsprintf##x; \
  58. TraceApiIn(szT); \
  59. }
  60. VOID TraceApiOut(LPSTR psz);
  61. #define TRACEAPIOUT(x) if (bDbgFlags & DBF_TRACEAPI) { \
  62. char szT[100]; \
  63. wsprintf##x; \
  64. TraceApiOut(szT); \
  65. }
  66. #else
  67. #define TRACETERM(x)
  68. #define TRACETERMBREAK(x)
  69. #define TRACEAPIIN(x)
  70. #define TRACEAPIOUT(x)
  71. #endif
  72. // PRIVATE CONSTANTS
  73. #define CBF_MASK 0x003ff000L
  74. #define CBF_MONMASK 0x0027f000L
  75. #define ST_TERM_WAITING 0x8000
  76. #define ST_NOTIFYONDEATH 0x4000
  77. #define ST_PERM2DIE 0x2000
  78. #define ST_IM_DEAD 0x1000
  79. #define ST_DISC_ATTEMPTED 0x0800
  80. #define ST_CHECKPARTNER 0x0400
  81. #define DDEFMT_TEXT CF_TEXT
  82. #define TID_TIMEOUT 1
  83. #define TID_SHUTDOWN 2
  84. #define TID_EMPTYPOSTQ 4
  85. #define TIMEOUT_QUEUECHECK 200
  86. //
  87. // values for pai->wTimeoutStatus
  88. //
  89. #define TOS_CLEAR 0x00
  90. #define TOS_TICK 0x01
  91. #define TOS_ABORT 0x02
  92. #define TOS_DONE 0x80
  93. #define GWL_PCI 0 // ties conv windows to data.
  94. #define GWW_PAI 0 // other windows have pai here.
  95. #define GWW_CHECKVAL 4 // for verification of hwnds.
  96. #define GWW_STATE 6 // conv list state
  97. #define MH_INTCREATE 5
  98. #define MH_INTKEEP 6
  99. #define MH_INTDELETE 7
  100. // MACROS
  101. #define MAKEHCONV(hwnd) (IsWindow(hwnd) ? hwnd | ((DWORD)GetWindowWord(hwnd, GWW_CHECKVAL) << 16) : 0)
  102. #define UNUSED
  103. #define max(a,b) (((a) > (b)) ? (a) : (b))
  104. #define min(a,b) (((a) < (b)) ? (a) : (b))
  105. #define PHMEM(hData) ((LPBYTE)&((LPWORD)&(hData))[1])
  106. #define MONHSZ(a, fsAction, hTask) if (cMonitor) MonHsz(a, fsAction, hTask)
  107. #define MONERROR(pai, e) MonError(pai, e)
  108. #define MONLINK(pai, fEst, fNoData, hszSvc, hszTopic, hszItem, wFmt, fServer, hConvS, hConvC) \
  109. if (cMonitor) \
  110. MonLink(pai, fEst, fNoData, hszSvc, hszTopic, \
  111. hszItem, wFmt, fServer, hConvS, hConvC)
  112. #define MONCONN(pai, hszSvcInst, hszTopic, hwndC, hwndS, fConnect) \
  113. if (cMonitor) \
  114. MonConn(pai, hszSvcInst, hszTopic, hwndC, hwndS, fConnect)
  115. #define SETLASTERROR(pai, e) MonError(pai, e)
  116. #define SEMCHECKIN()
  117. #define SEMCHECKOUT()
  118. #define SEMENTER()
  119. #define SEMLEAVE()
  120. #define SEMINIT()
  121. #ifdef DEBUG
  122. VOID _loadds fAssert(BOOL f, LPSTR psz, WORD line, LPSTR szFile, BOOL fWarning);
  123. #define AssertF(f, psz) fAssert(f, psz, __LINE__, __FILE__, FALSE);
  124. #define AssertFW(f, psz) fAssert(f, psz, __LINE__, __FILE__, TRUE);
  125. #define DEBUGBREAK() DebugBreak()
  126. #define GLOBALREALLOC LogGlobalReAlloc
  127. #define GLOBALALLOC LogGlobalAlloc
  128. #define GLOBALFREE LogGlobalFree
  129. #define GLOBALLOCK LogGlobalLock
  130. #define GLOBALUNLOCK LogGlobalUnlock
  131. #include "heapwach.h"
  132. #else
  133. #define AssertF(f, psz)
  134. #define AssertFW(f, psz)
  135. #define DEBUGBREAK()
  136. #define GLOBALREALLOC GlobalReAlloc
  137. #define GLOBALALLOC GlobalAlloc
  138. #define GLOBALFREE GlobalFree
  139. #define GLOBALLOCK GlobalLock
  140. #define GLOBALUNLOCK GlobalUnlock
  141. #endif /* DEBUG */
  142. #define GLOBALPTR(h) (LPVOID)MAKELONG(0,h)
  143. typedef ATOM GATOM;
  144. typedef ATOM LATOM;
  145. // -------------- LISTS --------------
  146. typedef struct _LITEM { // generic list item
  147. struct _LITEM FAR *next;
  148. } LITEM;
  149. typedef LITEM FAR *PLITEM;
  150. typedef struct _LST { // generic list header
  151. PLITEM pItemFirst;
  152. HANDLE hheap;
  153. WORD cbItem;
  154. } LST;
  155. typedef LST FAR *PLST;
  156. #define ILST_LAST 0x0000 // flags for list lookups
  157. #define ILST_FIRST 0x0001
  158. #define ILST_NOLINK 0x0002
  159. typedef struct _HSZLI { // HSZ list item
  160. PLITEM next;
  161. ATOM a;
  162. } HSZLI;
  163. typedef struct _HWNDLI { // HWND list item
  164. PLITEM next;
  165. HWND hwnd;
  166. } HWNDLI;
  167. typedef struct _ACKHWNDLI { // extra ACK list item
  168. PLITEM next;
  169. HWND hwnd; // same as HWNDLI to here
  170. HSZ hszSvc;
  171. HSZ aTopic;
  172. } ACKHWNDLI;
  173. typedef struct _HWNDHSZLI { // HWND-HSZ pair list item
  174. PLITEM next;
  175. ATOM a; // same as HSZLI to here
  176. HWND hwnd;
  177. } HWNDHSZLI;
  178. typedef HWNDHSZLI FAR *PHWNDHSZLI;
  179. typedef struct _ADVLI { // ADVISE loop list item
  180. PLITEM next;
  181. ATOM aItem; // same as HSZLI to here
  182. ATOM aTopic;
  183. WORD wFmt;
  184. WORD fsStatus; // used to remember NODATA and FACKREQ state */
  185. HWND hwnd; // hwnd that has advise loop
  186. } ADVLI;
  187. typedef ADVLI FAR *PADVLI;
  188. // ------------ PILES -------------
  189. typedef struct _PILEB { // generic pile block header
  190. struct _PILEB FAR *next; // same as LITEM structure
  191. WORD cItems;
  192. WORD reserved;
  193. } PILEB;
  194. typedef PILEB FAR *PPILEB;
  195. typedef struct PILE { // generic pile header
  196. PPILEB pBlockFirst;
  197. HANDLE hheap;
  198. WORD cbBlock; // same as LST structure
  199. WORD cSubItemsMax;
  200. WORD cbSubItem;
  201. } PILE;
  202. typedef PILE FAR *PPILE;
  203. typedef BOOL (*NPFNCMP)(LPBYTE, LPBYTE); // item comparison function pointer
  204. #define PTOPPILEITEM(p) ((LPBYTE)p->pBlockFirst + sizeof(PILEB))
  205. #define FPI_DELETE 0x1 // pile search flags
  206. #define FPI_COUNT 0x2
  207. #define API_ADDED 1 // AddPileItem flags
  208. #define API_FOUND 2
  209. #define API_ERROR 0
  210. typedef struct _DIP { /* Data handle tracking pile */
  211. HANDLE hData; /* the handle to the data */
  212. HANDLE hTask; /* task owning the data */
  213. WORD cCount; /* use count = # datapiles using the handle */
  214. WORD fFlags; /* readonly, etc. */
  215. } DIP;
  216. typedef struct _LAP { /* Lost Ack Pile item */
  217. WORD object; /* either a handle or an atom */
  218. WORD type; /* transaction type the ack was meant for */
  219. } LAP;
  220. /*
  221. * These bits are used to keep track of advise loop states.
  222. */
  223. #define ADVST_WAITING 0x0080 /* fReserved bit - set if still waiting for FACK */
  224. #define ADVST_CHANGED 0x0040 /* fReserved bit - set if data changed while waiting */
  225. // ------------ QUEUES -------------
  226. typedef struct _QUEUEITEM { // generic queue item
  227. struct _QUEUEITEM FAR *next;
  228. struct _QUEUEITEM FAR *prev;
  229. WORD inst;
  230. } QUEUEITEM;
  231. typedef QUEUEITEM FAR *PQUEUEITEM;
  232. typedef struct _QST { // generic queue header
  233. WORD cItems;
  234. WORD instLast;
  235. WORD cbItem;
  236. HANDLE hheap;
  237. PQUEUEITEM pqiHead;
  238. } QST;
  239. typedef QST FAR *PQST;
  240. #define MAKEID(pqd) (LOWORD((DWORD)pqd) + ((DWORD)((pqd)->inst) << 16))
  241. #define PFROMID(pQ, id) ((PQUEUEITEM)MAKELONG(LOWORD(id), HIWORD(pQ)))
  242. #define QID_NEWEST -2L
  243. #define QID_OLDEST 0L
  244. // ------------- STRUCTURES -------------
  245. typedef struct _PMQI { // post message queue
  246. PQUEUEITEM FAR *next;
  247. PQUEUEITEM FAR *prev;
  248. WORD inst; // same as QUEUEITEM to here!
  249. WORD msg;
  250. LONG lParam;
  251. WORD wParam;
  252. HWND hwndTo;
  253. HGLOBAL hAssoc;
  254. WORD msgAssoc;
  255. } PMQI;
  256. typedef PMQI FAR *PPMQI;
  257. typedef struct _MQL { // message queue list
  258. struct _MQL FAR*next;
  259. HANDLE hTaskTo;
  260. PQST pMQ;
  261. } MQL, FAR *LPMQL;
  262. typedef struct _XFERINFO { // DdeClientTransaction parameters reversed!!!
  263. LPDWORD pulResult; // sync->flags, async->ID
  264. DWORD ulTimeout;
  265. WORD wType;
  266. WORD wFmt;
  267. HSZ hszItem;
  268. HCONV hConvClient;
  269. DWORD cbData;
  270. HDDEDATA hDataClient;
  271. } XFERINFO;
  272. typedef XFERINFO FAR *PXFERINFO;
  273. typedef struct _XADATA { // internal transaction specif info
  274. WORD state; // state of this transaction (XST_)
  275. WORD LastError; // last error logged in this transaction
  276. DWORD hUser; // set with DdeSetUserHandle
  277. PXFERINFO pXferInfo; // associated transaction info
  278. DWORD pdata; // data for the client from the server
  279. WORD DDEflags; // DDE flags resulting from transaction
  280. BOOL fAbandoned; // set if this transaction is abandoned.
  281. } XADATA;
  282. typedef XADATA FAR *PXADATA;
  283. typedef struct _CQDATA { // Client transaction queue
  284. PQUEUEITEM FAR *next;
  285. PQUEUEITEM FAR *prev;
  286. WORD inst;
  287. XADATA xad;
  288. XFERINFO XferInfo;
  289. } CQDATA;
  290. typedef CQDATA FAR *PCQDATA;
  291. typedef struct _APPINFO { // App wide information
  292. struct _APPINFO *next; // local heap object
  293. WORD cZombies; // number of hwnd's awaiting terminates
  294. PFNCALLBACK pfnCallback; // callback address
  295. PPILE pAppNamePile; // registered service names list
  296. PPILE pHDataPile; // data handles not freed
  297. PPILE pHszPile; // hsz cleanup tracking pile.
  298. HWND hwndSvrRoot; // root of all server windows.
  299. PLST plstCB; // callback queue
  300. DWORD afCmd; // app filter and command flags
  301. HANDLE hTask; // app task
  302. HANDLE hheapApp; // app heap
  303. HWND hwndDmg; // main app window
  304. HWND hwndFrame; // main app initiate window
  305. HWND hwndMonitor; // monitor window
  306. HWND hwndTimer; // current timer window
  307. WORD LastError; // last error
  308. WORD wFlags; // set to ST_BLOCKED or not.
  309. WORD cInProcess; // recursion guard
  310. WORD instCheck; // to validate idInst param.
  311. PLST pServerAdvList; // active ADVISE loops for servers
  312. LPSTR lpMemReserve; // reserve memory in case of crunch
  313. WORD wTimeoutStatus; // used to alert timeout modal loop
  314. } APPINFO;
  315. typedef APPINFO *PAPPINFO; // local heap object
  316. typedef APPINFO FAR *LPAPPINFO;
  317. typedef PAPPINFO FAR *LPPAPPINFO;
  318. #define LPCREATESTRUCT_GETPAI(lpcs) (*((LPPAPPINFO)(((LPCREATESTRUCT)lpcs)->lpCreateParams)))
  319. // defines for wFlags field
  320. #define AWF_DEFCREATESTATE 0x0001
  321. #define AWF_INSYNCTRANSACTION 0x0002
  322. #define AWF_UNINITCALLED 0x0004
  323. #define AWF_INPOSTDDEMSG 0x0008
  324. #define CB_RESERVE 256 // size of memory reserve block
  325. typedef struct _COMMONINFO { // Common (client & server) Conversation info
  326. PAPPINFO pai; // associated app info
  327. HSZ hszSvcReq; // app name used to make connection
  328. ATOM aServerApp; // app name returned by server
  329. ATOM aTopic; // conversation topic returned by server
  330. HCONV hConvPartner; // conversation partner window
  331. XADATA xad; // synchronous transaction data
  332. WORD fs; // conversation status (ST_ flags)
  333. HWND hwndFrame; // initiate window used to make connection
  334. CONVCONTEXT CC; // conversation context values
  335. PQST pPMQ; // post message queue - if needed.
  336. } COMMONINFO;
  337. typedef COMMONINFO far *PCOMMONINFO;
  338. typedef struct _CBLI { /* callback list item */
  339. PLITEM next;
  340. HCONV hConv; /* perameters for callback */
  341. HSZ hszTopic;
  342. HSZ hszItem;
  343. WORD wFmt;
  344. WORD wType;
  345. HDDEDATA hData;
  346. DWORD dwData1;
  347. DWORD dwData2;
  348. WORD msg; /* message received that created this item */
  349. WORD fsStatus; /* Status from DDE msg */
  350. HWND hwndPartner;
  351. PAPPINFO pai;
  352. HANDLE hMemFree; /* used for holding memory to free after callback */
  353. BOOL fQueueOnly; /* used to properly order replies to non-callback cases. */
  354. } CBLI;
  355. typedef CBLI FAR *PCBLI;
  356. typedef struct _CLIENTINFO { /* Client specific conversation info */
  357. COMMONINFO ci;
  358. HWND hwndInit; // frame window last INITIATE was sent to.
  359. PQST pQ; // assync transaction queue
  360. PLST pClientAdvList; // active ADVISE loops for client
  361. } CLIENTINFO;
  362. typedef CLIENTINFO FAR *PCLIENTINFO;
  363. typedef struct _SERVERINFO { /* Server specific conversation info */
  364. COMMONINFO ci;
  365. } SERVERINFO;
  366. typedef SERVERINFO FAR *PSERVERINFO;
  367. typedef struct _EXTDATAINFO { /* used to tie instance info to hDatas */
  368. PAPPINFO pai;
  369. HDDEDATA hData;
  370. } EXTDATAINFO;
  371. typedef EXTDATAINFO FAR *LPEXTDATAINFO;
  372. #define EXTRACTHCONVPAI(hConv) ((PCLIENTINFO)GetWindowLong((HWND)hConv, GWL_PCI))->ci.pai
  373. #define EXTRACTHCONVLISTPAI(hcl) (PAPPINFO)GetWindowWord((HWND)hcl, GWW_PAI)
  374. #define EXTRACTHDATAPAI(XhData) ((LPEXTDATAINFO)(XhData))->pai
  375. #define FREEEXTHDATA(XhData) FarFreeMem((LPSTR)XhData);
  376. typedef struct _DDE_DATA {
  377. WORD wStatus;
  378. WORD wFmt;
  379. WORD wData;
  380. } DDE_DATA, FAR *LPDDE_DATA;
  381. /******** structure for hook functions *******/
  382. typedef struct _HMSTRUCT {
  383. WORD hlParam;
  384. WORD llParam;
  385. WORD wParam;
  386. WORD wMsg;
  387. WORD hWnd;
  388. } HMSTRUCT, FAR *LPHMSTRUCT;
  389. typedef struct _IE { // InitEnum structure used to pass data to the fun.
  390. HWND hwnd;
  391. PCLIENTINFO pci;
  392. ATOM aTopic;
  393. } IE;
  394. /***** private window messages and constants ******/
  395. #define HDATA_READONLY 0x8000
  396. #define HDATA_NOAPPFREE 0x4000 // set on loaned handles (callback)
  397. #define HDATA_EXEC 0x0100 // this data was from execute
  398. #define UMSR_POSTADVISE (WM_USER + 104)
  399. #define UMSR_CHGPARTNER (WM_USER + 107)
  400. #define UM_REGISTER (WM_USER + 200)
  401. #define UM_UNREGISTER (WM_USER + 201)
  402. #define UM_MONITOR (WM_USER + 202)
  403. #define UM_QUERY (WM_USER + 203)
  404. #define Q_CLIENT 0
  405. #define Q_APPINFO 1
  406. #define UM_CHECKCBQ (WM_USER + 204)
  407. #define UM_DISCONNECT (WM_USER + 206)
  408. #define UM_SETBLOCK (WM_USER + 207)
  409. #define UM_FIXHEAP (WM_USER + 208)
  410. #define UM_TERMINATE (WM_USER + 209)
  411. // GLOBALS
  412. extern HANDLE hInstance;
  413. extern HWND hwndDmgMonitor;
  414. extern HANDLE hheapDmg;
  415. extern PAPPINFO pAppInfoList;
  416. extern PPILE pDataInfoPile;
  417. extern PPILE pLostAckPile;
  418. extern WORD hwInst;
  419. extern DWORD aulmapType[];
  420. extern CONVCONTEXT CCDef;
  421. extern char szNull[];
  422. extern WORD cMonitor;
  423. extern FARPROC prevMsgHook;
  424. extern FARPROC prevCallHook;
  425. extern DWORD ShutdownTimeout;
  426. extern DWORD ShutdownRetryTimeout;
  427. extern LPMQL gMessageQueueList;
  428. extern char SZFRAMECLASS[];
  429. extern char SZDMGCLASS[];
  430. extern char SZCLIENTCLASS[];
  431. extern char SZSERVERCLASS[];
  432. extern char SZMONITORCLASS[];
  433. extern char SZCONVLISTCLASS[];
  434. extern char SZHEAPWATCHCLASS[];
  435. //#ifdef DEBUG
  436. extern WORD cAtoms;
  437. //#endif
  438. // PROGMAN HACK!!!!
  439. extern ATOM aProgmanHack;
  440. // PROC DEFS
  441. /* from dmgutil.asm */
  442. LPBYTE NEAR HugeOffset(LPBYTE pSrc, DWORD cb);
  443. #ifdef DEBUG
  444. VOID StkTrace(WORD cFrames, LPVOID lpBuf);
  445. #endif
  446. extern WORD NEAR SwitchDS(WORD newDS);
  447. /* dmg.c entrypoints are exported by ddeml.h */
  448. /* from ddeml.c */
  449. WORD Register(LPDWORD pidInst, PFNCALLBACK pfnCallback, DWORD afCmd);
  450. BOOL AbandonTransaction(HWND hwnd, PAPPINFO pai, DWORD id, BOOL fMarkOnly);
  451. /* from dmgwndp.c */
  452. VOID ChildMsg(HWND hwndParent, WORD msg, WORD wParam, DWORD lParam, BOOL fPost);
  453. long EXPENTRY DmgWndProc(HWND hwnd, WORD msg, WORD wParam, DWORD lParam);
  454. long EXPENTRY ClientWndProc(HWND hwnd, WORD msg, WORD wParam, DWORD lParam);
  455. BOOL DoClientDDEmsg(PCLIENTINFO pci, HWND hwndClient, WORD msg, HWND hwndServer,
  456. DWORD lParam);
  457. BOOL fExpectedMsg(PXADATA pXad, DWORD lParam, WORD msg);
  458. BOOL AdvanceXaction(HWND hwnd, PCLIENTINFO pci, PXADATA pXad,
  459. DWORD lParam, WORD msg, LPWORD pErr);
  460. VOID CheckCBQ(PAPPINFO pai);
  461. VOID Disconnect(HWND hwnd, WORD afCmd, PCLIENTINFO pci);
  462. VOID Terminate(HWND hwnd, HWND hwndFrom, PCLIENTINFO pci);
  463. long EXPENTRY ServerWndProc(HWND hwnd, WORD msg, WORD wParam, DWORD lParam);
  464. long EXPENTRY subframeWndProc(HWND hwnd, WORD msg, WORD wParam, DWORD lParam);
  465. long EXPENTRY ConvListWndProc(HWND hwnd, WORD msg, WORD wParam, DWORD lParam);
  466. HDDEDATA DoCallback(PAPPINFO pai, HCONV hConv, HSZ hszTopic, HSZ hszItem,
  467. WORD wFmt, WORD wType, HDDEDATA hData, DWORD dwData1, DWORD dwData2);
  468. /* from dmgdde.c */
  469. BOOL timeout(PAPPINFO pai, DWORD ulTimeout, HWND hwndTimeout);
  470. HANDLE AllocDDESel(WORD fsStatus, WORD wFmt, DWORD cbData);
  471. BOOL MakeCallback(PCOMMONINFO pci, HCONV hConv, HSZ hszTopic, HSZ hszItem,
  472. WORD wFmt, WORD wType, HDDEDATA hData, DWORD dwData1, DWORD dwData2,
  473. WORD msg, WORD fsStatus, HWND hwndPartner, HANDLE hMemFree,
  474. BOOL fQueueOnly);
  475. BOOL PostDdeMessage(PCOMMONINFO pci, WORD msg, HWND hwndFrom, LONG lParam,
  476. WORD msgAssoc, HGLOBAL hAssoc);
  477. BOOL EmptyDDEPostQ(VOID);
  478. void CALLBACK EmptyQTimerProc(HWND hwnd, UINT msg, UINT tid, DWORD dwTime);
  479. /* from dmgmon.c */
  480. //#ifdef DEBUG
  481. long EXPENTRY DdePostHookProc(int nCode, WORD wParam, LPMSG lParam);
  482. long EXPENTRY DdeSendHookProc(int nCode, WORD wParam, LPHMSTRUCT lParam);
  483. VOID MonBrdcastCB(PAPPINFO pai, WORD wType, WORD wFmt, HCONV hConv,
  484. HSZ hszTopic, HSZ hszItem, HDDEDATA hData, DWORD dwData1,
  485. DWORD dwData2, DWORD dwRet);
  486. VOID MonHsz(ATOM a, WORD fsAction, HANDLE hTask);
  487. WORD MonError(PAPPINFO pai, WORD error);
  488. VOID MonLink(PAPPINFO pai, BOOL fEstablished, BOOL fNoData, HSZ hszSvc,
  489. HSZ hszTopic, HSZ hszItem, WORD wFmt, BOOL fServer,
  490. HCONV hConvServer, HCONV hConvClient);
  491. VOID MonConn(PAPPINFO pai, ATOM aApp, ATOM aTopic, HWND hwndClient,
  492. HWND hwndServer, BOOL fConnect);
  493. VOID MonitorBroadcast(HDDEDATA hData, WORD filter);
  494. HDDEDATA allocMonBuf(WORD cb, WORD filter);
  495. long EXPENTRY MonitorWndProc(HWND hwnd, WORD msg, WORD wParam, DWORD lParam);
  496. //#endif
  497. /* from dmghsz.c */
  498. BOOL FreeHsz(ATOM a);
  499. BOOL IncHszCount(ATOM a);
  500. WORD QueryHszLength(HSZ hsz);
  501. WORD QueryHszName(HSZ hsz, LPSTR psz, WORD cchMax);
  502. ATOM FindAddHsz(LPSTR psz, BOOL fAdd);
  503. HSZ MakeInstAppName(ATOM a, HWND hwndFrame);
  504. /* from dmgdb.c */
  505. PAPPINFO GetCurrentAppInfo(PAPPINFO);
  506. VOID UnlinkAppInfo(PAPPINFO pai);
  507. PLST CreateLst(HANDLE hheap, WORD cbItem);
  508. VOID DestroyLst(PLST pLst);
  509. VOID DestroyAdvLst(PLST pLst);
  510. VOID CleanupAdvList(HWND hwndClient, PCLIENTINFO pci);
  511. PLITEM FindLstItem(PLST pLst, NPFNCMP npfnCmp, PLITEM piSearch);
  512. BOOL CmpWORD(LPBYTE pb1, LPBYTE pb2);
  513. BOOL CmpHIWORD(LPBYTE pb1, LPBYTE pb2);
  514. BOOL CmpDWORD(LPBYTE pb1, LPBYTE pb2);
  515. PLITEM NewLstItem(PLST pLst, WORD afCmd);
  516. BOOL RemoveLstItem(PLST pLst, PLITEM pi);
  517. PPILE CreatePile(HANDLE hheap, WORD cbItem, WORD cItemsPerBlock);
  518. PPILE DestroyPile(PPILE pPile);
  519. WORD QPileItemCount(PPILE pPile);
  520. LPBYTE FindPileItem(PPILE pPile, NPFNCMP npfnCmp, LPBYTE pbSearch, WORD afCmd);
  521. WORD AddPileItem(PPILE pPile, LPBYTE pb, NPFNCMP npfncmp);
  522. BOOL PopPileSubitem(PPILE pPile, LPBYTE pb);
  523. VOID AddHwndHszList(ATOM a, HWND hwnd, PLST pLst);
  524. VOID DestroyHwndHszList(PLST pLst);
  525. HWND HwndFromHsz(ATOM a, PLST pLst);
  526. BOOL CmpAdv(LPBYTE pb1, LPBYTE pb2);
  527. WORD CountAdvReqLeft(register PADVLI pali);
  528. BOOL AddAdvList(PLST pLst, HWND hwnd, ATOM aTopic, ATOM aItem, WORD fsStatus, WORD usFormat);
  529. BOOL DeleteAdvList(PLST pLst, HWND hwnd, ATOM aTopic, ATOM aItem, WORD wFmt);
  530. PADVLI FindAdvList(PLST pLst, HWND hwnd, ATOM aTopic, ATOM aItem, WORD wFmt);
  531. PADVLI FindNextAdv(PADVLI padvli, HWND hwnd, ATOM aTopic, ATOM aItem);
  532. VOID SemInit(VOID);
  533. VOID SemCheckIn(VOID);
  534. VOID SemCheckOut(VOID);
  535. VOID SemEnter(VOID);
  536. VOID SemLeave(VOID);
  537. BOOL CopyHugeBlock(LPBYTE pSrc, LPBYTE pDst, DWORD cb);
  538. BOOL DmgDestroyWindow(HWND hwnd);
  539. BOOL ValidateHConv(HCONV hConv);
  540. /* from dmgq.c */
  541. PQST CreateQ(WORD cbItem);
  542. BOOL DestroyQ(PQST pQ);
  543. PQUEUEITEM Addqi(PQST pQ);
  544. VOID Deleteqi(PQST pQ, DWORD id);
  545. PQUEUEITEM Findqi(PQST pQ, DWORD id);
  546. PQUEUEITEM FindNextQi(PQST pQ, PQUEUEITEM pqi, BOOL fDelete);
  547. /* from dmgmem.c */
  548. HANDLE DmgCreateHeap(WORD wSize);
  549. HANDLE DmgDestroyHeap(HANDLE hheap);
  550. LPVOID FarAllocMem(HANDLE hheap, WORD wSize);
  551. VOID FarFreeMem(LPVOID lpMem);
  552. VOID RegisterClasses(VOID);
  553. // VOID UnregisterClasses(VOID);
  554. #ifdef DEBUG
  555. HGLOBAL LogGlobalReAlloc(HGLOBAL h, DWORD cb, UINT flags);
  556. HGLOBAL LogGlobalAlloc(UINT flags, DWORD cb);
  557. void FAR * LogGlobalLock(HGLOBAL h);
  558. BOOL LogGlobalUnlock(HGLOBAL h);
  559. HGLOBAL LogGlobalFree(HGLOBAL h);
  560. VOID LogDdeObject(UINT msg, LONG lParam);
  561. VOID DumpGlobalLogs(VOID);
  562. #endif
  563. /* from hData.c */
  564. HDDEDATA PutData(LPBYTE pSrc, DWORD cb, DWORD cbOff, ATOM aItem, WORD wFmt,
  565. WORD afCmd, PAPPINFO pai);
  566. VOID FreeDataHandle(PAPPINFO pai, HDDEDATA hData, BOOL fInternal);
  567. HDDEDATA DllEntry(PCOMMONINFO pcomi, HDDEDATA hData);
  568. VOID XmitPrep(HDDEDATA hData, PAPPINFO pai);
  569. HDDEDATA RecvPrep(PAPPINFO pai, HANDLE hMem, WORD afCmd);
  570. HANDLE CopyDDEShareHandle(HANDLE hMem);
  571. HBITMAP CopyBitmap(PAPPINFO pai, HBITMAP hbm);
  572. HDDEDATA CopyHDDEDATA(PAPPINFO pai, HDDEDATA hData);
  573. VOID FreeDDEData(HANDLE hMem, WORD wFmt);
  574. /* from stdinit.c */
  575. long ClientCreate(HWND hwnd, PAPPINFO pai);
  576. HWND GetDDEClientWindow(PAPPINFO pai, HWND hwndParent, HWND hwndSend, HSZ hszSvc, ATOM aTopic, PCONVCONTEXT pCC);
  577. BOOL FAR PASCAL InitEnum(HWND hwnd, IE FAR *pie);
  578. HWND CreateServerWindow(PAPPINFO pai, ATOM aTopic, PCONVCONTEXT pCC);
  579. VOID ServerFrameInitConv(PAPPINFO pai, HWND hwndFrame, HWND hwndClient, ATOM aApp, ATOM aTopic);
  580. long ServerCreate(HWND hwnd, PAPPINFO pai);
  581. BOOL ClientInitAck(HWND hwnd, PCLIENTINFO pci, HWND hwndServer,
  582. ATOM aApp, ATOM aTopic);
  583. /* from stdptcl.c */
  584. long ClientXferReq(PXFERINFO pXferInfo, HWND hwnd, PCLIENTINFO pci);
  585. WORD SendClientReq(PAPPINFO pai, PXADATA pXad, HWND hwndServer, HWND hwnd);
  586. VOID ServerProcessDDEMsg(PSERVERINFO psi, WORD msg, HWND hwndServer,
  587. HWND hwndClient, WORD lo, WORD hi);
  588. VOID PostServerAdvise(HWND hwnd, PSERVERINFO psi, PADVLI pali, WORD cLoops);
  589. VOID QReply(PCBLI pcbi, HDDEDATA hDataRet);
  590. long ClientXferRespond(HWND hwndClient, PXADATA pXad, LPWORD pErr);
  591. /* from register.c */
  592. LRESULT ProcessRegistrationMessage(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam);
  593. VOID RegisterService(BOOL fRegister, GATOM gaApp, HWND hwndListen);