home *** CD-ROM | disk | FTP | other *** search
/ PC Format (South-Africa) 2001 May / PCFMay2001.iso / Xenon / C++ / FreeCommandLineTools.exe / Include / vsop.h < prev    next >
Encoding:
C/C++ Source or Header  |  2000-01-31  |  4.7 KB  |  165 lines

  1. //--vsop.h-----------------------------------------------------------------
  2. //
  3. // Header file for the property stream wrapper class.
  4. //
  5. // Copyright (C) Microsoft Corp., 1986-1996.  All rights reserved.
  6. //
  7. //-----------------------------------------------------------------------------
  8.  
  9. #ifndef _VSOP_H
  10. #pragma option push -b -a8 -pc -A- /*P_O_Push*/
  11. #define _VSOP_H
  12.  
  13. #ifdef __cplusplus
  14. extern "C" {
  15. #endif
  16.  
  17. //$--IEDKVirtualStreamOnProperty---------------------------------------------------------
  18. //
  19. // Buffers access to a property stream
  20. //
  21. //----------------------------------------------------------------------------
  22.  
  23. #undef         INTERFACE
  24. #define         INTERFACE  IEDKVirtualStreamOnProperty
  25.  
  26. DECLARE_INTERFACE_(IEDKVirtualStreamOnProperty, IUnknown)
  27. {
  28.     // Notes:  Order IS important.  The IEDKVirtualStreamOnProperty interface
  29.     // must have the same vtable order as the IStream interface.
  30.     //
  31.     // The Read(), Write(), CopyTo() and Commit() methods will return
  32.     // MAPI_E_* error codes if an attempt to access the underlying property
  33.     // fails.  Otherwise, the IStream methods will return IStream STG_E_* errors.
  34.      
  35. #ifndef NO_BASEINTERFACE_FUNCS
  36.  
  37.     /* IUnknown methods */
  38.  
  39.     STDMETHOD(QueryInterface)(
  40.         THIS_
  41.         REFIID riid,
  42.         LPVOID * ppvObj
  43.         )                                        PURE;
  44.  
  45.     STDMETHOD_(ULONG, AddRef)(
  46.         THIS
  47.         )                                        PURE;
  48.  
  49.     STDMETHOD_(ULONG, Release)(
  50.         THIS
  51.         )                                        PURE;
  52.  
  53. #endif
  54.  
  55.     // IEDKVirtualStreamOnProperty methods (same as IStream methods)
  56.  
  57.     STDMETHOD(Read)(
  58.         THIS_
  59.         IN LPVOID pv,       // output buffer pointer
  60.         IN ULONG cb,        // maximum # of bytes to read
  61.         OUT ULONG * pcb     // # of bytes read
  62.         )                                                    PURE;
  63.  
  64.     STDMETHOD(Write)(
  65.         THIS_
  66.         IN VOID const * pv, // data to write
  67.         IN ULONG cb,        // # bytes to write
  68.         OUT ULONG *pcb      // # bytes written
  69.         )                                                    PURE;
  70.  
  71.     STDMETHOD(Seek)(
  72.         THIS_
  73.         IN LARGE_INTEGER cbOffset,      // byte offset
  74.         IN DWORD dwOrigin,              // origin
  75.         OUT ULARGE_INTEGER * pcbPos     // new position
  76.         )                                                    PURE;
  77.  
  78.     STDMETHOD(SetSize)(
  79.         THIS_
  80.         IN ULARGE_INTEGER nSize     // new size
  81.         )                                                    PURE;
  82.  
  83.     STDMETHOD(CopyTo)(
  84.         THIS_
  85.         IN LPSTREAM pStrm,              // destination stream pointer
  86.         IN ULARGE_INTEGER cb,           // # bytes to copy
  87.         OUT ULARGE_INTEGER * pcbRead,   // # bytes read
  88.         OUT ULARGE_INTEGER * pcbWritten // # bytes written
  89.         )                                                    PURE;
  90.  
  91.     STDMETHOD(Commit)(
  92.         THIS_
  93.         IN DWORD dwFlags    // flags
  94.         )                                                    PURE;
  95.  
  96.     STDMETHOD(Revert)(
  97.         THIS
  98.         )                                                    PURE;
  99.  
  100.     STDMETHOD(LockRegion)(
  101.         THIS_
  102.         IN ULARGE_INTEGER cbOffset, // offset
  103.         IN ULARGE_INTEGER cbLength, // length
  104.         IN DWORD dwFlags            // flags
  105.         )                                                    PURE;
  106.  
  107.     STDMETHOD(UnlockRegion)(
  108.         THIS_
  109.         IN ULARGE_INTEGER cbOffset, // offset
  110.         IN ULARGE_INTEGER cbLength, // length
  111.         IN DWORD dwFlags            // flags
  112.         )                                                    PURE;
  113.  
  114.     STDMETHOD(Stat)(
  115.         THIS_
  116.         OUT STATSTG * pStatStg,     // stream statistic pointer
  117.         IN DWORD dwFlags            // flags
  118.         )                                                    PURE;
  119.  
  120.     STDMETHOD(Clone)(
  121.         THIS_
  122.         OUT LPSTREAM * ppStrm       // pointer to new stream
  123.         )                                                    PURE;
  124.  
  125. };
  126.  
  127. //$--PVIRTUALSTREAMONPROPERTY-----------------------------------------------------------
  128. //
  129. // Pointer to IEDKVirtualStreamOnProperty interface.
  130. //
  131. //----------------------------------------------------------------------------
  132.  
  133. typedef IEDKVirtualStreamOnProperty * PVIRTUALSTREAMONPROPERTY;
  134.  
  135. //$--HrOpenVirtualStreamOnProperty------------------------------------------
  136. //
  137. // DESCRIPTION:
  138. // API to open a buffered stream on a binary or string property
  139. // Callable from "C" or "C++"
  140. //
  141. // INPUT:    pPropObject    --    MAPI property object pointer
  142. //            ulPropTag    --    property tag to open stream on
  143. //            ulFlags        --    MAPI property flags (MAPI_MODIFY, MAPI_CREATE)
  144. //
  145. // OUTPUT:    ppVirtualStreamOnProperty    --     pointer to buffered stream on property
  146. //
  147. // RETURNS:    HRESULT    --    NOERROR if successful,
  148. //                        E_INVALIDARG if bad input,
  149. //                        E_OUTOFMEMORY if memory problems,
  150. //                        E_FAIL otherwise
  151. //
  152. //-----------------------------------------------------------------------------
  153. STDAPI HrOpenVirtualStreamOnProperty(
  154.     IN LPMAPIPROP pPropObject,    // MAPI property object pointer
  155.     IN ULONG ulPropTag,         // property tag to open virtual stream on
  156.     IN ULONG ulFlags,            // MAPI property flags
  157.     OUT PVIRTUALSTREAMONPROPERTY * ppVirtualStreamOnProperty);  // pointer buffered stream
  158.  
  159. #ifdef __cplusplus
  160. }
  161. #endif
  162.  
  163. #pragma option pop /*P_O_Pop*/
  164. #endif
  165.