Ignore:
Timestamp:
Sep 15, 2001, 11:32:00 AM (24 years ago)
Author:
sandervl
Message:

restored old version + wine update

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/ole32/datacache.c

    r6648 r6711  
    1 /* $Id: datacache.c,v 1.2 2001-09-05 13:17:08 bird Exp $ */
    21/*
    3  *  OLE 2 Data cache
     2 *      OLE 2 Data cache
    43 *
    54 *      Copyright 1999  Francis Beaudet
     
    1817 *  -  This implementation of the datacache will let your application
    1918 *     load documents that have embedded OLE objects in them and it will
    20  *     also retrieve the metafile representation of those objects.
     19 *     also retrieve the metafile representation of those objects. 
    2120 *  -  This implementation of the datacache will also allow your
    2221 *     application to save new documents with OLE objects in them.
    23  *  -  The main thing that it doesn't do is allow you to activate
     22 *  -  The main thing that it doesn't do is allow you to activate 
    2423 *     or modify the OLE objects in any way.
    2524 *  -  I haven't found any good documentation on the real usage of
     
    2827 *     "\002OlePresXXX". It appears to just be a counter.
    2928 *  -  Also, I don't know the real content of the presentation stream
    30  *     header. I was able to figure-out where the extent of the object
     29 *     header. I was able to figure-out where the extent of the object 
    3130 *     was stored and the aspect, but that's about it.
    3231 */
     
    6160typedef struct PresentationDataHeader
    6261{
    63   DWORD unknown1;   /* -1 */
    64   DWORD unknown2;   /* 3, possibly CF_METAFILEPICT */
    65   DWORD unknown3;   /* 4, possibly TYMED_ISTREAM */
     62  DWORD unknown1;       /* -1 */
     63  DWORD unknown2;       /* 3, possibly CF_METAFILEPICT */
     64  DWORD unknown3;       /* 4, possibly TYMED_ISTREAM */
    6665  DVASPECT dvAspect;
    67   DWORD unknown5;   /* -1 */
     66  DWORD unknown5;       /* -1 */
    6867
    6968  DWORD unknown6;
    70   DWORD unknown7;   /* 0 */
     69  DWORD unknown7;       /* 0 */
    7170  DWORD dwObjectExtentX;
    7271  DWORD dwObjectExtentY;
     
    8281   * List all interface VTables here
    8382   */
    84   ICOM_VTABLE(IDataObject)*      lpvtbl1;
     83  ICOM_VTABLE(IDataObject)*      lpvtbl1; 
    8584  ICOM_VTABLE(IUnknown)*         lpvtbl2;
    8685  ICOM_VTABLE(IPersistStorage)*  lpvtbl3;
    87   ICOM_VTABLE(IViewObject2)*     lpvtbl4;
     86  ICOM_VTABLE(IViewObject2)*     lpvtbl4; 
    8887  ICOM_VTABLE(IOleCache2)*       lpvtbl5;
    8988  ICOM_VTABLE(IOleCacheControl)* lpvtbl6;
     
    120119
    121120/*
    122  * Here, I define utility macros to help with the casting of the
     121 * Here, I define utility macros to help with the casting of the 
    123122 * "this" parameter.
    124123 * There is a version to accomodate all of the VTables implemented
     
    126125 */
    127126#define _ICOM_THIS_From_IDataObject(class,name)       class* this = (class*)name;
    128 #define _ICOM_THIS_From_NDIUnknown(class, name)       class* this = (class*)(((char*)name)-sizeof(void*));
    129 #define _ICOM_THIS_From_IPersistStorage(class, name)  class* this = (class*)(((char*)name)-2*sizeof(void*));
    130 #define _ICOM_THIS_From_IViewObject2(class, name)     class* this = (class*)(((char*)name)-3*sizeof(void*));
    131 #define _ICOM_THIS_From_IOleCache2(class, name)       class* this = (class*)(((char*)name)-4*sizeof(void*));
    132 #define _ICOM_THIS_From_IOleCacheControl(class, name) class* this = (class*)(((char*)name)-5*sizeof(void*));
     127#define _ICOM_THIS_From_NDIUnknown(class, name)       class* this = (class*)(((char*)name)-sizeof(void*)); 
     128#define _ICOM_THIS_From_IPersistStorage(class, name)  class* this = (class*)(((char*)name)-2*sizeof(void*)); 
     129#define _ICOM_THIS_From_IViewObject2(class, name)     class* this = (class*)(((char*)name)-3*sizeof(void*)); 
     130#define _ICOM_THIS_From_IOleCache2(class, name)       class* this = (class*)(((char*)name)-4*sizeof(void*)); 
     131#define _ICOM_THIS_From_IOleCacheControl(class, name) class* this = (class*)(((char*)name)-5*sizeof(void*)); 
    133132
    134133/*
     
    136135 */
    137136static DataCache* DataCache_Construct(REFCLSID  clsid,
    138                       LPUNKNOWN pUnkOuter);
     137                                      LPUNKNOWN pUnkOuter);
    139138static void       DataCache_Destroy(DataCache* ptrToDestroy);
    140139static HRESULT    DataCache_ReadPresentationData(DataCache*              this,
    141                         DWORD                   drawAspect,
    142                         PresentationDataHeader* header);
     140                                                DWORD                   drawAspect,
     141                                                PresentationDataHeader* header);
    143142static HRESULT    DataCache_OpenPresStream(DataCache *this,
    144                        DWORD      drawAspect,
    145                        IStream  **pStm);
     143                                           DWORD      drawAspect,
     144                                           IStream  **pStm);
    146145static HMETAFILE  DataCache_ReadPresMetafile(DataCache* this,
    147                          DWORD      drawAspect);
     146                                             DWORD      drawAspect);
    148147static void       DataCache_FireOnViewChange(DataCache* this,
    149                          DWORD      aspect,
    150                          LONG       lindex);
     148                                             DWORD      aspect,
     149                                             LONG       lindex);
    151150
    152151/*
     
    158157            REFIID         riid,
    159158            void**         ppvObject);
    160 static ULONG WINAPI DataCache_NDIUnknown_AddRef(
     159static ULONG WINAPI DataCache_NDIUnknown_AddRef( 
    161160            IUnknown*      iface);
    162 static ULONG WINAPI DataCache_NDIUnknown_Release(
     161static ULONG WINAPI DataCache_NDIUnknown_Release( 
    163162            IUnknown*      iface);
    164163
     
    171170            REFIID           riid,
    172171            void**           ppvObject);
    173 static ULONG WINAPI DataCache_IDataObject_AddRef(
     172static ULONG WINAPI DataCache_IDataObject_AddRef( 
    174173            IDataObject*     iface);
    175 static ULONG WINAPI DataCache_IDataObject_Release(
     174static ULONG WINAPI DataCache_IDataObject_Release( 
    176175            IDataObject*     iface);
    177176static HRESULT WINAPI DataCache_GetData(
    178         IDataObject*     iface,
    179         LPFORMATETC      pformatetcIn,
    180         STGMEDIUM*       pmedium);
     177            IDataObject*     iface,
     178            LPFORMATETC      pformatetcIn,
     179            STGMEDIUM*       pmedium);
    181180static HRESULT WINAPI DataCache_GetDataHere(
    182         IDataObject*     iface,
    183         LPFORMATETC      pformatetc,
    184         STGMEDIUM*       pmedium);
     181            IDataObject*     iface,
     182            LPFORMATETC      pformatetc,
     183            STGMEDIUM*       pmedium);
    185184static HRESULT WINAPI DataCache_QueryGetData(
    186         IDataObject*     iface,
    187         LPFORMATETC      pformatetc);
     185            IDataObject*     iface,
     186            LPFORMATETC      pformatetc);
    188187static HRESULT WINAPI DataCache_GetCanonicalFormatEtc(
    189         IDataObject*     iface,
    190         LPFORMATETC      pformatectIn,
    191         LPFORMATETC      pformatetcOut);
     188            IDataObject*     iface,
     189            LPFORMATETC      pformatectIn,
     190            LPFORMATETC      pformatetcOut);
    192191static HRESULT WINAPI DataCache_IDataObject_SetData(
    193         IDataObject*     iface,
    194         LPFORMATETC      pformatetc,
    195         STGMEDIUM*       pmedium,
    196         BOOL             fRelease);
     192            IDataObject*     iface,
     193            LPFORMATETC      pformatetc,
     194            STGMEDIUM*       pmedium,
     195            BOOL             fRelease);
    197196static HRESULT WINAPI DataCache_EnumFormatEtc(
    198         IDataObject*     iface,
    199         DWORD            dwDirection,
    200         IEnumFORMATETC** ppenumFormatEtc);
     197            IDataObject*     iface,       
     198            DWORD            dwDirection,
     199            IEnumFORMATETC** ppenumFormatEtc);
    201200static HRESULT WINAPI DataCache_DAdvise(
    202         IDataObject*     iface,
    203         FORMATETC*       pformatetc,
    204         DWORD            advf,
    205         IAdviseSink*     pAdvSink,
    206         DWORD*           pdwConnection);
     201            IDataObject*     iface,
     202            FORMATETC*       pformatetc,
     203            DWORD            advf,
     204            IAdviseSink*     pAdvSink,
     205            DWORD*           pdwConnection);
    207206static HRESULT WINAPI DataCache_DUnadvise(
    208         IDataObject*     iface,
    209         DWORD            dwConnection);
     207            IDataObject*     iface,
     208            DWORD            dwConnection);
    210209static HRESULT WINAPI DataCache_EnumDAdvise(
    211         IDataObject*     iface,
    212         IEnumSTATDATA**  ppenumAdvise);
     210            IDataObject*     iface,
     211            IEnumSTATDATA**  ppenumAdvise);
    213212
    214213/*
     
    220219            REFIID           riid,
    221220            void**           ppvObject);
    222 static ULONG WINAPI DataCache_IPersistStorage_AddRef(
     221static ULONG WINAPI DataCache_IPersistStorage_AddRef( 
    223222            IPersistStorage* iface);
    224 static ULONG WINAPI DataCache_IPersistStorage_Release(
     223static ULONG WINAPI DataCache_IPersistStorage_Release( 
    225224            IPersistStorage* iface);
    226 static HRESULT WINAPI DataCache_GetClassID(
     225static HRESULT WINAPI DataCache_GetClassID( 
    227226            IPersistStorage* iface,
    228         CLSID*           pClassID);
    229 static HRESULT WINAPI DataCache_IsDirty(
     227            CLSID*           pClassID);
     228static HRESULT WINAPI DataCache_IsDirty( 
    230229            IPersistStorage* iface);
    231 static HRESULT WINAPI DataCache_InitNew(
     230static HRESULT WINAPI DataCache_InitNew(
     231            IPersistStorage* iface,
     232            IStorage*        pStg);
     233static HRESULT WINAPI DataCache_Load(
    232234            IPersistStorage* iface,
    233         IStorage*        pStg);
    234 static HRESULT WINAPI DataCache_Load(
     235            IStorage*        pStg);
     236static HRESULT WINAPI DataCache_Save(
    235237            IPersistStorage* iface,
    236         IStorage*        pStg);
    237 static HRESULT WINAPI DataCache_Save(
    238             IPersistStorage* iface,
    239         IStorage*        pStg,
    240         BOOL             fSameAsLoad);
    241 static HRESULT WINAPI DataCache_SaveCompleted(
    242             IPersistStorage* iface,
    243         IStorage*        pStgNew);
     238            IStorage*        pStg,
     239            BOOL             fSameAsLoad);
     240static HRESULT WINAPI DataCache_SaveCompleted(
     241            IPersistStorage* iface, 
     242            IStorage*        pStgNew);
    244243static HRESULT WINAPI DataCache_HandsOffStorage(
    245244            IPersistStorage* iface);
     
    253252            REFIID           riid,
    254253            void**           ppvObject);
    255 static ULONG WINAPI DataCache_IViewObject2_AddRef(
     254static ULONG WINAPI DataCache_IViewObject2_AddRef( 
    256255            IViewObject2* iface);
    257 static ULONG WINAPI DataCache_IViewObject2_Release(
     256static ULONG WINAPI DataCache_IViewObject2_Release( 
    258257            IViewObject2* iface);
    259258static HRESULT WINAPI DataCache_Draw(
    260259            IViewObject2*    iface,
    261         DWORD            dwDrawAspect,
    262         LONG             lindex,
    263         void*            pvAspect,
    264         DVTARGETDEVICE*  ptd,
    265         HDC              hdcTargetDev,
    266         HDC              hdcDraw,
    267         LPCRECTL         lprcBounds,
    268         LPCRECTL         lprcWBounds,
    269         IVO_ContCallback pfnContinue,
    270         DWORD            dwContinue);
     260            DWORD            dwDrawAspect,
     261            LONG             lindex,
     262            void*            pvAspect,
     263            DVTARGETDEVICE*  ptd,
     264            HDC              hdcTargetDev,
     265            HDC              hdcDraw,
     266            LPCRECTL         lprcBounds,
     267            LPCRECTL         lprcWBounds,
     268            IVO_ContCallback pfnContinue,
     269            DWORD            dwContinue);
    271270static HRESULT WINAPI DataCache_GetColorSet(
    272             IViewObject2*   iface,
    273         DWORD           dwDrawAspect,
    274         LONG            lindex,
    275         void*           pvAspect,
    276         DVTARGETDEVICE* ptd,
    277         HDC             hicTargetDevice,
    278         LOGPALETTE**    ppColorSet);
     271            IViewObject2*   iface, 
     272            DWORD           dwDrawAspect,
     273            LONG            lindex,
     274            void*           pvAspect,
     275            DVTARGETDEVICE* ptd,
     276            HDC             hicTargetDevice,
     277            LOGPALETTE**    ppColorSet);
    279278static HRESULT WINAPI DataCache_Freeze(
    280279            IViewObject2*   iface,
    281         DWORD           dwDrawAspect,
    282         LONG            lindex,
    283         void*           pvAspect,
    284         DWORD*          pdwFreeze);
     280            DWORD           dwDrawAspect,
     281            LONG            lindex,
     282            void*           pvAspect,
     283            DWORD*          pdwFreeze);
    285284static HRESULT WINAPI DataCache_Unfreeze(
    286285            IViewObject2*   iface,
    287         DWORD           dwFreeze);
     286            DWORD           dwFreeze);
    288287static HRESULT WINAPI DataCache_SetAdvise(
    289288            IViewObject2*   iface,
    290         DWORD           aspects,
    291         DWORD           advf,
    292         IAdviseSink*    pAdvSink);
     289            DWORD           aspects,
     290            DWORD           advf,
     291            IAdviseSink*    pAdvSink);
    293292static HRESULT WINAPI DataCache_GetAdvise(
    294             IViewObject2*   iface,
    295         DWORD*          pAspects,
    296         DWORD*          pAdvf,
    297         IAdviseSink**   ppAdvSink);
     293            IViewObject2*   iface, 
     294            DWORD*          pAspects,
     295            DWORD*          pAdvf,
     296            IAdviseSink**   ppAdvSink);
    298297static HRESULT WINAPI DataCache_GetExtent(
    299             IViewObject2*   iface,
    300         DWORD           dwDrawAspect,
    301         LONG            lindex,
    302         DVTARGETDEVICE* ptd,
    303         LPSIZEL         lpsizel);
     298            IViewObject2*   iface, 
     299            DWORD           dwDrawAspect,
     300            LONG            lindex,
     301            DVTARGETDEVICE* ptd,
     302            LPSIZEL         lpsizel);
    304303
    305304/*
     
    311310            REFIID          riid,
    312311            void**          ppvObject);
    313 static ULONG WINAPI DataCache_IOleCache2_AddRef(
     312static ULONG WINAPI DataCache_IOleCache2_AddRef( 
    314313            IOleCache2*     iface);
    315 static ULONG WINAPI DataCache_IOleCache2_Release(
     314static ULONG WINAPI DataCache_IOleCache2_Release( 
    316315            IOleCache2*     iface);
    317316static HRESULT WINAPI DataCache_Cache(
    318317            IOleCache2*     iface,
    319         FORMATETC*      pformatetc,
    320         DWORD           advf,
    321         DWORD*          pdwConnection);
     318            FORMATETC*      pformatetc,
     319            DWORD           advf,
     320            DWORD*          pdwConnection);
    322321static HRESULT WINAPI DataCache_Uncache(
    323         IOleCache2*     iface,
    324         DWORD           dwConnection);
     322            IOleCache2*     iface,
     323            DWORD           dwConnection);
    325324static HRESULT WINAPI DataCache_EnumCache(
    326325            IOleCache2*     iface,
    327         IEnumSTATDATA** ppenumSTATDATA);
     326            IEnumSTATDATA** ppenumSTATDATA);
    328327static HRESULT WINAPI DataCache_InitCache(
    329         IOleCache2*     iface,
    330         IDataObject*    pDataObject);
     328            IOleCache2*     iface,
     329            IDataObject*    pDataObject);
    331330static HRESULT WINAPI DataCache_IOleCache2_SetData(
    332331            IOleCache2*     iface,
    333         FORMATETC*      pformatetc,
    334         STGMEDIUM*      pmedium,
    335         BOOL            fRelease);
     332            FORMATETC*      pformatetc,
     333            STGMEDIUM*      pmedium,
     334            BOOL            fRelease);
    336335static HRESULT WINAPI DataCache_UpdateCache(
    337336            IOleCache2*     iface,
    338         LPDATAOBJECT    pDataObject,
    339         DWORD           grfUpdf,
    340         LPVOID          pReserved);
     337            LPDATAOBJECT    pDataObject,
     338            DWORD           grfUpdf,
     339            LPVOID          pReserved);
    341340static HRESULT WINAPI DataCache_DiscardCache(
    342341            IOleCache2*     iface,
    343         DWORD           dwDiscardOptions);
     342            DWORD           dwDiscardOptions);
    344343
    345344/*
     
    351350            REFIID            riid,
    352351            void**            ppvObject);
    353 static ULONG WINAPI DataCache_IOleCacheControl_AddRef(
     352static ULONG WINAPI DataCache_IOleCacheControl_AddRef( 
    354353            IOleCacheControl* iface);
    355 static ULONG WINAPI DataCache_IOleCacheControl_Release(
     354static ULONG WINAPI DataCache_IOleCacheControl_Release( 
    356355            IOleCacheControl* iface);
    357356static HRESULT WINAPI DataCache_OnRun(
    358         IOleCacheControl* iface,
    359         LPDATAOBJECT      pDataObject);
     357            IOleCacheControl* iface,
     358            LPDATAOBJECT      pDataObject);
    360359static HRESULT WINAPI DataCache_OnStop(
    361         IOleCacheControl* iface);
     360            IOleCacheControl* iface);
    362361
    363362/*
     
    448447 */
    449448HRESULT WINAPI CreateDataCache(
    450   LPUNKNOWN pUnkOuter,
    451   REFCLSID  rclsid,
    452   REFIID    riid,
     449  LPUNKNOWN pUnkOuter, 
     450  REFCLSID  rclsid, 
     451  REFIID    riid, 
    453452  LPVOID*   ppvObj)
    454453{
     
    472471   * IUnknown pointer can be returned to the outside.
    473472   */
    474   if ( (pUnkOuter!=NULL) &&
     473  if ( (pUnkOuter!=NULL) && 
    475474       (memcmp(&IID_IUnknown, riid, sizeof(IID_IUnknown)) != 0) )
    476475    return CLASS_E_NOAGGREGATION;
     
    479478   * Try to construct a new instance of the class.
    480479   */
    481   newCache = DataCache_Construct(rclsid,
    482                 pUnkOuter);
     480  newCache = DataCache_Construct(rclsid, 
     481                                pUnkOuter);
    483482
    484483  if (newCache == 0)
     
    515514  if (newObject==0)
    516515    return newObject;
    517 
     516 
    518517  /*
    519518   * Initialize the virtual function table.
     
    525524  newObject->lpvtbl5 = &DataCache_IOleCache2_VTable;
    526525  newObject->lpvtbl6 = &DataCache_IOleCacheControl_VTable;
    527 
    528   /*
    529    * Start with one reference count. The caller of this function
     526 
     527  /*
     528   * Start with one reference count. The caller of this function 
    530529   * must release the interface pointer when it is done.
    531530   */
     
    534533  /*
    535534   * Initialize the outer unknown
    536    * We don't keep a reference on the outer unknown since, the way
     535   * We don't keep a reference on the outer unknown since, the way 
    537536   * aggregation works, our lifetime is at least as large as it's
    538537   * lifetime.
     
    580579 * DataCache_ReadPresentationData
    581580 *
    582  * This method will read information for the requested presentation
     581 * This method will read information for the requested presentation 
    583582 * into the given structure.
    584583 *
     
    602601  hres = DataCache_OpenPresStream(
    603602           this,
    604        drawAspect,
    605        &presStream);
     603           drawAspect,
     604           &presStream);
    606605
    607606  if (FAILED(hres))
     
    614613  hres = IStream_Read(
    615614           presStream,
    616        header,
    617        sizeof(PresentationDataHeader),
    618        NULL);
     615           header,
     616           sizeof(PresentationDataHeader),
     617           NULL);
    619618
    620619  /*
     
    658657    {
    659658      IAdviseSink_OnViewChange(this->sinkInterface,
    660                    aspect,
    661                    lindex);
     659                               aspect,
     660                               lindex);
    662661
    663662      /*
     
    667666      if ( (this->sinkAdviseFlag & ADVF_ONLYONCE) != 0)
    668667      {
    669     IAdviseSink_Release(this->sinkInterface);
    670 
    671     this->sinkInterface  = NULL;
    672     this->sinkAspects    = 0;
    673     this->sinkAdviseFlag = 0;
     668        IAdviseSink_Release(this->sinkInterface);
     669
     670        this->sinkInterface  = NULL;
     671        this->sinkAspects    = 0;
     672        this->sinkAdviseFlag = 0;
    674673      }
    675674    }
     
    687686
    688687    return (elem->type == STGTY_STREAM)
    689     && (elem->cbSize.s.LowPart >= sizeof(PresentationDataHeader))
    690     && (strlenW(name) == 11)
    691     && (strncmpW(name, OlePres, 8) == 0)
    692     && (name[8] >= '0') && (name[8] <= '9')
    693     && (name[9] >= '0') && (name[9] <= '9')
    694     && (name[10] >= '0') && (name[10] <= '9');
     688        && (elem->cbSize.s.LowPart >= sizeof(PresentationDataHeader))
     689        && (strlenW(name) == 11)
     690        && (strncmpW(name, OlePres, 8) == 0)
     691        && (name[8] >= '0') && (name[8] <= '9')
     692        && (name[9] >= '0') && (name[9] <= '9')
     693        && (name[10] >= '0') && (name[10] <= '9');
    695694}
    696695
     
    708707 *
    709708 * Errors:
    710  *   S_OK       The requested stream has been opened.
    711  *   OLE_E_BLANK    The requested stream could not be found.
     709 *   S_OK               The requested stream has been opened.
     710 *   OLE_E_BLANK        The requested stream could not be found.
    712711 *   Quite a few others I'm too lazy to map correctly.
    713712 *
    714713 * Notes:
    715  *   Algorithm: Scan the elements of the presentation storage, looking
    716  *      for presentation streams. For each presentation stream,
    717  *      load the header and check to see if the aspect maches.
     714 *   Algorithm: Scan the elements of the presentation storage, looking
     715 *              for presentation streams. For each presentation stream,
     716 *              load the header and check to see if the aspect maches.
    718717 *
    719718 *   If a fallback is desired, just opening the first presentation stream
     
    736735    while ((hr = IEnumSTATSTG_Next(pEnum, 1, &elem, NULL)) == S_OK)
    737736    {
    738     if (DataCache_IsPresentationStream(&elem))
    739     {
    740         IStream *pStm;
    741 
    742         hr = IStorage_OpenStream(this->presentationStorage, elem.pwcsName,
    743                      NULL, STGM_READ | STGM_SHARE_EXCLUSIVE, 0,
    744                      &pStm);
    745         if (SUCCEEDED(hr))
    746         {
    747         PresentationDataHeader header;
    748         ULONG actual_read;
    749 
    750         hr = IStream_Read(pStm, &header, sizeof(header), &actual_read);
    751 
    752         /* can't use SUCCEEDED(hr): S_FALSE counts as an error */
    753         if (hr == S_OK && actual_read == sizeof(header)
    754             && header.dvAspect == drawAspect)
    755         {
    756             /* Rewind the stream before returning it. */
    757             LARGE_INTEGER offset;
    758             offset.s.LowPart = 0;
    759             offset.s.HighPart = 0;
    760             IStream_Seek(pStm, offset, STREAM_SEEK_SET, NULL);
    761 
    762             *ppStm = pStm;
    763 
    764             CoTaskMemFree(elem.pwcsName);
    765             IEnumSTATSTG_Release(pEnum);
    766 
    767             return S_OK;
    768         }
    769 
    770         IStream_Release(pStm);
    771         }
     737        if (DataCache_IsPresentationStream(&elem))
     738        {
     739            IStream *pStm;
     740
     741            hr = IStorage_OpenStream(this->presentationStorage, elem.pwcsName,
     742                                     NULL, STGM_READ | STGM_SHARE_EXCLUSIVE, 0,
     743                                     &pStm);
     744            if (SUCCEEDED(hr))
     745            {
     746                PresentationDataHeader header;
     747                ULONG actual_read;
     748
     749                hr = IStream_Read(pStm, &header, sizeof(header), &actual_read);
     750
     751                /* can't use SUCCEEDED(hr): S_FALSE counts as an error */
     752                if (hr == S_OK && actual_read == sizeof(header)
     753                    && header.dvAspect == drawAspect)
     754                {
     755                    /* Rewind the stream before returning it. */
     756                    LARGE_INTEGER offset;
     757                    offset.s.LowPart = 0;
     758                    offset.s.HighPart = 0;
     759                    IStream_Seek(pStm, offset, STREAM_SEEK_SET, NULL);
     760
     761                    *ppStm = pStm;
     762
     763                    CoTaskMemFree(elem.pwcsName);
     764                    IEnumSTATSTG_Release(pEnum);
     765
     766                    return S_OK;
     767                }
     768
     769                IStream_Release(pStm);
     770            }
     771        }
     772
     773        CoTaskMemFree(elem.pwcsName);
    772774    }
    773775
    774     CoTaskMemFree(elem.pwcsName);
    775     }
    776 
    777776    IEnumSTATSTG_Release(pEnum);
    778777
     
    783782 * DataCache_ReadPresentationData
    784783 *
    785  * This method will read information for the requested presentation
     784 * This method will read information for the requested presentation 
    786785 * into the given structure.
    787786 *
     
    809808   */
    810809  hres = DataCache_OpenPresStream(
    811            this,
    812        drawAspect,
    813        &presStream);
     810           this, 
     811           drawAspect,
     812           &presStream);
    814813
    815814  if (FAILED(hres))
     
    820819   */
    821820  hres = IStream_Stat(presStream,
    822               &streamInfo,
    823               STATFLAG_NONAME);
     821                      &streamInfo,
     822                      STATFLAG_NONAME);
    824823
    825824  /*
     
    831830  hres = IStream_Seek(
    832831           presStream,
    833        offset,
    834        STREAM_SEEK_SET,
    835        NULL);
     832           offset,
     833           STREAM_SEEK_SET,
     834           NULL);
    836835
    837836  streamInfo.cbSize.s.LowPart -= offset.s.LowPart;
     
    840839   * Allocate a buffer for the metafile bits.
    841840   */
    842   metafileBits = HeapAlloc(GetProcessHeap(),
    843                0,
    844                streamInfo.cbSize.s.LowPart);
     841  metafileBits = HeapAlloc(GetProcessHeap(), 
     842                           0,
     843                           streamInfo.cbSize.s.LowPart);
    845844
    846845  /*
     
    848847   */
    849848  hres = IStream_Read(
    850        presStream,
    851        metafileBits,
    852        streamInfo.cbSize.s.LowPart,
    853        NULL);
     849           presStream,
     850           metafileBits,
     851           streamInfo.cbSize.s.LowPart,
     852           NULL);
    854853
    855854  /*
     
    898897  if ( (this==0) || (ppvObject==0) )
    899898    return E_INVALIDARG;
    900 
     899 
    901900  /*
    902901   * Initialize the return parameter.
     
    907906   * Compare the riid with the interface IDs implemented by this object.
    908907   */
    909   if (memcmp(&IID_IUnknown, riid, sizeof(IID_IUnknown)) == 0)
     908  if (memcmp(&IID_IUnknown, riid, sizeof(IID_IUnknown)) == 0) 
    910909  {
    911910    *ppvObject = iface;
    912911  }
    913   else if (memcmp(&IID_IDataObject, riid, sizeof(IID_IDataObject)) == 0)
     912  else if (memcmp(&IID_IDataObject, riid, sizeof(IID_IDataObject)) == 0) 
    914913  {
    915914    *ppvObject = (IDataObject*)&(this->lpvtbl1);
    916915  }
    917916  else if ( (memcmp(&IID_IPersistStorage, riid, sizeof(IID_IPersistStorage)) == 0)  ||
    918         (memcmp(&IID_IPersist, riid, sizeof(IID_IPersist)) == 0) )
     917            (memcmp(&IID_IPersist, riid, sizeof(IID_IPersist)) == 0) )
    919918  {
    920919    *ppvObject = (IPersistStorage*)&(this->lpvtbl3);
    921920  }
    922921  else if ( (memcmp(&IID_IViewObject, riid, sizeof(IID_IViewObject)) == 0) ||
    923         (memcmp(&IID_IViewObject2, riid, sizeof(IID_IViewObject2)) == 0) )
     922            (memcmp(&IID_IViewObject2, riid, sizeof(IID_IViewObject2)) == 0) )
    924923  {
    925924    *ppvObject = (IViewObject2*)&(this->lpvtbl4);
    926925  }
    927926  else if ( (memcmp(&IID_IOleCache, riid, sizeof(IID_IOleCache)) == 0) ||
    928         (memcmp(&IID_IOleCache2, riid, sizeof(IID_IOleCache2)) == 0) )
     927            (memcmp(&IID_IOleCache2, riid, sizeof(IID_IOleCache2)) == 0) )
    929928  {
    930929    *ppvObject = (IOleCache2*)&(this->lpvtbl5);
    931930  }
    932   else if (memcmp(&IID_IOleCacheControl, riid, sizeof(IID_IOleCacheControl)) == 0)
     931  else if (memcmp(&IID_IOleCacheControl, riid, sizeof(IID_IOleCacheControl)) == 0) 
    933932  {
    934933    *ppvObject = (IOleCacheControl*)&(this->lpvtbl6);
     
    943942    return E_NOINTERFACE;
    944943  }
    945 
     944 
    946945  /*
    947946   * Query Interface always increases the reference count by one when it is
    948    * successful.
     947   * successful. 
    949948   */
    950949  IUnknown_AddRef((IUnknown*)*ppvObject);
    951950
    952   return S_OK;;
     951  return S_OK;; 
    953952}
    954953
     
    961960 * to the outer unknown.
    962961 */
    963 static ULONG WINAPI DataCache_NDIUnknown_AddRef(
     962static ULONG WINAPI DataCache_NDIUnknown_AddRef( 
    964963            IUnknown*      iface)
    965964{
     
    979978 * to the outer unknown.
    980979 */
    981 static ULONG WINAPI DataCache_NDIUnknown_Release(
     980static ULONG WINAPI DataCache_NDIUnknown_Release( 
    982981            IUnknown*      iface)
    983982{
     
    998997    return 0;
    999998  }
    1000 
     999 
    10011000  return this->ref;
    10021001}
     
    10191018  _ICOM_THIS_From_IDataObject(DataCache, iface);
    10201019
    1021   return IUnknown_QueryInterface(this->outerUnknown, riid, ppvObject);
     1020  return IUnknown_QueryInterface(this->outerUnknown, riid, ppvObject); 
    10221021}
    10231022
     
    10271026 * See Windows documentation for more details on IUnknown methods.
    10281027 */
    1029 static ULONG WINAPI DataCache_IDataObject_AddRef(
     1028static ULONG WINAPI DataCache_IDataObject_AddRef( 
    10301029            IDataObject*     iface)
    10311030{
    10321031  _ICOM_THIS_From_IDataObject(DataCache, iface);
    10331032
    1034   return IUnknown_AddRef(this->outerUnknown);
     1033  return IUnknown_AddRef(this->outerUnknown); 
    10351034}
    10361035
     
    10401039 * See Windows documentation for more details on IUnknown methods.
    10411040 */
    1042 static ULONG WINAPI DataCache_IDataObject_Release(
     1041static ULONG WINAPI DataCache_IDataObject_Release( 
    10431042            IDataObject*     iface)
    10441043{
    10451044  _ICOM_THIS_From_IDataObject(DataCache, iface);
    10461045
    1047   return IUnknown_Release(this->outerUnknown);
     1046  return IUnknown_Release(this->outerUnknown); 
    10481047}
    10491048
     
    10561055 */
    10571056static HRESULT WINAPI DataCache_GetData(
    1058         IDataObject*     iface,
    1059         LPFORMATETC      pformatetcIn,
    1060         STGMEDIUM*       pmedium)
     1057            IDataObject*     iface,
     1058            LPFORMATETC      pformatetcIn,
     1059            STGMEDIUM*       pmedium)
    10611060{
    10621061  HRESULT hr = 0;
     
    11551154
    11561155static HRESULT WINAPI DataCache_GetDataHere(
    1157         IDataObject*     iface,
    1158         LPFORMATETC      pformatetc,
    1159         STGMEDIUM*       pmedium)
     1156            IDataObject*     iface,
     1157            LPFORMATETC      pformatetc,
     1158            STGMEDIUM*       pmedium)
    11601159{
    11611160  FIXME("stub\n");
     
    11641163
    11651164static HRESULT WINAPI DataCache_QueryGetData(
    1166         IDataObject*     iface,
    1167         LPFORMATETC      pformatetc)
     1165            IDataObject*     iface,
     1166            LPFORMATETC      pformatetc)
    11681167{
    11691168  FIXME("stub\n");
     
    11791178 */
    11801179static HRESULT WINAPI DataCache_GetCanonicalFormatEtc(
    1181         IDataObject*     iface,
    1182         LPFORMATETC      pformatectIn,
    1183         LPFORMATETC      pformatetcOut)
     1180            IDataObject*     iface,
     1181            LPFORMATETC      pformatectIn,
     1182            LPFORMATETC      pformatetcOut)
    11841183{
    11851184  TRACE("()\n");
     
    11951194 */
    11961195static HRESULT WINAPI DataCache_IDataObject_SetData(
    1197         IDataObject*     iface,
    1198         LPFORMATETC      pformatetc,
    1199         STGMEDIUM*       pmedium,
    1200         BOOL             fRelease)
     1196            IDataObject*     iface,
     1197            LPFORMATETC      pformatetc,
     1198            STGMEDIUM*       pmedium,
     1199            BOOL             fRelease)
    12011200{
    12021201  IOleCache2* oleCache = NULL;
     
    12251224 */
    12261225static HRESULT WINAPI DataCache_EnumFormatEtc(
    1227         IDataObject*     iface,
    1228         DWORD            dwDirection,
    1229         IEnumFORMATETC** ppenumFormatEtc)
     1226            IDataObject*     iface,       
     1227            DWORD            dwDirection,
     1228            IEnumFORMATETC** ppenumFormatEtc)
    12301229{
    12311230  TRACE("()\n");
     
    12411240 */
    12421241static HRESULT WINAPI DataCache_DAdvise(
    1243         IDataObject*     iface,
    1244         FORMATETC*       pformatetc,
    1245         DWORD            advf,
    1246         IAdviseSink*     pAdvSink,
    1247         DWORD*           pdwConnection)
     1242            IDataObject*     iface,
     1243            FORMATETC*       pformatetc,
     1244            DWORD            advf,
     1245            IAdviseSink*     pAdvSink,
     1246            DWORD*           pdwConnection)
    12481247{
    12491248  TRACE("()\n");
     
    12591258 */
    12601259static HRESULT WINAPI DataCache_DUnadvise(
    1261         IDataObject*     iface,
    1262         DWORD            dwConnection)
     1260            IDataObject*     iface,
     1261            DWORD            dwConnection)
    12631262{
    12641263  TRACE("()\n");
     
    12741273 */
    12751274static HRESULT WINAPI DataCache_EnumDAdvise(
    1276         IDataObject*     iface,
    1277         IEnumSTATDATA**  ppenumAdvise)
     1275            IDataObject*     iface,
     1276            IEnumSTATDATA**  ppenumAdvise)
    12781277{
    12791278  TRACE("()\n");
     
    12981297  _ICOM_THIS_From_IPersistStorage(DataCache, iface);
    12991298
    1300   return IUnknown_QueryInterface(this->outerUnknown, riid, ppvObject);
     1299  return IUnknown_QueryInterface(this->outerUnknown, riid, ppvObject); 
    13011300}
    13021301
     
    13061305 * See Windows documentation for more details on IUnknown methods.
    13071306 */
    1308 static ULONG WINAPI DataCache_IPersistStorage_AddRef(
     1307static ULONG WINAPI DataCache_IPersistStorage_AddRef( 
    13091308            IPersistStorage* iface)
    13101309{
    13111310  _ICOM_THIS_From_IPersistStorage(DataCache, iface);
    13121311
    1313   return IUnknown_AddRef(this->outerUnknown);
     1312  return IUnknown_AddRef(this->outerUnknown); 
    13141313}
    13151314
     
    13191318 * See Windows documentation for more details on IUnknown methods.
    13201319 */
    1321 static ULONG WINAPI DataCache_IPersistStorage_Release(
     1320static ULONG WINAPI DataCache_IPersistStorage_Release( 
    13221321            IPersistStorage* iface)
    13231322{
    13241323  _ICOM_THIS_From_IPersistStorage(DataCache, iface);
    13251324
    1326   return IUnknown_Release(this->outerUnknown);
     1325  return IUnknown_Release(this->outerUnknown); 
    13271326}
    13281327
     
    13341333 * See Windows documentation for more details on IPersistStorage methods.
    13351334 */
    1336 static HRESULT WINAPI DataCache_GetClassID(
     1335static HRESULT WINAPI DataCache_GetClassID( 
    13371336            IPersistStorage* iface,
    1338         CLSID*           pClassID)
     1337            CLSID*           pClassID)
    13391338{
    13401339  TRACE("(%p, %p)\n", iface, pClassID);
     
    13451344 * DataCache_IsDirty (IPersistStorage)
    13461345 *
    1347  * Until we actully connect to a running object and retrieve new
     1346 * Until we actully connect to a running object and retrieve new 
    13481347 * information to it, we never get dirty.
    13491348 *
    13501349 * See Windows documentation for more details on IPersistStorage methods.
    13511350 */
    1352 static HRESULT WINAPI DataCache_IsDirty(
     1351static HRESULT WINAPI DataCache_IsDirty( 
    13531352            IPersistStorage* iface)
    13541353{
     
    13661365 * See Windows documentation for more details on IPersistStorage methods.
    13671366 */
    1368 static HRESULT WINAPI DataCache_InitNew(
     1367static HRESULT WINAPI DataCache_InitNew(
     1368            IPersistStorage* iface,
     1369            IStorage*        pStg)
     1370{
     1371  TRACE("(%p, %p)\n", iface, pStg);
     1372
     1373  return DataCache_Load(iface, pStg);
     1374}
     1375
     1376/************************************************************************
     1377 * DataCache_Load (IPersistStorage)
     1378 *
     1379 * The data cache implementation of IPersistStorage_Load doesn't
     1380 * actually load anything. Instead, it holds on to the storage pointer
     1381 * and it will load the presentation information when the
     1382 * IDataObject_GetData or IViewObject2_Draw methods are called.
     1383 *
     1384 * See Windows documentation for more details on IPersistStorage methods.
     1385 */
     1386static HRESULT WINAPI DataCache_Load(
    13691387            IPersistStorage* iface,
    1370         IStorage*        pStg)
    1371 {
     1388            IStorage*        pStg)
     1389{
     1390  _ICOM_THIS_From_IPersistStorage(DataCache, iface);
     1391
    13721392  TRACE("(%p, %p)\n", iface, pStg);
    13731393
    1374   return DataCache_Load(iface, pStg);
    1375 }
    1376 
    1377 /************************************************************************
    1378  * DataCache_Load (IPersistStorage)
    1379  *
    1380  * The data cache implementation of IPersistStorage_Load doesn't
    1381  * actually load anything. Instead, it holds on to the storage pointer
    1382  * and it will load the presentation information when the
    1383  * IDataObject_GetData or IViewObject2_Draw methods are called.
    1384  *
    1385  * See Windows documentation for more details on IPersistStorage methods.
    1386  */
    1387 static HRESULT WINAPI DataCache_Load(
    1388             IPersistStorage* iface,
    1389         IStorage*        pStg)
    1390 {
    1391   _ICOM_THIS_From_IPersistStorage(DataCache, iface);
    1392 
    1393   TRACE("(%p, %p)\n", iface, pStg);
    1394 
    13951394  if (this->presentationStorage != NULL)
    13961395  {
     
    14101409 * DataCache_Save (IPersistStorage)
    14111410 *
    1412  * Until we actully connect to a running object and retrieve new
     1411 * Until we actully connect to a running object and retrieve new 
    14131412 * information to it, we never have to save anything. However, it is
    14141413 * our responsability to copy the information when saving to a new
     
    14171416 * See Windows documentation for more details on IPersistStorage methods.
    14181417 */
    1419 static HRESULT WINAPI DataCache_Save(
     1418static HRESULT WINAPI DataCache_Save( 
    14201419            IPersistStorage* iface,
    1421         IStorage*        pStg,
    1422         BOOL             fSameAsLoad)
     1420            IStorage*        pStg,
     1421            BOOL             fSameAsLoad)
    14231422{
    14241423  _ICOM_THIS_From_IPersistStorage(DataCache, iface);
     
    14261425  TRACE("(%p, %p, %d)\n", iface, pStg, fSameAsLoad);
    14271426
    1428   if ( (!fSameAsLoad) &&
     1427  if ( (!fSameAsLoad) && 
    14291428       (this->presentationStorage!=NULL) )
    14301429  {
    14311430    return IStorage_CopyTo(this->presentationStorage,
    1432                0,
    1433                NULL,
    1434                NULL,
    1435                pStg);
     1431                           0,
     1432                           NULL,
     1433                           NULL,
     1434                           pStg);
    14361435  }
    14371436
     
    14471446 * See Windows documentation for more details on IPersistStorage methods.
    14481447 */
    1449 static HRESULT WINAPI DataCache_SaveCompleted(
    1450             IPersistStorage* iface,
    1451         IStorage*        pStgNew)
     1448static HRESULT WINAPI DataCache_SaveCompleted( 
     1449            IPersistStorage* iface, 
     1450            IStorage*        pStgNew)
    14521451{
    14531452  TRACE("(%p, %p)\n", iface, pStgNew);
     
    15121511  _ICOM_THIS_From_IViewObject2(DataCache, iface);
    15131512
    1514   return IUnknown_QueryInterface(this->outerUnknown, riid, ppvObject);
     1513  return IUnknown_QueryInterface(this->outerUnknown, riid, ppvObject); 
    15151514}
    15161515
     
    15201519 * See Windows documentation for more details on IUnknown methods.
    15211520 */
    1522 static ULONG WINAPI DataCache_IViewObject2_AddRef(
     1521static ULONG WINAPI DataCache_IViewObject2_AddRef( 
    15231522            IViewObject2* iface)
    15241523{
    15251524  _ICOM_THIS_From_IViewObject2(DataCache, iface);
    15261525
    1527   return IUnknown_AddRef(this->outerUnknown);
     1526  return IUnknown_AddRef(this->outerUnknown); 
    15281527}
    15291528
     
    15331532 * See Windows documentation for more details on IUnknown methods.
    15341533 */
    1535 static ULONG WINAPI DataCache_IViewObject2_Release(
     1534static ULONG WINAPI DataCache_IViewObject2_Release( 
    15361535            IViewObject2* iface)
    15371536{
    15381537  _ICOM_THIS_From_IViewObject2(DataCache, iface);
    15391538
    1540   return IUnknown_Release(this->outerUnknown);
     1539  return IUnknown_Release(this->outerUnknown); 
    15411540}
    15421541
     
    15511550static HRESULT WINAPI DataCache_Draw(
    15521551            IViewObject2*    iface,
    1553         DWORD            dwDrawAspect,
    1554         LONG             lindex,
    1555         void*            pvAspect,
    1556         DVTARGETDEVICE*  ptd,
    1557         HDC              hdcTargetDev,
    1558         HDC              hdcDraw,
    1559         LPCRECTL         lprcBounds,
    1560         LPCRECTL         lprcWBounds,
    1561         IVO_ContCallback pfnContinue,
    1562         DWORD            dwContinue)
     1552            DWORD            dwDrawAspect,
     1553            LONG             lindex,
     1554            void*            pvAspect,
     1555            DVTARGETDEVICE*  ptd,
     1556            HDC              hdcTargetDev,
     1557            HDC              hdcDraw,
     1558            LPCRECTL         lprcBounds,
     1559            LPCRECTL         lprcWBounds,
     1560            IVO_ContCallback pfnContinue,
     1561            DWORD            dwContinue)
    15631562{
    15641563  PresentationDataHeader presData;
     
    15691568
    15701569  TRACE("(%p, %lx, %ld, %p, %x, %x, %p, %p, %p, %lx)\n",
    1571     iface,
    1572     dwDrawAspect,
    1573     lindex,
    1574     pvAspect,
    1575     hdcTargetDev,
    1576     hdcDraw,
    1577     lprcBounds,
    1578     lprcWBounds,
    1579     pfnContinue,
    1580     dwContinue);
     1570        iface,
     1571        dwDrawAspect,
     1572        lindex,
     1573        pvAspect,
     1574        hdcTargetDev,
     1575        hdcDraw,
     1576        lprcBounds,
     1577        lprcWBounds,
     1578        pfnContinue,
     1579        dwContinue);
    15811580
    15821581  /*
     
    15911590   */
    15921591  hres = DataCache_ReadPresentationData(this,
    1593                     dwDrawAspect,
    1594                     &presData);
     1592                                        dwDrawAspect,
     1593                                        &presData);
    15951594
    15961595  if (FAILED(hres))
     
    16051604   */
    16061605  presMetafile = DataCache_ReadPresMetafile(this,
    1607                         dwDrawAspect);
     1606                                            dwDrawAspect);
    16081607
    16091608  /*
     
    16201619
    16211620    SetWindowExtEx(hdcDraw,
    1622            presData.dwObjectExtentX,
    1623            presData.dwObjectExtentY,
    1624            &oldWindowExt);
    1625 
    1626     SetViewportExtEx(hdcDraw,
    1627              lprcBounds->right - lprcBounds->left,
    1628              lprcBounds->bottom - lprcBounds->top,
    1629              &oldViewportExt);
     1621                   presData.dwObjectExtentX,
     1622                   presData.dwObjectExtentY,
     1623                   &oldWindowExt);
     1624
     1625    SetViewportExtEx(hdcDraw, 
     1626                     lprcBounds->right - lprcBounds->left,
     1627                     lprcBounds->bottom - lprcBounds->top,
     1628                     &oldViewportExt);
    16301629
    16311630    SetViewportOrgEx(hdcDraw,
    1632              lprcBounds->left,
    1633              lprcBounds->top,
    1634              &oldViewportOrg);
     1631                     lprcBounds->left,
     1632                     lprcBounds->top,
     1633                     &oldViewportOrg);
    16351634
    16361635    PlayMetaFile(hdcDraw, presMetafile);
    16371636
    16381637    SetWindowExtEx(hdcDraw,
    1639            oldWindowExt.cx,
    1640            oldWindowExt.cy,
    1641            NULL);
    1642 
    1643     SetViewportExtEx(hdcDraw,
    1644              oldViewportExt.cx,
    1645              oldViewportExt.cy,
    1646              NULL);
     1638                   oldWindowExt.cx,
     1639                   oldWindowExt.cy,
     1640                   NULL);
     1641
     1642    SetViewportExtEx(hdcDraw, 
     1643                     oldViewportExt.cx,
     1644                     oldViewportExt.cy,
     1645                     NULL);
    16471646
    16481647    SetViewportOrgEx(hdcDraw,
    1649              oldViewportOrg.x,
    1650              oldViewportOrg.y,
    1651              NULL);
     1648                     oldViewportOrg.x,
     1649                     oldViewportOrg.y,
     1650                     NULL);
    16521651
    16531652    SetMapMode(hdcDraw, prevMapMode);
     
    16601659
    16611660static HRESULT WINAPI DataCache_GetColorSet(
    1662             IViewObject2*   iface,
    1663         DWORD           dwDrawAspect,
    1664         LONG            lindex,
    1665         void*           pvAspect,
    1666         DVTARGETDEVICE* ptd,
    1667         HDC             hicTargetDevice,
    1668         LOGPALETTE**    ppColorSet)
     1661            IViewObject2*   iface, 
     1662            DWORD           dwDrawAspect,
     1663            LONG            lindex,
     1664            void*           pvAspect,
     1665            DVTARGETDEVICE* ptd,
     1666            HDC             hicTargetDevice,
     1667            LOGPALETTE**    ppColorSet)
    16691668{
    16701669  FIXME("stub\n");
     
    16741673static HRESULT WINAPI DataCache_Freeze(
    16751674            IViewObject2*   iface,
    1676         DWORD           dwDrawAspect,
    1677         LONG            lindex,
    1678         void*           pvAspect,
    1679         DWORD*          pdwFreeze)
     1675            DWORD           dwDrawAspect,
     1676            LONG            lindex,
     1677            void*           pvAspect,
     1678            DWORD*          pdwFreeze)
    16801679{
    16811680  FIXME("stub\n");
     
    16851684static HRESULT WINAPI DataCache_Unfreeze(
    16861685            IViewObject2*   iface,
    1687         DWORD           dwFreeze)
     1686            DWORD           dwFreeze)
    16881687{
    16891688  FIXME("stub\n");
     
    17011700static HRESULT WINAPI DataCache_SetAdvise(
    17021701            IViewObject2*   iface,
    1703         DWORD           aspects,
    1704         DWORD           advf,
    1705         IAdviseSink*    pAdvSink)
     1702            DWORD           aspects,
     1703            DWORD           advf,
     1704            IAdviseSink*    pAdvSink)
    17061705{
    17071706  _ICOM_THIS_From_IViewObject2(DataCache, iface);
     
    17161715    IAdviseSink_Release(this->sinkInterface);
    17171716    this->sinkInterface  = NULL;
    1718     this->sinkAspects    = 0;
     1717    this->sinkAspects    = 0; 
    17191718    this->sinkAdviseFlag = 0;
    17201719  }
     
    17261725  {
    17271726    this->sinkInterface  = pAdvSink;
    1728     this->sinkAspects    = aspects;
    1729     this->sinkAdviseFlag = advf;
     1727    this->sinkAspects    = aspects; 
     1728    this->sinkAdviseFlag = advf;   
    17301729
    17311730    IAdviseSink_AddRef(this->sinkInterface);
     
    17391738  {
    17401739    DataCache_FireOnViewChange(this,
    1741                    DVASPECT_CONTENT,
    1742                    -1);
     1740                               DVASPECT_CONTENT,
     1741                               -1);
    17431742  }
    17441743
     
    17491748 * DataCache_GetAdvise (IViewObject2)
    17501749 *
    1751  * This method queries the current state of the advise sink
     1750 * This method queries the current state of the advise sink 
    17521751 * installed on the data cache.
    17531752 *
     
    17551754 */
    17561755static HRESULT WINAPI DataCache_GetAdvise(
    1757             IViewObject2*   iface,
    1758         DWORD*          pAspects,
    1759         DWORD*          pAdvf,
    1760         IAdviseSink**   ppAdvSink)
     1756            IViewObject2*   iface, 
     1757            DWORD*          pAspects,
     1758            DWORD*          pAdvf,
     1759            IAdviseSink**   ppAdvSink)
    17611760{
    17621761  _ICOM_THIS_From_IViewObject2(DataCache, iface);
     
    17751774  if (ppAdvSink!=NULL)
    17761775  {
    1777     IAdviseSink_QueryInterface(this->sinkInterface,
    1778                    &IID_IAdviseSink,
    1779                    (void**)ppAdvSink);
     1776    IAdviseSink_QueryInterface(this->sinkInterface, 
     1777                               &IID_IAdviseSink,
     1778                               (void**)ppAdvSink);
    17801779  }
    17811780
     
    17911790 */
    17921791static HRESULT WINAPI DataCache_GetExtent(
    1793             IViewObject2*   iface,
    1794         DWORD           dwDrawAspect,
    1795         LONG            lindex,
    1796         DVTARGETDEVICE* ptd,
    1797         LPSIZEL         lpsizel)
     1792            IViewObject2*   iface, 
     1793            DWORD           dwDrawAspect,
     1794            LONG            lindex,
     1795            DVTARGETDEVICE* ptd,
     1796            LPSIZEL         lpsizel)
    17981797{
    17991798  PresentationDataHeader presData;
     
    18021801  _ICOM_THIS_From_IViewObject2(DataCache, iface);
    18031802
    1804   TRACE("(%p, %lx, %ld, %p, %p)\n",
    1805     iface, dwDrawAspect, lindex, ptd, lpsizel);
     1803  TRACE("(%p, %lx, %ld, %p, %p)\n", 
     1804        iface, dwDrawAspect, lindex, ptd, lpsizel);
    18061805
    18071806  /*
     
    18291828  if (ptd!=NULL)
    18301829    FIXME("Unimplemented ptd = %p\n", ptd);
    1831 
    1832   /*
    1833    * Get the presentation information from the
     1830 
     1831  /*
     1832   * Get the presentation information from the 
    18341833   * cache.
    18351834   */
    18361835  hres = DataCache_ReadPresentationData(this,
    1837                     dwDrawAspect,
    1838                     &presData);
     1836                                        dwDrawAspect,
     1837                                        &presData);
    18391838
    18401839  if (SUCCEEDED(hres))
     
    18711870  _ICOM_THIS_From_IOleCache2(DataCache, iface);
    18721871
    1873   return IUnknown_QueryInterface(this->outerUnknown, riid, ppvObject);
     1872  return IUnknown_QueryInterface(this->outerUnknown, riid, ppvObject); 
    18741873}
    18751874
     
    18791878 * See Windows documentation for more details on IUnknown methods.
    18801879 */
    1881 static ULONG WINAPI DataCache_IOleCache2_AddRef(
     1880static ULONG WINAPI DataCache_IOleCache2_AddRef( 
    18821881            IOleCache2*     iface)
    18831882{
    18841883  _ICOM_THIS_From_IOleCache2(DataCache, iface);
    18851884
    1886   return IUnknown_AddRef(this->outerUnknown);
     1885  return IUnknown_AddRef(this->outerUnknown); 
    18871886}
    18881887
     
    18921891 * See Windows documentation for more details on IUnknown methods.
    18931892 */
    1894 static ULONG WINAPI DataCache_IOleCache2_Release(
     1893static ULONG WINAPI DataCache_IOleCache2_Release( 
    18951894            IOleCache2*     iface)
    18961895{
    18971896  _ICOM_THIS_From_IOleCache2(DataCache, iface);
    18981897
    1899   return IUnknown_Release(this->outerUnknown);
     1898  return IUnknown_Release(this->outerUnknown); 
    19001899}
    19011900
    19021901static HRESULT WINAPI DataCache_Cache(
    19031902            IOleCache2*     iface,
    1904         FORMATETC*      pformatetc,
    1905         DWORD           advf,
    1906         DWORD*          pdwConnection)
     1903            FORMATETC*      pformatetc,
     1904            DWORD           advf,
     1905            DWORD*          pdwConnection)
    19071906{
    19081907  FIXME("stub\n");
     
    19111910
    19121911static HRESULT WINAPI DataCache_Uncache(
    1913         IOleCache2*     iface,
    1914         DWORD           dwConnection)
     1912            IOleCache2*     iface,
     1913            DWORD           dwConnection)
    19151914{
    19161915  FIXME("stub\n");
     
    19201919static HRESULT WINAPI DataCache_EnumCache(
    19211920            IOleCache2*     iface,
    1922         IEnumSTATDATA** ppenumSTATDATA)
     1921            IEnumSTATDATA** ppenumSTATDATA)
    19231922{
    19241923  FIXME("stub\n");
     
    19271926
    19281927static HRESULT WINAPI DataCache_InitCache(
    1929         IOleCache2*     iface,
    1930         IDataObject*    pDataObject)
     1928            IOleCache2*     iface,
     1929            IDataObject*    pDataObject)
    19311930{
    19321931  FIXME("stub\n");
     
    19361935static HRESULT WINAPI DataCache_IOleCache2_SetData(
    19371936            IOleCache2*     iface,
    1938         FORMATETC*      pformatetc,
    1939         STGMEDIUM*      pmedium,
    1940         BOOL            fRelease)
     1937            FORMATETC*      pformatetc,
     1938            STGMEDIUM*      pmedium,
     1939            BOOL            fRelease)
    19411940{
    19421941  FIXME("stub\n");
     
    19461945static HRESULT WINAPI DataCache_UpdateCache(
    19471946            IOleCache2*     iface,
    1948         LPDATAOBJECT    pDataObject,
    1949         DWORD           grfUpdf,
    1950         LPVOID          pReserved)
     1947            LPDATAOBJECT    pDataObject,
     1948            DWORD           grfUpdf,
     1949            LPVOID          pReserved)
    19511950{
    19521951  FIXME("stub\n");
     
    19561955static HRESULT WINAPI DataCache_DiscardCache(
    19571956            IOleCache2*     iface,
    1958         DWORD           dwDiscardOptions)
     1957            DWORD           dwDiscardOptions)
    19591958{
    19601959  FIXME("stub\n");
     
    19801979  _ICOM_THIS_From_IOleCacheControl(DataCache, iface);
    19811980
    1982   return IUnknown_QueryInterface(this->outerUnknown, riid, ppvObject);
     1981  return IUnknown_QueryInterface(this->outerUnknown, riid, ppvObject); 
    19831982}
    19841983
     
    19881987 * See Windows documentation for more details on IUnknown methods.
    19891988 */
    1990 static ULONG WINAPI DataCache_IOleCacheControl_AddRef(
     1989static ULONG WINAPI DataCache_IOleCacheControl_AddRef( 
    19911990            IOleCacheControl* iface)
    19921991{
    19931992  _ICOM_THIS_From_IOleCacheControl(DataCache, iface);
    19941993
    1995   return IUnknown_AddRef(this->outerUnknown);
     1994  return IUnknown_AddRef(this->outerUnknown); 
    19961995}
    19971996
     
    20012000 * See Windows documentation for more details on IUnknown methods.
    20022001 */
    2003 static ULONG WINAPI DataCache_IOleCacheControl_Release(
     2002static ULONG WINAPI DataCache_IOleCacheControl_Release( 
    20042003            IOleCacheControl* iface)
    20052004{
    20062005  _ICOM_THIS_From_IOleCacheControl(DataCache, iface);
    20072006
    2008   return IUnknown_Release(this->outerUnknown);
     2007  return IUnknown_Release(this->outerUnknown); 
    20092008}
    20102009
    20112010static HRESULT WINAPI DataCache_OnRun(
    2012         IOleCacheControl* iface,
    2013         LPDATAOBJECT      pDataObject)
     2011            IOleCacheControl* iface,
     2012            LPDATAOBJECT      pDataObject)
    20142013{
    20152014  FIXME("stub\n");
     
    20182017
    20192018static HRESULT WINAPI DataCache_OnStop(
    2020         IOleCacheControl* iface)
     2019            IOleCacheControl* iface)
    20212020{
    20222021  FIXME("stub\n");
Note: See TracChangeset for help on using the changeset viewer.