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.

1013 lines
42 KiB

  1. /****************************** Module Header ******************************\
  2. * Module Name: dll.h
  3. *
  4. * PURPOSE: Private definitions file for ole.c
  5. *
  6. * Created: 1990
  7. *
  8. * Copyright (c) 1990, 1991 Microsoft Corporation
  9. *
  10. * History:
  11. * Raor, Srinik (../../90,91) Original
  12. * curts created portable version for win16/32
  13. *
  14. \***************************************************************************/
  15. #define OLE_INTERNAL
  16. #include "port1632.h"
  17. #include "cmacs.h"
  18. #include "ole.h"
  19. ////////////////////////////////////////////////////////////////////////////
  20. // //
  21. // WIN16 //
  22. // //
  23. ////////////////////////////////////////////////////////////////////////////
  24. #ifdef WIN16
  25. #define PROBE_MODE(bProtMode) {\
  26. if (!bProtMode) \
  27. return OLE_ERROR_PROTECT_ONLY; \
  28. }
  29. extern WORD FARINTERNAL FarCheckPointer (LPVOID, int);
  30. extern WORD wWinVer;
  31. extern BOOL bProtMode;
  32. extern BOOL bWLO;
  33. #define MAKE_DDE_LPARAM(x,y,z) MAKELONG(y,z)
  34. #define UNREFERENCED_PARAMETER(p) (p)
  35. #define WIN16METAFILEPICT METAFILEPICT
  36. #define LPWIN16METAFILEPICT LPMETAFILEPICT
  37. #define WIN16BITMAP BITMAP
  38. #define LPWIN16BITMAP LPBITMAP
  39. // Routines in OLE.ASM //
  40. WORD GetGDIds (DWORD);
  41. WORD IsMetaDC (HDC, WORD);
  42. WORD CheckPointer (LPVOID, int);
  43. #endif
  44. ////////////////////////////////////////////////////////////////////////////
  45. // //
  46. // WIN32 //
  47. // //
  48. ////////////////////////////////////////////////////////////////////////////
  49. #ifdef WIN32
  50. typedef struct tagWIN16METAFILEPICT
  51. {
  52. short mm;
  53. short xExt;
  54. short yExt;
  55. WORD hMF;
  56. } WIN16METAFILEPICT ,FAR* LPWIN16METAFILEPICT;
  57. #ifndef RC_INVOKED
  58. #pragma pack(1)
  59. typedef struct tagWIN16BITMAP
  60. {
  61. short bmType;
  62. short bmWidth;
  63. short bmHeight;
  64. short bmWidthBytes;
  65. BYTE bmPlanes;
  66. BYTE bmBitsPixel;
  67. void FAR* bmBits;
  68. } WIN16BITMAP, FAR* LPWIN16BITMAP;
  69. #pragma pack() /* Resume normal packing */
  70. #endif /* !RC_INVOKED */
  71. #define PROBE_MODE(bProtMode)
  72. #define GET_WM_DDE_EXECUTE_LPARAM(hdataExec) ((UINT)hdataExec)
  73. #define MAKE_DDE_LPARAM(x,y,z) PackDDElParam((UINT)x,(UINT_PTR)y,(UINT_PTR)z)
  74. #define FarCheckPointer CheckPointer
  75. INT CheckPointer (LPVOID, int);
  76. #define FarInitAsyncCmd InitAsyncCmd
  77. #endif
  78. /////////////////////////////////////////////////////////////////////////////
  79. // //
  80. // Defines, Object methods table and Structures. //
  81. // //
  82. /////////////////////////////////////////////////////////////////////////////
  83. //#ifndef HUGE
  84. //#define HUGE huge
  85. //#endif
  86. /* file format types */
  87. #define OS_WIN16 0x0000
  88. #define OS_MAC 0x0001
  89. #define OS_WIN32 0x0002
  90. // Characteristics Type Field
  91. #define CT_NULL 0L
  92. #define CT_LINK 1L
  93. #define CT_EMBEDDED 2L
  94. #define CT_STATIC 3L
  95. #define CT_OLDLINK 4L
  96. #define CT_PICTURE 5L
  97. #define OLE_NO 0 // for boolean query functions
  98. #define OLE_YES 1 // for boolean query functions
  99. #define MAX_STR 256
  100. #define MAX_NET_NAME MAX_STR
  101. #define INVALID_INDEX -1
  102. #define MAX_ATOM 256
  103. #define NUM_RENDER 4
  104. #define PROTOCOL_EDIT ((LPSTR)"StdFileEditing")
  105. #define PROTOCOL_STATIC ((LPSTR)"Static")
  106. #define PROTOCOL_EXECUTE ((LPSTR)"StdExecute")
  107. #define READ_ACCESS 0
  108. #define WRITE_ACCESS 1
  109. #define POPUP_NETDLG 1
  110. #define PROBE_OLDLINK(lpobj){\
  111. if (lpobj->bOldLink)\
  112. return OLE_ERROR_OBJECT;\
  113. }
  114. #define PROBE_READ(lp){\
  115. if (!CheckPointer((LPVOID)(lp), READ_ACCESS))\
  116. return OLE_ERROR_ADDRESS; \
  117. }
  118. #define PROBE_WRITE(lp){\
  119. if (!CheckPointer((LPVOID)(lp), WRITE_ACCESS))\
  120. return OLE_ERROR_ADDRESS; \
  121. }
  122. #define FARPROBE_READ(lp){\
  123. if (!FarCheckPointer((LPVOID)(lp), READ_ACCESS))\
  124. return OLE_ERROR_ADDRESS; \
  125. }
  126. #define FARPROBE_WRITE(lp){\
  127. if (!FarCheckPointer((LPVOID)(lp), WRITE_ACCESS))\
  128. return OLE_ERROR_ADDRESS; \
  129. }
  130. extern OLECLIPFORMAT cfBinary;
  131. extern OLECLIPFORMAT cfOwnerLink;
  132. extern OLECLIPFORMAT cfObjectLink;
  133. extern OLECLIPFORMAT cfLink;
  134. extern OLECLIPFORMAT cfNative;
  135. extern ATOM aStdHostNames;
  136. extern ATOM aStdTargetDevice ;
  137. extern ATOM aStdDocDimensions;
  138. extern ATOM aStdDocName;
  139. extern ATOM aStdColorScheme;
  140. extern ATOM aNullArg;
  141. extern ATOM aSave;
  142. extern ATOM aChange;
  143. extern ATOM aClose;
  144. extern ATOM aPackage;
  145. extern HANDLE hInstDLL;
  146. extern WORD wReleaseVer;
  147. extern DWORD dwVerFromFile;
  148. // Used by QuerySize() API;
  149. extern DWORD dwObjSize;
  150. extern OLESTREAM dllStream;
  151. typedef struct _OLEOBJECT { /*object */
  152. LPOLEOBJECTVTBL lpvtbl;
  153. char objId[2];
  154. HOBJECT hobj;
  155. LPOLECLIENT lpclient;
  156. LONG ctype;
  157. LONG cx;
  158. LONG cy;
  159. LONG mm;
  160. int iTable; // Index into the dll table
  161. ATOM aObjName; //** Client
  162. LHCLIENTDOC lhclientdoc; // Document
  163. LPOLEOBJECT lpPrevObj; // related
  164. LPOLEOBJECT lpNextObj; //** fileds
  165. LPOLEOBJECT lpParent; // NULL for LE or Static objects.
  166. } OBJECT;
  167. typedef struct _CF_NAME_ATOM {
  168. char * cfName;
  169. ATOM cfAtom;
  170. } CF_NAME_ATOM;
  171. extern CF_NAME_ATOM cfNameAtom[];
  172. /////////////////////////////////////////////////////////////////////////////
  173. // METAFFILE object structures
  174. /////////////////////////////////////////////////////////////////////////////
  175. typedef struct _METADC {
  176. int xMwo;
  177. int yMwo;
  178. int xMwe;
  179. int yMwe;
  180. int xre;
  181. int yre;
  182. struct _METADC * pNext;
  183. } METADC, *PMETADC;
  184. typedef struct _METAINFO {
  185. METADC headDc;
  186. int xwo;
  187. int ywo;
  188. int xwe;
  189. int ywe;
  190. int xro;
  191. int yro;
  192. } METAINFO, *PMETAINFO;
  193. typedef struct OBJECT_MF { /* object_mf */
  194. OBJECT head;
  195. DWORD sizeBytes;
  196. METAFILEPICT mfp;
  197. HANDLE hmfp;
  198. BOOL fMetaDC;
  199. OLESTATUS error;
  200. int nRecord;
  201. PMETAINFO pMetaInfo;
  202. PMETADC pCurMdc;
  203. } OBJECT_MF;
  204. typedef OBJECT_MF FAR * LPOBJECT_MF;
  205. #ifdef WIN32
  206. /////////////////////////////////////////////////////////////////////////////
  207. // ENHMETAFILE structures
  208. /////////////////////////////////////////////////////////////////////////////
  209. typedef struct OBJECT_EMF {
  210. OBJECT head;
  211. DWORD sizeBytes;
  212. HENHMETAFILE hemf;
  213. BOOL fMetaDC;
  214. OLESTATUS error;
  215. int nRecord;
  216. } OBJECT_EMF;
  217. typedef OBJECT_EMF FAR * LPOBJECT_EMF;
  218. #endif
  219. /////////////////////////////////////////////////////////////////////////////
  220. // BITMAP object structure
  221. /////////////////////////////////////////////////////////////////////////////
  222. typedef struct
  223. {
  224. OBJECT head;
  225. DWORD sizeBytes;
  226. int xSize; // width in pixels
  227. int ySize; // height in pixels
  228. HBITMAP hBitmap;
  229. } OBJECT_BM;
  230. typedef OBJECT_BM FAR * LPOBJECT_BM;
  231. // DIB object structures
  232. typedef struct _OBJECT_DIB {
  233. OBJECT head;
  234. DWORD sizeBytes;
  235. int xSize;
  236. int ySize;
  237. HANDLE hDIB;
  238. } OBJECT_DIB;
  239. typedef OBJECT_DIB FAR * LPOBJECT_DIB;
  240. //* GENERIC object structure
  241. typedef struct
  242. {
  243. OBJECT head;
  244. OLECLIPFORMAT cfFormat;
  245. ATOM aClass;
  246. DWORD sizeBytes;
  247. HANDLE hData;
  248. } OBJECT_GEN;
  249. typedef OBJECT_GEN FAR * LPOBJECT_GEN;
  250. typedef struct _RENDER_ENTRY { /* dll_entry */
  251. LPSTR lpClass;
  252. ATOM aClass;
  253. OLESTATUS (FARINTERNAL *Load) (LPOLESTREAM, LPOLECLIENT, LHCLIENTDOC, LPSTR, LPOLEOBJECT FAR *, LONG);
  254. } RENDER_ENTRY;
  255. typedef struct _DLL_ENTRY {
  256. ATOM aDll; /* global atom for dll name with full path */
  257. HANDLE hDll; /* handle to the dll module */
  258. int cObj; /* count of objects, unload dll when this is 0 */
  259. OLESTATUS (FAR PASCAL *Load) (LPOLESTREAM, LPSTR, LPOLECLIENT, LHCLIENTDOC, LPSTR, LPOLEOBJECT FAR *, LONG, ATOM, OLECLIPFORMAT);
  260. OLESTATUS (FAR PASCAL *Clip) (LPSTR, LPOLECLIENT, LHCLIENTDOC, LPSTR, LPOLEOBJECT FAR *, OLEOPT_RENDER, OLECLIPFORMAT, LONG);
  261. OLESTATUS (FAR PASCAL *Link) (LPSTR, LPOLECLIENT, LHCLIENTDOC, LPSTR, LPOLEOBJECT FAR *, OLEOPT_RENDER, OLECLIPFORMAT);
  262. OLESTATUS (FAR PASCAL *CreateFromTemplate) (LPSTR, LPOLECLIENT, LPSTR, LHCLIENTDOC, LPSTR, LPOLEOBJECT FAR *, OLEOPT_RENDER, OLECLIPFORMAT);
  263. OLESTATUS (FAR PASCAL *Create) (LPSTR, LPOLECLIENT, LPSTR, LHCLIENTDOC, LPSTR, LPOLEOBJECT FAR *, OLEOPT_RENDER, OLECLIPFORMAT);
  264. OLESTATUS (FAR PASCAL *CreateFromFile) (LPSTR, LPOLECLIENT, LPSTR, LPSTR, LHCLIENTDOC, LPSTR, LPOLEOBJECT FAR *, OLEOPT_RENDER, OLECLIPFORMAT);
  265. OLESTATUS (FAR PASCAL *CreateLinkFromFile) (LPSTR, LPOLECLIENT, LPSTR, LPSTR, LPSTR, LHCLIENTDOC, LPSTR, LPOLEOBJECT FAR *, OLEOPT_RENDER, OLECLIPFORMAT);
  266. OLESTATUS (FAR PASCAL *CreateInvisible) (LPSTR, LPOLECLIENT, LPSTR, LHCLIENTDOC, LPSTR, LPOLEOBJECT FAR *, OLEOPT_RENDER, OLECLIPFORMAT, BOOL);
  267. } DLL_ENTRY;
  268. /////////////////////////////////////////////////////////////////////////////
  269. // //
  270. // Routines in OLE.C //
  271. // //
  272. /////////////////////////////////////////////////////////////////////////////
  273. BOOL INTERNAL CheckObject(LPOLEOBJECT);
  274. BOOL FARINTERNAL FarCheckObject(LPOLEOBJECT);
  275. OLESTATUS INTERNAL LeQueryCreateFromClip (LPSTR, OLEOPT_RENDER, OLECLIPFORMAT, LONG);
  276. /////////////////////////////////////////////////////////////////////////////
  277. // //
  278. // Routines in DEFCREAT.C //
  279. // //
  280. /////////////////////////////////////////////////////////////////////////////
  281. OLESTATUS FAR PASCAL DefLoadFromStream (LPOLESTREAM, LPSTR, LPOLECLIENT, LHCLIENTDOC, LPSTR, LPOLEOBJECT FAR *, LONG, ATOM, OLECLIPFORMAT);
  282. OLESTATUS FAR PASCAL DefCreateFromClip (LPSTR, LPOLECLIENT, LHCLIENTDOC, LPSTR, LPOLEOBJECT FAR *, OLEOPT_RENDER, OLECLIPFORMAT, LONG);
  283. OLESTATUS FAR PASCAL DefCreateLinkFromClip (LPSTR, LPOLECLIENT, LHCLIENTDOC, LPSTR, LPOLEOBJECT FAR *, OLEOPT_RENDER, OLECLIPFORMAT);
  284. OLESTATUS FAR PASCAL DefCreateFromTemplate (LPSTR, LPOLECLIENT, LPSTR, LHCLIENTDOC, LPSTR, LPOLEOBJECT FAR *, OLEOPT_RENDER, OLECLIPFORMAT);
  285. OLESTATUS FAR PASCAL DefCreate (LPSTR, LPOLECLIENT, LPSTR, LHCLIENTDOC, LPSTR, LPOLEOBJECT FAR *, OLEOPT_RENDER, OLECLIPFORMAT);
  286. OLESTATUS FAR PASCAL DefCreateFromFile (LPSTR, LPOLECLIENT, LPSTR, LPSTR, LHCLIENTDOC, LPSTR, LPOLEOBJECT FAR *, OLEOPT_RENDER, OLECLIPFORMAT);
  287. OLESTATUS FAR PASCAL DefCreateLinkFromFile (LPSTR, LPOLECLIENT, LPSTR, LPSTR, LPSTR, LHCLIENTDOC, LPSTR, LPOLEOBJECT FAR *, OLEOPT_RENDER, OLECLIPFORMAT);
  288. OLESTATUS FAR PASCAL DefCreateInvisible (LPSTR, LPOLECLIENT, LPSTR, LHCLIENTDOC, LPSTR, LPOLEOBJECT FAR *, OLEOPT_RENDER, OLECLIPFORMAT, BOOL);
  289. /////////////////////////////////////////////////////////////////////////////
  290. // //
  291. // Routines in PBHANDLR.C //
  292. // //
  293. /////////////////////////////////////////////////////////////////////////////
  294. OLESTATUS FAR PASCAL PbLoadFromStream (LPOLESTREAM, LPSTR, LPOLECLIENT, LHCLIENTDOC, LPSTR, LPOLEOBJECT FAR *, LONG, ATOM, OLECLIPFORMAT);
  295. OLESTATUS FAR PASCAL PbCreateFromClip (LPSTR, LPOLECLIENT, LHCLIENTDOC, LPSTR, LPOLEOBJECT FAR *, OLEOPT_RENDER, OLECLIPFORMAT, LONG);
  296. OLESTATUS FAR PASCAL PbCreateLinkFromClip (LPSTR, LPOLECLIENT, LHCLIENTDOC, LPSTR, LPOLEOBJECT FAR *, OLEOPT_RENDER, OLECLIPFORMAT);
  297. OLESTATUS FAR PASCAL PbCreateFromTemplate (LPSTR, LPOLECLIENT, LPSTR, LHCLIENTDOC, LPSTR, LPOLEOBJECT FAR *, OLEOPT_RENDER, OLECLIPFORMAT);
  298. OLESTATUS FAR PASCAL PbCreate (LPSTR, LPOLECLIENT, LPSTR, LHCLIENTDOC, LPSTR, LPOLEOBJECT FAR *, OLEOPT_RENDER, OLECLIPFORMAT);
  299. OLESTATUS FAR PASCAL PbCreateFromFile (LPSTR, LPOLECLIENT, LPSTR, LPSTR, LHCLIENTDOC, LPSTR, LPOLEOBJECT FAR *, OLEOPT_RENDER, OLECLIPFORMAT);
  300. OLESTATUS FAR PASCAL PbCreateLinkFromFile (LPSTR, LPOLECLIENT, LPSTR, LPSTR, LPSTR, LHCLIENTDOC, LPSTR, LPOLEOBJECT FAR *, OLEOPT_RENDER, OLECLIPFORMAT);
  301. OLESTATUS FAR PASCAL PbCreateInvisible (LPSTR, LPOLECLIENT, LPSTR, LHCLIENTDOC, LPSTR, LPOLEOBJECT FAR *, OLEOPT_RENDER, OLECLIPFORMAT, BOOL);
  302. /////////////////////////////////////////////////////////////////////////////
  303. // //
  304. // Defines common for le.c, ledde.c, dde.c, doc.c //
  305. // //
  306. /////////////////////////////////////////////////////////////////////////////
  307. // Constants for chekcing whether the instance is SrvrDLL instance.
  308. #define WW_LPTR 0 // ptr tosrvr/doc/item
  309. #define WW_LE 4 // signature
  310. #define WW_HANDLE 6 // instance handle
  311. #define WC_LE 0x4c45 // LE chars
  312. // command flags
  313. #define ACT_SHOW 0x0001 // show the window
  314. #define ACT_ACTIVATE 0x0002 // activate
  315. #define ACT_DOVERB 0x0004 // Run the item
  316. #define ACT_ADVISE 0x0008 // advise for data
  317. #define ACT_REQUEST 0x0010 // request for data
  318. #define ACT_CLOSE 0x0020 // request for advise only on close
  319. #define ACT_UNLAUNCH 0x0040 // unload the server after all the
  320. #define ACT_TERMSRVR 0x0080 // terminate server
  321. #define ACT_TERMDOC 0x0100 // terminate document
  322. #define ACT_NATIVE 0x0200 // only for LNKed objects, if we
  323. // need native data.
  324. #define ACT_MINIMIZE 0x0400 // launch the app minimized
  325. #define ACT_NOLAUNCH 0x0800 // don't launch the server
  326. #define LN_TEMPLATE 0x0000 // create from template
  327. #define LN_NEW 0x1000 // create new
  328. #define LN_EMBACT 0x2000 // activate emb
  329. #define LN_LNKACT 0x3000 // activate link
  330. #define LN_MASK 0xf000 // launch mask
  331. #define LN_SHIFT 12 // shift count for LN_MASK
  332. typedef struct _EDIT_DDE { /* edit_dde */
  333. HANDLE hInst;
  334. int extraTerm;
  335. HWND hClient;
  336. HWND hServer;
  337. BOOL bTerminating;
  338. BOOL bAbort;
  339. BOOL bCallLater; // used in request cases. if this is FALSE
  340. // then OLE_CHANGED is sent to client
  341. int awaitAck;
  342. HANDLE hopt; // Memory block I may have to free
  343. int nAdviseClose; // count of outstanding advises on closes
  344. int nAdviseSave; // count of outstanding advises on save
  345. HANDLE hData; // Poked data/ temp for holding the
  346. // handle in DDE messages
  347. // busy parameters
  348. LPARAM lParam; // lparam value in case we need to
  349. // repost the message
  350. UINT msg; // busy repost message
  351. UINT_PTR wTimer; // timer id.
  352. } EDIT_DDE;
  353. typedef EDIT_DDE NEAR *PEDIT_DDE;
  354. typedef EDIT_DDE FAR *LPEDIT_DDE;
  355. typedef struct _OBJECT_LE { /* object_le */
  356. OBJECT head;
  357. ATOM app;
  358. ATOM topic;
  359. ATOM item;
  360. ATOM aServer;
  361. BOOL bOldLink; // whether a linked object for old link
  362. BOOL bOleServer; // server which supports the verbs
  363. UINT verb; // verb nuymber;
  364. UINT fCmd; // Command flags;
  365. OLEOPT_UPDATE optUpdate;
  366. OLEOPT_UPDATE optNew; // new update options
  367. LPSTR lptemplate; // ptr to the template string, if
  368. // create from template
  369. ATOM aNetName; // network name on which the doc is
  370. char cDrive; // local drive for that network
  371. DWORD dwNetInfo; // LOW WORD = Net type
  372. // HIGH WORD = Driver version
  373. LPOLEOBJECT lpobjPict;
  374. LONG lAppData; // apps data
  375. LONG lHandlerData; // handler data
  376. HANDLE hnative;
  377. HANDLE hLink;
  378. HANDLE hhostNames; // host name block
  379. HANDLE htargetDevice; // target device info
  380. HANDLE hdocDimensions; // document dimensions
  381. HANDLE hextraData; // reqestdata handle
  382. UINT cfExtra; // extra format data
  383. HANDLE hlogpal; // logiccal palette
  384. UINT oldasyncCmd; // previous asynchronous command
  385. UINT asyncCmd; // asynchronous command
  386. BOOL endAsync; // true if we need to send END_RELEASE.
  387. BOOL bAsync; // true if async command on.
  388. UINT mainRtn; // main async routine
  389. UINT subRtn; // step within the main async routine
  390. UINT mainErr; // failure error
  391. UINT subErr; // step error
  392. UINT errHint; // ;error hint
  393. BOOL bSvrClosing; // TRUE - server in the process of
  394. // closing down
  395. BOOL bUnlaunchLater; // Call EmbLnkDelete from EndAsyncCmd
  396. // if this flag is TRUE
  397. HANDLE hSysEdit; // handle to system edit.
  398. PEDIT_DDE pSysEdit; // near ptr to system edit.
  399. HANDLE hDocEdit; // handle to doc level channel
  400. PEDIT_DDE pDocEdit; // near ptr to the doc level channel
  401. BOOL bNewPict;
  402. } OBJECT_LE;
  403. typedef OBJECT_LE FAR * LPOBJECT_LE;
  404. typedef struct _CLIENTDOC { /* object_le */
  405. char docId[2];
  406. LPOLEOBJECT lpHeadObj;
  407. LPOLEOBJECT lpTailObj;
  408. ATOM aClass;
  409. ATOM aDoc;
  410. HANDLE hdoc;
  411. DWORD dwFileVer;
  412. struct _CLIENTDOC FAR * lpPrevDoc;
  413. struct _CLIENTDOC FAR * lpNextDoc;
  414. } CLIENTDOC;
  415. typedef CLIENTDOC FAR * LPCLIENTDOC;
  416. typedef struct _HOSTNAMES {
  417. WORD clientNameOffset;
  418. WORD documentNameOffset;
  419. BYTE data[];
  420. } HOSTNAMES;
  421. typedef HOSTNAMES FAR * LPHOSTNAMES;
  422. //
  423. // BOUNDSRECT must be defined as the same size in both
  424. // 16 and 32 bit versions.
  425. //
  426. typedef struct _BOUNDSRECT {
  427. USHORT defaultWidth;
  428. USHORT defaultHeight;
  429. USHORT maxWidth;
  430. USHORT maxHeight;
  431. } BOUNDSRECT;
  432. typedef BOUNDSRECT FAR *LPBOUNDSRECT;
  433. /////////////////////////////////////////////////////////////////////////////
  434. // //
  435. // Function pointer types //
  436. // //
  437. /////////////////////////////////////////////////////////////////////////////
  438. typedef OLESTATUS (FAR PASCAL *_LOAD) (LPOLESTREAM, LPSTR, LPOLECLIENT, LHCLIENTDOC, LPSTR, LPOLEOBJECT FAR *, LONG, ATOM, OLECLIPFORMAT);
  439. typedef OLESTATUS (FAR PASCAL *_CLIP) (LPSTR, LPOLECLIENT, LHCLIENTDOC, LPSTR, LPOLEOBJECT FAR *, OLEOPT_RENDER, OLECLIPFORMAT, LONG);
  440. typedef OLESTATUS (FAR PASCAL *_LINK) (LPSTR, LPOLECLIENT, LHCLIENTDOC, LPSTR, LPOLEOBJECT FAR *, OLEOPT_RENDER, OLECLIPFORMAT);
  441. typedef OLESTATUS (FAR PASCAL *_CREATEFROMTEMPLATE) (LPSTR, LPOLECLIENT, LPSTR, LHCLIENTDOC, LPSTR, LPOLEOBJECT FAR *, OLEOPT_RENDER, OLECLIPFORMAT);
  442. typedef OLESTATUS (FAR PASCAL *_CREATE) (LPSTR, LPOLECLIENT, LPSTR, LHCLIENTDOC, LPSTR, LPOLEOBJECT FAR *, OLEOPT_RENDER, OLECLIPFORMAT);
  443. typedef OLESTATUS (FAR PASCAL *_CREATEFROMFILE) (LPSTR, LPOLECLIENT, LPSTR, LPSTR, LHCLIENTDOC, LPSTR, LPOLEOBJECT FAR *, OLEOPT_RENDER, OLECLIPFORMAT);
  444. typedef OLESTATUS (FAR PASCAL *_CREATELINKFROMFILE) (LPSTR, LPOLECLIENT, LPSTR, LPSTR, LPSTR, LHCLIENTDOC, LPSTR, LPOLEOBJECT FAR *, OLEOPT_RENDER, OLECLIPFORMAT);
  445. typedef OLESTATUS (FAR PASCAL *_CREATEINVISIBLE) (LPSTR, LPOLECLIENT, LPSTR, LHCLIENTDOC, LPSTR, LPOLEOBJECT FAR *, OLEOPT_RENDER, OLECLIPFORMAT, BOOL);
  446. // AwaitAck values
  447. #define AA_REQUEST 1
  448. #define AA_ADVISE 2
  449. #define AA_POKE 3
  450. #define AA_EXECUTE 4
  451. #define AA_UNADVISE 5
  452. #define AA_INITIATE 6
  453. // Bits for Positive WM_DDE_ACK
  454. #define POSITIVE_ACK 0x8000
  455. /////////////////////////////////////////////////////////////////////////////
  456. // //
  457. // Routines in LE.C //
  458. // //
  459. /////////////////////////////////////////////////////////////////////////////
  460. LPVOID FARINTERNAL LeQueryProtocol (LPOLEOBJECT, OLE_LPCSTR);
  461. OLESTATUS FARINTERNAL LeRelease (LPOLEOBJECT);
  462. OLESTATUS FARINTERNAL LeClone (LPOLEOBJECT, LPOLECLIENT, LHCLIENTDOC, OLE_LPCSTR, LPOLEOBJECT FAR *);
  463. OLESTATUS FARINTERNAL LeCopyFromLink (LPOLEOBJECT, LPOLECLIENT, LHCLIENTDOC, OLE_LPCSTR, LPOLEOBJECT FAR *);
  464. OLESTATUS FARINTERNAL LeEqual (LPOLEOBJECT, LPOLEOBJECT);
  465. OLESTATUS FARINTERNAL LeCopy (LPOLEOBJECT);
  466. OLESTATUS FARINTERNAL LeQueryBounds (LPOLEOBJECT, LPRECT);
  467. OLESTATUS FARINTERNAL LeDraw (LPOLEOBJECT, HDC, OLE_CONST RECT FAR*, OLE_CONST RECT FAR*, HDC);
  468. OLECLIPFORMAT FARINTERNAL LeEnumFormat (LPOLEOBJECT, OLECLIPFORMAT);
  469. OLESTATUS FARINTERNAL LeGetData (LPOLEOBJECT, OLECLIPFORMAT, HANDLE FAR *);
  470. OLESTATUS FARINTERNAL LeRequestData (LPOLEOBJECT, OLECLIPFORMAT);
  471. OLESTATUS FARINTERNAL LeQueryOutOfDate (LPOLEOBJECT);
  472. OLESTATUS FARINTERNAL LeObjectConvert (LPOLEOBJECT, OLE_LPCSTR, LPOLECLIENT, LHCLIENTDOC, OLE_LPCSTR, LPOLEOBJECT FAR *);
  473. OLESTATUS FARINTERNAL LeChangeData (LPOLEOBJECT, HANDLE, LPOLECLIENT, BOOL);
  474. LPOBJECT_LE FARINTERNAL LeCreateBlank(LHCLIENTDOC, LPSTR, LONG);
  475. void FARINTERNAL SetExtents (LPOBJECT_LE);
  476. OLESTATUS FARINTERNAL LeSaveToStream (LPOLEOBJECT, LPOLESTREAM);
  477. OLESTATUS FARINTERNAL LeLoadFromStream (LPOLESTREAM, LPOLECLIENT, LHCLIENTDOC, LPSTR, LPOLEOBJECT FAR *, LONG, ATOM, OLECLIPFORMAT);
  478. OLESTATUS INTERNAL LeStreamRead (LPOLESTREAM, LPOBJECT_LE);
  479. OLESTATUS INTERNAL LeStreamWrite (LPOLESTREAM, LPOBJECT_LE);
  480. int FARINTERNAL ContextCallBack (LPOLEOBJECT, OLE_NOTIFICATION);
  481. void INTERNAL DeleteObjectAtoms (LPOBJECT_LE);
  482. void FARINTERNAL DeleteExtraData (LPOBJECT_LE);
  483. OLESTATUS FARINTERNAL LeGetUpdateOptions (LPOLEOBJECT, OLEOPT_UPDATE FAR *);
  484. OLESTATUS FARINTERNAL LnkPaste (LPOLECLIENT, LHCLIENTDOC, LPSTR, LPOLEOBJECT FAR *, OLEOPT_RENDER, OLECLIPFORMAT, OLECLIPFORMAT);
  485. OLESTATUS FARINTERNAL EmbPaste (LPOLECLIENT, LHCLIENTDOC, LPSTR, LPOLEOBJECT FAR *, OLEOPT_RENDER, OLECLIPFORMAT);
  486. BOOL INTERNAL SetLink (LPOBJECT_LE, HANDLE, LPSTR FAR *);
  487. HANDLE INTERNAL GetLink (LPOBJECT_LE);
  488. void FARINTERNAL SetEmbeddedTopic (LPOBJECT_LE);
  489. OLESTATUS FAR PASCAL LeQueryReleaseStatus (LPOLEOBJECT);
  490. OLESTATUS FAR PASCAL LeQueryReleaseError (LPOLEOBJECT);
  491. OLE_RELEASE_METHOD FAR PASCAL LeQueryReleaseMethod (LPOLEOBJECT);
  492. OLESTATUS FARINTERNAL LeQueryType (LPOLEOBJECT, LPLONG);
  493. OLESTATUS FARINTERNAL LeObjectLong (LPOLEOBJECT, UINT, LPLONG);
  494. void SetNetDrive (LPOBJECT_LE);
  495. /////////////////////////////////////////////////////////////////////////////
  496. // //
  497. // Routines in LEDDE.C //
  498. // //
  499. /////////////////////////////////////////////////////////////////////////////
  500. OLESTATUS FARINTERNAL LeDoVerb (LPOLEOBJECT, UINT, BOOL, BOOL);
  501. OLESTATUS FARINTERNAL LeShow (LPOLEOBJECT, BOOL);
  502. OLESTATUS FARINTERNAL LeQueryOpen (LPOLEOBJECT);
  503. BOOL INTERNAL QueryOpen (LPOBJECT_LE);
  504. OLESTATUS FARINTERNAL LeActivate (LPOLEOBJECT, UINT, BOOL, BOOL, HWND, OLE_CONST RECT FAR*);
  505. OLESTATUS FARINTERNAL LeUpdate (LPOLEOBJECT);
  506. OLESTATUS FARINTERNAL EmbOpen (LPOBJECT_LE, BOOL, BOOL, HWND, LPRECT);
  507. OLESTATUS FARINTERNAL EmbUpdate (LPOBJECT_LE);
  508. OLESTATUS FARINTERNAL EmbOpenUpdate (LPOBJECT_LE);
  509. OLESTATUS FARINTERNAL LnkOpen (LPOBJECT_LE, BOOL, BOOL, HWND, LPRECT);
  510. OLESTATUS FARINTERNAL LnkUpdate (LPOBJECT_LE);
  511. OLESTATUS FARINTERNAL LnkOpenUpdate (LPOBJECT_LE);
  512. OLESTATUS FARINTERNAL LeClose (LPOLEOBJECT);
  513. OLESTATUS FARINTERNAL LeReconnect (LPOLEOBJECT);
  514. OLESTATUS INTERNAL PokeNativeData (LPOBJECT_LE);
  515. BOOL INTERNAL PostMessageToServer (PEDIT_DDE, UINT, LPARAM);
  516. OLESTATUS FARINTERNAL LeCreateFromTemplate (LPOLECLIENT, LPSTR, LHCLIENTDOC, LPSTR, LPOLEOBJECT FAR *, OLEOPT_RENDER, OLECLIPFORMAT);
  517. OLESTATUS FARINTERNAL LeCreate (LPOLECLIENT, LPSTR, LHCLIENTDOC, LPSTR, LPOLEOBJECT FAR *, OLEOPT_RENDER, OLECLIPFORMAT);
  518. OLESTATUS FARINTERNAL LeCreateInvisible (LPOLECLIENT, LPSTR, LHCLIENTDOC, LPSTR, LPOLEOBJECT FAR *, OLEOPT_RENDER, OLECLIPFORMAT, BOOL);
  519. OLESTATUS FARINTERNAL CreateFromClassOrTemplate (LPOLECLIENT, LPSTR, LPOLEOBJECT FAR *, OLEOPT_RENDER, OLECLIPFORMAT, UINT, LPSTR, LHCLIENTDOC, LPSTR);
  520. OLESTATUS FARINTERNAL CreateEmbLnkFromFile (LPOLECLIENT, LPCSTR, LPSTR, LPSTR, LHCLIENTDOC, LPSTR, LPOLEOBJECT FAR *, OLEOPT_RENDER, OLECLIPFORMAT, LONG);
  521. OLESTATUS FARINTERNAL LeSetUpdateOptions (LPOLEOBJECT, OLEOPT_UPDATE);
  522. void INTERNAL AdvisePict (LPOBJECT_LE, ATOM);
  523. void INTERNAL UnAdvisePict (LPOBJECT_LE);
  524. int INTERNAL GetPictType (LPOBJECT_LE);
  525. void INTERNAL AdviseOn (LPOBJECT_LE, int, ATOM);
  526. void INTERNAL UnAdviseOn (LPOBJECT_LE, int);
  527. void INTERNAL RequestOn (LPOBJECT_LE, int);
  528. void INTERNAL RequestPict (LPOBJECT_LE);
  529. OLESTATUS FARINTERNAL LeSetHostNames (LPOLEOBJECT, OLE_LPCSTR, OLE_LPCSTR);
  530. OLESTATUS INTERNAL PokeHostNames (LPOBJECT_LE);
  531. OLESTATUS INTERNAL SetHostNamesHandle (LPOBJECT_LE, LPSTR, LPSTR);
  532. void INTERNAL FreePokeData (LPOBJECT_LE, PEDIT_DDE);
  533. OLESTATUS INTERNAL SendPokeData (LPOBJECT_LE, ATOM, HANDLE, OLECLIPFORMAT);
  534. OLESTATUS FARINTERNAL LeSetTargetDevice (LPOLEOBJECT, HANDLE);
  535. OLESTATUS INTERNAL PokeTargetDeviceInfo (LPOBJECT_LE);
  536. OLESTATUS INTERNAL PokeDocDimensions (LPOBJECT_LE);
  537. OLESTATUS FARINTERNAL LeSetBounds (LPOLEOBJECT, OLE_CONST RECT FAR*);
  538. OLESTATUS FARINTERNAL LeSetData (LPOLEOBJECT, OLECLIPFORMAT, HANDLE);
  539. BOOL INTERNAL SendSrvrMainCmd (LPOBJECT_LE, LPSTR);
  540. ATOM INTERNAL ExtendAtom (LPOBJECT_LE, ATOM);
  541. BOOL INTERNAL CreatePictObject (LHCLIENTDOC, LPSTR, LPOBJECT_LE, OLEOPT_RENDER, OLECLIPFORMAT, LPCSTR);
  542. BOOL INTERNAL IsSrvrDLLwnd (HWND, HANDLE);
  543. OLESTATUS INTERNAL ChangeDocAndItem (LPOBJECT_LE, HANDLE);
  544. BOOL QueryUnlaunch (LPOBJECT_LE);
  545. BOOL QueryClose (LPOBJECT_LE);
  546. OLESTATUS FARINTERNAL LeSetColorScheme (LPOLEOBJECT, OLE_CONST LOGPALETTE FAR*);
  547. OLESTATUS INTERNAL PokeColorScheme (LPOBJECT_LE);
  548. OLESTATUS FARINTERNAL ProbeAsync (LPOBJECT_LE);
  549. BOOL INTERNAL IsServerValid (LPOBJECT_LE);
  550. BOOL INTERNAL IsWindowValid (HWND);
  551. OLESTATUS FARINTERNAL LeExecute (LPOLEOBJECT, HANDLE, UINT);
  552. void INTERNAL FreeGDIdata (HANDLE, OLECLIPFORMAT);
  553. BOOL INTERNAL CanPutHandleInPokeBlock (LPOBJECT_LE, OLECLIPFORMAT);
  554. BOOL INTERNAL ChangeEMFtoMF( LPOBJECT_LE );
  555. BOOL INTERNAL ChangeEMFtoMFneeded(LPOBJECT_LE, ATOM );
  556. /////////////////////////////////////////////////////////////////////////////
  557. // //
  558. // Routines in DDE.C //
  559. // //
  560. /////////////////////////////////////////////////////////////////////////////
  561. LRESULT FARINTERNAL DocWndProc(HWND, UINT, WPARAM, LPARAM );
  562. LRESULT FARINTERNAL SrvrWndProc(HWND, UINT, WPARAM, LPARAM );
  563. BOOL INTERNAL CheckAtomValid (ATOM);
  564. void INTERNAL HandleAckInitMsg (PEDIT_DDE, HWND);
  565. BOOL INTERNAL HandleAck (LPOBJECT_LE, PEDIT_DDE, WPARAM, LPARAM);
  566. void INTERNAL HandleDataMsg (LPOBJECT_LE, HANDLE, ATOM);
  567. void INTERNAL HandleTermMsg (LPOBJECT_LE, PEDIT_DDE, HWND, BOOL);
  568. void INTERNAL HandleTimerMsg (LPOBJECT_LE, PEDIT_DDE);
  569. void INTERNAL SetData (LPOBJECT_LE, HANDLE, int);
  570. BOOL INTERNAL DeleteBusyData (LPOBJECT_LE, PEDIT_DDE);
  571. void INTERNAL DeleteAbortData (LPOBJECT_LE, PEDIT_DDE);
  572. BOOL INTERNAL WaitDDE (HWND, BOOL);
  573. BOOL INTERNAL WaitDDEAck (PEDIT_DDE);
  574. BOOL INTERNAL InitSrvrConv (LPOBJECT_LE, HANDLE);
  575. void INTERNAL TermSrvrConv (LPOBJECT_LE);
  576. void INTERNAL DeleteSrvrEdit (LPOBJECT_LE);
  577. BOOL INTERNAL SrvrExecute (LPOBJECT_LE, HANDLE);
  578. void INTERNAL SendStdExit (LPOBJECT_LE);
  579. void INTERNAL SendStdClose (LPOBJECT_LE);
  580. void INTERNAL SendStdExit (LPOBJECT_LE);
  581. BOOL FARINTERNAL InitDocConv (LPOBJECT_LE, BOOL);
  582. BOOL INTERNAL DocExecute (LPOBJECT_LE, HANDLE);
  583. void INTERNAL TermDocConv (LPOBJECT_LE);
  584. void INTERNAL DeleteDocEdit (LPOBJECT_LE);
  585. HANDLE INTERNAL LeLaunchApp (LPOBJECT_LE);
  586. HANDLE INTERNAL LoadApp (LPSTR, UINT);
  587. int INTERNAL ScanItemOptions (ATOM, int FAR *);
  588. void INTERNAL ChangeDocName (LPOBJECT_LE, LPSTR);
  589. BOOL INTERNAL CanCallback (LPOBJECT_LE, int);
  590. void FARINTERNAL CallEmbLnkDelete (LPOBJECT_LE);
  591. /////////////////////////////////////////////////////////////////////////////
  592. // //
  593. // Picture Object routines used by routines in other modules //
  594. // //
  595. /////////////////////////////////////////////////////////////////////////////
  596. LPOBJECT_BM FARINTERNAL BmCreateBlank (LHCLIENTDOC, LPSTR, LONG);
  597. OLESTATUS FARINTERNAL BmLoadFromStream (LPOLESTREAM, LPOLECLIENT, LHCLIENTDOC, LPSTR, LPOLEOBJECT FAR *, LONG);
  598. OLESTATUS FARINTERNAL BmPaste (LPOLECLIENT, LHCLIENTDOC, LPSTR, LPOLEOBJECT FAR *, LONG);
  599. LPOBJECT_DIB FARINTERNAL DibCreateBlank (LHCLIENTDOC, LPSTR, LONG);
  600. LPOBJECT_DIB FARINTERNAL DibCreateObject (HANDLE, LPOLECLIENT, BOOL, LHCLIENTDOC, LPCSTR, LONG);
  601. OLESTATUS FARINTERNAL DibLoadFromStream (LPOLESTREAM, LPOLECLIENT, LHCLIENTDOC, LPSTR, LPOLEOBJECT FAR *, LONG);
  602. OLESTATUS FARINTERNAL DibPaste (LPOLECLIENT, LHCLIENTDOC, LPSTR, LPOLEOBJECT FAR *, LONG);
  603. LPOBJECT_MF FARINTERNAL MfCreateBlank (LHCLIENTDOC, LPSTR, LONG);
  604. LPOBJECT_MF FARINTERNAL MfCreateObject (HANDLE, LPOLECLIENT, BOOL, LHCLIENTDOC, LPCSTR, LONG);
  605. OLESTATUS FARINTERNAL MfLoadFromStream (LPOLESTREAM, LPOLECLIENT, LHCLIENTDOC, LPSTR, LPOLEOBJECT FAR *, LONG);
  606. OLESTATUS FARINTERNAL MfPaste (LPOLECLIENT, LHCLIENTDOC, LPSTR, LPOLEOBJECT FAR *, LONG);
  607. LPOBJECT_EMF FARINTERNAL EmfCreateBlank (LHCLIENTDOC, LPSTR, LONG);
  608. LPOBJECT_EMF FARINTERNAL EmfCreateObject (HANDLE, LPOLECLIENT, BOOL, LHCLIENTDOC, LPCSTR, LONG);
  609. OLESTATUS FARINTERNAL EmfLoadFromStream (LPOLESTREAM, LPOLECLIENT, LHCLIENTDOC, LPSTR, LPOLEOBJECT FAR *, LONG);
  610. OLESTATUS FARINTERNAL EmfPaste (LPOLECLIENT, LHCLIENTDOC, LPSTR, LPOLEOBJECT FAR *, LONG);
  611. LPOBJECT_GEN FARINTERNAL GenCreateBlank (LHCLIENTDOC, LPSTR, LONG, ATOM);
  612. OLESTATUS FARINTERNAL GenLoadFromStream (LPOLESTREAM, LPOLECLIENT, LHCLIENTDOC, LPSTR, LPOLEOBJECT FAR *, LONG, ATOM, OLECLIPFORMAT);
  613. OLESTATUS FARINTERNAL GenPaste (LPOLECLIENT, LHCLIENTDOC, LPSTR, LPOLEOBJECT FAR *, LPSTR, OLECLIPFORMAT, LONG);
  614. /////////////////////////////////////////////////////////////////////////////
  615. // //
  616. // Routines in MAIN.C //
  617. // //
  618. /////////////////////////////////////////////////////////////////////////////
  619. void FARINTERNAL UnloadDll (void);
  620. int FARINTERNAL LoadDll (LPCSTR);
  621. void FARINTERNAL DecreaseHandlerObjCount (int);
  622. void FARINTERNAL RemoveLinkStringFromTopic (LPOBJECT_LE);
  623. OLESTATUS FARINTERNAL CreatePictFromClip (LPOLECLIENT, LHCLIENTDOC, LPSTR, LPOLEOBJECT FAR *, OLEOPT_RENDER, OLECLIPFORMAT, LPSTR, LONG);
  624. OLESTATUS FARINTERNAL CreatePackageFromClip (LPOLECLIENT, LHCLIENTDOC, LPSTR, LPOLEOBJECT FAR *, OLEOPT_RENDER, OLECLIPFORMAT, LONG);
  625. /////////////////////////////////////////////////////////////////////////////
  626. // //
  627. // Routines in UTILS.C //
  628. // //
  629. /////////////////////////////////////////////////////////////////////////////
  630. BOOL PutStrWithLen (LPOLESTREAM, LPSTR);
  631. BOOL GetStrWithLen (LPOLESTREAM, LPSTR);
  632. ATOM GetAtomFromStream (LPOLESTREAM);
  633. BOOL PutAtomIntoStream (LPOLESTREAM, ATOM);
  634. BOOL GetBytes (LPOLESTREAM, LPSTR, LONG);
  635. BOOL PutBytes (LPOLESTREAM, LPSTR, LONG);
  636. BOOL QueryApp (LPCSTR, LPCSTR, LPSTR);
  637. HANDLE MapStrToH (LPSTR);
  638. void UtilMemClr (PSTR, UINT);
  639. BOOL QueryHandler (UINT);
  640. OLESTATUS INTERNAL FileExists (LPOBJECT_LE);
  641. ATOM FARINTERNAL GetAppAtom (LPCSTR);
  642. HANDLE FARINTERNAL DuplicateGlobal (HANDLE, UINT);
  643. HANDLE FARINTERNAL CopyData (LPSTR, DWORD);
  644. ATOM FARINTERNAL DuplicateAtom (ATOM);
  645. BOOL FARINTERNAL UtilQueryProtocol (LPOBJECT_LE, OLE_LPCSTR);
  646. BOOL FARINTERNAL CmpGlobals (HANDLE, HANDLE);
  647. void FARINTERNAL ConvertToHimetric(LPPOINT);
  648. BOOL FARINTERNAL QueryVerb (LPOBJECT_LE, UINT, LPSTR, LONG);
  649. BOOL FARINTERNAL MapExtToClass (LPSTR, LPSTR, int);
  650. int FARINTERNAL GlobalGetAtomLen (ATOM);
  651. void FARINTERNAL UtilMemCpy (LPSTR, LPSTR, DWORD);
  652. BOOL FARINTERNAL UtilMemCmp (LPSTR, LPSTR, DWORD);
  653. BOOL FARINTERNAL IsObjectBlank (LPOBJECT_LE);
  654. OLESTATUS FARINTERNAL ObjQueryName (LPOLEOBJECT, LPSTR, UINT FAR *);
  655. OLESTATUS FARINTERNAL ObjRename (LPOLEOBJECT, OLE_LPCSTR);
  656. void INTERNAL SetExeAtom (LPOBJECT_LE);
  657. BOOL INTERNAL OleIsDcMeta (HDC hdc);
  658. void INTERNAL ConvertMF32to16(LPMETAFILEPICT, LPWIN16METAFILEPICT);
  659. void INTERNAL ConvertMF16to32(LPWIN16METAFILEPICT, LPMETAFILEPICT);
  660. void INTERNAL ConvertBM32to16(LPBITMAP, LPWIN16BITMAP);
  661. void INTERNAL ConvertBM16to32(LPWIN16BITMAP, LPBITMAP);
  662. DWORD INTERNAL GetFileVersion(LPOLEOBJECT);
  663. // !!!make a routine and let the macro call the routine
  664. // definitions related to the asynchronous operations.
  665. #define WAIT_FOR_ASYNC_MSG(lpobj) { \
  666. lpobj->subRtn++; \
  667. if (lpobj->bAsync){ \
  668. lpobj->endAsync = TRUE; \
  669. return OLE_WAIT_FOR_RELEASE; \
  670. } \
  671. }
  672. #define STEP_NOP(lpobj) lpobj->subRtn++;
  673. // !!! Assumes all the creates are in order
  674. #define PROBE_CREATE_ASYNC(lpobj) \
  675. if (lpobj->asyncCmd >= OLE_CREATE && \
  676. lpobj->asyncCmd <= OLE_CREATEINVISIBLE) {\
  677. if(ProbeAsync(lpobj) == OLE_BUSY)\
  678. return OLE_BUSY;\
  679. }
  680. #define PROBE_OBJECT_BLANK(lpobj) \
  681. if (lpobj->asyncCmd >= OLE_CREATE && \
  682. lpobj->asyncCmd <= OLE_CREATEFROMFILE) { \
  683. if ((ProbeAsync(lpobj) == OLE_BUSY) && IsObjectBlank(lpobj)) \
  684. return OLE_ERROR_BLANK;\
  685. }
  686. #define PROBE_ASYNC(lpobj)\
  687. if(ProbeAsync(lpobj) == OLE_BUSY)\
  688. return OLE_BUSY;
  689. #define IS_SVRCLOSING(lpobj)\
  690. ((lpobj->bUnlaunchLater || lpobj->bSvrClosing) ? TRUE : FALSE)
  691. #define PROBE_SVRCLOSING(lpobj)\
  692. if (IS_SVRCLOSING(lpobj)) \
  693. return OLE_ERROR_NOT_OPEN; \
  694. #define CLEAR_STEP_ERROR(lpobj) lpobj->subErr = OLE_OK;
  695. #define SKIP_TO(a, b) if (a) goto b;
  696. #define RESETERR(lpobj) lpobj->mainErr = OLE_OK
  697. #define SETSTEP(lpobj, no) lpobj->subRtn = no
  698. #define SETERRHINT(lpobj, no) lpobj->errHint = no
  699. #define CLEARASYNCCMD(lpobj) lpobj->asyncCmd = OLE_NONE
  700. // routines.
  701. BOOL ProcessErr (LPOBJECT_LE);
  702. void InitAsyncCmd (LPOBJECT_LE, UINT, UINT);
  703. void NextAsyncCmd (LPOBJECT_LE, UINT);
  704. void ScheduleAsyncCmd (LPOBJECT_LE);
  705. OLESTATUS EndAsyncCmd (LPOBJECT_LE);
  706. OLESTATUS DocShow (LPOBJECT_LE);
  707. OLESTATUS DocRun (LPOBJECT_LE);
  708. void SendStdShow (LPOBJECT_LE);
  709. OLESTATUS EmbLnkClose (LPOBJECT_LE);
  710. OLESTATUS LnkSetUpdateOptions (LPOBJECT_LE);
  711. OLESTATUS EmbSrvrUnlaunch (LPOBJECT_LE);
  712. OLESTATUS LnkChangeLnk (LPOBJECT_LE);
  713. OLESTATUS RequestData (LPOBJECT_LE, OLECLIPFORMAT);
  714. OLESTATUS FARINTERNAL EmbLnkDelete(LPOBJECT_LE);
  715. void FARINTERNAL FarInitAsyncCmd(LPOBJECT_LE, UINT, UINT);
  716. // async command routines.
  717. #define EMBLNKDELETE 1
  718. #define LNKOPENUPDATE 2
  719. #define DOCSHOW 3
  720. #define EMBOPENUPDATE 4
  721. #define EMBLNKCLOSE 5
  722. #define LNKSETUPDATEOPTIONS 6
  723. #define LNKCHANGELNK 7
  724. #define REQUESTDATA 8
  725. #define DOCRUN 9
  726. /////////////////////////////////////////////////////////////////////////////
  727. // //
  728. // Routines in DOC.C //
  729. // //
  730. /////////////////////////////////////////////////////////////////////////////
  731. BOOL FARINTERNAL CheckClientDoc (LPCLIENTDOC);
  732. void FARINTERNAL DocAddObject (LPCLIENTDOC, LPOLEOBJECT, LPCSTR);
  733. void FARINTERNAL DocDeleteObject (LPOLEOBJECT);
  734. LPOLEOBJECT INTERNAL DocGetNextObject (LPCLIENTDOC, LPOLEOBJECT);
  735. /////////////////////////////////////////////////////////////////////////////
  736. // //
  737. // Routines in NET.C //
  738. // //
  739. /////////////////////////////////////////////////////////////////////////////
  740. #define IDD_DRIVE 500
  741. #define IDD_PASSWORD 501
  742. #define IDD_PATH 502
  743. #define IDS_NETERR 600
  744. #define IDS_NETCONERRMSG 601
  745. #define IDS_FILENOTFOUNDMSG 602
  746. #define IDS_BADPATHMSG 603
  747. OLESTATUS FARINTERNAL SetNetName (LPOBJECT_LE);
  748. BOOL FARINTERNAL SetNextNetDrive (LPOBJECT_LE, int FAR *, LPSTR);
  749. OLESTATUS FARINTERNAL CheckNetDrive (LPOBJECT_LE, BOOL);
  750. OLESTATUS INTERNAL FixNet (LPOBJECT_LE, LPSTR, BOOL);
  751. OLESTATUS INTERNAL ConnectNet (LPOBJECT_LE, LPSTR);
  752. BOOL FARINTERNAL ChangeTopic (LPOBJECT_LE);
  753. VOID INTERNAL FillDrives (HWND);
  754. INT_PTR FAR PASCAL ConnectDlgProc(HWND, UINT, WPARAM, LPARAM);
  755. /////////////////////////////////////////////////////////////////////////////
  756. // //
  757. // Routines in ERROR.C //
  758. // //
  759. /////////////////////////////////////////////////////////////////////////////
  760. OLESTATUS FARINTERNAL ObjQueryType (LPOLEOBJECT, LPLONG);
  761. OLESTATUS FARINTERNAL ObjQuerySize (LPOLEOBJECT, DWORD FAR *);
  762. DWORD PASCAL FAR DllPut (LPOLESTREAM, OLE_CONST void FAR*, DWORD);
  763. HANDLE FARINTERNAL DuplicateGDIdata (HANDLE, OLECLIPFORMAT);
  764. /////////////////////////////////////////////////////////////////////////////
  765. // //
  766. // Routines in BM.C //
  767. // //
  768. /////////////////////////////////////////////////////////////////////////////
  769. HBITMAP FARINTERNAL BmDuplicate (HBITMAP, DWORD FAR *, LPBITMAP);