home *** CD-ROM | disk | FTP | other *** search
/ Power GUI Programming with VisualAge C++ / powergui.iso / trialva / ibmcppw / sdk / winh / objbase.h < prev    next >
Encoding:
C/C++ Source or Header  |  1995-07-11  |  20.0 KB  |  580 lines

  1. //+---------------------------------------------------------------------------
  2. //
  3. //  Microsoft Windows
  4. //  Copyright (C) Microsoft Corporation, 1992 - 1995.
  5. //
  6. //  File:       objbase.h
  7. //
  8. //  Contents:   Component object model defintions.
  9. //
  10. //----------------------------------------------------------------------------
  11.  
  12. #include <rpc.h>
  13. #include <rpcndr.h>
  14.  
  15. #if !defined( _OBJBASE_H_ )
  16. #define _OBJBASE_H_
  17.  
  18. #include <pshpack8.h>
  19.  
  20. // Component Object Model defines, and macros
  21.  
  22. #ifdef __cplusplus
  23.     #define EXTERN_C    extern "C"
  24. #else
  25.     #define EXTERN_C    extern
  26. #endif
  27.  
  28. #ifdef _WIN32
  29.  
  30. // Win32 doesn't support __export
  31.  
  32. #define STDMETHODCALLTYPE       __stdcall
  33. #define STDMETHODVCALLTYPE      __cdecl
  34.  
  35. #define STDAPICALLTYPE          __stdcall
  36. #define STDAPIVCALLTYPE         __cdecl
  37.  
  38. #else
  39.  
  40. #define STDMETHODCALLTYPE       __export __stdcall
  41. #define STDMETHODVCALLTYPE      __export __cdecl
  42.  
  43. #define STDAPICALLTYPE          __export __stdcall
  44. #define STDAPIVCALLTYPE         __export __cdecl
  45.  
  46. #endif
  47.  
  48.  
  49. #define STDAPI                  EXTERN_C HRESULT STDAPICALLTYPE
  50. #define STDAPI_(type)           EXTERN_C type STDAPICALLTYPE
  51.  
  52. #define STDMETHODIMP            HRESULT STDMETHODCALLTYPE
  53. #define STDMETHODIMP_(type)     type STDMETHODCALLTYPE
  54.  
  55. // The 'V' versions allow Variable Argument lists.
  56.  
  57. #define STDAPIV                 EXTERN_C HRESULT STDAPIVCALLTYPE
  58. #define STDAPIV_(type)          EXTERN_C type STDAPIVCALLTYPE
  59.  
  60. #define STDMETHODIMPV           HRESULT STDMETHODVCALLTYPE
  61. #define STDMETHODIMPV_(type)    type STDMETHODVCALLTYPE
  62.  
  63. #ifdef _OLE32_
  64. #define WINOLEAPI        STDAPI
  65. #define WINOLEAPI_(type) STDAPI_(type)
  66. #else
  67. #define WINOLEAPI        EXTERN_C DECLSPEC_IMPORT HRESULT STDAPICALLTYPE
  68. #define WINOLEAPI_(type) EXTERN_C DECLSPEC_IMPORT type STDAPICALLTYPE
  69. #endif
  70.  
  71. /****** Interface Declaration ***********************************************/
  72.  
  73. /*
  74.  *      These are macros for declaring interfaces.  They exist so that
  75.  *      a single definition of the interface is simulataneously a proper
  76.  *      declaration of the interface structures (C++ abstract classes)
  77.  *      for both C and C++.
  78.  *
  79.  *      DECLARE_INTERFACE(iface) is used to declare an interface that does
  80.  *      not derive from a base interface.
  81.  *      DECLARE_INTERFACE_(iface, baseiface) is used to declare an interface
  82.  *      that does derive from a base interface.
  83.  *
  84.  *      By default if the source file has a .c extension the C version of
  85.  *      the interface declaratations will be expanded; if it has a .cpp
  86.  *      extension the C++ version will be expanded. if you want to force
  87.  *      the C version expansion even though the source file has a .cpp
  88.  *      extension, then define the macro "CINTERFACE".
  89.  *      eg.     cl -DCINTERFACE file.cpp
  90.  *
  91.  *      Example Interface declaration:
  92.  *
  93.  *          #undef  INTERFACE
  94.  *          #define INTERFACE   IClassFactory
  95.  *
  96.  *          DECLARE_INTERFACE_(IClassFactory, IUnknown)
  97.  *          {
  98.  *              // *** IUnknown methods ***
  99.  *              STDMETHOD(QueryInterface) (THIS_
  100.  *                                        REFIID riid,
  101.  *                                        LPVOID FAR* ppvObj) PURE;
  102.  *              STDMETHOD_(ULONG,AddRef) (THIS) PURE;
  103.  *              STDMETHOD_(ULONG,Release) (THIS) PURE;
  104.  *
  105.  *              // *** IClassFactory methods ***
  106.  *              STDMETHOD(CreateInstance) (THIS_
  107.  *                                        LPUNKNOWN pUnkOuter,
  108.  *                                        REFIID riid,
  109.  *                                        LPVOID FAR* ppvObject) PURE;
  110.  *          };
  111.  *
  112.  *      Example C++ expansion:
  113.  *
  114.  *          struct FAR IClassFactory : public IUnknown
  115.  *          {
  116.  *              virtual HRESULT STDMETHODCALLTYPE QueryInterface(
  117.  *                                                  IID FAR& riid,
  118.  *                                                  LPVOID FAR* ppvObj) = 0;
  119.  *              virtual HRESULT STDMETHODCALLTYPE AddRef(void) = 0;
  120.  *              virtual HRESULT STDMETHODCALLTYPE Release(void) = 0;
  121.  *              virtual HRESULT STDMETHODCALLTYPE CreateInstance(
  122.  *                                              LPUNKNOWN pUnkOuter,
  123.  *                                              IID FAR& riid,
  124.  *                                              LPVOID FAR* ppvObject) = 0;
  125.  *          };
  126.  *
  127.  *          NOTE: Our documentation says '#define interface class' but we use
  128.  *          'struct' instead of 'class' to keep a lot of 'public:' lines
  129.  *          out of the interfaces.  The 'FAR' forces the 'this' pointers to
  130.  *          be far, which is what we need.
  131.  *
  132.  *      Example C expansion:
  133.  *
  134.  *          typedef struct IClassFactory
  135.  *          {
  136.  *              const struct IClassFactoryVtbl FAR* lpVtbl;
  137.  *          } IClassFactory;
  138.  *
  139.  *          typedef struct IClassFactoryVtbl IClassFactoryVtbl;
  140.  *
  141.  *          struct IClassFactoryVtbl
  142.  *          {
  143.  *              HRESULT (STDMETHODCALLTYPE * QueryInterface) (
  144.  *                                                  IClassFactory FAR* This,
  145.  *                                                  IID FAR* riid,
  146.  *                                                  LPVOID FAR* ppvObj) ;
  147.  *              HRESULT (STDMETHODCALLTYPE * AddRef) (IClassFactory FAR* This) ;
  148.  *              HRESULT (STDMETHODCALLTYPE * Release) (IClassFactory FAR* This) ;
  149.  *              HRESULT (STDMETHODCALLTYPE * CreateInstance) (
  150.  *                                                  IClassFactory FAR* This,
  151.  *                                                  LPUNKNOWN pUnkOuter,
  152.  *                                                  IID FAR* riid,
  153.  *                                                  LPVOID FAR* ppvObject);
  154.  *              HRESULT (STDMETHODCALLTYPE * LockServer) (
  155.  *                                                  IClassFactory FAR* This,
  156.  *                                                  BOOL fLock);
  157.  *          };
  158.  */
  159.  
  160.  
  161. #if defined(__cplusplus) && !defined(CINTERFACE)
  162. //#define interface               struct FAR
  163. #define interface struct
  164. #define STDMETHOD(method)       virtual HRESULT STDMETHODCALLTYPE method
  165. #define STDMETHOD_(type,method) virtual type STDMETHODCALLTYPE method
  166. #define PURE                    = 0
  167. #define THIS_
  168. #define THIS                    void
  169. #define DECLARE_INTERFACE(iface)    interface iface
  170. #define DECLARE_INTERFACE_(iface, baseiface)    interface iface : public baseiface
  171.  
  172.  
  173.  
  174. #else
  175.  
  176. #define interface               struct
  177.  
  178. #define STDMETHOD(method)       HRESULT (STDMETHODCALLTYPE * method)
  179. #define STDMETHOD_(type,method) type (STDMETHODCALLTYPE * method)
  180.  
  181.  
  182.  
  183.  
  184. #define PURE
  185. #define THIS_                   INTERFACE FAR* This,
  186. #define THIS                    INTERFACE FAR* This
  187. #ifdef CONST_VTABLE
  188. #define CONST_VTBL const
  189. #define DECLARE_INTERFACE(iface)    typedef interface iface { \
  190.                                     const struct iface##Vtbl FAR* lpVtbl; \
  191.                                 } iface; \
  192.                                 typedef const struct iface##Vtbl iface##Vtbl; \
  193.                                 const struct iface##Vtbl
  194. #else
  195. #define CONST_VTBL
  196. #define DECLARE_INTERFACE(iface)    typedef interface iface { \
  197.                                     struct iface##Vtbl FAR* lpVtbl; \
  198.                                 } iface; \
  199.                                 typedef struct iface##Vtbl iface##Vtbl; \
  200.                                 struct iface##Vtbl
  201. #endif
  202. #define DECLARE_INTERFACE_(iface, baseiface)    DECLARE_INTERFACE(iface)
  203.  
  204. #endif
  205.  
  206.  
  207.  
  208.  
  209. /****** Additional basic types **********************************************/
  210.  
  211.  
  212. #ifndef FARSTRUCT
  213. #ifdef __cplusplus
  214. #define FARSTRUCT   FAR
  215. #else
  216. #define FARSTRUCT
  217. #endif  // __cplusplus
  218. #endif  // FARSTRUCT
  219.  
  220.  
  221.  
  222. #ifndef HUGEP
  223. #ifdef _WIN32
  224. #define HUGEP
  225. #else
  226. #define HUGEP __huge
  227. #endif // WIN32
  228. #endif // HUGEP
  229.  
  230.  
  231. #include <stdlib.h>
  232.  
  233. #define LISet32(li, v) ((li).HighPart = (v) < 0 ? -1 : 0, (li).LowPart = (v))
  234.  
  235. #define ULISet32(li, v) ((li).HighPart = 0, (li).LowPart = (v))
  236.  
  237.  
  238.  
  239.  
  240.  
  241.  
  242. #define CLSCTX_ALL              (CLSCTX_INPROC_SERVER| \
  243.                                  CLSCTX_INPROC_HANDLER| \
  244.                                  CLSCTX_LOCAL_SERVER)
  245.  
  246. #define CLSCTX_INPROC           (CLSCTX_INPROC_SERVER|CLSCTX_INPROC_HANDLER)
  247.  
  248. #define CLSCTX_SERVER           (CLSCTX_INPROC_SERVER|CLSCTX_LOCAL_SERVER)
  249.  
  250.  
  251. // class registration flags; passed to CoRegisterClassObject
  252. typedef enum tagREGCLS
  253. {
  254.     REGCLS_SINGLEUSE = 0,       // class object only generates one instance
  255.     REGCLS_MULTIPLEUSE = 1,     // same class object genereates multiple inst.
  256.                                 // and local automatically goes into inproc tbl.
  257.     REGCLS_MULTI_SEPARATE = 2   // multiple use, but separate control over each
  258.                                 // context.
  259. } REGCLS;
  260.  
  261. // interface marshaling definitions
  262. #define MARSHALINTERFACE_MIN 500 // minimum number of bytes for interface marshl
  263.  
  264.  
  265. //
  266. // Common typedefs for paramaters used in Storage API's, gleamed from storage.h
  267. // Also contains Storage error codes, which should be moved into the storage
  268. // idl files.
  269. //
  270.  
  271.  
  272. #define CWCSTORAGENAME 32
  273.  
  274. /* Storage instantiation modes */
  275. #define STGM_DIRECT             0x00000000L
  276. #define STGM_TRANSACTED         0x00010000L
  277. #define STGM_SIMPLE             0x08000000L
  278.  
  279. #define STGM_READ               0x00000000L
  280. #define STGM_WRITE              0x00000001L
  281. #define STGM_READWRITE          0x00000002L
  282.  
  283. #define STGM_SHARE_DENY_NONE    0x00000040L
  284. #define STGM_SHARE_DENY_READ    0x00000030L
  285. #define STGM_SHARE_DENY_WRITE   0x00000020L
  286. #define STGM_SHARE_EXCLUSIVE    0x00000010L
  287.  
  288. #define STGM_PRIORITY           0x00040000L
  289. #define STGM_DELETEONRELEASE    0x04000000L
  290. #if (WINVER >= 400)
  291. #define STGM_NOSCRATCH          0x00100000L
  292. #endif /* WINVER */
  293.  
  294. #define STGM_CREATE             0x00001000L
  295. #define STGM_CONVERT            0x00020000L
  296. #define STGM_FAILIFTHERE        0x00000000L
  297.  
  298.  
  299. /* here is where we pull in the MIDL generated headers for the interfaces */
  300. typedef interface    IRpcStubBuffer     IRpcStubBuffer;
  301. typedef interface    IRpcChannelBuffer  IRpcChannelBuffer;
  302.  
  303. #include <wtypes.h>
  304. #include <unknwn.h>
  305. #include <objidl.h>
  306.  
  307.  
  308. // macros to define byte pattern for a GUID.
  309. //      Example: DEFINE_GUID(GUID_XXX, a, b, c, ...);
  310. //
  311. // Each dll/exe must initialize the GUIDs once.  This is done in one of
  312. // two ways.  If you are not using precompiled headers for the file(s) which
  313. // initializes the GUIDs, define INITGUID before including objbase.h.  This
  314. // is how OLE builds the initialized versions of the GUIDs which are included
  315. // in ole2.lib.  The GUIDs in ole2.lib are all defined in the same text
  316. // segment GUID_TEXT.
  317. //
  318. // The alternative (which some versions of the compiler don't handle properly;
  319. // they wind up with the initialized GUIDs in a data, not a text segment),
  320. // is to use a precompiled version of objbase.h and then include initguid.h
  321. // after objbase.h followed by one or more of the guid defintion files.
  322.  
  323. #ifndef INITGUID
  324. #define DEFINE_GUID(name, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8) \
  325.     EXTERN_C const GUID CDECL FAR name
  326. #else
  327.  
  328. #define DEFINE_GUID(name, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8) \
  329.         EXTERN_C const GUID CDECL name \
  330.                 = { l, w1, w2, { b1, b2,  b3,  b4,  b5,  b6,  b7,  b8 } }
  331. #endif // INITGUID
  332.  
  333. #define DEFINE_OLEGUID(name, l, w1, w2) \
  334.     DEFINE_GUID(name, l, w1, w2, 0xC0,0,0,0,0,0,0,0x46)
  335.  
  336. #ifdef __cplusplus
  337. inline BOOL IsEqualGUID(REFGUID rguid1, REFGUID rguid2)
  338. {
  339.     return !memcmp(&rguid1, &rguid2, sizeof(GUID));
  340. }
  341. #else   //  ! __cplusplus
  342. #define IsEqualGUID(rguid1, rguid2) (!memcmp(rguid1, rguid2, sizeof(GUID)))
  343. #endif  //  __cplusplus
  344.  
  345. #define IsEqualIID(riid1, riid2) IsEqualGUID(riid1, riid2)
  346. #define IsEqualCLSID(rclsid1, rclsid2) IsEqualGUID(rclsid1, rclsid2)
  347.  
  348. #ifdef __cplusplus
  349.  
  350. // because GUID is defined elsewhere in WIN32 land, the operator == and !=
  351. // are moved outside the class to global scope.
  352.  
  353. inline BOOL operator==(const GUID& guidOne, const GUID& guidOther)
  354. {
  355. #ifdef _WIN32
  356.     return !memcmp(&guidOne,&guidOther,sizeof(GUID));
  357. #else
  358.     return !_fmemcmp(&guidOne,&guidOther,sizeof(GUID)); }
  359. #endif
  360. }
  361.  
  362. inline BOOL operator!=(const GUID& guidOne, const GUID& guidOther)
  363. {
  364.     return !(guidOne == guidOther);
  365. }
  366.  
  367. #endif // __cpluscplus
  368.  
  369.  
  370. #ifndef INITGUID
  371. #include <cguid.h>
  372. #endif
  373.  
  374.  
  375.  
  376. /****** STD Object API Prototypes *****************************************/
  377.  
  378. WINOLEAPI_(DWORD) CoBuildVersion( VOID );
  379.  
  380. /* init/uninit */
  381.  
  382. WINOLEAPI  CoInitialize(LPVOID pvReserved);
  383. WINOLEAPI_(void)  CoUninitialize(void);
  384. WINOLEAPI  CoGetMalloc(DWORD dwMemContext, LPMALLOC FAR* ppMalloc);
  385. WINOLEAPI_(DWORD) CoGetCurrentProcess(void);
  386. WINOLEAPI  CoRegisterMallocSpy(LPMALLOCSPY pMallocSpy);
  387. WINOLEAPI  CoRevokeMallocSpy(void);
  388. WINOLEAPI  CoCreateStandardMalloc(DWORD memctx, IMalloc FAR* FAR* ppMalloc);
  389.  
  390. #if DBG == 1
  391. WINOLEAPI_(ULONG) DebugCoGetRpcFault( void );
  392. WINOLEAPI_(void) DebugCoSetRpcFault( ULONG );
  393. #endif
  394.  
  395. /* register/revoke/get class objects */
  396.  
  397. WINOLEAPI  CoGetClassObject(REFCLSID rclsid, DWORD dwClsContext, LPVOID pvReserved,
  398.                     REFIID riid, LPVOID FAR* ppv);
  399. WINOLEAPI  CoRegisterClassObject(REFCLSID rclsid, LPUNKNOWN pUnk,
  400.                     DWORD dwClsContext, DWORD flags, LPDWORD lpdwRegister);
  401. WINOLEAPI  CoRevokeClassObject(DWORD dwRegister);
  402.  
  403.  
  404. /* marshaling interface pointers */
  405.  
  406. WINOLEAPI CoGetMarshalSizeMax(ULONG *pulSize, REFIID riid, LPUNKNOWN pUnk,
  407.                     DWORD dwDestContext, LPVOID pvDestContext, DWORD mshlflags);
  408. WINOLEAPI CoMarshalInterface(LPSTREAM pStm, REFIID riid, LPUNKNOWN pUnk,
  409.                     DWORD dwDestContext, LPVOID pvDestContext, DWORD mshlflags);
  410. WINOLEAPI CoUnmarshalInterface(LPSTREAM pStm, REFIID riid, LPVOID FAR* ppv);
  411. WINOLEAPI CoMarshalHresult(LPSTREAM pstm, HRESULT hresult);
  412. WINOLEAPI CoUnmarshalHresult(LPSTREAM pstm, HRESULT FAR * phresult);
  413. WINOLEAPI CoReleaseMarshalData(LPSTREAM pStm);
  414. WINOLEAPI CoDisconnectObject(LPUNKNOWN pUnk, DWORD dwReserved);
  415. WINOLEAPI CoLockObjectExternal(LPUNKNOWN pUnk, BOOL fLock, BOOL fLastUnlockReleases);
  416. WINOLEAPI CoGetStandardMarshal(REFIID riid, LPUNKNOWN pUnk,
  417.                     DWORD dwDestContext, LPVOID pvDestContext, DWORD mshlflags,
  418.                     LPMARSHAL FAR* ppMarshal);
  419.  
  420. WINOLEAPI_(BOOL) CoIsHandlerConnected(LPUNKNOWN pUnk);
  421. WINOLEAPI_(BOOL) CoHasStrongExternalConnections(LPUNKNOWN pUnk);
  422.  
  423. // Apartment model inter-thread interface passing helpers
  424. WINOLEAPI CoMarshalInterThreadInterfaceInStream(REFIID riid, LPUNKNOWN pUnk,
  425.                     LPSTREAM *ppStm);
  426.  
  427. WINOLEAPI CoGetInterfaceAndReleaseStream(LPSTREAM pStm, REFIID iid,
  428.                     LPVOID FAR* ppv);
  429.  
  430. WINOLEAPI CoCreateFreeThreadedMarshaler(LPUNKNOWN  punkOuter,
  431.                     LPUNKNOWN *ppunkMarshal);
  432.  
  433. /* dll loading helpers; keeps track of ref counts and unloads all on exit */
  434.  
  435. WINOLEAPI_(HINSTANCE) CoLoadLibrary(LPOLESTR lpszLibName, BOOL bAutoFree);
  436. WINOLEAPI_(void) CoFreeLibrary(HINSTANCE hInst);
  437. WINOLEAPI_(void) CoFreeAllLibraries(void);
  438. WINOLEAPI_(void) CoFreeUnusedLibraries(void);
  439.  
  440.  
  441. /* helper for creating instances */
  442.  
  443. WINOLEAPI CoCreateInstance(REFCLSID rclsid, LPUNKNOWN pUnkOuter,
  444.                     DWORD dwClsContext, REFIID riid, LPVOID FAR* ppv);
  445.  
  446.  
  447. /* other helpers */
  448.  
  449. WINOLEAPI StringFromCLSID(REFCLSID rclsid, LPOLESTR FAR* lplpsz);
  450. WINOLEAPI CLSIDFromString(LPOLESTR lpsz, LPCLSID pclsid);
  451. WINOLEAPI StringFromIID(REFIID rclsid, LPOLESTR FAR* lplpsz);
  452. WINOLEAPI IIDFromString(LPOLESTR lpsz, LPIID lpiid);
  453. WINOLEAPI_(BOOL) CoIsOle1Class(REFCLSID rclsid);
  454. WINOLEAPI ProgIDFromCLSID (REFCLSID clsid, LPOLESTR FAR* lplpszProgID);
  455. WINOLEAPI CLSIDFromProgID (LPCOLESTR lpszProgID, LPCLSID lpclsid);
  456. WINOLEAPI_(int) StringFromGUID2(REFGUID rguid, LPOLESTR lpsz, int cbMax);
  457.  
  458. WINOLEAPI CoCreateGuid(GUID FAR *pguid);
  459.  
  460. WINOLEAPI_(BOOL) CoFileTimeToDosDateTime(
  461.                  FILETIME FAR* lpFileTime, LPWORD lpDosDate, LPWORD lpDosTime);
  462. WINOLEAPI_(BOOL) CoDosDateTimeToFileTime(
  463.                        WORD nDosDate, WORD nDosTime, FILETIME FAR* lpFileTime);
  464. WINOLEAPI  CoFileTimeNow( FILETIME FAR* lpFileTime );
  465.  
  466.  
  467. WINOLEAPI CoRegisterMessageFilter( LPMESSAGEFILTER lpMessageFilter,
  468.                                 LPMESSAGEFILTER FAR* lplpMessageFilter );
  469.  
  470.  
  471. /* TreatAs APIS */
  472.  
  473. WINOLEAPI CoGetTreatAsClass(REFCLSID clsidOld, LPCLSID pClsidNew);
  474. WINOLEAPI CoTreatAsClass(REFCLSID clsidOld, REFCLSID clsidNew);
  475.  
  476.  
  477. /* the server dlls must define their DllGetClassObject and DllCanUnloadNow
  478.  * to match these; the typedefs are located here to ensure all are changed at
  479.  * the same time.
  480.  */
  481.  
  482. #ifdef _MAC
  483. typedef STDAPICALLTYPE HRESULT (* LPFNGETCLASSOBJECT) (REFCLSID, REFIID, LPVOID *);
  484. #else
  485. typedef HRESULT (STDAPICALLTYPE * LPFNGETCLASSOBJECT) (REFCLSID, REFIID, LPVOID *);
  486. #endif
  487.  
  488. #ifdef _MAC
  489. typedef STDAPICALLTYPE HRESULT (* LPFNCANUNLOADNOW)(void);
  490. #else
  491. typedef HRESULT (STDAPICALLTYPE * LPFNCANUNLOADNOW)(void);
  492. #endif
  493.  
  494. STDAPI  DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID FAR* ppv);
  495.  
  496. STDAPI  DllCanUnloadNow(void);
  497.  
  498.  
  499. /****** Default Memory Allocation ******************************************/
  500. WINOLEAPI_(LPVOID) CoTaskMemAlloc(ULONG cb);
  501. WINOLEAPI_(LPVOID) CoTaskMemRealloc(LPVOID pv, ULONG cb);
  502. WINOLEAPI_(void)   CoTaskMemFree(LPVOID pv);
  503.  
  504. /****** DV APIs ***********************************************************/
  505.  
  506.  
  507. WINOLEAPI CreateDataAdviseHolder(LPDATAADVISEHOLDER FAR* ppDAHolder);
  508.  
  509. WINOLEAPI CreateDataCache(LPUNKNOWN pUnkOuter, REFCLSID rclsid,
  510.                                         REFIID iid, LPVOID FAR* ppv);
  511.  
  512.  
  513.  
  514.  
  515. /****** Storage API Prototypes ********************************************/
  516.  
  517.  
  518. WINOLEAPI StgCreateDocfile(const OLECHAR FAR* pwcsName,
  519.             DWORD grfMode,
  520.             DWORD reserved,
  521.             IStorage FAR * FAR *ppstgOpen);
  522.  
  523. WINOLEAPI StgCreateDocfileOnILockBytes(ILockBytes FAR *plkbyt,
  524.                     DWORD grfMode,
  525.                     DWORD reserved,
  526.                     IStorage FAR * FAR *ppstgOpen);
  527.  
  528. WINOLEAPI StgOpenStorage(const OLECHAR FAR* pwcsName,
  529.               IStorage FAR *pstgPriority,
  530.               DWORD grfMode,
  531.               SNB snbExclude,
  532.               DWORD reserved,
  533.               IStorage FAR * FAR *ppstgOpen);
  534. WINOLEAPI StgOpenStorageOnILockBytes(ILockBytes FAR *plkbyt,
  535.                   IStorage FAR *pstgPriority,
  536.                   DWORD grfMode,
  537.                   SNB snbExclude,
  538.                   DWORD reserved,
  539.                   IStorage FAR * FAR *ppstgOpen);
  540.  
  541. WINOLEAPI StgIsStorageFile(const OLECHAR FAR* pwcsName);
  542. WINOLEAPI StgIsStorageILockBytes(ILockBytes FAR* plkbyt);
  543.  
  544. WINOLEAPI StgSetTimes(OLECHAR const FAR* lpszName,
  545.                    FILETIME const FAR* pctime,
  546.                    FILETIME const FAR* patime,
  547.                    FILETIME const FAR* pmtime);
  548.  
  549.  
  550. //
  551. //  Moniker APIs
  552. //
  553.  
  554. WINOLEAPI  BindMoniker(LPMONIKER pmk, DWORD grfOpt, REFIID iidResult, LPVOID FAR* ppvResult);
  555. WINOLEAPI  MkParseDisplayName(LPBC pbc, LPCOLESTR szUserName,
  556.                 ULONG FAR * pchEaten, LPMONIKER FAR * ppmk);
  557. WINOLEAPI  MonikerRelativePathTo(LPMONIKER pmkSrc, LPMONIKER pmkDest, LPMONIKER
  558.                 FAR* ppmkRelPath, BOOL dwReserved);
  559. WINOLEAPI  MonikerCommonPrefixWith(LPMONIKER pmkThis, LPMONIKER pmkOther,
  560.                 LPMONIKER FAR* ppmkCommon);
  561. WINOLEAPI  CreateBindCtx(DWORD reserved, LPBC FAR* ppbc);
  562. WINOLEAPI  CreateGenericComposite(LPMONIKER pmkFirst, LPMONIKER pmkRest,
  563.     LPMONIKER FAR* ppmkComposite);
  564. WINOLEAPI  GetClassFile (LPCOLESTR szFilename, CLSID FAR* pclsid);
  565.  
  566. WINOLEAPI  CreateFileMoniker(LPCOLESTR lpszPathName, LPMONIKER FAR* ppmk);
  567.  
  568. WINOLEAPI  CreateItemMoniker(LPCOLESTR lpszDelim, LPCOLESTR lpszItem,
  569.     LPMONIKER FAR* ppmk);
  570. WINOLEAPI  CreateAntiMoniker(LPMONIKER FAR* ppmk);
  571. WINOLEAPI  CreatePointerMoniker(LPUNKNOWN punk, LPMONIKER FAR* ppmk);
  572.  
  573. WINOLEAPI  GetRunningObjectTable( DWORD reserved, LPRUNNINGOBJECTTABLE FAR* pprot);
  574.  
  575. #ifndef RC_INVOKED
  576. #include <poppack.h>
  577. #endif // RC_INVOKED
  578.  
  579. #endif     // __OBJBASE_H__
  580.