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.

507 lines
25 KiB

  1. /*****************************************************************************\
  2. * *
  3. * ole.h - Object Linking and Embedding functions, types, and definitions*
  4. * *
  5. * Version 1.0 *
  6. * *
  7. * NOTE: windows.h must be #included first *
  8. * *
  9. * Copyright (c) Microsoft Corporation. All rights reserved. *
  10. * *
  11. \*****************************************************************************/
  12. #ifndef _INC_OLE
  13. #define _INC_OLE
  14. #if _MSC_VER > 1000
  15. #pragma once
  16. #endif
  17. #ifdef WIN16
  18. #include <pshpack1.h> /* Assume byte packing throughout */
  19. #endif
  20. #ifdef __cplusplus
  21. extern "C" { /* Assume C declarations for C++ */
  22. #endif /* __cplusplus */
  23. #ifndef WINAPI /* If not included with 3.1 headers... */
  24. #define WINAPI FAR PASCAL
  25. #define CALLBACK FAR PASCAL
  26. #define LPCSTR LPSTR
  27. #define LRESULT LONG_PTR
  28. #define HGLOBAL HANDLE
  29. #endif /* _INC_WINDOWS */
  30. #ifdef STRICT
  31. #define OLE_LPCSTR LPCSTR
  32. #define OLE_CONST const
  33. #else /* STRICT */
  34. #define OLE_LPCSTR LPSTR
  35. #define OLE_CONST
  36. #endif /* !STRICT */
  37. #define LRESULT LONG_PTR
  38. #define HGLOBAL HANDLE
  39. /* Object types */
  40. #define OT_LINK 1L
  41. #define OT_EMBEDDED 2L
  42. #define OT_STATIC 3L
  43. /* activate verbs */
  44. #define OLEVERB_PRIMARY 0
  45. /* target device info structure */
  46. typedef struct _OLETARGETDEVICE
  47. {
  48. USHORT otdDeviceNameOffset;
  49. USHORT otdDriverNameOffset;
  50. USHORT otdPortNameOffset;
  51. USHORT otdExtDevmodeOffset;
  52. USHORT otdExtDevmodeSize;
  53. USHORT otdEnvironmentOffset;
  54. USHORT otdEnvironmentSize;
  55. BYTE otdData[1];
  56. } OLETARGETDEVICE;
  57. typedef OLETARGETDEVICE FAR* LPOLETARGETDEVICE;
  58. /* flags used in some methods */
  59. #define OF_SET 0x0001
  60. #define OF_GET 0x0002
  61. #define OF_HANDLER 0x0004
  62. /* return codes for OLE functions */
  63. typedef enum
  64. {
  65. OLE_OK, /* 0 Function operated correctly */
  66. OLE_WAIT_FOR_RELEASE, /* 1 Command has been initiated, client */
  67. /* must wait for release. keep dispatching */
  68. /* messages till OLE_RELESE in callback */
  69. OLE_BUSY, /* 2 Tried to execute a method while another */
  70. /* method is in progress. */
  71. OLE_ERROR_PROTECT_ONLY, /* 3 Ole APIs are called in real mode */
  72. OLE_ERROR_MEMORY, /* 4 Could not alloc or lock memory */
  73. OLE_ERROR_STREAM, /* 5 (OLESTREAM) stream error */
  74. OLE_ERROR_STATIC, /* 6 Non static object expected */
  75. OLE_ERROR_BLANK, /* 7 Critical data missing */
  76. OLE_ERROR_DRAW, /* 8 Error while drawing */
  77. OLE_ERROR_METAFILE, /* 9 Invalid metafile */
  78. OLE_ERROR_ABORT, /* 10 Client chose to abort metafile drawing */
  79. OLE_ERROR_CLIPBOARD, /* 11 Failed to get/set clipboard data */
  80. OLE_ERROR_FORMAT, /* 12 Requested format is not available */
  81. OLE_ERROR_OBJECT, /* 13 Not a valid object */
  82. OLE_ERROR_OPTION, /* 14 Invalid option(link update / render) */
  83. OLE_ERROR_PROTOCOL, /* 15 Invalid protocol */
  84. OLE_ERROR_ADDRESS, /* 16 One of the pointers is invalid */
  85. OLE_ERROR_NOT_EQUAL, /* 17 Objects are not equal */
  86. OLE_ERROR_HANDLE, /* 18 Invalid handle encountered */
  87. OLE_ERROR_GENERIC, /* 19 Some general error */
  88. OLE_ERROR_CLASS, /* 20 Invalid class */
  89. OLE_ERROR_SYNTAX, /* 21 Command syntax is invalid */
  90. OLE_ERROR_DATATYPE, /* 22 Data format is not supported */
  91. OLE_ERROR_PALETTE, /* 23 Invalid color palette */
  92. OLE_ERROR_NOT_LINK, /* 24 Not a linked object */
  93. OLE_ERROR_NOT_EMPTY, /* 25 Client doc contains objects. */
  94. OLE_ERROR_SIZE, /* 26 Incorrect buffer size passed to the api */
  95. /* that places some string in caller's */
  96. /* buffer */
  97. OLE_ERROR_DRIVE, /* 27 Drive letter in doc name is invalid */
  98. OLE_ERROR_NETWORK, /* 28 Failed to establish connection to a */
  99. /* network share on which the document */
  100. /* is located */
  101. OLE_ERROR_NAME, /* 29 Invalid name(doc name, object name), */
  102. /* etc.. passed to the APIs */
  103. OLE_ERROR_TEMPLATE, /* 30 Server failed to load template */
  104. OLE_ERROR_NEW, /* 31 Server failed to create new doc */
  105. OLE_ERROR_EDIT, /* 32 Server failed to create embedded */
  106. /* instance */
  107. OLE_ERROR_OPEN, /* 33 Server failed to open document, */
  108. /* possible invalid link */
  109. OLE_ERROR_NOT_OPEN, /* 34 Object is not open for editing */
  110. OLE_ERROR_LAUNCH, /* 35 Failed to launch server */
  111. OLE_ERROR_COMM, /* 36 Failed to communicate with server */
  112. OLE_ERROR_TERMINATE, /* 37 Error in termination */
  113. OLE_ERROR_COMMAND, /* 38 Error in execute */
  114. OLE_ERROR_SHOW, /* 39 Error in show */
  115. OLE_ERROR_DOVERB, /* 40 Error in sending do verb, or invalid */
  116. /* verb */
  117. OLE_ERROR_ADVISE_NATIVE, /* 41 Item could be missing */
  118. OLE_ERROR_ADVISE_PICT, /* 42 Item could be missing or server doesn't */
  119. /* this format. */
  120. OLE_ERROR_ADVISE_RENAME, /* 43 Server doesn't support rename */
  121. OLE_ERROR_POKE_NATIVE, /* 44 Failure of poking native data to server */
  122. OLE_ERROR_REQUEST_NATIVE, /* 45 Server failed to render native data */
  123. OLE_ERROR_REQUEST_PICT, /* 46 Server failed to render presentation */
  124. /* data */
  125. OLE_ERROR_SERVER_BLOCKED, /* 47 Trying to block a blocked server or */
  126. /* trying to revoke a blocked server */
  127. /* or document */
  128. OLE_ERROR_REGISTRATION, /* 48 Server is not registered in regestation */
  129. /* data base */
  130. OLE_ERROR_ALREADY_REGISTERED,/*49 Trying to register same doc multiple */
  131. /* times */
  132. OLE_ERROR_TASK, /* 50 Server or client task is invalid */
  133. OLE_ERROR_OUTOFDATE, /* 51 Object is out of date */
  134. OLE_ERROR_CANT_UPDATE_CLIENT,/* 52 Embed doc's client doesn't accept */
  135. /* updates */
  136. OLE_ERROR_UPDATE, /* 53 erorr while trying to update */
  137. OLE_ERROR_SETDATA_FORMAT, /* 54 Server app doesn't understand the */
  138. /* format given to its SetData method */
  139. OLE_ERROR_STATIC_FROM_OTHER_OS,/* 55 trying to load a static object created */
  140. /* on another Operating System */
  141. OLE_ERROR_FILE_VER,
  142. /* Following are warnings */
  143. OLE_WARN_DELETE_DATA = 1000 /* Caller must delete the data when he is */
  144. /* done with it. */
  145. } OLESTATUS;
  146. /* Codes for CallBack events */
  147. typedef enum
  148. {
  149. OLE_CHANGED, /* 0 */
  150. OLE_SAVED, /* 1 */
  151. OLE_CLOSED, /* 2 */
  152. OLE_RENAMED, /* 3 */
  153. OLE_QUERY_PAINT, /* 4 Interruptible paint support */
  154. OLE_RELEASE, /* 5 Object is released(asynchronous operation */
  155. /* is completed) */
  156. OLE_QUERY_RETRY /* 6 Query for retry when server sends busy ACK */
  157. } OLE_NOTIFICATION;
  158. typedef enum
  159. {
  160. OLE_NONE, /* 0 no method active */
  161. OLE_DELETE, /* 1 object delete */
  162. OLE_LNKPASTE, /* 2 PasteLink(auto reconnect) */
  163. OLE_EMBPASTE, /* 3 paste(and update) */
  164. OLE_SHOW, /* 4 Show */
  165. OLE_RUN, /* 5 Run */
  166. OLE_ACTIVATE, /* 6 Activate */
  167. OLE_UPDATE, /* 7 Update */
  168. OLE_CLOSE, /* 8 Close */
  169. OLE_RECONNECT, /* 9 Reconnect */
  170. OLE_SETUPDATEOPTIONS, /* 10 setting update options */
  171. OLE_SERVERUNLAUNCH, /* 11 server is being unlaunched */
  172. OLE_LOADFROMSTREAM, /* 12 LoadFromStream(auto reconnect) */
  173. OLE_SETDATA, /* 13 OleSetData */
  174. OLE_REQUESTDATA, /* 14 OleRequestData */
  175. OLE_OTHER, /* 15 other misc async operations */
  176. OLE_CREATE, /* 16 create */
  177. OLE_CREATEFROMTEMPLATE, /* 17 CreatefromTemplate */
  178. OLE_CREATELINKFROMFILE, /* 18 CreateLinkFromFile */
  179. OLE_COPYFROMLNK, /* 19 CopyFromLink(auto reconnect) */
  180. OLE_CREATEFROMFILE, /* 20 CreateFromFile */
  181. OLE_CREATEINVISIBLE /* 21 CreateInvisible */
  182. } OLE_RELEASE_METHOD;
  183. /* rendering options */
  184. typedef enum
  185. {
  186. olerender_none,
  187. olerender_draw,
  188. olerender_format
  189. } OLEOPT_RENDER;
  190. /* standard clipboard format type */
  191. typedef WORD OLECLIPFORMAT;
  192. /* Link update options */
  193. typedef enum
  194. {
  195. oleupdate_always,
  196. oleupdate_onsave,
  197. #ifdef OLE_INTERNAL
  198. oleupdate_oncall,
  199. oleupdate_onclose
  200. #else
  201. oleupdate_oncall
  202. #endif /* OLE_INTERNAL */
  203. } OLEOPT_UPDATE;
  204. typedef HANDLE HOBJECT;
  205. typedef LONG_PTR LHSERVER;
  206. typedef LONG_PTR LHCLIENTDOC;
  207. typedef LONG_PTR LHSERVERDOC;
  208. typedef struct _OLEOBJECT FAR* LPOLEOBJECT;
  209. typedef struct _OLESTREAM FAR* LPOLESTREAM;
  210. typedef struct _OLECLIENT FAR* LPOLECLIENT;
  211. /* object method table definitions. */
  212. typedef struct _OLEOBJECTVTBL
  213. {
  214. void FAR* (CALLBACK* QueryProtocol) (LPOLEOBJECT, OLE_LPCSTR);
  215. OLESTATUS (CALLBACK* Release) (LPOLEOBJECT);
  216. OLESTATUS (CALLBACK* Show) (LPOLEOBJECT, BOOL);
  217. OLESTATUS (CALLBACK* DoVerb) (LPOLEOBJECT, UINT, BOOL, BOOL);
  218. OLESTATUS (CALLBACK* GetData) (LPOLEOBJECT, OLECLIPFORMAT, HANDLE FAR*);
  219. OLESTATUS (CALLBACK* SetData) (LPOLEOBJECT, OLECLIPFORMAT, HANDLE);
  220. OLESTATUS (CALLBACK* SetTargetDevice) (LPOLEOBJECT, HGLOBAL);
  221. OLESTATUS (CALLBACK* SetBounds) (LPOLEOBJECT, OLE_CONST RECT FAR*);
  222. OLECLIPFORMAT (CALLBACK* EnumFormats) (LPOLEOBJECT, OLECLIPFORMAT);
  223. OLESTATUS (CALLBACK* SetColorScheme) (LPOLEOBJECT, OLE_CONST LOGPALETTE FAR*);
  224. /* Server has to implement only the above methods. */
  225. #ifndef SERVERONLY
  226. /* Extra methods required for client. */
  227. OLESTATUS (CALLBACK* Delete) (LPOLEOBJECT);
  228. OLESTATUS (CALLBACK* SetHostNames) (LPOLEOBJECT, OLE_LPCSTR, OLE_LPCSTR);
  229. OLESTATUS (CALLBACK* SaveToStream) (LPOLEOBJECT, LPOLESTREAM);
  230. OLESTATUS (CALLBACK* Clone) (LPOLEOBJECT, LPOLECLIENT, LHCLIENTDOC, OLE_LPCSTR, LPOLEOBJECT FAR*);
  231. OLESTATUS (CALLBACK* CopyFromLink) (LPOLEOBJECT, LPOLECLIENT, LHCLIENTDOC, OLE_LPCSTR, LPOLEOBJECT FAR*);
  232. OLESTATUS (CALLBACK* Equal) (LPOLEOBJECT, LPOLEOBJECT);
  233. OLESTATUS (CALLBACK* CopyToClipboard) (LPOLEOBJECT);
  234. OLESTATUS (CALLBACK* Draw) (LPOLEOBJECT, HDC, OLE_CONST RECT FAR*, OLE_CONST RECT FAR*, HDC);
  235. OLESTATUS (CALLBACK* Activate) (LPOLEOBJECT, UINT, BOOL, BOOL, HWND, OLE_CONST RECT FAR*);
  236. OLESTATUS (CALLBACK* Execute) (LPOLEOBJECT, HGLOBAL, UINT);
  237. OLESTATUS (CALLBACK* Close) (LPOLEOBJECT);
  238. OLESTATUS (CALLBACK* Update) (LPOLEOBJECT);
  239. OLESTATUS (CALLBACK* Reconnect) (LPOLEOBJECT);
  240. OLESTATUS (CALLBACK* ObjectConvert) (LPOLEOBJECT, OLE_LPCSTR, LPOLECLIENT, LHCLIENTDOC, OLE_LPCSTR, LPOLEOBJECT FAR*);
  241. OLESTATUS (CALLBACK* GetLinkUpdateOptions) (LPOLEOBJECT, OLEOPT_UPDATE FAR*);
  242. OLESTATUS (CALLBACK* SetLinkUpdateOptions) (LPOLEOBJECT, OLEOPT_UPDATE);
  243. OLESTATUS (CALLBACK* Rename) (LPOLEOBJECT, OLE_LPCSTR);
  244. OLESTATUS (CALLBACK* QueryName) (LPOLEOBJECT, LPSTR, UINT FAR*);
  245. OLESTATUS (CALLBACK* QueryType) (LPOLEOBJECT, LONG FAR*);
  246. OLESTATUS (CALLBACK* QueryBounds) (LPOLEOBJECT, RECT FAR*);
  247. OLESTATUS (CALLBACK* QuerySize) (LPOLEOBJECT, DWORD FAR*);
  248. OLESTATUS (CALLBACK* QueryOpen) (LPOLEOBJECT);
  249. OLESTATUS (CALLBACK* QueryOutOfDate) (LPOLEOBJECT);
  250. OLESTATUS (CALLBACK* QueryReleaseStatus) (LPOLEOBJECT);
  251. OLESTATUS (CALLBACK* QueryReleaseError) (LPOLEOBJECT);
  252. OLE_RELEASE_METHOD (CALLBACK* QueryReleaseMethod)(LPOLEOBJECT);
  253. OLESTATUS (CALLBACK* RequestData) (LPOLEOBJECT, OLECLIPFORMAT);
  254. OLESTATUS (CALLBACK* ObjectLong) (LPOLEOBJECT, UINT, LONG FAR*);
  255. /* This method is internal only */
  256. OLESTATUS (CALLBACK* ChangeData) (LPOLEOBJECT, HANDLE, LPOLECLIENT, BOOL);
  257. #endif /* !SERVERONLY */
  258. } OLEOBJECTVTBL;
  259. typedef OLEOBJECTVTBL FAR* LPOLEOBJECTVTBL;
  260. #ifndef OLE_INTERNAL
  261. typedef struct _OLEOBJECT
  262. {
  263. LPOLEOBJECTVTBL lpvtbl;
  264. } OLEOBJECT;
  265. #endif
  266. /* ole client definitions */
  267. typedef struct _OLECLIENTVTBL
  268. {
  269. int (CALLBACK* CallBack)(LPOLECLIENT, OLE_NOTIFICATION, LPOLEOBJECT);
  270. } OLECLIENTVTBL;
  271. typedef OLECLIENTVTBL FAR* LPOLECLIENTVTBL;
  272. typedef struct _OLECLIENT
  273. {
  274. LPOLECLIENTVTBL lpvtbl;
  275. } OLECLIENT;
  276. /* Stream definitions */
  277. typedef struct _OLESTREAMVTBL
  278. {
  279. DWORD (CALLBACK* Get)(LPOLESTREAM, void FAR*, DWORD);
  280. DWORD (CALLBACK* Put)(LPOLESTREAM, OLE_CONST void FAR*, DWORD);
  281. } OLESTREAMVTBL;
  282. typedef OLESTREAMVTBL FAR* LPOLESTREAMVTBL;
  283. typedef struct _OLESTREAM
  284. {
  285. LPOLESTREAMVTBL lpstbl;
  286. } OLESTREAM;
  287. /* Public Function Prototypes */
  288. OLESTATUS WINAPI OleDelete(LPOLEOBJECT);
  289. OLESTATUS WINAPI OleRelease(LPOLEOBJECT);
  290. OLESTATUS WINAPI OleSaveToStream(LPOLEOBJECT, LPOLESTREAM);
  291. OLESTATUS WINAPI OleEqual(LPOLEOBJECT, LPOLEOBJECT );
  292. OLESTATUS WINAPI OleCopyToClipboard(LPOLEOBJECT);
  293. OLESTATUS WINAPI OleSetHostNames(LPOLEOBJECT, LPCSTR, LPCSTR);
  294. OLESTATUS WINAPI OleSetTargetDevice(LPOLEOBJECT, HGLOBAL);
  295. OLESTATUS WINAPI OleSetBounds(LPOLEOBJECT, const RECT FAR*);
  296. OLESTATUS WINAPI OleSetColorScheme(LPOLEOBJECT, const LOGPALETTE FAR*);
  297. OLESTATUS WINAPI OleQueryBounds(LPOLEOBJECT, RECT FAR*);
  298. OLESTATUS WINAPI OleQuerySize(LPOLEOBJECT, DWORD FAR*);
  299. OLESTATUS WINAPI OleDraw(LPOLEOBJECT, HDC, const RECT FAR*, const RECT FAR*, HDC);
  300. OLESTATUS WINAPI OleQueryOpen(LPOLEOBJECT);
  301. OLESTATUS WINAPI OleActivate(LPOLEOBJECT, UINT, BOOL, BOOL, HWND, const RECT FAR*);
  302. OLESTATUS WINAPI OleExecute(LPOLEOBJECT, HGLOBAL, UINT);
  303. OLESTATUS WINAPI OleClose(LPOLEOBJECT);
  304. OLESTATUS WINAPI OleUpdate(LPOLEOBJECT);
  305. OLESTATUS WINAPI OleReconnect(LPOLEOBJECT);
  306. OLESTATUS WINAPI OleGetLinkUpdateOptions(LPOLEOBJECT, OLEOPT_UPDATE FAR*);
  307. OLESTATUS WINAPI OleSetLinkUpdateOptions(LPOLEOBJECT, OLEOPT_UPDATE);
  308. void FAR* WINAPI OleQueryProtocol(LPOLEOBJECT, LPCSTR);
  309. /* Routines related to asynchronous operations. */
  310. OLESTATUS WINAPI OleQueryReleaseStatus(LPOLEOBJECT);
  311. OLESTATUS WINAPI OleQueryReleaseError(LPOLEOBJECT);
  312. OLE_RELEASE_METHOD WINAPI OleQueryReleaseMethod(LPOLEOBJECT);
  313. OLESTATUS WINAPI OleQueryType(LPOLEOBJECT, LONG FAR*);
  314. /* LOWORD is major version, HIWORD is minor version */
  315. DWORD WINAPI OleQueryClientVersion(void);
  316. DWORD WINAPI OleQueryServerVersion(void);
  317. /* Converting to format (as in clipboard): */
  318. OLECLIPFORMAT WINAPI OleEnumFormats(LPOLEOBJECT, OLECLIPFORMAT);
  319. OLESTATUS WINAPI OleGetData(LPOLEOBJECT, OLECLIPFORMAT, HANDLE FAR*);
  320. OLESTATUS WINAPI OleSetData(LPOLEOBJECT, OLECLIPFORMAT, HANDLE);
  321. OLESTATUS WINAPI OleQueryOutOfDate(LPOLEOBJECT);
  322. OLESTATUS WINAPI OleRequestData(LPOLEOBJECT, OLECLIPFORMAT);
  323. /* Query apis for creation from clipboard */
  324. OLESTATUS WINAPI OleQueryLinkFromClip(LPCSTR, OLEOPT_RENDER, OLECLIPFORMAT);
  325. OLESTATUS WINAPI OleQueryCreateFromClip(LPCSTR, OLEOPT_RENDER, OLECLIPFORMAT);
  326. /* Object creation functions */
  327. OLESTATUS WINAPI OleCreateFromClip(LPCSTR, LPOLECLIENT, LHCLIENTDOC, LPCSTR, LPOLEOBJECT FAR*, OLEOPT_RENDER, OLECLIPFORMAT);
  328. OLESTATUS WINAPI OleCreateLinkFromClip(LPCSTR, LPOLECLIENT, LHCLIENTDOC, LPCSTR, LPOLEOBJECT FAR*, OLEOPT_RENDER, OLECLIPFORMAT);
  329. OLESTATUS WINAPI OleCreateFromFile(LPCSTR, LPOLECLIENT, LPCSTR, LPCSTR, LHCLIENTDOC, LPCSTR, LPOLEOBJECT FAR*, OLEOPT_RENDER, OLECLIPFORMAT);
  330. OLESTATUS WINAPI OleCreateLinkFromFile(LPCSTR, LPOLECLIENT, LPCSTR, LPCSTR, LPCSTR, LHCLIENTDOC, LPCSTR, LPOLEOBJECT FAR*, OLEOPT_RENDER, OLECLIPFORMAT);
  331. OLESTATUS WINAPI OleLoadFromStream(LPOLESTREAM, LPCSTR, LPOLECLIENT, LHCLIENTDOC, LPCSTR, LPOLEOBJECT FAR*);
  332. OLESTATUS WINAPI OleCreate(LPCSTR, LPOLECLIENT, LPCSTR, LHCLIENTDOC, LPCSTR, LPOLEOBJECT FAR*, OLEOPT_RENDER, OLECLIPFORMAT);
  333. OLESTATUS WINAPI OleCreateInvisible(LPCSTR, LPOLECLIENT, LPCSTR, LHCLIENTDOC, LPCSTR, LPOLEOBJECT FAR*, OLEOPT_RENDER, OLECLIPFORMAT, BOOL);
  334. OLESTATUS WINAPI OleCreateFromTemplate(LPCSTR, LPOLECLIENT, LPCSTR, LHCLIENTDOC, LPCSTR, LPOLEOBJECT FAR*, OLEOPT_RENDER, OLECLIPFORMAT);
  335. OLESTATUS WINAPI OleClone(LPOLEOBJECT, LPOLECLIENT, LHCLIENTDOC, LPCSTR, LPOLEOBJECT FAR*);
  336. OLESTATUS WINAPI OleCopyFromLink(LPOLEOBJECT, LPCSTR, LPOLECLIENT, LHCLIENTDOC, LPCSTR, LPOLEOBJECT FAR*);
  337. OLESTATUS WINAPI OleObjectConvert(LPOLEOBJECT, LPCSTR, LPOLECLIENT, LHCLIENTDOC, LPCSTR, LPOLEOBJECT FAR*);
  338. OLESTATUS WINAPI OleRename(LPOLEOBJECT, LPCSTR);
  339. OLESTATUS WINAPI OleQueryName(LPOLEOBJECT, LPSTR, UINT FAR*);
  340. OLESTATUS WINAPI OleRevokeObject(LPOLECLIENT);
  341. BOOL WINAPI OleIsDcMeta(HDC);
  342. /* client document API */
  343. OLESTATUS WINAPI OleRegisterClientDoc(LPCSTR, LPCSTR, LONG, LHCLIENTDOC FAR*);
  344. OLESTATUS WINAPI OleRevokeClientDoc(LHCLIENTDOC);
  345. OLESTATUS WINAPI OleRenameClientDoc(LHCLIENTDOC, LPCSTR);
  346. OLESTATUS WINAPI OleRevertClientDoc(LHCLIENTDOC);
  347. OLESTATUS WINAPI OleSavedClientDoc(LHCLIENTDOC);
  348. OLESTATUS WINAPI OleEnumObjects(LHCLIENTDOC, LPOLEOBJECT FAR*);
  349. /* server usage definitions */
  350. typedef enum {
  351. OLE_SERVER_MULTI, /* multiple instances */
  352. OLE_SERVER_SINGLE /* single instance(multiple document) */
  353. } OLE_SERVER_USE;
  354. /* Server API */
  355. typedef struct _OLESERVER FAR* LPOLESERVER;
  356. OLESTATUS WINAPI OleRegisterServer(LPCSTR, LPOLESERVER, LHSERVER FAR*, HINSTANCE, OLE_SERVER_USE);
  357. OLESTATUS WINAPI OleRevokeServer(LHSERVER);
  358. OLESTATUS WINAPI OleBlockServer(LHSERVER);
  359. OLESTATUS WINAPI OleUnblockServer(LHSERVER, BOOL FAR*);
  360. /* APIs to keep server open */
  361. OLESTATUS WINAPI OleLockServer(LPOLEOBJECT, LHSERVER FAR*);
  362. OLESTATUS WINAPI OleUnlockServer(LHSERVER);
  363. /* Server document API */
  364. typedef struct _OLESERVERDOC FAR* LPOLESERVERDOC;
  365. OLESTATUS WINAPI OleRegisterServerDoc(LHSERVER, LPCSTR, LPOLESERVERDOC, LHSERVERDOC FAR*);
  366. OLESTATUS WINAPI OleRevokeServerDoc(LHSERVERDOC);
  367. OLESTATUS WINAPI OleRenameServerDoc(LHSERVERDOC, LPCSTR);
  368. OLESTATUS WINAPI OleRevertServerDoc(LHSERVERDOC);
  369. OLESTATUS WINAPI OleSavedServerDoc(LHSERVERDOC);
  370. typedef struct _OLESERVERVTBL
  371. {
  372. OLESTATUS (CALLBACK* Open) (LPOLESERVER, LHSERVERDOC, OLE_LPCSTR, LPOLESERVERDOC FAR*);
  373. /* long handle to doc(privtate to DLL) */
  374. /* lp to OLESERVER */
  375. /* document name */
  376. /* place holder for returning oledoc. */
  377. OLESTATUS (CALLBACK* Create)(LPOLESERVER, LHSERVERDOC, OLE_LPCSTR, OLE_LPCSTR, LPOLESERVERDOC FAR*);
  378. /* long handle to doc(privtate to DLL) */
  379. /* lp to OLESERVER */
  380. /* lp class name */
  381. /* lp doc name */
  382. /* place holder for returning oledoc. */
  383. OLESTATUS (CALLBACK* CreateFromTemplate)(LPOLESERVER, LHSERVERDOC, OLE_LPCSTR, OLE_LPCSTR, OLE_LPCSTR, LPOLESERVERDOC FAR*);
  384. /* long handle to doc(privtate to DLL) */
  385. /* lp to OLESERVER */
  386. /* lp class name */
  387. /* lp doc name */
  388. /* lp template name */
  389. /* place holder for returning oledoc. */
  390. OLESTATUS (CALLBACK* Edit) (LPOLESERVER, LHSERVERDOC, OLE_LPCSTR, OLE_LPCSTR, LPOLESERVERDOC FAR*);
  391. /* long handle to doc(privtate to DLL) */
  392. /* lp to OLESERVER */
  393. /* lp class name */
  394. /* lp doc name */
  395. /* place holder for returning oledoc. */
  396. OLESTATUS (CALLBACK* Exit) (LPOLESERVER);
  397. /* lp OLESERVER */
  398. OLESTATUS (CALLBACK* Release) (LPOLESERVER);
  399. /* lp OLESERVER */
  400. OLESTATUS (CALLBACK* Execute)(LPOLESERVER, HGLOBAL);
  401. /* lp OLESERVER */
  402. /* handle to command strings */
  403. } OLESERVERVTBL;
  404. typedef OLESERVERVTBL FAR* LPOLESERVERVTBL;
  405. typedef struct _OLESERVER
  406. {
  407. LPOLESERVERVTBL lpvtbl;
  408. } OLESERVER;
  409. typedef struct _OLESERVERDOCVTBL
  410. {
  411. OLESTATUS (CALLBACK* Save) (LPOLESERVERDOC);
  412. OLESTATUS (CALLBACK* Close) (LPOLESERVERDOC);
  413. OLESTATUS (CALLBACK* SetHostNames)(LPOLESERVERDOC, OLE_LPCSTR, OLE_LPCSTR);
  414. OLESTATUS (CALLBACK* SetDocDimensions)(LPOLESERVERDOC, OLE_CONST RECT FAR*);
  415. OLESTATUS (CALLBACK* GetObject) (LPOLESERVERDOC, OLE_LPCSTR, LPOLEOBJECT FAR*, LPOLECLIENT);
  416. OLESTATUS (CALLBACK* Release) (LPOLESERVERDOC);
  417. OLESTATUS (CALLBACK* SetColorScheme)(LPOLESERVERDOC, OLE_CONST LOGPALETTE FAR*);
  418. OLESTATUS (CALLBACK* Execute) (LPOLESERVERDOC, HGLOBAL);
  419. } OLESERVERDOCVTBL;
  420. typedef OLESERVERDOCVTBL FAR* LPOLESERVERDOCVTBL;
  421. typedef struct _OLESERVERDOC
  422. {
  423. LPOLESERVERDOCVTBL lpvtbl;
  424. } OLESERVERDOC;
  425. #ifdef __cplusplus
  426. }
  427. #endif /* __cplusplus */
  428. #ifdef WIN16
  429. #include <poppack.h>
  430. #endif
  431. #endif /* !_INC_OLE */