home *** CD-ROM | disk | FTP | other *** search
/ OpenStep (Enterprise) / OpenStepENTCD.toast / OEDEV / DEV.Z / OBJBASE.H < prev    next >
Encoding:
C/C++ Source or Header  |  1996-09-08  |  21.0 KB  |  617 lines

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