Changeset 8620 for trunk/src


Ignore:
Timestamp:
Jun 9, 2002, 6:37:22 PM (23 years ago)
Author:
sandervl
Message:

Resync with latest Wine

Location:
trunk/src/ole32
Files:
21 edited

Legend:

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

    r8441 r8620  
    3737    ICOM_VTABLE(IMoniker)*  lpvtbl1;  /* VTable relative to the IMoniker interface.*/
    3838
    39     /* The ROT (RunningObjectTable implementation) uses the IROTData interface to test whether 
     39    /* The ROT (RunningObjectTable implementation) uses the IROTData interface to test whether
    4040     * two monikers are equal. That's whay IROTData interface is implemented by monikers.
    4141     */
     
    143143{
    144144    ICOM_THIS(AntiMonikerImpl,iface);
    145  
     145
    146146  TRACE("(%p,%p,%p)\n",This,riid,ppvObject);
    147147
     
    149149    if ( (This==0) || (ppvObject==0) )
    150150        return E_INVALIDARG;
    151  
     151
    152152  /* Initialize the return parameter */
    153153  *ppvObject = 0;
     
    166166    if ((*ppvObject)==0)
    167167        return E_NOINTERFACE;
    168  
     168
    169169   /* Query Interface always increases the reference count by one when it is successful */
    170170  AntiMonikerImpl_AddRef(iface);
     
    203203        return 0;
    204204    }
    205     return This->ref;;
     205    return This->ref;
    206206}
    207207
     
    215215    if (pClassID==NULL)
    216216        return E_POINTER;
    217            
     217
    218218    *pClassID = CLSID_AntiMoniker;
    219        
     219
    220220    return S_OK;
    221221}
     
    259259    DWORD constant=1;
    260260    HRESULT res;
    261    
     261
    262262    /* data writen by this function is only a DWORD constant seted to 1 ! */
    263263    res=IStream_Write(pStm,&constant,sizeof(constant),NULL);
     
    278278
    279279    /* for more details see AntiMonikerImpl_Save coments */
    280    
     280
    281281    /* Normaly the sizemax must be the  size of DWORD ! but I tested this function it ususlly return 16 bytes */
    282282    /* more than the number of bytes used by AntiMoniker::Save function */
     
    357357
    358358    *ppmkReduced=iface;
    359    
     359
    360360    return MK_S_REDUCED_TO_SELF;
    361361}
     
    375375
    376376    *ppmkComposite=0;
    377    
     377
    378378    if (fOnlyIfNotGeneric)
    379379        return MK_E_NEEDGENERIC;
     
    391391    if (ppenumMoniker == NULL)
    392392        return E_POINTER;
    393    
     393
    394394    *ppenumMoniker = NULL;
    395395
     
    403403{
    404404    DWORD mkSys;
    405    
     405
    406406    TRACE("(%p,%p)\n",iface,pmkOtherMoniker);
    407407
    408408    if (pmkOtherMoniker==NULL)
    409409        return S_FALSE;
    410    
     410
    411411    IMoniker_IsSystemMoniker(pmkOtherMoniker,&mkSys);
    412412
     
    491491{
    492492    DWORD mkSys;
    493    
     493
    494494    IMoniker_IsSystemMoniker(pmkOther,&mkSys);
    495495
     
    501501
    502502        IMoniker_AddRef(iface);
    503        
     503
    504504        return MK_S_US;
    505505    }
     
    534534{
    535535    WCHAR back[]={'\\','.','.',0};
    536    
     536
    537537    TRACE("(%p,%p,%p,%p)\n",iface,pbc,pmkToLeft,ppszDisplayName);
    538538
     
    551551
    552552    strcpyW(*ppszDisplayName,back);
    553    
     553
    554554    return S_OK;
    555555}
     
    578578    if (!pwdMksys)
    579579        return E_POINTER;
    580    
     580
    581581    (*pwdMksys)=MKSYS_ANTIMONIKER;
    582582
     
    615615{
    616616    ICOM_THIS_From_IROTData(IMoniker, iface);
    617    
     617
    618618    TRACE("(%p)\n",iface);
    619619
     
    641641    HRESULT        hr = S_OK;
    642642    IID riid=IID_IMoniker;
    643    
     643
    644644    TRACE("(%p)\n",ppmk);
    645645
  • trunk/src/ole32/bindctx.c

    r8441 r8620  
    3333
    3434/* represent the first size table and it's increment block size */
    35 #define  BLOCK_TAB_SIZE 10 
     35#define  BLOCK_TAB_SIZE 10
    3636#define  MAX_TAB_SIZE   0xFFFFFFFF
    3737
     
    5151
    5252    ICOM_VFIELD(IBindCtx); /* VTable relative to the IBindCtx interface.*/
    53                                      
     53
    5454    ULONG ref; /* reference counter for this object */
    5555
     
    115115  if ( (This==0) || (ppvObject==0) )
    116116      return E_INVALIDARG;
    117  
     117
    118118  /* Initialize the return parameter.*/
    119119  *ppvObject = 0;
     
    129129  if ((*ppvObject)==0)
    130130      return E_NOINTERFACE;
    131  
     131
    132132   /* Query Interface always increases the reference count by one when it is successful */
    133133  BindCtxImpl_AddRef(iface);
     
    168168        return 0;
    169169    }
    170     return This->ref;;
     170    return This->ref;
    171171}
    172172
     
    236236    if (punk==NULL)
    237237        return E_POINTER;
    238    
     238
    239239    IUnknown_AddRef(punk);
    240    
     240
    241241    /* put the object in the first free element in the table */
    242242    This->bindCtxTable[lastIndex].pObj = punk;
     
    276276    /* check if the object was registred or not */
    277277    if (BindCtxImpl_GetObjectIndex(This,punk,NULL,&index)==S_FALSE)
    278        
     278
    279279        return MK_E_NOTBOUND;
    280280
    281281    IUnknown_Release(This->bindCtxTable[index].pObj);
    282    
     282
    283283    /* left-shift all elements in the right side of the current revoked object */
    284284    for(j=index; j<This->bindCtxTableLastIndex-1; j++)
    285285        This->bindCtxTable[j]= This->bindCtxTable[j+1];
    286    
     286
    287287    This->bindCtxTableLastIndex--;
    288288
     
    320320    if (pbindopts==NULL)
    321321        return E_POINTER;
    322    
     322
    323323    if (pbindopts->cbStruct > sizeof(BIND_OPTS2))
    324324    {
     
    364364    if (pprot==NULL)
    365365        return E_POINTER;
    366    
     366
    367367    res=GetRunningObjectTable(0, pprot);
    368368
     
    381381    if (punk==NULL)
    382382        return E_INVALIDARG;
    383    
     383
    384384    IUnknown_AddRef(punk);
    385385
     
    402402
    403403    This->bindCtxTableLastIndex++;
    404    
     404
    405405    if (This->bindCtxTableLastIndex == This->bindCtxTableSize){ /* table is full ! must be resized */
    406406
     
    432432
    433433    *punk=0;
    434    
     434
    435435    if (BindCtxImpl_GetObjectIndex(This,NULL,pszkey,&index)==S_FALSE)
    436436        return E_FAIL;
    437437
    438438    IUnknown_AddRef(This->bindCtxTable[index].pObj);
    439    
     439
    440440    *punk = This->bindCtxTable[index].pObj;
    441441
     
    459459    /* release the object if it's found */
    460460    IUnknown_Release(This->bindCtxTable[index].pObj);
    461    
     461
    462462    /* remove the object from the table with a left-shifting of all objects in the right side */
    463463    for(j=index; j<This->bindCtxTableLastIndex-1; j++)
    464464        This->bindCtxTable[j]= This->bindCtxTable[j+1];
    465    
     465
    466466    This->bindCtxTableLastIndex--;
    467467
     
    489489    DWORD i;
    490490    BYTE found=0;
    491    
     491
    492492    TRACE("(%p,%p,%p,%p)\n",This,punk,pszkey,index);
    493493
  • trunk/src/ole32/clipboard.c

    r8441 r8620  
    9595
    9696  /*
    97    * The hidden OLE clipboard window. This window is used as the bridge between the 
     97   * The hidden OLE clipboard window. This window is used as the bridge between the
    9898   * the OLE and windows clipboard API. (Windows creates one such window per process)
    9999   */
     
    128128*   DO NOT add any members before the VTables declaration!
    129129*/
    130 typedef struct 
     130typedef struct
    131131{
    132132  /* IEnumFORMATETC VTable */
    133133  ICOM_VFIELD(IEnumFORMATETC);
    134  
     134
    135135  /* IEnumFORMATETC fields */
    136136  UINT                         posFmt;    /* current enumerator position */
     
    147147   */
    148148  IUnknown*                    pUnkDataObj;
    149  
     149
    150150} IEnumFORMATETCImpl;
    151151
     
    186186            REFIID           riid,
    187187            void**           ppvObject);
    188 static ULONG WINAPI OLEClipbrd_IDataObject_AddRef( 
     188static ULONG WINAPI OLEClipbrd_IDataObject_AddRef(
    189189            IDataObject*     iface);
    190 static ULONG WINAPI OLEClipbrd_IDataObject_Release( 
     190static ULONG WINAPI OLEClipbrd_IDataObject_Release(
    191191            IDataObject*     iface);
    192192static HRESULT WINAPI OLEClipbrd_IDataObject_GetData(
    193193            IDataObject*     iface,
    194             LPFORMATETC      pformatetcIn, 
     194            LPFORMATETC      pformatetcIn,
    195195            STGMEDIUM*       pmedium);
    196196static HRESULT WINAPI OLEClipbrd_IDataObject_GetDataHere(
    197             IDataObject*     iface, 
     197            IDataObject*     iface,
    198198            LPFORMATETC      pformatetc,
    199199            STGMEDIUM*       pmedium);
     
    202202            LPFORMATETC      pformatetc);
    203203static HRESULT WINAPI OLEClipbrd_IDataObject_GetCanonicalFormatEtc(
    204             IDataObject*     iface, 
    205             LPFORMATETC      pformatectIn, 
     204            IDataObject*     iface,
     205            LPFORMATETC      pformatectIn,
    206206            LPFORMATETC      pformatetcOut);
    207207static HRESULT WINAPI OLEClipbrd_IDataObject_SetData(
    208208            IDataObject*     iface,
    209             LPFORMATETC      pformatetc, 
    210             STGMEDIUM*       pmedium, 
     209            LPFORMATETC      pformatetc,
     210            STGMEDIUM*       pmedium,
    211211            BOOL             fRelease);
    212212static HRESULT WINAPI OLEClipbrd_IDataObject_EnumFormatEtc(
    213             IDataObject*     iface,       
     213            IDataObject*     iface,
    214214            DWORD            dwDirection,
    215215            IEnumFORMATETC** ppenumFormatEtc);
    216216static HRESULT WINAPI OLEClipbrd_IDataObject_DAdvise(
    217             IDataObject*     iface, 
    218             FORMATETC*       pformatetc, 
    219             DWORD            advf, 
    220             IAdviseSink*     pAdvSink, 
     217            IDataObject*     iface,
     218            FORMATETC*       pformatetc,
     219            DWORD            advf,
     220            IAdviseSink*     pAdvSink,
    221221            DWORD*           pdwConnection);
    222222static HRESULT WINAPI OLEClipbrd_IDataObject_DUnadvise(
     
    279279
    280280/*
    281  * Name of our registered OLE clipboard window class 
     281 * Name of our registered OLE clipboard window class
    282282 */
    283283CHAR OLEClipbrd_WNDCLASS[] = "CLIPBRDWNDCLASS";
     
    293293
    294294/*---------------------------------------------------------------------*
    295  *           Win32 OLE clipboard API 
     295 *           Win32 OLE clipboard API
    296296 *---------------------------------------------------------------------*/
    297297
     
    304304 *
    305305 *    S_OK                  IDataObject pointer placed on the clipboard
    306  *    CLIPBRD_E_CANT_OPEN   OpenClipboard failed 
    307  *    CLIPBRD_E_CANT_EMPTY  EmptyClipboard failed 
     306 *    CLIPBRD_E_CANT_OPEN   OpenClipboard failed
     307 *    CLIPBRD_E_CANT_EMPTY  EmptyClipboard failed
    308308 *    CLIPBRD_E_CANT_CLOSE  CloseClipboard failed
    309309 *    CLIPBRD_E_CANT_SET    SetClipboard failed
     
    320320  OLEClipbrd **ppDataObject;
    321321*/
    322  
     322
    323323  TRACE("(%p)\n", pDataObj);
    324  
     324
    325325  /*
    326326   * Make sure we have a clipboard object
     
    345345  /*
    346346   * Empty the current clipboard and make our window the clipboard owner
    347    * NOTE: This will trigger a WM_DESTROYCLIPBOARD message 
     347   * NOTE: This will trigger a WM_DESTROYCLIPBOARD message
    348348   */
    349349  if ( !EmptyClipboard() )
     
    370370
    371371  /*
    372    * Enumerate all HGLOBAL formats supported by the source and make 
     372   * Enumerate all HGLOBAL formats supported by the source and make
    373373   * those formats available using delayed rendering using SetClipboardData.
    374    * Only global memory based data items may be made available to non-OLE 
    375    * applications via the standard Windows clipboard API. Data based on other 
     374   * Only global memory based data items may be made available to non-OLE
     375   * applications via the standard Windows clipboard API. Data based on other
    376376   * mediums(non TYMED_HGLOBAL) can only be accessed via the Ole Clipboard API.
    377377   *
     
    387387      HANDLE_ERROR( hr );
    388388    }
    389      
     389
    390390    while ( S_OK == IEnumFORMATETC_Next(penumFormatetc, 1, &rgelt, NULL) )
    391391    {
     
    396396              GetClipboardFormatNameA(rgelt.cfFormat, szFmtName, sizeof(szFmtName)-1)
    397397                ? szFmtName : "");
    398  
     398
    399399        SetClipboardData( rgelt.cfFormat, (HANDLE)NULL);
    400400      }
     
    405405  /*
    406406   * Windows additionally creates a new "DataObject" clipboard format
    407    * and stores in on the clipboard. We could possibly store a pointer 
     407   * and stores in on the clipboard. We could possibly store a pointer
    408408   * to our internal IDataObject interface on the clipboard. I'm not
    409409   * sure what the use of this is though.
     
    416416   if (hDataObject==0)
    417417     HANDLE_ERROR( E_OUTOFMEMORY );
    418    
     418
    419419   ppDataObject = (OLEClipbrd**)GlobalLock(hDataObject);
    420420   *ppDataObject = theOleClipboard;
     
    424424     HANDLE_ERROR( CLIPBRD_E_CANT_SET );
    425425*/
    426  
     426
    427427  hr = S_OK;
    428428
     
    453453/***********************************************************************
    454454 * OleGetClipboard [OLE32.105]
    455  * Returns a pointer to our internal IDataObject which represents the conceptual 
    456  * state of the Windows clipboard. If the current clipboard already contains 
     455 * Returns a pointer to our internal IDataObject which represents the conceptual
     456 * state of the Windows clipboard. If the current clipboard already contains
    457457 * an IDataObject, our internal IDataObject will delegate to this object.
    458458 */
     
    461461  HRESULT hr = S_OK;
    462462  TRACE("()\n");
    463    
     463
    464464  /*
    465465   * Make sure we have a clipboard object
     
    502502  BOOL bClipboardOpen = FALSE;
    503503  IDataObject* pIDataObjectSrc = NULL;
    504  
     504
    505505  TRACE("()\n");
    506506
     
    522522  pIDataObjectSrc = theOleClipboard->pIDataObjectSrc;
    523523  IDataObject_AddRef(pIDataObjectSrc);
    524  
     524
    525525  /*
    526526   * Open the Windows clipboard
     
    562562    }
    563563  }
    564  
     564
    565565  IEnumFORMATETC_Release(penumFormatetc);
    566  
     566
    567567  /*
    568568   * Release the source data object we are holding on to
     
    585585 *           OleIsCurrentClipboard [OLE32.110]
    586586 */
    587 HRESULT WINAPI OleIsCurrentClipboard (  IDataObject *pDataObject) 
     587HRESULT WINAPI OleIsCurrentClipboard (  IDataObject *pDataObject)
    588588{
    589589  TRACE("()\n");
     
    601601
    602602/*---------------------------------------------------------------------*
    603  *           Internal implementation methods for the OLE clipboard 
     603 *           Internal implementation methods for the OLE clipboard
    604604 *---------------------------------------------------------------------*/
    605605
    606606/***********************************************************************
    607607 * OLEClipbrd_Initialize()
    608  * Initializes the OLE clipboard. 
     608 * Initializes the OLE clipboard.
    609609 */
    610610void OLEClipbrd_Initialize()
    611611{
    612612  /*
    613    * Create the clipboard if necessary 
     613   * Create the clipboard if necessary
    614614   */
    615615  if ( !theOleClipboard )
     
    623623/***********************************************************************
    624624 * OLEClipbrd_UnInitialize()
    625  * Un-Initializes the OLE clipboard 
     625 * Un-Initializes the OLE clipboard
    626626 */
    627627void OLEClipbrd_UnInitialize()
     
    650650  OLEClipbrd* newObject = NULL;
    651651  HGLOBAL hNewObject = 0;
    652  
     652
    653653  /*
    654654   * Allocate space for the object. We use GlobalAlloc since we need
     
    664664   */
    665665  newObject = GlobalLock(hNewObject);
    666  
     666
    667667  /*
    668668   * Initialize the virtual function table.
     
    671671
    672672  /*
    673    * Start with one reference count. The caller of this function 
     673   * Start with one reference count. The caller of this function
    674674   * must release the interface pointer when it is done.
    675675   */
     
    677677
    678678  newObject->hSelf = hNewObject;
    679  
     679
    680680  /*
    681681   * The Ole clipboard is a singleton - save the global handle and pointer
     
    690690{
    691691  TRACE("()\n");
    692    
     692
    693693  if ( !ptrToDestroy )
    694694    return;
    695695
    696696  /*
    697    * Destroy the Ole clipboard window 
     697   * Destroy the Ole clipboard window
    698698   */
    699699  if ( ptrToDestroy->hWndClipboard )
     
    717717/***********************************************************************
    718718 * OLEClipbrd_CreateWindow()
    719  * Create the clipboard window 
     719 * Create the clipboard window
    720720 */
    721721static HWND OLEClipbrd_CreateWindow()
     
    724724  WNDCLASSEXA wcex;
    725725
    726   /* 
    727    * Register the clipboard window class if necessary 
     726  /*
     727   * Register the clipboard window class if necessary
    728728   */
    729729    ZeroMemory( &wcex, sizeof(WNDCLASSEXA));
     
    741741
    742742  /*
    743    * Create a hidden window to receive OLE clipboard messages 
     743   * Create a hidden window to receive OLE clipboard messages
    744744   */
    745745
     
    751751 */
    752752
    753   hwnd = CreateWindowA(OLEClipbrd_WNDCLASS, 
     753  hwnd = CreateWindowA(OLEClipbrd_WNDCLASS,
    754754                                    "ClipboardWindow",
    755755                                    WS_POPUP | WS_CLIPSIBLINGS | WS_OVERLAPPED,
     
    770770static void OLEClipbrd_DestroyWindow(HWND hwnd)
    771771{
    772   /* 
    773    * Destroy clipboard window and unregister its WNDCLASS 
     772  /*
     773   * Destroy clipboard window and unregister its WNDCLASS
    774774   */
    775775  DestroyWindow(hwnd);
     
    779779/***********************************************************************
    780780 * OLEClipbrd_WndProc(HWND, unsigned, WORD, LONG)
    781  * Processes messages sent to the OLE clipboard window. 
    782  * Note that we will intercept messages in our WndProc only when data 
    783  * has been placed in the clipboard via OleSetClipboard(). 
     781 * Processes messages sent to the OLE clipboard window.
     782 * Note that we will intercept messages in our WndProc only when data
     783 * has been placed in the clipboard via OleSetClipboard().
    784784 * i.e. Only when OLE owns the windows clipboard.
    785785 */
     
    787787  (HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
    788788{
    789   switch (message) 
     789  switch (message)
    790790  {
    791791    /*
    792      * WM_RENDERFORMAT 
     792     * WM_RENDERFORMAT
    793793     * We receive this message to allow us to handle delayed rendering of
    794      * a specific clipboard format when an application requests data in 
     794     * a specific clipboard format when an application requests data in
    795795     * that format by calling GetClipboardData.
    796      * (Recall that in OleSetClipboard, we used SetClipboardData to 
     796     * (Recall that in OleSetClipboard, we used SetClipboardData to
    797797     * make all HGLOBAL formats supported by the source IDataObject
    798798     * available using delayed rendering)
    799      * On receiving this mesage we must actually render the data in the 
    800      * specified format and place it on the clipboard by calling the 
    801      * SetClipboardData function. 
     799     * On receiving this mesage we must actually render the data in the
     800     * specified format and place it on the clipboard by calling the
     801     * SetClipboardData function.
    802802     */
    803803    case WM_RENDERFORMAT:
    804804    {
    805805      FORMATETC rgelt;
    806        
     806
    807807      ZeroMemory( &rgelt, sizeof(FORMATETC));
    808808
     
    816816
    817817      TRACE("(): WM_RENDERFORMAT(cfFormat=%d)\n", rgelt.cfFormat);
    818      
     818
    819819      /*
    820820       * Render the clipboard data.
     
    840840      IEnumFORMATETC* penumFormatetc = NULL;
    841841      FORMATETC rgelt;
    842      
     842
    843843      TRACE("(): WM_RENDERALLFORMATS\n");
    844      
     844
    845845      /*
    846846       * Render all HGLOBAL formats supported by the source into
     
    859859        {
    860860          /*
    861            * Render the clipboard data. 
     861           * Render the clipboard data.
    862862           */
    863863          if ( FAILED(OLEClipbrd_RenderFormat( (IDataObject*)&(theOleClipboard->lpvtbl1), &rgelt )) )
    864864            continue;
    865        
     865
    866866          TRACE("(): WM_RENDERALLFORMATS(cfFormat=%d)\n", rgelt.cfFormat);
    867867        }
    868868      }
    869      
     869
    870870      IEnumFORMATETC_Release(penumFormatetc);
    871871
     
    10061006
    10071007        HeapFree(GetProcessHeap(), 0, mfBits);
    1008  
     1008
    10091009        GlobalUnlock(std2.u.hGlobal);
    10101010
     
    10341034   *  Put a copy of the rendered data back on the clipboard
    10351035   */
    1036  
     1036
    10371037  if ( !(hDup = OLEClipbrd_GlobalDupMem(hStorage)) )
    10381038    HANDLE_ERROR( E_OUTOFMEMORY );
    1039        
     1039
    10401040  if ( !SetClipboardData( pFormatetc->cfFormat, hDup ) )
    10411041  {
     
    10451045
    10461046CLEANUP:
    1047  
     1047
    10481048  ReleaseStgMedium(&std);
    1049  
     1049
    10501050  return hr;
    10511051}
     
    10611061    PVOID pGlobalSrc, pGlobalDest;
    10621062    DWORD cBytes;
    1063    
     1063
    10641064    if ( !hGlobalSrc )
    10651065      return 0;
     
    10681068    if ( 0 == cBytes )
    10691069      return 0;
    1070        
     1070
    10711071    hGlobalDest = GlobalAlloc( GMEM_DDESHARE|GMEM_MOVEABLE,
    10721072                               cBytes );
    10731073    if ( !hGlobalDest )
    10741074      return 0;
    1075    
     1075
    10761076    pGlobalSrc = GlobalLock(hGlobalSrc);
    10771077    pGlobalDest = GlobalLock(hGlobalDest);
     
    10801080
    10811081    memcpy(pGlobalDest, pGlobalSrc, cBytes);
    1082        
     1082
    10831083    GlobalUnlock(hGlobalSrc);
    10841084    GlobalUnlock(hGlobalDest);
     
    10891089
    10901090/*---------------------------------------------------------------------*
    1091  *  Implementation of the internal IDataObject interface exposed by 
     1091 *  Implementation of the internal IDataObject interface exposed by
    10921092 *  the OLE clipboard.
    10931093 *---------------------------------------------------------------------*/
     
    11041104            void**           ppvObject)
    11051105{
    1106   /* 
    1107    * Declare "This" pointer 
     1106  /*
     1107   * Declare "This" pointer
    11081108   */
    11091109  ICOM_THIS(OLEClipbrd, iface);
    11101110  TRACE("(%p)->(\n\tIID:\t%s,%p)\n",This,debugstr_guid(riid),ppvObject);
    1111  
     1111
    11121112  /*
    11131113   * Perform a sanity check on the parameters.
     
    11151115  if ( (This==0) || (ppvObject==0) )
    11161116    return E_INVALIDARG;
    1117  
     1117
    11181118  /*
    11191119   * Initialize the return parameter.
     
    11241124   * Compare the riid with the interface IDs implemented by this object.
    11251125   */
    1126   if (memcmp(&IID_IUnknown, riid, sizeof(IID_IUnknown)) == 0) 
     1126  if (memcmp(&IID_IUnknown, riid, sizeof(IID_IUnknown)) == 0)
    11271127  {
    11281128    *ppvObject = iface;
    11291129  }
    1130   else if (memcmp(&IID_IDataObject, riid, sizeof(IID_IDataObject)) == 0) 
     1130  else if (memcmp(&IID_IDataObject, riid, sizeof(IID_IDataObject)) == 0)
    11311131  {
    11321132    *ppvObject = (IDataObject*)&(This->lpvtbl1);
     
    11371137    return E_NOINTERFACE;
    11381138  }
    1139  
     1139
    11401140  /*
    11411141   * Query Interface always increases the reference count by one when it is
    1142    * successful. 
     1142   * successful.
    11431143   */
    11441144  IUnknown_AddRef((IUnknown*)*ppvObject);
     
    11521152 * See Windows documentation for more details on IUnknown methods.
    11531153 */
    1154 static ULONG WINAPI OLEClipbrd_IDataObject_AddRef( 
     1154static ULONG WINAPI OLEClipbrd_IDataObject_AddRef(
    11551155            IDataObject*     iface)
    11561156{
    1157   /* 
    1158    * Declare "This" pointer 
     1157  /*
     1158   * Declare "This" pointer
    11591159   */
    11601160  ICOM_THIS(OLEClipbrd, iface);
    11611161
    11621162  TRACE("(%p)->(count=%lu)\n",This, This->ref);
    1163  
     1163
    11641164  This->ref++;
    11651165
     
    11721172 * See Windows documentation for more details on IUnknown methods.
    11731173 */
    1174 static ULONG WINAPI OLEClipbrd_IDataObject_Release( 
     1174static ULONG WINAPI OLEClipbrd_IDataObject_Release(
    11751175            IDataObject*     iface)
    11761176{
    1177   /* 
    1178    * Declare "This" pointer 
     1177  /*
     1178   * Declare "This" pointer
    11791179   */
    11801180  ICOM_THIS(OLEClipbrd, iface);
    11811181
    11821182  TRACE("(%p)->(count=%lu)\n",This, This->ref);
    1183  
     1183
    11841184  /*
    11851185   * Decrease the reference count on this object.
     
    11941194    OLEClipbrd_Destroy(This);
    11951195  }
    1196  
     1196
    11971197  return This->ref;
    11981198}
    11991199
    1200  
     1200
    12011201/************************************************************************
    12021202 * OLEClipbrd_IDataObject_GetData (IDataObject)
    12031203 *
    1204  * The OLE Clipboard's implementation of this method delegates to 
     1204 * The OLE Clipboard's implementation of this method delegates to
    12051205 * a data source if there is one or wraps around the windows clipboard
    12061206 *
     
    12091209static HRESULT WINAPI OLEClipbrd_IDataObject_GetData(
    12101210            IDataObject*     iface,
    1211             LPFORMATETC      pformatetcIn, 
     1211            LPFORMATETC      pformatetcIn,
    12121212            STGMEDIUM*       pmedium)
    12131213{
     
    12181218
    12191219  /*
    1220    * Declare "This" pointer 
     1220   * Declare "This" pointer
    12211221   */
    12221222  ICOM_THIS(OLEClipbrd, iface);
    1223  
     1223
    12241224  TRACE("(%p,%p,%p)\n", iface, pformatetcIn, pmedium);
    12251225
     
    12471247*/
    12481248
    1249   /* 
     1249  /*
    12501250   * Otherwise, get the data from the windows clipboard using GetClipboardData
    12511251   */
     
    12741274  }
    12751275
    1276   /* 
     1276  /*
    12771277   * Return the clipboard data in the storage medium structure
    12781278   */
     
    12801280  pmedium->u.hGlobal = (HGLOBAL)hData;
    12811281  pmedium->pUnkForRelease = NULL;
    1282  
     1282
    12831283  hr = S_OK;
    1284  
     1284
    12851285CLEANUP:
    12861286  /*
     
    12961296
    12971297static HRESULT WINAPI OLEClipbrd_IDataObject_GetDataHere(
    1298             IDataObject*     iface, 
     1298            IDataObject*     iface,
    12991299            LPFORMATETC      pformatetc,
    13001300            STGMEDIUM*       pmedium)
     
    13071307 * OLEClipbrd_IDataObject_QueryGetData (IDataObject)
    13081308 *
    1309  * The OLE Clipboard's implementation of this method delegates to 
     1309 * The OLE Clipboard's implementation of this method delegates to
    13101310 * a data source if there is one or wraps around the windows clipboard
    13111311 * function IsClipboardFormatAvailable() otherwise.
     
    13171317            LPFORMATETC      pformatetc)
    13181318{
    1319   /* 
    1320    * Declare "This" pointer 
     1319  /*
     1320   * Declare "This" pointer
    13211321   */
    13221322  ICOM_THIS(OLEClipbrd, iface);
     
    13481348  if ( pformatetc->tymed != TYMED_HGLOBAL )
    13491349    return DV_E_TYMED;
    1350          
     1350
    13511351  /*
    13521352   * Delegate to the Windows clipboard function IsClipboardFormatAvailable
     
    13611361 */
    13621362static HRESULT WINAPI OLEClipbrd_IDataObject_GetCanonicalFormatEtc(
    1363             IDataObject*     iface, 
    1364             LPFORMATETC      pformatectIn, 
     1363            IDataObject*     iface,
     1364            LPFORMATETC      pformatectIn,
    13651365            LPFORMATETC      pformatetcOut)
    13661366{
     
    13771377 * OLEClipbrd_IDataObject_SetData (IDataObject)
    13781378 *
    1379  * The OLE Clipboard's does not implement this method 
     1379 * The OLE Clipboard's does not implement this method
    13801380 *
    13811381 * See Windows documentation for more details on IDataObject methods.
     
    13831383static HRESULT WINAPI OLEClipbrd_IDataObject_SetData(
    13841384            IDataObject*     iface,
    1385             LPFORMATETC      pformatetc, 
    1386             STGMEDIUM*       pmedium, 
     1385            LPFORMATETC      pformatetc,
     1386            STGMEDIUM*       pmedium,
    13871387            BOOL             fRelease)
    13881388{
     
    14061406  UINT format;
    14071407  BOOL bClipboardOpen;
    1408  
    1409   /* 
    1410    * Declare "This" pointer 
     1408
     1409  /*
     1410   * Declare "This" pointer
    14111411   */
    14121412  ICOM_THIS(OLEClipbrd, iface);
     
    14611461      HANDLE_ERROR( E_FAIL );
    14621462    }
    1463    
     1463
    14641464    /* Init the FORMATETC struct */
    14651465    afmt[i].cfFormat = format;
     
    14801480  if (FAILED( hr = IEnumFORMATETC_AddRef(*ppenumFormatEtc)))
    14811481    HANDLE_ERROR( hr );
    1482      
     1482
    14831483  hr = S_OK;
    1484  
     1484
    14851485CLEANUP:
    14861486  /*
     
    14891489  if (afmt)
    14901490    HeapFree(GetProcessHeap(), 0, afmt);
    1491  
     1491
    14921492  /*
    14931493   * Close Windows clipboard
     
    15021502 * OLEClipbrd_IDataObject_DAdvise (IDataObject)
    15031503 *
    1504  * The OLE Clipboard's does not implement this method 
     1504 * The OLE Clipboard's does not implement this method
    15051505 *
    15061506 * See Windows documentation for more details on IDataObject methods.
    15071507 */
    15081508static HRESULT WINAPI OLEClipbrd_IDataObject_DAdvise(
    1509             IDataObject*     iface, 
    1510             FORMATETC*       pformatetc, 
    1511             DWORD            advf, 
    1512             IAdviseSink*     pAdvSink, 
     1509            IDataObject*     iface,
     1510            FORMATETC*       pformatetc,
     1511            DWORD            advf,
     1512            IAdviseSink*     pAdvSink,
    15131513            DWORD*           pdwConnection)
    15141514{
     
    15201520 * OLEClipbrd_IDataObject_DUnadvise (IDataObject)
    15211521 *
    1522  * The OLE Clipboard's does not implement this method 
     1522 * The OLE Clipboard's does not implement this method
    15231523 *
    15241524 * See Windows documentation for more details on IDataObject methods.
     
    15671567  DWORD size=cfmt * sizeof(FORMATETC);
    15681568  LPMALLOC pIMalloc;
    1569  
     1569
    15701570  ef = (IEnumFORMATETCImpl*)HeapAlloc(GetProcessHeap(),
    15711571                                      HEAP_ZERO_MEMORY,
     
    15731573  if (!ef)
    15741574    return NULL;
    1575  
     1575
    15761576  ef->ref = 0;
    15771577  ICOM_VTBL(ef) = &efvt;
    15781578  ef->pUnkDataObj = pUnkDataObj;
    1579  
     1579
    15801580  ef->posFmt = 0;
    15811581  ef->countFmt = cfmt;
     
    15841584  ef->pFmt = (LPFORMATETC)IMalloc_Alloc(pIMalloc, size);
    15851585  IMalloc_Release(pIMalloc);
    1586  
     1586
    15871587  if (ef->pFmt)
    15881588    memcpy(ef->pFmt, afmt, size);
    1589  
     1589
    15901590  TRACE("(%p)->()\n",ef);
    15911591  return (LPENUMFORMATETC)ef;
     
    16091609   * we only need to support the IUnknown and IEnumFORMATETC interfaces
    16101610   */
    1611  
     1611
    16121612  *ppvObj = NULL;
    1613  
     1613
    16141614  if(IsEqualIID(riid, &IID_IUnknown))
    16151615  {
     
    16191619  {
    16201620    *ppvObj = (IDataObject*)This;
    1621   }   
    1622  
     1621  }
     1622
    16231623  if(*ppvObj)
    16241624  {
     
    16271627    return S_OK;
    16281628  }
    1629  
     1629
    16301630  TRACE("-- Interface: E_NOINTERFACE\n");
    16311631  return E_NOINTERFACE;
     
    16481648  if (This->pUnkDataObj)
    16491649    IUnknown_AddRef(This->pUnkDataObj);
    1650  
     1650
    16511651  return ++(This->ref);
    16521652}
     
    16661666  if (This->pUnkDataObj)
    16671667    IUnknown_Release(This->pUnkDataObj);  /* Release parent data object */
    1668  
    1669   if (!--(This->ref)) 
     1668
     1669  if (!--(This->ref))
    16701670  {
    16711671    TRACE("() - destroying IEnumFORMATETC(%p)\n",This);
     
    16751675      IMalloc_Release(pIMalloc);
    16761676    }
    1677      
     1677
    16781678    HeapFree(GetProcessHeap(),0,This);
    16791679    return 0;
     
    16941694  UINT cfetch;
    16951695  HRESULT hres = S_FALSE;
    1696  
     1696
    16971697  TRACE("(%p)->(pos=%u)\n", This, This->posFmt);
    1698  
     1698
    16991699  if (This->posFmt < This->countFmt)
    17001700  {
     
    17051705      hres = S_OK;
    17061706    }
    1707    
     1707
    17081708    memcpy(rgelt, &This->pFmt[This->posFmt], cfetch * sizeof(FORMATETC));
    17091709    This->posFmt += cfetch;
     
    17131713    cfetch = 0;
    17141714  }
    1715  
     1715
    17161716  if (pceltFethed)
    17171717  {
    17181718    *pceltFethed = cfetch;
    17191719  }
    1720  
     1720
    17211721  return hres;
    17221722}
     
    17311731  ICOM_THIS(IEnumFORMATETCImpl,iface);
    17321732  TRACE("(%p)->(num=%lu)\n", This, celt);
    1733  
     1733
    17341734  This->posFmt += celt;
    17351735  if (This->posFmt > This->countFmt)
     
    17501750  ICOM_THIS(IEnumFORMATETCImpl,iface);
    17511751  TRACE("(%p)->()\n", This);
    1752  
     1752
    17531753  This->posFmt = 0;
    17541754  return S_OK;
     
    17651765  ICOM_THIS(IEnumFORMATETCImpl,iface);
    17661766  HRESULT hr = S_OK;
    1767  
     1767
    17681768  TRACE("(%p)->(ppenum=%p)\n", This, ppenum);
    17691769
     
    17771777  if (FAILED( hr = IEnumFORMATETC_AddRef(*ppenum)))
    17781778    return ( hr );
    1779  
     1779
    17801780  return (*ppenum) ? S_OK : E_OUTOFMEMORY;
    17811781}
  • trunk/src/ole32/compobj.c

    r8441 r8620  
    5050#include "ifs.h"
    5151
    52 #include "debugtools.h"
    53 
    54 DEFAULT_DEBUG_CHANNEL(ole);
     52#include "wine/debug.h"
     53
     54WINE_DEFAULT_DEBUG_CHANNEL(ole);
    5555
    5656/****************************************************************************
     
    399399    return S_OK;
    400400}
    401 
    402401#ifndef __WIN32OS2__
    403402/***********************************************************************
     
    413412}
    414413#endif
    415 
    416414/******************************************************************************
    417415 *              CoDisconnectObject      [COMPOBJ.15]
     
    612610  return S_OK;
    613611}
    614 
    615612#ifndef __WIN32OS2__
    616613/******************************************************************************
     
    656653}
    657654#endif
    658 
    659655/******************************************************************************
    660656 *              StringFromCLSID [OLE32.151]
     
    932928        return S_OK;
    933929}
    934 
    935930#ifndef __WIN32OS2__
    936931/* FIXME: this function is not declared in the WINELIB headers. But where should it go ? */
     
    955950        return 0;
    956951}
    957 #endif
     952
    958953/* FIXME: this function is not declared in the WINELIB headers. But where should it go ? */
    959954/***********************************************************************
     
    10131008    return DosDateTimeToFileTime(wDosDate, wDosTime, ft);
    10141009}
    1015 
     1010#endif
    10161011/***
    10171012 * COM_GetRegisteredClassObject
     
    13001295}
    13011296
    1302 static HRESULT WINAPI Remote_CoGetClassObject(
    1303     REFCLSID rclsid, DWORD dwClsContext, COSERVERINFO *pServerInfo,
    1304     REFIID iid, LPVOID *ppv
    1305 ) {
    1306   HKEY          key;
    1307   char          buf[200];
    1308   HRESULT       hres = E_UNEXPECTED;
    1309   char          xclsid[80];
    1310   WCHAR         dllName[MAX_PATH+1];
    1311   DWORD         dllNameLen = sizeof(dllName);
    1312   STARTUPINFOW  sinfo;
    1313   PROCESS_INFORMATION   pinfo;
    1314 
    1315   WINE_StringFromCLSID((LPCLSID)rclsid,xclsid);
    1316 
    1317   sprintf(buf,"CLSID\\%s\\LocalServer32",xclsid);
    1318   hres = RegOpenKeyExA(HKEY_CLASSES_ROOT, buf, 0, KEY_READ, &key);
    1319 
    1320   if (hres != ERROR_SUCCESS)
    1321       return REGDB_E_CLASSNOTREG;
    1322 
    1323   memset(dllName,0,sizeof(dllName));
    1324   hres= RegQueryValueExW(key,NULL,NULL,NULL,(LPBYTE)dllName,&dllNameLen);
    1325   if (hres)
    1326           return REGDB_E_CLASSNOTREG; /* FIXME: check retval */
    1327   RegCloseKey(key);
    1328 
    1329   TRACE("found LocalServer32 exe %s\n", debugstr_w(dllName));
    1330 
    1331   memset(&sinfo,0,sizeof(sinfo));
    1332   sinfo.cb = sizeof(sinfo);
    1333   if (!CreateProcessW(NULL,dllName,NULL,NULL,FALSE,0,NULL,NULL,&sinfo,&pinfo))
    1334       return E_FAIL;
    1335   return create_marshalled_proxy(rclsid,iid,ppv);
    1336 }
    1337 
    13381297/***********************************************************************
    13391298 *           CoGetClassObject [COMPOBJ.7]
    13401299 *           CoGetClassObject [OLE32.16]
    13411300 *
    1342  * FIXME.  If request allows of several options and there is a failure 
     1301 * FIXME.  If request allows of several options and there is a failure
    13431302 *         with one (other than not being registered) do we try the
    13441303 *         others or return failure?  (E.g. inprocess is registered but
     
    13631322#endif
    13641323    DllGetClassObjectFunc DllGetClassObject;
    1365     HKEY key;
    1366     char buf[200];
    13671324
    13681325    WINE_StringFromCLSID((LPCLSID)rclsid,xclsid);
     
    13971354
    13981355      return hres;
    1399     }
    1400 
    1401     if (((CLSCTX_LOCAL_SERVER) & dwClsContext)
    1402         && !((CLSCTX_INPROC_SERVER|CLSCTX_INPROC_HANDLER) & dwClsContext))
    1403         return Remote_CoGetClassObject(rclsid,dwClsContext,pServerInfo,iid,ppv);
    1404 
    1405     /* remote servers not supported yet */
    1406     if (     ((CLSCTX_REMOTE_SERVER) & dwClsContext)
    1407         && !((CLSCTX_INPROC_SERVER|CLSCTX_INPROC_HANDLER) & dwClsContext)
    1408     ){
    1409         FIXME("CLSCTX_REMOTE_SERVER not supported!\n");
    1410         return E_NOINTERFACE;
    14111356    }
    14121357
     
    14441389        }
    14451390    }
    1446    
    1447 
    1448     /* Finally try out of process */
    1449     /* out of process and remote servers not supported yet */
     1391
     1392
     1393    /* Next try out of process */
    14501394    if (CLSCTX_LOCAL_SERVER & dwClsContext)
    14511395    {
    1452         memset(ProviderName,0,sizeof(ProviderName));
    1453         sprintf(buf,"CLSID\\%s\\LocalServer32",xclsid);
    1454         if (((hres = RegOpenKeyExA(HKEY_CLASSES_ROOT, buf, 0, KEY_READ, &key)) != ERROR_SUCCESS) ||
    1455             ((hres = RegQueryValueExW(key,NULL,NULL,NULL,(LPBYTE)ProviderName,&ProviderNameLen)),
    1456              RegCloseKey (key),
    1457              hres != ERROR_SUCCESS))
    1458         {
    1459             hres = REGDB_E_CLASSNOTREG;
    1460         }
    1461         else
    1462         {
    1463             /* CO_E_APPNOTFOUND if no exe */
    1464             FIXME("CLSCTX_LOCAL_SERVER %s registered but not yet supported!\n",debugstr_w(ProviderName));
    1465             hres = E_ACCESSDENIED;
    1466         }
    1467     }
    1468 
     1396        return create_marshalled_proxy(rclsid,iid,ppv);
     1397    }
     1398
     1399    /* Finally try remote */
    14691400    if (CLSCTX_REMOTE_SERVER & dwClsContext)
    14701401    {
    14711402        FIXME ("CLSCTX_REMOTE_SERVER not supported\n");
    1472         hres = E_ACCESSDENIED;
     1403        hres = E_NOINTERFACE;
    14731404    }
    14741405
     
    15761507    return MK_E_INVALIDEXTENSION;
    15771508}
    1578 #ifndef __WIN32OS2__
    15791509/******************************************************************************
    15801510 *              CoRegisterMessageFilter [COMPOBJ.27]
     
    15871517        return 0;
    15881518}
    1589 #endif
     1519
    15901520/***********************************************************************
    15911521 *           CoCreateInstance [COMPOBJ.13]
  • trunk/src/ole32/compobj_private.h

    r8441 r8620  
    2020 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
    2121 */
     22
    2223#ifndef __WINE_OLE_COMPOBJ_H
    2324#define __WINE_OLE_COMPOBJ_H
  • trunk/src/ole32/compositemoniker.c

    r8441 r8620  
    4040    ICOM_VTABLE(IMoniker)*  lpvtbl1;  /* VTable relative to the IMoniker interface.*/
    4141
    42     /* The ROT (RunningObjectTable implementation) uses the IROTData 
    43      * interface to test whether two monikers are equal. That's why IROTData 
     42    /* The ROT (RunningObjectTable implementation) uses the IROTData
     43     * interface to test whether two monikers are equal. That's why IROTData
    4444     * interface is implemented by monikers.
    4545     */
     
    201201{
    202202    ICOM_THIS(CompositeMonikerImpl,iface);
    203  
     203
    204204    TRACE("(%p,%p,%p)\n",This,riid,ppvObject);
    205205
     
    207207    if ( (This==0) || (ppvObject==0) )
    208208        return E_INVALIDARG;
    209  
     209
    210210    /* Initialize the return parameter */
    211211    *ppvObject = 0;
     
    250250    ICOM_THIS(CompositeMonikerImpl,iface);
    251251    ULONG i;
    252    
     252
    253253    TRACE("(%p)\n",This);
    254254
     
    261261        for (i=0;i<This->tabLastIndex;i++)
    262262            IMoniker_Release(This->tabMoniker[i]);
    263        
     263
    264264        CompositeMonikerImpl_Destroy(This);
    265265
    266266        return 0;
    267267    }
    268     return This->ref;;
     268    return This->ref;
    269269}
    270270
     
    278278    if (pClassID==NULL)
    279279        return E_POINTER;
    280            
     280
    281281    *pClassID = CLSID_CompositeMoniker;
    282        
     282
    283283    return S_OK;
    284284}
     
    307307    CLSID clsid;
    308308    WCHAR string[1]={0};
    309    
    310     ICOM_THIS(CompositeMonikerImpl,iface);   
     309
     310    ICOM_THIS(CompositeMonikerImpl,iface);
    311311
    312312    TRACE("(%p,%p)\n",iface,pStm);
     
    366366        /* resize the table if needed */
    367367        if (++This->tabLastIndex==This->tabSize){
    368                
     368
    369369            This->tabSize+=BLOCK_TAB_SIZE;
    370370            This->tabMoniker=HeapReAlloc(GetProcessHeap(),0,This->tabMoniker,This->tabSize*sizeof(IMoniker));
     
    387387    IMoniker *pmk;
    388388    DWORD constant=3;
    389    
     389
    390390    TRACE("(%p,%p,%d)\n",iface,pStm,fClearDirty);
    391391
    392     /* This function calls OleSaveToStream function for each moniker within 
     392    /* This function calls OleSaveToStream function for each moniker within
    393393     * this object.
    394      * When I tested this function in windows, I usually found this constant 
    395      * at the beginning of the stream. I don't known why (there's no 
     394     * When I tested this function in windows, I usually found this constant
     395     * at the beginning of the stream. I don't known why (there's no
    396396     * indication in the specification) !
    397397     */
     
    427427    ULARGE_INTEGER ptmpSize;
    428428
    429     /* The sizeMax of this object is calculated by calling  GetSizeMax on 
     429    /* The sizeMax of this object is calculated by calling  GetSizeMax on
    430430     * each moniker within this object then summing all returned values
    431431     */
     
    465465    IMoniker *tempMk;
    466466    HRESULT res;
    467    
     467
    468468    TRACE("(%p,%p,%p)\n",This,pmkFirst,pmkRest);
    469469
     
    491491
    492492        IMoniker_Enum(pmkFirst,TRUE,&enumMoniker);
    493        
     493
    494494        while(IEnumMoniker_Next(enumMoniker,1,&This->tabMoniker[This->tabLastIndex],NULL)==S_OK){
    495495
    496496
    497497            if (++This->tabLastIndex==This->tabSize){
    498                
     498
    499499                This->tabSize+=BLOCK_TAB_SIZE;
    500500                This->tabMoniker=HeapReAlloc(GetProcessHeap(),0,This->tabMoniker,This->tabSize*sizeof(IMoniker));
     
    511511
    512512    IMoniker_IsSystemMoniker(pmkRest,&mkSys);
    513    
     513
    514514    if (mkSys!=MKSYS_GENERICCOMPOSITE){
    515515
     
    518518        res=IMoniker_ComposeWith(This->tabMoniker[This->tabLastIndex-1],pmkRest,TRUE,&tempMk);
    519519
    520         if (res==MK_E_NEEDGENERIC){ 
     520        if (res==MK_E_NEEDGENERIC){
    521521
    522522            /* there's no simplification in this case */
     
    527527            IMoniker_AddRef(pmkRest);
    528528        }
    529         else if (tempMk==NULL){ 
     529        else if (tempMk==NULL){
    530530
    531531            /* we have an antimoniker after a simple moniker so we can make a simplification in this case */
     
    545545        /* resize tabMoniker if needed */
    546546        if (This->tabLastIndex==This->tabSize){
    547                
     547
    548548            This->tabSize+=BLOCK_TAB_SIZE;
    549549
     
    556556    else{
    557557
    558         /* add a composite moniker to the moniker table (do the same thing 
    559          * for each moniker within the composite moniker as a simple moniker 
     558        /* add a composite moniker to the moniker table (do the same thing
     559         * for each moniker within the composite moniker as a simple moniker
    560560         * (see above for how to add a simple moniker case) )
    561561         */
     
    584584
    585585            if (This->tabLastIndex==This->tabSize){
    586                
     586
    587587                This->tabSize+=BLOCK_TAB_SIZE;
    588588
     
    627627    IMoniker *tempMk,*antiMk,*mostRigthMk;
    628628    IEnumMoniker *enumMoniker;
    629    
     629
    630630    TRACE("(%p,%p,%p,%p,%p)\n",iface,pbc,pmkToLeft,riid,ppvResult);
    631631
    632632    if (ppvResult==NULL)
    633633        return E_POINTER;
    634    
     634
    635635    *ppvResult=0;
    636636    /* If pmkToLeft is NULL, this method looks for the moniker in the ROT, and if found, queries the retrieved */
     
    656656        IEnumMoniker_Next(enumMoniker,1,&mostRigthMk,NULL);
    657657        IEnumMoniker_Release(enumMoniker);
    658        
     658
    659659        res=CreateAntiMoniker(&antiMk);
    660660        res=IMoniker_ComposeWith(iface,antiMk,0,&tempMk);
    661661        IMoniker_Release(antiMk);
    662        
     662
    663663        res=CompositeMonikerImpl_BindToObject(mostRigthMk,pbc,tempMk,riid,ppvResult);
    664664
     
    691691
    692692    if (pmkToLeft!=NULL){
    693        
     693
    694694        IMoniker_Enum(iface,FALSE,&enumMoniker);
    695695        IEnumMoniker_Next(enumMoniker,1,&mostRigthMk,NULL);
    696696        IEnumMoniker_Release(enumMoniker);
    697        
     697
    698698        res=CreateAntiMoniker(&antiMk);
    699699        res=IMoniker_ComposeWith(iface,antiMk,0,&tempMk);
    700700        IMoniker_Release(antiMk);
    701        
     701
    702702        res=CompositeMonikerImpl_BindToStorage(mostRigthMk,pbc,tempMk,riid,ppvResult);
    703703
     
    737737        IEnumMoniker_Next(enumMoniker,1,&mostRigthMk,NULL);
    738738        IEnumMoniker_Release(enumMoniker);
    739        
     739
    740740        res=CreateAntiMoniker(&antiMk);
    741741        res=IMoniker_ComposeWith(iface,antiMk,0,&tempMk);
     
    754754        IEnumMoniker_Next(enumMoniker,1,&mostRigthMk,NULL);
    755755        IEnumMoniker_Release(enumMoniker);
    756        
     756
    757757        res=CreateAntiMoniker(&antiMk);
    758758        res=IMoniker_ComposeWith(iface,antiMk,0,&tempMk);
     
    797797    /* otherwise, the method returns the result of combining the two monikers by calling the */
    798798    /* CreateGenericComposite function */
    799    
     799
    800800    if (fOnlyIfNotGeneric)
    801801        return MK_E_NEEDGENERIC;
    802    
     802
    803803    return CreateGenericComposite(iface,pmkRight,ppmkComposite);
    804804}
     
    815815    if (ppenumMoniker == NULL)
    816816        return E_POINTER;
    817    
     817
    818818    return EnumMonikerImpl_CreateEnumMoniker(This->tabMoniker,This->tabLastIndex,0,fForward,ppenumMoniker);
    819819}
     
    827827    IMoniker *tempMk1,*tempMk2;
    828828    HRESULT res1,res2,res;
    829    
     829
    830830    TRACE("(%p,%p)\n",iface,pmkOtherMoniker);
    831831
     
    839839    if (enumMoniker1==NULL)
    840840        return S_FALSE;
    841    
     841
    842842    IMoniker_Enum(iface,TRUE,&enumMoniker2);
    843843
     
    846846        res1=IEnumMoniker_Next(enumMoniker1,1,&tempMk1,NULL);
    847847        res2=IEnumMoniker_Next(enumMoniker2,1,&tempMk2,NULL);
    848        
     848
    849849        if((res1==S_OK)&&(res2==S_OK)){
    850850
     
    916916        /* If pmkToLeft is NULL, this method returns S_OK if pmkNewlyRunning is non-NULL and is equal */
    917917        /* to this moniker */
    918        
     918
    919919        if (pmkNewlyRunning!=NULL)
    920920
     
    934934            /* IMoniker::IsRunning on the rightmost component of the composite, passing the remainder of */
    935935            /* the composite as the pmkToLeft parameter for that call.                                   */
    936            
     936
    937937             res=IBindCtx_GetRunningObjectTable(pbc,&rot);
    938938
     
    978978    IMoniker *tempMk,*antiMk,*mostRigthMk;
    979979    IEnumMoniker *enumMoniker;
    980    
     980
    981981    TRACE("(%p,%p,%p,%p)\n",iface,pbc,pmkToLeft,pCompositeTime);
    982982
     
    10751075    IEnumMoniker *enumMoniker1,*enumMoniker2;
    10761076    ULONG i,nbCommonMk=0;
    1077    
     1077
    10781078    /* If the other moniker is a composite, this method compares the components of each composite from left  */
    10791079    /* to right. The returned common prefix moniker might also be a composite moniker, depending on how many */
     
    10821082    if (ppmkPrefix==NULL)
    10831083        return E_POINTER;
    1084    
     1084
    10851085    *ppmkPrefix=0;
    10861086
    10871087    if (pmkOther==NULL)
    10881088        return MK_E_NOPREFIX;
    1089    
     1089
    10901090    IMoniker_IsSystemMoniker(pmkOther,&mkSys);
    10911091
     
    11511151            IMoniker_Release(tempMk1);
    11521152            IMoniker_Release(tempMk2);
    1153            
     1153
    11541154            /* compose all common monikers in a composite moniker */
    11551155            for(i=0;i<nbCommonMk;i++){
     
    11621162
    11631163                IMoniker_Release(tempMk1);
    1164                
     1164
    11651165                *ppmkPrefix=tempMk2;
    11661166            }
     
    12031203    DWORD mkSys;
    12041204    HRESULT res1,res2;
    1205    
     1205
    12061206    *restMk=0;
    12071207
     
    12461246    for(;IEnumMoniker_Next(enumMoniker3,1,&tempMk,NULL)==S_OK;nbRestMk++)
    12471247
    1248         IMoniker_Release(tempMk);;
     1248        IMoniker_Release(tempMk);
    12491249
    12501250    if (nbRestMk==0)
     
    13011301
    13021302    /* finds the common prefix of the two monikers */
    1303     res=IMoniker_CommonPrefixWith(iface,pmkOther,&commonMk);   
     1303    res=IMoniker_CommonPrefixWith(iface,pmkOther,&commonMk);
    13041304
    13051305    /* if there's no common prefix or the two moniker are equal the relative is the other moniker */
     
    13581358    if (ppszDisplayName==NULL)
    13591359        return E_POINTER;
    1360    
     1360
    13611361    *ppszDisplayName=CoTaskMemAlloc(sizeof(WCHAR));
    13621362
     
    13701370
    13711371    IMoniker_Enum(iface,TRUE,&enumMoniker);
    1372    
     1372
    13731373    while(IEnumMoniker_Next(enumMoniker,1,&tempMk,NULL)==S_OK){
    13741374
     
    14301430    if (!pwdMksys)
    14311431        return E_POINTER;
    1432    
     1432
    14331433    (*pwdMksys)=MKSYS_GENERICCOMPOSITE;
    14341434
     
    14671467{
    14681468    ICOM_THIS_From_IROTData(IMoniker, iface);
    1469    
     1469
    14701470    TRACE("(%p)\n",iface);
    14711471
     
    14911491{
    14921492    ICOM_THIS(EnumMonikerImpl,iface);
    1493  
     1493
    14941494    TRACE("(%p,%p,%p)\n",This,riid,ppvObject);
    14951495
     
    14971497    if ( (This==0) || (ppvObject==0) )
    14981498        return E_INVALIDARG;
    1499  
     1499
    15001500    /* Initialize the return parameter */
    15011501    *ppvObject = 0;
     
    15421542    /* destroy the object if there's no more reference on it */
    15431543    if (This->ref==0){
    1544        
     1544
    15451545        for(i=0;i<This->tabSize;i++)
    15461546            IMoniker_Release(This->tabMoniker[i]);
     
    15511551        return 0;
    15521552    }
    1553     return This->ref;;
     1553    return This->ref;
    15541554}
    15551555
     
    15691569    if (pceltFethed!=NULL)
    15701570        *pceltFethed= i;
    1571    
     1571
    15721572    if (i==celt)
    15731573        return S_OK;
     
    15871587
    15881588    This->currentPos+=celt;
    1589    
     1589
    15901590    return S_OK;
    15911591}
     
    16331633    if (currentPos > tabSize)
    16341634        return E_INVALIDARG;
    1635    
     1635
    16361636    /* Initialize the virtual function table. */
    16371637    ICOM_VTBL(newEnumMoniker)    = &VT_EnumMonikerImpl;
     
    16761676    if (ppmkComposite==NULL)
    16771677        return E_POINTER;
    1678    
     1678
    16791679    *ppmkComposite=0;
    16801680
  • trunk/src/ole32/datacache.c

    r8441 r8620  
    3131 *  -  This implementation of the datacache will let your application
    3232 *     load documents that have embedded OLE objects in them and it will
    33  *     also retrieve the metafile representation of those objects. 
     33 *     also retrieve the metafile representation of those objects.
    3434 *  -  This implementation of the datacache will also allow your
    3535 *     application to save new documents with OLE objects in them.
    36  *  -  The main thing that it doesn't do is allow you to activate 
     36 *  -  The main thing that it doesn't do is allow you to activate
    3737 *     or modify the OLE objects in any way.
    3838 *  -  I haven't found any good documentation on the real usage of
     
    4141 *     "\002OlePresXXX". It appears to just be a counter.
    4242 *  -  Also, I don't know the real content of the presentation stream
    43  *     header. I was able to figure-out where the extent of the object 
     43 *     header. I was able to figure-out where the extent of the object
    4444 *     was stored and the aspect, but that's about it.
    4545 */
     
    9595   * List all interface VTables here
    9696   */
    97   ICOM_VTABLE(IDataObject)*      lpvtbl1; 
     97  ICOM_VTABLE(IDataObject)*      lpvtbl1;
    9898  ICOM_VTABLE(IUnknown)*         lpvtbl2;
    9999  ICOM_VTABLE(IPersistStorage)*  lpvtbl3;
    100   ICOM_VTABLE(IViewObject2)*     lpvtbl4; 
     100  ICOM_VTABLE(IViewObject2)*     lpvtbl4;
    101101  ICOM_VTABLE(IOleCache2)*       lpvtbl5;
    102102  ICOM_VTABLE(IOleCacheControl)* lpvtbl6;
     
    133133
    134134/*
    135  * Here, I define utility macros to help with the casting of the 
     135 * Here, I define utility macros to help with the casting of the
    136136 * "this" parameter.
    137137 * There is a version to accomodate all of the VTables implemented
     
    139139 */
    140140#define _ICOM_THIS_From_IDataObject(class,name)       class* this = (class*)name;
    141 #define _ICOM_THIS_From_NDIUnknown(class, name)       class* this = (class*)(((char*)name)-sizeof(void*)); 
    142 #define _ICOM_THIS_From_IPersistStorage(class, name)  class* this = (class*)(((char*)name)-2*sizeof(void*)); 
    143 #define _ICOM_THIS_From_IViewObject2(class, name)     class* this = (class*)(((char*)name)-3*sizeof(void*)); 
    144 #define _ICOM_THIS_From_IOleCache2(class, name)       class* this = (class*)(((char*)name)-4*sizeof(void*)); 
    145 #define _ICOM_THIS_From_IOleCacheControl(class, name) class* this = (class*)(((char*)name)-5*sizeof(void*)); 
     141#define _ICOM_THIS_From_NDIUnknown(class, name)       class* this = (class*)(((char*)name)-sizeof(void*));
     142#define _ICOM_THIS_From_IPersistStorage(class, name)  class* this = (class*)(((char*)name)-2*sizeof(void*));
     143#define _ICOM_THIS_From_IViewObject2(class, name)     class* this = (class*)(((char*)name)-3*sizeof(void*));
     144#define _ICOM_THIS_From_IOleCache2(class, name)       class* this = (class*)(((char*)name)-4*sizeof(void*));
     145#define _ICOM_THIS_From_IOleCacheControl(class, name) class* this = (class*)(((char*)name)-5*sizeof(void*));
    146146
    147147/*
     
    171171            REFIID         riid,
    172172            void**         ppvObject);
    173 static ULONG WINAPI DataCache_NDIUnknown_AddRef( 
     173static ULONG WINAPI DataCache_NDIUnknown_AddRef(
    174174            IUnknown*      iface);
    175 static ULONG WINAPI DataCache_NDIUnknown_Release( 
     175static ULONG WINAPI DataCache_NDIUnknown_Release(
    176176            IUnknown*      iface);
    177177
     
    184184            REFIID           riid,
    185185            void**           ppvObject);
    186 static ULONG WINAPI DataCache_IDataObject_AddRef( 
     186static ULONG WINAPI DataCache_IDataObject_AddRef(
    187187            IDataObject*     iface);
    188 static ULONG WINAPI DataCache_IDataObject_Release( 
     188static ULONG WINAPI DataCache_IDataObject_Release(
    189189            IDataObject*     iface);
    190190static HRESULT WINAPI DataCache_GetData(
    191191            IDataObject*     iface,
    192             LPFORMATETC      pformatetcIn, 
     192            LPFORMATETC      pformatetcIn,
    193193            STGMEDIUM*       pmedium);
    194194static HRESULT WINAPI DataCache_GetDataHere(
    195             IDataObject*     iface, 
     195            IDataObject*     iface,
    196196            LPFORMATETC      pformatetc,
    197197            STGMEDIUM*       pmedium);
     
    200200            LPFORMATETC      pformatetc);
    201201static HRESULT WINAPI DataCache_GetCanonicalFormatEtc(
    202             IDataObject*     iface, 
    203             LPFORMATETC      pformatectIn, 
     202            IDataObject*     iface,
     203            LPFORMATETC      pformatectIn,
    204204            LPFORMATETC      pformatetcOut);
    205205static HRESULT WINAPI DataCache_IDataObject_SetData(
    206206            IDataObject*     iface,
    207             LPFORMATETC      pformatetc, 
    208             STGMEDIUM*       pmedium, 
     207            LPFORMATETC      pformatetc,
     208            STGMEDIUM*       pmedium,
    209209            BOOL             fRelease);
    210210static HRESULT WINAPI DataCache_EnumFormatEtc(
    211             IDataObject*     iface,       
     211            IDataObject*     iface,
    212212            DWORD            dwDirection,
    213213            IEnumFORMATETC** ppenumFormatEtc);
    214214static HRESULT WINAPI DataCache_DAdvise(
    215             IDataObject*     iface, 
    216             FORMATETC*       pformatetc, 
    217             DWORD            advf, 
    218             IAdviseSink*     pAdvSink, 
     215            IDataObject*     iface,
     216            FORMATETC*       pformatetc,
     217            DWORD            advf,
     218            IAdviseSink*     pAdvSink,
    219219            DWORD*           pdwConnection);
    220220static HRESULT WINAPI DataCache_DUnadvise(
     
    233233            REFIID           riid,
    234234            void**           ppvObject);
    235 static ULONG WINAPI DataCache_IPersistStorage_AddRef( 
     235static ULONG WINAPI DataCache_IPersistStorage_AddRef(
    236236            IPersistStorage* iface);
    237 static ULONG WINAPI DataCache_IPersistStorage_Release( 
     237static ULONG WINAPI DataCache_IPersistStorage_Release(
    238238            IPersistStorage* iface);
    239 static HRESULT WINAPI DataCache_GetClassID( 
     239static HRESULT WINAPI DataCache_GetClassID(
    240240            IPersistStorage* iface,
    241241            CLSID*           pClassID);
    242 static HRESULT WINAPI DataCache_IsDirty( 
     242static HRESULT WINAPI DataCache_IsDirty(
    243243            IPersistStorage* iface);
    244 static HRESULT WINAPI DataCache_InitNew(
    245             IPersistStorage* iface,
    246             IStorage*        pStg);
    247 static HRESULT WINAPI DataCache_Load(
     244static HRESULT WINAPI DataCache_InitNew(
    248245            IPersistStorage* iface,
    249246            IStorage*        pStg);
    250 static HRESULT WINAPI DataCache_Save(
     247static HRESULT WINAPI DataCache_Load(
    251248            IPersistStorage* iface,
    252             IStorage*        pStg,
     249            IStorage*        pStg);
     250static HRESULT WINAPI DataCache_Save(
     251            IPersistStorage* iface,
     252            IStorage*        pStg,
    253253            BOOL             fSameAsLoad);
    254 static HRESULT WINAPI DataCache_SaveCompleted( 
    255             IPersistStorage* iface, 
     254static HRESULT WINAPI DataCache_SaveCompleted(
     255            IPersistStorage* iface,
    256256            IStorage*        pStgNew);
    257257static HRESULT WINAPI DataCache_HandsOffStorage(
     
    266266            REFIID           riid,
    267267            void**           ppvObject);
    268 static ULONG WINAPI DataCache_IViewObject2_AddRef( 
     268static ULONG WINAPI DataCache_IViewObject2_AddRef(
    269269            IViewObject2* iface);
    270 static ULONG WINAPI DataCache_IViewObject2_Release( 
     270static ULONG WINAPI DataCache_IViewObject2_Release(
    271271            IViewObject2* iface);
    272272static HRESULT WINAPI DataCache_Draw(
     
    275275            LONG             lindex,
    276276            void*            pvAspect,
    277             DVTARGETDEVICE*  ptd, 
    278             HDC              hdcTargetDev, 
     277            DVTARGETDEVICE*  ptd,
     278            HDC              hdcTargetDev,
    279279            HDC              hdcDraw,
    280280            LPCRECTL         lprcBounds,
     
    283283            DWORD            dwContinue);
    284284static HRESULT WINAPI DataCache_GetColorSet(
    285             IViewObject2*   iface, 
    286             DWORD           dwDrawAspect, 
    287             LONG            lindex, 
    288             void*           pvAspect, 
    289             DVTARGETDEVICE* ptd, 
    290             HDC             hicTargetDevice, 
     285            IViewObject2*   iface,
     286            DWORD           dwDrawAspect,
     287            LONG            lindex,
     288            void*           pvAspect,
     289            DVTARGETDEVICE* ptd,
     290            HDC             hicTargetDevice,
    291291            LOGPALETTE**    ppColorSet);
    292292static HRESULT WINAPI DataCache_Freeze(
     
    294294            DWORD           dwDrawAspect,
    295295            LONG            lindex,
    296             void*           pvAspect, 
     296            void*           pvAspect,
    297297            DWORD*          pdwFreeze);
    298298static HRESULT WINAPI DataCache_Unfreeze(
     
    301301static HRESULT WINAPI DataCache_SetAdvise(
    302302            IViewObject2*   iface,
    303             DWORD           aspects, 
    304             DWORD           advf, 
     303            DWORD           aspects,
     304            DWORD           advf,
    305305            IAdviseSink*    pAdvSink);
    306306static HRESULT WINAPI DataCache_GetAdvise(
    307             IViewObject2*   iface, 
    308             DWORD*          pAspects, 
    309             DWORD*          pAdvf, 
     307            IViewObject2*   iface,
     308            DWORD*          pAspects,
     309            DWORD*          pAdvf,
    310310            IAdviseSink**   ppAdvSink);
    311311static HRESULT WINAPI DataCache_GetExtent(
    312             IViewObject2*   iface, 
    313             DWORD           dwDrawAspect, 
    314             LONG            lindex, 
    315             DVTARGETDEVICE* ptd, 
     312            IViewObject2*   iface,
     313            DWORD           dwDrawAspect,
     314            LONG            lindex,
     315            DVTARGETDEVICE* ptd,
    316316            LPSIZEL         lpsizel);
    317317
     
    324324            REFIID          riid,
    325325            void**          ppvObject);
    326 static ULONG WINAPI DataCache_IOleCache2_AddRef( 
     326static ULONG WINAPI DataCache_IOleCache2_AddRef(
    327327            IOleCache2*     iface);
    328 static ULONG WINAPI DataCache_IOleCache2_Release( 
     328static ULONG WINAPI DataCache_IOleCache2_Release(
    329329            IOleCache2*     iface);
    330330static HRESULT WINAPI DataCache_Cache(
     
    349349static HRESULT WINAPI DataCache_UpdateCache(
    350350            IOleCache2*     iface,
    351             LPDATAOBJECT    pDataObject, 
     351            LPDATAOBJECT    pDataObject,
    352352            DWORD           grfUpdf,
    353353            LPVOID          pReserved);
     
    364364            REFIID            riid,
    365365            void**            ppvObject);
    366 static ULONG WINAPI DataCache_IOleCacheControl_AddRef( 
     366static ULONG WINAPI DataCache_IOleCacheControl_AddRef(
    367367            IOleCacheControl* iface);
    368 static ULONG WINAPI DataCache_IOleCacheControl_Release( 
     368static ULONG WINAPI DataCache_IOleCacheControl_Release(
    369369            IOleCacheControl* iface);
    370370static HRESULT WINAPI DataCache_OnRun(
     
    461461 */
    462462HRESULT WINAPI CreateDataCache(
    463   LPUNKNOWN pUnkOuter, 
    464   REFCLSID  rclsid, 
    465   REFIID    riid, 
     463  LPUNKNOWN pUnkOuter,
     464  REFCLSID  rclsid,
     465  REFIID    riid,
    466466  LPVOID*   ppvObj)
    467467{
     
    485485   * IUnknown pointer can be returned to the outside.
    486486   */
    487   if ( (pUnkOuter!=NULL) && 
     487  if ( (pUnkOuter!=NULL) &&
    488488       (memcmp(&IID_IUnknown, riid, sizeof(IID_IUnknown)) != 0) )
    489489    return CLASS_E_NOAGGREGATION;
     
    492492   * Try to construct a new instance of the class.
    493493   */
    494   newCache = DataCache_Construct(rclsid, 
     494  newCache = DataCache_Construct(rclsid,
    495495                                 pUnkOuter);
    496496
     
    528528  if (newObject==0)
    529529    return newObject;
    530  
     530
    531531  /*
    532532   * Initialize the virtual function table.
     
    538538  newObject->lpvtbl5 = &DataCache_IOleCache2_VTable;
    539539  newObject->lpvtbl6 = &DataCache_IOleCacheControl_VTable;
    540  
    541   /*
    542    * Start with one reference count. The caller of this function 
     540
     541  /*
     542   * Start with one reference count. The caller of this function
    543543   * must release the interface pointer when it is done.
    544544   */
     
    547547  /*
    548548   * Initialize the outer unknown
    549    * We don't keep a reference on the outer unknown since, the way 
     549   * We don't keep a reference on the outer unknown since, the way
    550550   * aggregation works, our lifetime is at least as large as it's
    551551   * lifetime.
     
    593593 * DataCache_ReadPresentationData
    594594 *
    595  * This method will read information for the requested presentation 
     595 * This method will read information for the requested presentation
    596596 * into the given structure.
    597597 *
     
    796796 * DataCache_ReadPresentationData
    797797 *
    798  * This method will read information for the requested presentation 
     798 * This method will read information for the requested presentation
    799799 * into the given structure.
    800800 *
     
    822822   */
    823823  hres = DataCache_OpenPresStream(
    824            this, 
     824           this,
    825825           drawAspect,
    826826           &presStream);
     
    853853   * Allocate a buffer for the metafile bits.
    854854   */
    855   metafileBits = HeapAlloc(GetProcessHeap(), 
    856                            0, 
     855  metafileBits = HeapAlloc(GetProcessHeap(),
     856                           0,
    857857                           streamInfo.cbSize.s.LowPart);
    858858
     
    911911  if ( (this==0) || (ppvObject==0) )
    912912    return E_INVALIDARG;
    913  
     913
    914914  /*
    915915   * Initialize the return parameter.
     
    920920   * Compare the riid with the interface IDs implemented by this object.
    921921   */
    922   if (memcmp(&IID_IUnknown, riid, sizeof(IID_IUnknown)) == 0) 
     922  if (memcmp(&IID_IUnknown, riid, sizeof(IID_IUnknown)) == 0)
    923923  {
    924924    *ppvObject = iface;
    925925  }
    926   else if (memcmp(&IID_IDataObject, riid, sizeof(IID_IDataObject)) == 0) 
     926  else if (memcmp(&IID_IDataObject, riid, sizeof(IID_IDataObject)) == 0)
    927927  {
    928928    *ppvObject = (IDataObject*)&(this->lpvtbl1);
     
    943943    *ppvObject = (IOleCache2*)&(this->lpvtbl5);
    944944  }
    945   else if (memcmp(&IID_IOleCacheControl, riid, sizeof(IID_IOleCacheControl)) == 0) 
     945  else if (memcmp(&IID_IOleCacheControl, riid, sizeof(IID_IOleCacheControl)) == 0)
    946946  {
    947947    *ppvObject = (IOleCacheControl*)&(this->lpvtbl6);
     
    956956    return E_NOINTERFACE;
    957957  }
    958  
     958
    959959  /*
    960960   * Query Interface always increases the reference count by one when it is
    961    * successful. 
     961   * successful.
    962962   */
    963963  IUnknown_AddRef((IUnknown*)*ppvObject);
    964964
    965   return S_OK;
     965  return S_OK;
    966966}
    967967
     
    974974 * to the outer unknown.
    975975 */
    976 static ULONG WINAPI DataCache_NDIUnknown_AddRef( 
     976static ULONG WINAPI DataCache_NDIUnknown_AddRef(
    977977            IUnknown*      iface)
    978978{
     
    992992 * to the outer unknown.
    993993 */
    994 static ULONG WINAPI DataCache_NDIUnknown_Release( 
     994static ULONG WINAPI DataCache_NDIUnknown_Release(
    995995            IUnknown*      iface)
    996996{
     
    10111011    return 0;
    10121012  }
    1013  
     1013
    10141014  return this->ref;
    10151015}
     
    10321032  _ICOM_THIS_From_IDataObject(DataCache, iface);
    10331033
    1034   return IUnknown_QueryInterface(this->outerUnknown, riid, ppvObject); 
     1034  return IUnknown_QueryInterface(this->outerUnknown, riid, ppvObject);
    10351035}
    10361036
     
    10401040 * See Windows documentation for more details on IUnknown methods.
    10411041 */
    1042 static ULONG WINAPI DataCache_IDataObject_AddRef( 
     1042static ULONG WINAPI DataCache_IDataObject_AddRef(
    10431043            IDataObject*     iface)
    10441044{
    10451045  _ICOM_THIS_From_IDataObject(DataCache, iface);
    10461046
    1047   return IUnknown_AddRef(this->outerUnknown); 
     1047  return IUnknown_AddRef(this->outerUnknown);
    10481048}
    10491049
     
    10531053 * See Windows documentation for more details on IUnknown methods.
    10541054 */
    1055 static ULONG WINAPI DataCache_IDataObject_Release( 
     1055static ULONG WINAPI DataCache_IDataObject_Release(
    10561056            IDataObject*     iface)
    10571057{
    10581058  _ICOM_THIS_From_IDataObject(DataCache, iface);
    10591059
    1060   return IUnknown_Release(this->outerUnknown); 
     1060  return IUnknown_Release(this->outerUnknown);
    10611061}
    10621062
     
    10701070static HRESULT WINAPI DataCache_GetData(
    10711071            IDataObject*     iface,
    1072             LPFORMATETC      pformatetcIn, 
     1072            LPFORMATETC      pformatetcIn,
    10731073            STGMEDIUM*       pmedium)
    10741074{
     
    11681168
    11691169static HRESULT WINAPI DataCache_GetDataHere(
    1170             IDataObject*     iface, 
     1170            IDataObject*     iface,
    11711171            LPFORMATETC      pformatetc,
    11721172            STGMEDIUM*       pmedium)
     
    11921192 */
    11931193static HRESULT WINAPI DataCache_GetCanonicalFormatEtc(
    1194             IDataObject*     iface, 
    1195             LPFORMATETC      pformatectIn, 
     1194            IDataObject*     iface,
     1195            LPFORMATETC      pformatectIn,
    11961196            LPFORMATETC      pformatetcOut)
    11971197{
     
    12091209static HRESULT WINAPI DataCache_IDataObject_SetData(
    12101210            IDataObject*     iface,
    1211             LPFORMATETC      pformatetc, 
    1212             STGMEDIUM*       pmedium, 
     1211            LPFORMATETC      pformatetc,
     1212            STGMEDIUM*       pmedium,
    12131213            BOOL             fRelease)
    12141214{
     
    12271227  IOleCache2_Release(oleCache);
    12281228
    1229   return hres;;
     1229  return hres;
    12301230}
    12311231
     
    12381238 */
    12391239static HRESULT WINAPI DataCache_EnumFormatEtc(
    1240             IDataObject*     iface,       
     1240            IDataObject*     iface,
    12411241            DWORD            dwDirection,
    12421242            IEnumFORMATETC** ppenumFormatEtc)
     
    12541254 */
    12551255static HRESULT WINAPI DataCache_DAdvise(
    1256             IDataObject*     iface, 
    1257             FORMATETC*       pformatetc, 
    1258             DWORD            advf, 
    1259             IAdviseSink*     pAdvSink, 
     1256            IDataObject*     iface,
     1257            FORMATETC*       pformatetc,
     1258            DWORD            advf,
     1259            IAdviseSink*     pAdvSink,
    12601260            DWORD*           pdwConnection)
    12611261{
     
    13111311  _ICOM_THIS_From_IPersistStorage(DataCache, iface);
    13121312
    1313   return IUnknown_QueryInterface(this->outerUnknown, riid, ppvObject); 
     1313  return IUnknown_QueryInterface(this->outerUnknown, riid, ppvObject);
    13141314}
    13151315
     
    13191319 * See Windows documentation for more details on IUnknown methods.
    13201320 */
    1321 static ULONG WINAPI DataCache_IPersistStorage_AddRef( 
     1321static ULONG WINAPI DataCache_IPersistStorage_AddRef(
    13221322            IPersistStorage* iface)
    13231323{
    13241324  _ICOM_THIS_From_IPersistStorage(DataCache, iface);
    13251325
    1326   return IUnknown_AddRef(this->outerUnknown); 
     1326  return IUnknown_AddRef(this->outerUnknown);
    13271327}
    13281328
     
    13321332 * See Windows documentation for more details on IUnknown methods.
    13331333 */
    1334 static ULONG WINAPI DataCache_IPersistStorage_Release( 
     1334static ULONG WINAPI DataCache_IPersistStorage_Release(
    13351335            IPersistStorage* iface)
    13361336{
    13371337  _ICOM_THIS_From_IPersistStorage(DataCache, iface);
    13381338
    1339   return IUnknown_Release(this->outerUnknown); 
     1339  return IUnknown_Release(this->outerUnknown);
    13401340}
    13411341
     
    13471347 * See Windows documentation for more details on IPersistStorage methods.
    13481348 */
    1349 static HRESULT WINAPI DataCache_GetClassID( 
     1349static HRESULT WINAPI DataCache_GetClassID(
    13501350            IPersistStorage* iface,
    13511351            CLSID*           pClassID)
     
    13581358 * DataCache_IsDirty (IPersistStorage)
    13591359 *
    1360  * Until we actully connect to a running object and retrieve new 
     1360 * Until we actully connect to a running object and retrieve new
    13611361 * information to it, we never get dirty.
    13621362 *
    13631363 * See Windows documentation for more details on IPersistStorage methods.
    13641364 */
    1365 static HRESULT WINAPI DataCache_IsDirty( 
     1365static HRESULT WINAPI DataCache_IsDirty(
    13661366            IPersistStorage* iface)
    13671367{
     
    13791379 * See Windows documentation for more details on IPersistStorage methods.
    13801380 */
    1381 static HRESULT WINAPI DataCache_InitNew(
    1382             IPersistStorage* iface,
    1383             IStorage*        pStg)
    1384 {
    1385   TRACE("(%p, %p)\n", iface, pStg);
    1386 
    1387   return DataCache_Load(iface, pStg);
    1388 }
    1389 
    1390 /************************************************************************
    1391  * DataCache_Load (IPersistStorage)
    1392  *
    1393  * The data cache implementation of IPersistStorage_Load doesn't
    1394  * actually load anything. Instead, it holds on to the storage pointer
    1395  * and it will load the presentation information when the
    1396  * IDataObject_GetData or IViewObject2_Draw methods are called.
    1397  *
    1398  * See Windows documentation for more details on IPersistStorage methods.
    1399  */
    1400 static HRESULT WINAPI DataCache_Load(
     1381static HRESULT WINAPI DataCache_InitNew(
    14011382            IPersistStorage* iface,
    14021383            IStorage*        pStg)
    14031384{
     1385  TRACE("(%p, %p)\n", iface, pStg);
     1386
     1387  return DataCache_Load(iface, pStg);
     1388}
     1389
     1390/************************************************************************
     1391 * DataCache_Load (IPersistStorage)
     1392 *
     1393 * The data cache implementation of IPersistStorage_Load doesn't
     1394 * actually load anything. Instead, it holds on to the storage pointer
     1395 * and it will load the presentation information when the
     1396 * IDataObject_GetData or IViewObject2_Draw methods are called.
     1397 *
     1398 * See Windows documentation for more details on IPersistStorage methods.
     1399 */
     1400static HRESULT WINAPI DataCache_Load(
     1401            IPersistStorage* iface,
     1402            IStorage*        pStg)
     1403{
    14041404  _ICOM_THIS_From_IPersistStorage(DataCache, iface);
    14051405
     
    14231423 * DataCache_Save (IPersistStorage)
    14241424 *
    1425  * Until we actully connect to a running object and retrieve new 
     1425 * Until we actully connect to a running object and retrieve new
    14261426 * information to it, we never have to save anything. However, it is
    14271427 * our responsability to copy the information when saving to a new
     
    14301430 * See Windows documentation for more details on IPersistStorage methods.
    14311431 */
    1432 static HRESULT WINAPI DataCache_Save( 
     1432static HRESULT WINAPI DataCache_Save(
    14331433            IPersistStorage* iface,
    1434             IStorage*        pStg, 
     1434            IStorage*        pStg,
    14351435            BOOL             fSameAsLoad)
    14361436{
     
    14391439  TRACE("(%p, %p, %d)\n", iface, pStg, fSameAsLoad);
    14401440
    1441   if ( (!fSameAsLoad) && 
     1441  if ( (!fSameAsLoad) &&
    14421442       (this->presentationStorage!=NULL) )
    14431443  {
     
    14601460 * See Windows documentation for more details on IPersistStorage methods.
    14611461 */
    1462 static HRESULT WINAPI DataCache_SaveCompleted( 
    1463             IPersistStorage* iface, 
     1462static HRESULT WINAPI DataCache_SaveCompleted(
     1463            IPersistStorage* iface,
    14641464            IStorage*        pStgNew)
    14651465{
     
    15251525  _ICOM_THIS_From_IViewObject2(DataCache, iface);
    15261526
    1527   return IUnknown_QueryInterface(this->outerUnknown, riid, ppvObject); 
     1527  return IUnknown_QueryInterface(this->outerUnknown, riid, ppvObject);
    15281528}
    15291529
     
    15331533 * See Windows documentation for more details on IUnknown methods.
    15341534 */
    1535 static ULONG WINAPI DataCache_IViewObject2_AddRef( 
     1535static ULONG WINAPI DataCache_IViewObject2_AddRef(
    15361536            IViewObject2* iface)
    15371537{
    15381538  _ICOM_THIS_From_IViewObject2(DataCache, iface);
    15391539
    1540   return IUnknown_AddRef(this->outerUnknown); 
     1540  return IUnknown_AddRef(this->outerUnknown);
    15411541}
    15421542
     
    15461546 * See Windows documentation for more details on IUnknown methods.
    15471547 */
    1548 static ULONG WINAPI DataCache_IViewObject2_Release( 
     1548static ULONG WINAPI DataCache_IViewObject2_Release(
    15491549            IViewObject2* iface)
    15501550{
    15511551  _ICOM_THIS_From_IViewObject2(DataCache, iface);
    15521552
    1553   return IUnknown_Release(this->outerUnknown); 
     1553  return IUnknown_Release(this->outerUnknown);
    15541554}
    15551555
     
    15671567            LONG             lindex,
    15681568            void*            pvAspect,
    1569             DVTARGETDEVICE*  ptd, 
    1570             HDC              hdcTargetDev, 
     1569            DVTARGETDEVICE*  ptd,
     1570            HDC              hdcTargetDev,
    15711571            HDC              hdcDraw,
    15721572            LPCRECTL         lprcBounds,
     
    15861586        lindex,
    15871587        pvAspect,
    1588         hdcTargetDev, 
     1588        hdcTargetDev,
    15891589        hdcDraw,
    15901590        lprcBounds,
     
    16371637                   &oldWindowExt);
    16381638
    1639     SetViewportExtEx(hdcDraw, 
     1639    SetViewportExtEx(hdcDraw,
    16401640                     lprcBounds->right - lprcBounds->left,
    16411641                     lprcBounds->bottom - lprcBounds->top,
     
    16541654                   NULL);
    16551655
    1656     SetViewportExtEx(hdcDraw, 
     1656    SetViewportExtEx(hdcDraw,
    16571657                     oldViewportExt.cx,
    16581658                     oldViewportExt.cy,
     
    16731673
    16741674static HRESULT WINAPI DataCache_GetColorSet(
    1675             IViewObject2*   iface, 
    1676             DWORD           dwDrawAspect, 
    1677             LONG            lindex, 
    1678             void*           pvAspect, 
    1679             DVTARGETDEVICE* ptd, 
    1680             HDC             hicTargetDevice, 
     1675            IViewObject2*   iface,
     1676            DWORD           dwDrawAspect,
     1677            LONG            lindex,
     1678            void*           pvAspect,
     1679            DVTARGETDEVICE* ptd,
     1680            HDC             hicTargetDevice,
    16811681            LOGPALETTE**    ppColorSet)
    16821682{
     
    16891689            DWORD           dwDrawAspect,
    16901690            LONG            lindex,
    1691             void*           pvAspect, 
     1691            void*           pvAspect,
    16921692            DWORD*          pdwFreeze)
    16931693{
     
    17141714static HRESULT WINAPI DataCache_SetAdvise(
    17151715            IViewObject2*   iface,
    1716             DWORD           aspects, 
    1717             DWORD           advf, 
     1716            DWORD           aspects,
     1717            DWORD           advf,
    17181718            IAdviseSink*    pAdvSink)
    17191719{
     
    17291729    IAdviseSink_Release(this->sinkInterface);
    17301730    this->sinkInterface  = NULL;
    1731     this->sinkAspects    = 0; 
     1731    this->sinkAspects    = 0;
    17321732    this->sinkAdviseFlag = 0;
    17331733  }
     
    17391739  {
    17401740    this->sinkInterface  = pAdvSink;
    1741     this->sinkAspects    = aspects; 
    1742     this->sinkAdviseFlag = advf;   
     1741    this->sinkAspects    = aspects;
     1742    this->sinkAdviseFlag = advf;
    17431743
    17441744    IAdviseSink_AddRef(this->sinkInterface);
     
    17621762 * DataCache_GetAdvise (IViewObject2)
    17631763 *
    1764  * This method queries the current state of the advise sink 
     1764 * This method queries the current state of the advise sink
    17651765 * installed on the data cache.
    17661766 *
     
    17681768 */
    17691769static HRESULT WINAPI DataCache_GetAdvise(
    1770             IViewObject2*   iface, 
    1771             DWORD*          pAspects, 
    1772             DWORD*          pAdvf, 
     1770            IViewObject2*   iface,
     1771            DWORD*          pAspects,
     1772            DWORD*          pAdvf,
    17731773            IAdviseSink**   ppAdvSink)
    17741774{
     
    17881788  if (ppAdvSink!=NULL)
    17891789  {
    1790     IAdviseSink_QueryInterface(this->sinkInterface, 
    1791                                &IID_IAdviseSink, 
     1790    IAdviseSink_QueryInterface(this->sinkInterface,
     1791                               &IID_IAdviseSink,
    17921792                               (void**)ppAdvSink);
    17931793  }
     
    18041804 */
    18051805static HRESULT WINAPI DataCache_GetExtent(
    1806             IViewObject2*   iface, 
    1807             DWORD           dwDrawAspect, 
    1808             LONG            lindex, 
    1809             DVTARGETDEVICE* ptd, 
     1806            IViewObject2*   iface,
     1807            DWORD           dwDrawAspect,
     1808            LONG            lindex,
     1809            DVTARGETDEVICE* ptd,
    18101810            LPSIZEL         lpsizel)
    18111811{
     
    18151815  _ICOM_THIS_From_IViewObject2(DataCache, iface);
    18161816
    1817   TRACE("(%p, %lx, %ld, %p, %p)\n", 
     1817  TRACE("(%p, %lx, %ld, %p, %p)\n",
    18181818        iface, dwDrawAspect, lindex, ptd, lpsizel);
    18191819
     
    18421842  if (ptd!=NULL)
    18431843    FIXME("Unimplemented ptd = %p\n", ptd);
    1844  
    1845   /*
    1846    * Get the presentation information from the 
     1844
     1845  /*
     1846   * Get the presentation information from the
    18471847   * cache.
    18481848   */
     
    18841884  _ICOM_THIS_From_IOleCache2(DataCache, iface);
    18851885
    1886   return IUnknown_QueryInterface(this->outerUnknown, riid, ppvObject); 
     1886  return IUnknown_QueryInterface(this->outerUnknown, riid, ppvObject);
    18871887}
    18881888
     
    18921892 * See Windows documentation for more details on IUnknown methods.
    18931893 */
    1894 static ULONG WINAPI DataCache_IOleCache2_AddRef( 
     1894static ULONG WINAPI DataCache_IOleCache2_AddRef(
    18951895            IOleCache2*     iface)
    18961896{
    18971897  _ICOM_THIS_From_IOleCache2(DataCache, iface);
    18981898
    1899   return IUnknown_AddRef(this->outerUnknown); 
     1899  return IUnknown_AddRef(this->outerUnknown);
    19001900}
    19011901
     
    19051905 * See Windows documentation for more details on IUnknown methods.
    19061906 */
    1907 static ULONG WINAPI DataCache_IOleCache2_Release( 
     1907static ULONG WINAPI DataCache_IOleCache2_Release(
    19081908            IOleCache2*     iface)
    19091909{
    19101910  _ICOM_THIS_From_IOleCache2(DataCache, iface);
    19111911
    1912   return IUnknown_Release(this->outerUnknown); 
     1912  return IUnknown_Release(this->outerUnknown);
    19131913}
    19141914
     
    19591959static HRESULT WINAPI DataCache_UpdateCache(
    19601960            IOleCache2*     iface,
    1961             LPDATAOBJECT    pDataObject, 
     1961            LPDATAOBJECT    pDataObject,
    19621962            DWORD           grfUpdf,
    19631963            LPVOID          pReserved)
     
    19931993  _ICOM_THIS_From_IOleCacheControl(DataCache, iface);
    19941994
    1995   return IUnknown_QueryInterface(this->outerUnknown, riid, ppvObject); 
     1995  return IUnknown_QueryInterface(this->outerUnknown, riid, ppvObject);
    19961996}
    19971997
     
    20012001 * See Windows documentation for more details on IUnknown methods.
    20022002 */
    2003 static ULONG WINAPI DataCache_IOleCacheControl_AddRef( 
     2003static ULONG WINAPI DataCache_IOleCacheControl_AddRef(
    20042004            IOleCacheControl* iface)
    20052005{
    20062006  _ICOM_THIS_From_IOleCacheControl(DataCache, iface);
    20072007
    2008   return IUnknown_AddRef(this->outerUnknown); 
     2008  return IUnknown_AddRef(this->outerUnknown);
    20092009}
    20102010
     
    20142014 * See Windows documentation for more details on IUnknown methods.
    20152015 */
    2016 static ULONG WINAPI DataCache_IOleCacheControl_Release( 
     2016static ULONG WINAPI DataCache_IOleCacheControl_Release(
    20172017            IOleCacheControl* iface)
    20182018{
    20192019  _ICOM_THIS_From_IOleCacheControl(DataCache, iface);
    20202020
    2021   return IUnknown_Release(this->outerUnknown); 
     2021  return IUnknown_Release(this->outerUnknown);
    20222022}
    20232023
  • trunk/src/ole32/errorinfo.c

    r8441 r8620  
    2020 * NOTES:
    2121 *
    22  * The errorinfo is a per-thread object. The reference is stored in the 
     22 * The errorinfo is a per-thread object. The reference is stored in the
    2323 * TEB at offset 0xf80
    2424 */
     
    4848    WCHAR* stringBuffer;
    4949    DWORD len;
    50    
     50
    5151    if (in == NULL)
    5252        return NULL;
     
    107107{
    108108    DWORD* bufferPointer;
    109    
     109
    110110    /* NULL is a valid parameter */
    111111    if(!in) return;
     
    133133        ICOM_VTABLE(ISupportErrorInfo)  *lpvtsei;
    134134        DWORD                           ref;
    135        
     135
    136136        GUID m_Guid;
    137137        BSTR bstrSource;
     
    148148 converts a objectpointer to This
    149149 */
    150 #define _IErrorInfo_Offset ((int)(&(((ErrorInfoImpl*)0)->lpvtei))) 
    151 #define _ICOM_THIS_From_IErrorInfo(class, name) class* This = (class*)(((char*)name)-_IErrorInfo_Offset); 
    152 
    153 #define _ICreateErrorInfo_Offset ((int)(&(((ErrorInfoImpl*)0)->lpvtcei))) 
    154 #define _ICOM_THIS_From_ICreateErrorInfo(class, name) class* This = (class*)(((char*)name)-_ICreateErrorInfo_Offset); 
    155 
    156 #define _ISupportErrorInfo_Offset ((int)(&(((ErrorInfoImpl*)0)->lpvtsei))) 
    157 #define _ICOM_THIS_From_ISupportErrorInfo(class, name) class* This = (class*)(((char*)name)-_ISupportErrorInfo_Offset); 
     150#define _IErrorInfo_Offset ((int)(&(((ErrorInfoImpl*)0)->lpvtei)))
     151#define _ICOM_THIS_From_IErrorInfo(class, name) class* This = (class*)(((char*)name)-_IErrorInfo_Offset);
     152
     153#define _ICreateErrorInfo_Offset ((int)(&(((ErrorInfoImpl*)0)->lpvtcei)))
     154#define _ICOM_THIS_From_ICreateErrorInfo(class, name) class* This = (class*)(((char*)name)-_ICreateErrorInfo_Offset);
     155
     156#define _ISupportErrorInfo_Offset ((int)(&(((ErrorInfoImpl*)0)->lpvtsei)))
     157#define _ICOM_THIS_From_ISupportErrorInfo(class, name) class* This = (class*)(((char*)name)-_ISupportErrorInfo_Offset);
    158158
    159159/*
     
    194194        if(IsEqualIID(riid, &IID_IErrorInfo))
    195195        {
    196           *ppvoid = _IErrorInfo_(This); 
     196          *ppvoid = _IErrorInfo_(This);
    197197        }
    198198        else if(IsEqualIID(riid, &IID_ICreateErrorInfo))
     
    240240static HRESULT WINAPI IErrorInfoImpl_GetGUID(
    241241        IErrorInfo* iface,
    242         GUID * pGUID) 
     242        GUID * pGUID)
    243243{
    244244        _ICOM_THIS_From_IErrorInfo(ErrorInfoImpl, iface);
     
    271271            return E_INVALIDARG;
    272272        *pBstrDescription = ERRORINFO_SysAllocString(This->bstrDescription);
    273        
     273
    274274        return S_OK;
    275275}
     
    285285            return E_INVALIDARG;
    286286        *pBstrHelpFile = ERRORINFO_SysAllocString(This->bstrHelpFile);
    287        
     287
    288288        return S_OK;
    289289}
     
    298298            return E_INVALIDARG;
    299299        *pdwHelpContext = This->m_dwHelpContext;
    300        
     300
    301301        return S_OK;
    302302}
     
    308308  IErrorInfoImpl_AddRef,
    309309  IErrorInfoImpl_Release,
    310  
     310
    311311  IErrorInfoImpl_GetGUID,
    312312  IErrorInfoImpl_GetSource,
     
    363363            ERRORINFO_SysFreeString(This->bstrSource);
    364364        This->bstrSource = ERRORINFO_SysAllocString(szSource);
    365        
     365
    366366        return S_OK;
    367367}
     
    376376            ERRORINFO_SysFreeString(This->bstrDescription);
    377377        This->bstrDescription = ERRORINFO_SysAllocString(szDescription);
    378        
     378
    379379        return S_OK;
    380380}
     
    400400        TRACE("(%p)\n",This);
    401401        This->m_dwHelpContext = dwHelpContext;
    402        
     402
    403403        return S_OK;
    404404}
     
    425425        _ICOM_THIS_From_ISupportErrorInfo(ErrorInfoImpl, iface);
    426426        TRACE("(%p)\n", This);
    427        
     427
    428428        return IErrorInfo_QueryInterface(_IErrorInfo_(This), riid, ppvoid);
    429429}
     
    475475        if(! pperrinfo ) return E_INVALIDARG;
    476476        if(!(pei=IErrorInfoImpl_Constructor()))return E_OUTOFMEMORY;
    477        
     477
    478478        res = IErrorInfo_QueryInterface(pei, &IID_ICreateErrorInfo, (LPVOID*)pperrinfo);
    479479        IErrorInfo_Release(pei);
  • trunk/src/ole32/filemoniker.c

    r8441 r8620  
    4040    ICOM_VTABLE(IMoniker)*  lpvtbl1;  /* VTable relative to the IMoniker interface.*/
    4141
    42     /* The ROT (RunningObjectTable implementation) uses the IROTData interface to test whether 
     42    /* The ROT (RunningObjectTable implementation) uses the IROTData interface to test whether
    4343     * two monikers are equal. That's whay IROTData interface is implemented by monikers.
    4444     */
     
    150150{
    151151    ICOM_THIS(FileMonikerImpl,iface);
    152  
     152
    153153  TRACE("(%p,%p,%p)\n",This,riid,ppvObject);
    154154
     
    156156    if ( (This==0) || (ppvObject==0) )
    157157        return E_INVALIDARG;
    158  
     158
    159159    /* Initialize the return parameter */
    160160  *ppvObject = 0;
     
    167167       )
    168168        *ppvObject = iface;
    169    
     169
    170170    else if (IsEqualIID(&IID_IROTData, riid))
    171171        *ppvObject = (IROTData*)&(This->lpvtbl2);
     
    174174    if ((*ppvObject)==0)
    175175        return E_NOINTERFACE;
    176  
     176
    177177    /* Query Interface always increases the reference count by one when it is successful */
    178178  FileMonikerImpl_AddRef(iface);
     
    211211        return 0;
    212212    }
    213     return This->ref;;
     213    return This->ref;
    214214}
    215215
     
    226226
    227227    *pClassID = CLSID_FileMoniker;
    228        
     228
    229229    return S_OK;
    230230}
     
    266266    if (bread!=sizeof(WORD) || wbuffer!=0)
    267267        return E_FAIL;
    268    
     268
    269269    /* read filePath string length (plus one) */
    270270    res=IStream_Read(pStm,&length,sizeof(DWORD),&bread);
     
    282282    if (bread != sizeof(DWORD) || dwbuffer != 0xDEADFFFF)
    283283        return E_FAIL;
    284        
     284
    285285    length--;
    286        
     286
    287287    for(i=0;i<10;i++){
    288288        res=IStream_Read(pStm,&wbuffer,sizeof(WORD),&bread);
     
    290290            return E_FAIL;
    291291    }
    292    
     292
    293293    if (length>8)
    294294        length=0;
    295        
     295
    296296    doubleLenHex=doubleLenDec=2*length;
    297297    if (length > 5)
     
    304304    if (length==0)
    305305        return res;
    306        
     306
    307307    res=IStream_Read(pStm,&dwbuffer,sizeof(DWORD),&bread);
    308308    if (bread!=sizeof(DWORD) || dwbuffer!=doubleLenHex)
     
    325325
    326326    HeapFree(GetProcessHeap(),0,filePathA);
    327    
     327
    328328    return res;
    329329}
     
    336336                                    BOOL fClearDirty)/* Specifies whether to clear the dirty flag */
    337337{
    338     /* this function saves data of this object. In the beginning I thougth 
    339      * that I have just to write the filePath string on Stream. But, when I 
    340      * tested this function whith windows programs samples, I noticed that it 
    341      * was not the case. So I analysed data written by this function on 
    342      * Windows and what this did function exactly ! But I have no idea about 
     338    /* this function saves data of this object. In the beginning I thougth
     339     * that I have just to write the filePath string on Stream. But, when I
     340     * tested this function whith windows programs samples, I noticed that it
     341     * was not the case. So I analysed data written by this function on
     342     * Windows and what this did function exactly ! But I have no idea about
    343343     * its logic !
    344344     * I guessed data which must be written on stream is:
     
    348348     * 4) DWORD constant : 0xDEADFFFF
    349349     * 5) ten WORD constant: zero
    350      * 6) DWORD: double-length of the the path string type W ("\0" not 
     350     * 6) DWORD: double-length of the the path string type W ("\0" not
    351351     *    included)
    352352     * 7) WORD constant: 0x3
     
    355355     */
    356356
    357     ICOM_THIS(FileMonikerImpl,iface);       
     357    ICOM_THIS(FileMonikerImpl,iface);
    358358
    359359    HRESULT res;
     
    390390    /* write a DWORD set to 0xDEADFFFF: constant */
    391391    res=IStream_Write(pStm,&constant1,sizeof(DWORD),NULL);
    392        
     392
    393393    len--;
    394394    /* write 10 times a DWORD set to 0 : constants */
    395395    for(i=0;i<10;i++)
    396396        res=IStream_Write(pStm,&zero,sizeof(WORD),NULL);
    397        
     397
    398398    if (len>8)
    399399        len=0;
    400        
     400
    401401    doubleLenHex=doubleLenDec=2*len;
    402402    if (len > 5)
     
    437437
    438438    /* for more details see FileMonikerImpl_Save coments */
    439    
     439
    440440    sizeMAx =  sizeof(WORD) +           /* first WORD is 0 */
    441441               sizeof(DWORD)+           /* length of filePath including "\0" in the end of the string */
     
    447447    if (len==0 || len > 8)
    448448        return S_OK;
    449    
     449
    450450    sizeMAx += sizeof(DWORD)+           /* size of the unicode filePath: "\0" not included */
    451451               sizeof(WORD)+            /* constant : 0x3 */
    452452               len*sizeof(WCHAR);       /* unicde filePath string */
    453    
     453
    454454    pcbSize->s.LowPart=sizeMAx;
    455455    pcbSize->s.HighPart=0;
     
    469469    WCHAR bkSlash[]={'\\',0};
    470470    BYTE addBkSlash;
    471    
     471
    472472    TRACE("(%p,%p)\n",This,lpszPathName);
    473473
     
    514514
    515515        *This->filePathName=0;
    516    
     516
    517517        for(i=0;tabStr[i]!=NULL;i++)
    518518            strcatW(This->filePathName,tabStr[i]);
    519    
     519
    520520        if (addBkSlash)
    521521            strcatW(This->filePathName,bkSlash);
     
    560560    IClassFactory *pcf=0;
    561561    IClassActivator *pca=0;
    562    
    563     ICOM_THIS(FileMonikerImpl,iface);   
     562
     563    ICOM_THIS(FileMonikerImpl,iface);
    564564
    565565    *ppvResult=0;
     
    568568
    569569    if(pmkToLeft==NULL){
    570        
     570
    571571        res=IBindCtx_GetRunningObjectTable(pbc,&prot);
    572572
     
    600600
    601601            res=IMoniker_BindToObject(pmkToLeft,pbc,NULL,&IID_IClassActivator,(void**)&pca);
    602        
     602
    603603            if (res==E_NOINTERFACE)
    604604                return MK_E_INTERMEDIATEINTERFACENOTSUPPORTED;
     
    619619
    620620            FIXME("()\n");
    621            
     621
    622622            /*res=GetClassFile(This->filePathName,&clsID);
    623623
     
    655655    if (pcf!=NULL)
    656656        IClassFactory_Release(pcf);
    657    
     657
    658658    return res;
    659659}
     
    761761
    762762    *ppmkComposite=0;
    763    
     763
    764764    IMoniker_IsSystemMoniker(pmkRight,&mkSys);
    765765
     
    790790        /* the length of the composed path string  is raised by the sum of the two paths lengths  */
    791791        newStr=HeapAlloc(GetProcessHeap(),0,sizeof(WCHAR)*(lstrlenW(str1)+lstrlenW(str2)+1));
    792        
     792
    793793          if (newStr==NULL)
    794794                return E_OUTOFMEMORY;
     
    800800        if ((strDec2[i]==NULL && lastIdx1>-1 && lastIdx2>-1) || lstrcmpW(strDec2[i],bkSlash)!=0)
    801801            strcatW(newStr,bkSlash);
    802            
     802
    803803        for(j=i;j<=lastIdx2;j++)
    804804            strcatW(newStr,strDec2[j]);
    805        
     805
    806806        /* create a new moniker with the new string */
    807807        res=CreateFileMoniker(newStr,ppmkComposite);
     
    879879
    880880    IMoniker_GetDisplayName(pmkOtherMoniker,bind,NULL,&filePath);
    881    
     881
    882882    if (lstrcmpiW(filePath,
    883883                  This->filePathName)!=0)
    884884
    885885        return S_FALSE;
    886    
     886
    887887    return S_OK;
    888888}
     
    901901    if (pdwHash==NULL)
    902902        return E_POINTER;
    903    
     903
    904904    val =  This->filePathName;
    905905    len = lstrlenW(val);
     
    985985        if (!GetFileAttributesExW(This->filePathName,GetFileExInfoStandard,&info))
    986986            return MK_E_NOOBJECT;
    987        
     987
    988988        *pFileTime=info.ftLastWriteTime;
    989989    }
     
    10201020    if (pmkOther==NULL)
    10211021        return E_INVALIDARG;
    1022    
     1022
    10231023    *ppmkPrefix=0;
    1024    
     1024
    10251025    /* check if we have the same type of moniker */
    10261026    IMoniker_IsSystemMoniker(pmkOther,&mkSys);
     
    10441044
    10451045        *commonPath=0;
    1046        
     1046
    10471047        for(sameIdx=0; ( (stringTable1[sameIdx]!=NULL) &&
    10481048                         (stringTable2[sameIdx]!=NULL) &&
     
    10631063        if (machimeNameCase && *stringTable1[sameIdx-1]=='\\')
    10641064            sameIdx--;
    1065        
     1065
    10661066        if (machimeNameCase && (sameIdx<=3) && (nb1 > 3 || nb2 > 3) )
    10671067            return MK_E_NOPREFIX;
     
    10691069        for(i=0;i<sameIdx;i++)
    10701070            strcatW(commonPath,stringTable1[i]);
    1071        
     1071
    10721072        for(i=0;i<nb1;i++)
    10731073            CoTaskMemFree(stringTable1[i]);
     
    10811081
    10821082        HeapFree(GetProcessHeap(),0,commonPath);
    1083        
     1083
    10841084        return CreateFileMoniker(commonPath,ppmkPrefix);
    10851085    }
     
    11011101
    11021102    strgtable =CoTaskMemAlloc(len*sizeof(LPOLESTR));
    1103    
     1103
    11041104    if (strgtable==NULL)
    11051105        return E_OUTOFMEMORY;
    1106    
     1106
    11071107    while(str[i]!=0){
    11081108
     
    11351135    }
    11361136    strgtable[tabIndex]=NULL;
    1137    
     1137
    11381138    *stringTable=strgtable;
    1139    
     1139
    11401140    return tabIndex;
    11411141}
     
    11511151    DWORD len1=0,len2=0,sameIdx=0,j=0;
    11521152    WCHAR back[] ={'.','.','\\',0};
    1153    
     1153
    11541154    TRACE("(%p,%p,%p)\n",iface,pmOther,ppmkRelPath);
    11551155
     
    11591159    if (pmOther==NULL)
    11601160        return E_INVALIDARG;
    1161    
     1161
    11621162    res=CreateBindCtx(0,&bind);
    11631163    if (FAILED(res))
     
    11761176    if (FAILED(len1) || FAILED(len2))
    11771177        return E_OUTOFMEMORY;
    1178        
     1178
    11791179    /* count the number of similar items from the begin of the two paths */
    11801180    for(sameIdx=0; ( (tabStr1[sameIdx]!=NULL) &&
     
    11971197    for(j=sameIdx;tabStr2[j]!=NULL;j++)
    11981198        strcatW(relPath,tabStr2[j]);
    1199    
     1199
    12001200    res=CreateFileMoniker(relPath,ppmkRelPath);
    1201    
     1201
    12021202    for(j=0; tabStr1[j]!=NULL;j++)
    12031203        CoTaskMemFree(tabStr1[j]);
     
    12411241
    12421242    strcpyW(*ppszDisplayName,This->filePathName);
    1243    
     1243
    12441244    return S_OK;
    12451245}
     
    12681268    if (!pwdMksys)
    12691269        return E_POINTER;
    1270    
     1270
    12711271    (*pwdMksys)=MKSYS_FILEMONIKER;
    12721272
     
    13051305{
    13061306    ICOM_THIS_From_IROTData(IMoniker, iface);
    1307    
     1307
    13081308    TRACE("(%p)\n",This);
    13091309
     
    13491349    if(lpszPathName==NULL)
    13501350        return MK_E_SYNTAX;
    1351            
     1351
    13521352    *ppmk=0;
    1353        
     1353
    13541354    newFileMoniker = HeapAlloc(GetProcessHeap(), 0, sizeof(FileMonikerImpl));
    13551355
  • trunk/src/ole32/hglobalstream.c

    r8441 r8620  
    4949  ICOM_VFIELD(IStream);  /* Needs to be the first item in the stuct
    5050                          * since we want to cast this in a IStream pointer */
    51  
     51
    5252  /*
    5353   * Reference count
     
    9494HRESULT WINAPI HGLOBALStreamImpl_QueryInterface(
    9595                IStream*      iface,
    96                 REFIID         riid,            /* [in] */         
    97                 void**         ppvObject);  /* [iid_is][out] */ 
    98        
     96                REFIID         riid,            /* [in] */
     97                void**         ppvObject);  /* [iid_is][out] */
     98
    9999ULONG WINAPI HGLOBALStreamImpl_AddRef(
    100100                IStream*      iface);
    101        
     101
    102102ULONG WINAPI HGLOBALStreamImpl_Release(
    103103                IStream*      iface);
    104        
    105 HRESULT WINAPI HGLOBALStreamImpl_Read( 
     104
     105HRESULT WINAPI HGLOBALStreamImpl_Read(
    106106                IStream*      iface,
    107107                void*          pv,        /* [length_is][size_is][out] */
    108                 ULONG          cb,        /* [in] */                     
    109                 ULONG*         pcbRead);  /* [out] */                   
    110        
     108                ULONG          cb,        /* [in] */
     109                ULONG*         pcbRead);  /* [out] */
     110
    111111HRESULT WINAPI HGLOBALStreamImpl_Write(
    112112                IStream*      iface,
    113                 const void*    pv,          /* [size_is][in] */ 
    114                 ULONG          cb,          /* [in] */         
    115                 ULONG*         pcbWritten); /* [out] */         
    116        
    117 HRESULT WINAPI HGLOBALStreamImpl_Seek( 
     113                const void*    pv,          /* [size_is][in] */
     114                ULONG          cb,          /* [in] */
     115                ULONG*         pcbWritten); /* [out] */
     116
     117HRESULT WINAPI HGLOBALStreamImpl_Seek(
    118118                IStream*      iface,
    119                 LARGE_INTEGER   dlibMove,         /* [in] */ 
    120                 DWORD           dwOrigin,         /* [in] */ 
     119                LARGE_INTEGER   dlibMove,         /* [in] */
     120                DWORD           dwOrigin,         /* [in] */
    121121                ULARGE_INTEGER* plibNewPosition); /* [out] */
    122        
    123 HRESULT WINAPI HGLOBALStreamImpl_SetSize( 
     122
     123HRESULT WINAPI HGLOBALStreamImpl_SetSize(
    124124                IStream*      iface,
    125                 ULARGE_INTEGER  libNewSize);  /* [in] */ 
    126        
    127 HRESULT WINAPI HGLOBALStreamImpl_CopyTo( 
     125                ULARGE_INTEGER  libNewSize);  /* [in] */
     126
     127HRESULT WINAPI HGLOBALStreamImpl_CopyTo(
    128128                IStream*      iface,
    129                 IStream*      pstm,         /* [unique][in] */ 
    130                 ULARGE_INTEGER  cb,           /* [in] */         
    131                 ULARGE_INTEGER* pcbRead,      /* [out] */       
    132                 ULARGE_INTEGER* pcbWritten);  /* [out] */       
    133 
    134 HRESULT WINAPI HGLOBALStreamImpl_Commit( 
     129                IStream*      pstm,         /* [unique][in] */
     130                ULARGE_INTEGER  cb,           /* [in] */
     131                ULARGE_INTEGER* pcbRead,      /* [out] */
     132                ULARGE_INTEGER* pcbWritten);  /* [out] */
     133
     134HRESULT WINAPI HGLOBALStreamImpl_Commit(
    135135                IStream*      iface,
    136                 DWORD           grfCommitFlags); /* [in] */ 
    137        
    138 HRESULT WINAPI HGLOBALStreamImpl_Revert( 
     136                DWORD           grfCommitFlags); /* [in] */
     137
     138HRESULT WINAPI HGLOBALStreamImpl_Revert(
    139139                IStream*  iface);
    140        
    141 HRESULT WINAPI HGLOBALStreamImpl_LockRegion( 
     140
     141HRESULT WINAPI HGLOBALStreamImpl_LockRegion(
    142142                IStream*     iface,
    143                 ULARGE_INTEGER libOffset,   /* [in] */ 
    144                 ULARGE_INTEGER cb,          /* [in] */ 
    145                 DWORD          dwLockType); /* [in] */ 
    146        
    147 HRESULT WINAPI HGLOBALStreamImpl_UnlockRegion( 
     143                ULARGE_INTEGER libOffset,   /* [in] */
     144                ULARGE_INTEGER cb,          /* [in] */
     145                DWORD          dwLockType); /* [in] */
     146
     147HRESULT WINAPI HGLOBALStreamImpl_UnlockRegion(
    148148                IStream*     iface,
    149                 ULARGE_INTEGER libOffset,   /* [in] */ 
    150                 ULARGE_INTEGER cb,          /* [in] */ 
    151                 DWORD          dwLockType); /* [in] */ 
    152        
    153 HRESULT WINAPI HGLOBALStreamImpl_Stat( 
     149                ULARGE_INTEGER libOffset,   /* [in] */
     150                ULARGE_INTEGER cb,          /* [in] */
     151                DWORD          dwLockType); /* [in] */
     152
     153HRESULT WINAPI HGLOBALStreamImpl_Stat(
    154154                IStream*     iface,
    155155                STATSTG*       pstatstg,     /* [out] */
    156                 DWORD          grfStatFlag); /* [in] */ 
    157        
    158 HRESULT WINAPI HGLOBALStreamImpl_Clone( 
     156                DWORD          grfStatFlag); /* [in] */
     157
     158HRESULT WINAPI HGLOBALStreamImpl_Clone(
    159159                IStream*     iface,
    160                 IStream**    ppstm);       /* [out] */ 
     160                IStream**    ppstm);       /* [out] */
    161161
    162162
     
    187187 */
    188188HRESULT WINAPI CreateStreamOnHGlobal(
    189                 HGLOBAL   hGlobal, 
    190                 BOOL      fDeleteOnRelease, 
     189                HGLOBAL   hGlobal,
     190                BOOL      fDeleteOnRelease,
    191191                LPSTREAM* ppstm)
    192192{
     
    198198  if (newStream!=NULL)
    199199  {
    200     return IUnknown_QueryInterface((IUnknown*)newStream, 
     200    return IUnknown_QueryInterface((IUnknown*)newStream,
    201201                                   &IID_IStream,
    202202                                   (void**)ppstm);
     
    241241 * Params:
    242242 *    hGlobal          - Handle that will support the stream. can be NULL.
    243  *    fDeleteOnRelease - Flag set to TRUE if the HGLOBAL will be released 
     243 *    fDeleteOnRelease - Flag set to TRUE if the HGLOBAL will be released
    244244 *                       when the IStream object is destroyed.
    245245 */
     
    251251
    252252  newStream = HeapAlloc(GetProcessHeap(), 0, sizeof(HGLOBALStreamImpl));
    253  
     253
    254254  if (newStream!=0)
    255255  {
     
    259259    ICOM_VTBL(newStream) = &HGLOBALStreamImpl_Vtbl;
    260260    newStream->ref    = 0;
    261    
     261
    262262    /*
    263263     * Initialize the support.
     
    274274                                             GMEM_SHARE, 0);
    275275    }
    276    
     276
    277277    /*
    278278     * Start the stream at the beginning.
     
    280280    newStream->currentPosition.s.HighPart = 0;
    281281    newStream->currentPosition.s.LowPart = 0;
    282    
     282
    283283    /*
    284284     * Initialize the size of the stream to the size of the handle.
     
    287287    newStream->streamSize.s.LowPart  = GlobalSize(newStream->supportHandle);
    288288  }
    289  
     289
    290290  return newStream;
    291291}
     
    294294 * This is the destructor of the HGLOBALStreamImpl class.
    295295 *
    296  * This method will clean-up all the resources used-up by the given HGLOBALStreamImpl 
     296 * This method will clean-up all the resources used-up by the given HGLOBALStreamImpl
    297297 * class. The pointer passed-in to this function will be freed and will not
    298298 * be valid anymore.
     
    314314   * Finally, free the memory used-up by the class.
    315315   */
    316   HeapFree(GetProcessHeap(), 0, This); 
     316  HeapFree(GetProcessHeap(), 0, This);
    317317}
    318318
     
    323323HRESULT WINAPI HGLOBALStreamImpl_QueryInterface(
    324324                  IStream*     iface,
    325                   REFIID         riid,        /* [in] */         
    326                   void**         ppvObject)   /* [iid_is][out] */ 
     325                  REFIID         riid,        /* [in] */
     326                  void**         ppvObject)   /* [iid_is][out] */
    327327{
    328328  HGLOBALStreamImpl* const This=(HGLOBALStreamImpl*)iface;
     
    333333  if (ppvObject==0)
    334334    return E_INVALIDARG;
    335  
     335
    336336  /*
    337337   * Initialize the return parameter.
    338338   */
    339339  *ppvObject = 0;
    340  
     340
    341341  /*
    342342   * Compare the riid with the interface IDs implemented by this object.
    343343   */
    344   if (memcmp(&IID_IUnknown, riid, sizeof(IID_IUnknown)) == 0) 
     344  if (memcmp(&IID_IUnknown, riid, sizeof(IID_IUnknown)) == 0)
    345345  {
    346346    *ppvObject = (IStream*)This;
    347347  }
    348   else if (memcmp(&IID_IStream, riid, sizeof(IID_IStream)) == 0) 
     348  else if (memcmp(&IID_IStream, riid, sizeof(IID_IStream)) == 0)
    349349  {
    350350    *ppvObject = (IStream*)This;
    351351  }
    352  
     352
    353353  /*
    354354   * Check that we obtained an interface.
     
    356356  if ((*ppvObject)==0)
    357357    return E_NOINTERFACE;
    358  
     358
    359359  /*
    360360   * Query Interface always increases the reference count by one when it is
     
    362362   */
    363363  HGLOBALStreamImpl_AddRef(iface);
    364  
    365   return S_OK;;
     364
     365  return S_OK;
    366366}
    367367
     
    376376
    377377  This->ref++;
    378  
     378
    379379  return This->ref;
    380380}
     
    390390
    391391  ULONG newRef;
    392  
     392
    393393  This->ref--;
    394  
     394
    395395  newRef = This->ref;
    396  
     396
    397397  /*
    398398   * If the reference count goes down to 0, perform suicide.
     
    402402    HGLOBALStreamImpl_Destroy(This);
    403403  }
    404  
     404
    405405  return newRef;
    406406}
     
    415415 * See the documentation of ISequentialStream for more info.
    416416 */
    417 HRESULT WINAPI HGLOBALStreamImpl_Read( 
     417HRESULT WINAPI HGLOBALStreamImpl_Read(
    418418                  IStream*     iface,
    419419                  void*          pv,        /* [length_is][size_is][out] */
    420                   ULONG          cb,        /* [in] */                     
    421                   ULONG*         pcbRead)   /* [out] */                   
     420                  ULONG          cb,        /* [in] */
     421                  ULONG*         pcbRead)   /* [out] */
    422422{
    423423  HGLOBALStreamImpl* const This=(HGLOBALStreamImpl*)iface;
     
    429429  TRACE("(%p, %p, %ld, %p)\n", iface,
    430430        pv, cb, pcbRead);
    431  
    432   /* 
     431
     432  /*
    433433   * If the caller is not interested in the nubmer of bytes read,
    434434   * we use another buffer to avoid "if" statements in the code.
     
    436436  if (pcbRead==0)
    437437    pcbRead = &bytesReadBuffer;
    438  
     438
    439439  /*
    440440   * Using the known size of the stream, calculate the number of bytes
     
    464464   */
    465465  GlobalUnlock(This->supportHandle);
    466  
     466
    467467  /*
    468468   * The function returns S_OK if the buffer was filled completely
     
    472472  if(*pcbRead == cb)
    473473    return S_OK;
    474  
     474
    475475  return S_FALSE;
    476476}
    477        
     477
    478478/***
    479479 * This method is part of the ISequentialStream interface.
     
    488488HRESULT WINAPI HGLOBALStreamImpl_Write(
    489489                  IStream*     iface,
    490                   const void*    pv,          /* [size_is][in] */ 
    491                   ULONG          cb,          /* [in] */         
    492                   ULONG*         pcbWritten)  /* [out] */         
     490                  const void*    pv,          /* [size_is][in] */
     491                  ULONG          cb,          /* [in] */
     492                  ULONG*         pcbWritten)  /* [out] */
    493493{
    494494  HGLOBALStreamImpl* const This=(HGLOBALStreamImpl*)iface;
     
    500500  TRACE("(%p, %p, %ld, %p)\n", iface,
    501501        pv, cb, pcbWritten);
    502  
     502
    503503  /*
    504504   * If the caller is not interested in the number of bytes written,
     
    507507  if (pcbWritten == 0)
    508508    pcbWritten = &bytesWritten;
    509  
     509
    510510  if (cb == 0)
    511511  {
     
    517517    newSize.s.LowPart = This->currentPosition.s.LowPart + cb;
    518518  }
    519  
     519
    520520  /*
    521521   * Verify if we need to grow the stream
     
    526526   IStream_SetSize(iface, newSize);
    527527  }
    528  
     528
    529529  /*
    530530   * Lock the buffer in position and copy the data.
     
    532532  supportBuffer = GlobalLock(This->supportHandle);
    533533
    534   memcpy((char *) supportBuffer+This->currentPosition.s.LowPart, pv, cb); 
     534  memcpy((char *) supportBuffer+This->currentPosition.s.LowPart, pv, cb);
    535535
    536536  /*
     
    548548   */
    549549  GlobalUnlock(This->supportHandle);
    550  
     550
    551551  return S_OK;
    552552}
     
    559559 *
    560560 * See the documentation of IStream for more info.
    561  */       
    562 HRESULT WINAPI HGLOBALStreamImpl_Seek( 
     561 */
     562HRESULT WINAPI HGLOBALStreamImpl_Seek(
    563563                  IStream*      iface,
    564                   LARGE_INTEGER   dlibMove,         /* [in] */ 
    565                   DWORD           dwOrigin,         /* [in] */ 
     564                  LARGE_INTEGER   dlibMove,         /* [in] */
     565                  DWORD           dwOrigin,         /* [in] */
    566566                  ULARGE_INTEGER* plibNewPosition) /* [out] */
    567567{
     
    573573        dlibMove.s.LowPart, dwOrigin, plibNewPosition);
    574574
    575   /* 
     575  /*
    576576   * The caller is allowed to pass in NULL as the new position return value.
    577577   * If it happens, we assign it to a dynamic variable to avoid special cases
     
    627627  plibNewPosition->s.LowPart += dlibMove.s.LowPart;
    628628  This->currentPosition = *plibNewPosition;
    629  
     629
    630630  return S_OK;
    631631}
     
    640640 * See the documentation of IStream for more info.
    641641 */
    642 HRESULT WINAPI HGLOBALStreamImpl_SetSize( 
     642HRESULT WINAPI HGLOBALStreamImpl_SetSize(
    643643                                     IStream*      iface,
    644                                      ULARGE_INTEGER  libNewSize)   /* [in] */ 
     644                                     ULARGE_INTEGER  libNewSize)   /* [in] */
    645645{
    646646  HGLOBALStreamImpl* const This=(HGLOBALStreamImpl*)iface;
     
    653653  if (libNewSize.s.HighPart != 0)
    654654    return STG_E_INVALIDFUNCTION;
    655  
     655
    656656  if (This->streamSize.s.LowPart == libNewSize.s.LowPart)
    657657    return S_OK;
     
    660660   * Re allocate the HGlobal to fit the new size of the stream.
    661661   */
    662   This->supportHandle = GlobalReAlloc(This->supportHandle, 
     662  This->supportHandle = GlobalReAlloc(This->supportHandle,
    663663                                      libNewSize.s.LowPart,
    664664                                      0);
    665665
    666666  This->streamSize.s.LowPart = libNewSize.s.LowPart;
    667  
    668   return S_OK;
    669 }
    670        
     667
     668  return S_OK;
     669}
     670
    671671/***
    672672 * This method is part of the IStream interface.
     
    676676 * See the documentation of IStream for more info.
    677677 */
    678 HRESULT WINAPI HGLOBALStreamImpl_CopyTo( 
     678HRESULT WINAPI HGLOBALStreamImpl_CopyTo(
    679679                                    IStream*      iface,
    680                                     IStream*      pstm,         /* [unique][in] */ 
    681                                     ULARGE_INTEGER  cb,           /* [in] */         
    682                                     ULARGE_INTEGER* pcbRead,      /* [out] */       
    683                                     ULARGE_INTEGER* pcbWritten)   /* [out] */       
     680                                    IStream*      pstm,         /* [unique][in] */
     681                                    ULARGE_INTEGER  cb,           /* [in] */
     682                                    ULARGE_INTEGER* pcbRead,      /* [out] */
     683                                    ULARGE_INTEGER* pcbWritten)   /* [out] */
    684684{
    685685  HRESULT        hr = S_OK;
     
    689689  ULARGE_INTEGER totalBytesWritten;
    690690
    691   TRACE("(%p, %p, %ld, %p, %p)\n", iface, pstm, 
     691  TRACE("(%p, %p, %ld, %p, %p)\n", iface, pstm,
    692692        cb.s.LowPart, pcbRead, pcbWritten);
    693693
     
    712712    else
    713713      copySize = cb.s.LowPart;
    714    
     714
    715715    IStream_Read(iface, tmpBuffer, copySize, &bytesRead);
    716716
    717717    totalBytesRead.s.LowPart += bytesRead;
    718    
     718
    719719    IStream_Write(pstm, tmpBuffer, bytesRead, &bytesWritten);
    720720
     
    729729      break;
    730730    }
    731    
     731
    732732    if (bytesRead!=copySize)
    733733      cb.s.LowPart = 0;
     
    756756 * This method is part of the IStream interface.
    757757 *
    758  * For streams supported by HGLOBALS, this function does nothing. 
     758 * For streams supported by HGLOBALS, this function does nothing.
    759759 * This is what the documentation tells us.
    760760 *
    761761 * See the documentation of IStream for more info.
    762  */       
    763 HRESULT WINAPI HGLOBALStreamImpl_Commit( 
     762 */
     763HRESULT WINAPI HGLOBALStreamImpl_Commit(
    764764                  IStream*      iface,
    765                   DWORD         grfCommitFlags)  /* [in] */ 
     765                  DWORD         grfCommitFlags)  /* [in] */
    766766{
    767767  return S_OK;
     
    771771 * This method is part of the IStream interface.
    772772 *
    773  * For streams supported by HGLOBALS, this function does nothing. 
     773 * For streams supported by HGLOBALS, this function does nothing.
    774774 * This is what the documentation tells us.
    775775 *
    776776 * See the documentation of IStream for more info.
    777  */       
    778 HRESULT WINAPI HGLOBALStreamImpl_Revert( 
     777 */
     778HRESULT WINAPI HGLOBALStreamImpl_Revert(
    779779                  IStream* iface)
    780780{
     
    785785 * This method is part of the IStream interface.
    786786 *
    787  * For streams supported by HGLOBALS, this function does nothing. 
     787 * For streams supported by HGLOBALS, this function does nothing.
    788788 * This is what the documentation tells us.
    789789 *
    790790 * See the documentation of IStream for more info.
    791  */       
    792 HRESULT WINAPI HGLOBALStreamImpl_LockRegion( 
     791 */
     792HRESULT WINAPI HGLOBALStreamImpl_LockRegion(
    793793                  IStream*       iface,
    794                   ULARGE_INTEGER libOffset,   /* [in] */ 
    795                   ULARGE_INTEGER cb,          /* [in] */ 
    796                   DWORD          dwLockType)  /* [in] */ 
     794                  ULARGE_INTEGER libOffset,   /* [in] */
     795                  ULARGE_INTEGER cb,          /* [in] */
     796                  DWORD          dwLockType)  /* [in] */
    797797{
    798798  return S_OK;
     
    802802 * This method is part of the IStream interface.
    803803 *
    804  * For streams supported by HGLOBALS, this function does nothing. 
     804 * For streams supported by HGLOBALS, this function does nothing.
    805805 * This is what the documentation tells us.
    806806 *
    807807 * See the documentation of IStream for more info.
    808  */       
    809 HRESULT WINAPI HGLOBALStreamImpl_UnlockRegion( 
     808 */
     809HRESULT WINAPI HGLOBALStreamImpl_UnlockRegion(
    810810                  IStream*       iface,
    811                   ULARGE_INTEGER libOffset,   /* [in] */ 
    812                   ULARGE_INTEGER cb,          /* [in] */ 
    813                   DWORD          dwLockType)  /* [in] */ 
     811                  ULARGE_INTEGER libOffset,   /* [in] */
     812                  ULARGE_INTEGER cb,          /* [in] */
     813                  DWORD          dwLockType)  /* [in] */
    814814{
    815815  return S_OK;
     
    823823 *
    824824 * See the documentation of IStream for more info.
    825  */       
    826 HRESULT WINAPI HGLOBALStreamImpl_Stat( 
     825 */
     826HRESULT WINAPI HGLOBALStreamImpl_Stat(
    827827                  IStream*     iface,
    828828                  STATSTG*     pstatstg,     /* [out] */
    829                   DWORD        grfStatFlag)  /* [in] */ 
     829                  DWORD        grfStatFlag)  /* [in] */
    830830{
    831831  HGLOBALStreamImpl* const This=(HGLOBALStreamImpl*)iface;
     
    839839  return S_OK;
    840840}
    841        
    842 HRESULT WINAPI HGLOBALStreamImpl_Clone( 
     841
     842HRESULT WINAPI HGLOBALStreamImpl_Clone(
    843843                  IStream*     iface,
    844                   IStream**    ppstm) /* [out] */ 
     844                  IStream**    ppstm) /* [out] */
    845845{
    846846  FIXME("not implemented!\n");
  • trunk/src/ole32/itemmoniker.c

    r8441 r8620  
    3939    ICOM_VTABLE(IMoniker)*  lpvtbl1;  /* VTable relative to the IMoniker interface.*/
    4040
    41     /* The ROT (RunningObjectTable implementation) uses the IROTData interface to test whether 
     41    /* The ROT (RunningObjectTable implementation) uses the IROTData interface to test whether
    4242     * two monikers are equal. That's whay IROTData interface is implemented by monikers.
    4343     */
     
    4949
    5050    LPOLESTR itemDelimiter; /* Delimiter string */
    51    
     51
    5252} ItemMonikerImpl;
    5353
     
    155155    if ( (This==0) || (ppvObject==0) )
    156156        return E_INVALIDARG;
    157  
     157
    158158  /* Initialize the return parameter */
    159159  *ppvObject = 0;
     
    166166     )
    167167      *ppvObject = iface;
    168  
     168
    169169    else if (IsEqualIID(&IID_IROTData, riid))
    170170        *ppvObject = (IROTData*)&(This->lpvtbl2);
     
    173173    if ((*ppvObject)==0)
    174174        return E_NOINTERFACE;
    175  
     175
    176176   /* Query Interface always increases the reference count by one when it is successful */
    177177  ItemMonikerImpl_AddRef(iface);
     
    210210        return 0;
    211211    }
    212     return This->ref;;
     212    return This->ref;
    213213}
    214214
     
    222222    if (pClassID==NULL)
    223223        return E_POINTER;
    224            
     224
    225225    *pClassID = CLSID_ItemMoniker;
    226        
     226
    227227    return S_OK;
    228228}
     
    356356
    357357    /* for more details see ItemMonikerImpl_Save coments */
    358    
     358
    359359    pcbSize->s.LowPart =  sizeof(DWORD) + /* DWORD which contains delimiter length */
    360360                        delimiterLength + /* item delimiter string */
     
    433433{
    434434    ICOM_THIS(ItemMonikerImpl,iface);
    435    
     435
    436436    HRESULT   res;
    437437    IID    refid=IID_IOleItemContainer;
     
    480480    if(pmkToLeft==NULL)
    481481        return E_INVALIDARG;
    482        
     482
    483483    res=IMoniker_BindToObject(pmkToLeft,pbc,NULL,&IID_IOleItemContainer,(void**)&poic);
    484484
     
    510510
    511511    *ppmkReduced=iface;
    512    
     512
    513513    return MK_S_REDUCED_TO_SELF;
    514514}
     
    533533
    534534    *ppmkComposite=0;
    535    
     535
    536536    IMoniker_IsSystemMoniker(pmkRight,&mkSys);
    537537
     
    543543        /* if pmkRight is a composite whose leftmost component is an anti-moniker,           */
    544544        /* the returned moniker is the composite after the leftmost anti-moniker is removed. */
    545        
     545
    546546         if(mkSys==MKSYS_GENERICCOMPOSITE){
    547547
     
    561561                tempMkComposite=iface;
    562562                IMoniker_AddRef(iface);
    563                
     563
    564564                while(IEnumMoniker_Next(penumMk,1,&pmostLeftMk,NULL)==S_OK){
    565565
     
    618618    if (pmkOtherMoniker==NULL)
    619619        return S_FALSE;
    620    
     620
    621621    /* This method returns S_OK if both monikers are item monikers and their display names are */
    622622    /* identical (using a case-insensitive comparison); otherwise, the method returns S_FALSE. */
     
    633633    IMoniker_GetDisplayName(iface,bind,NULL,&dispName1);
    634634    IMoniker_GetDisplayName(pmkOtherMoniker,bind,NULL,&dispName2);
    635    
     635
    636636    if (lstrcmpW(dispName1,dispName2)!=0)
    637637        return S_FALSE;
    638    
     638
    639639    return S_OK;
    640640}
     
    653653    if (pdwHash==NULL)
    654654        return E_POINTER;
    655    
     655
    656656    val =  This->itemName;
    657657    len = lstrlenW(val);
     
    712712        /* requesting an IOleItemContainer interface pointer. The method then calls IOleItemContainer::IsRunning,*/
    713713        /* passing the string contained within this moniker. */
    714        
     714
    715715        res=IMoniker_BindToObject(pmkToLeft,pbc,NULL,&IID_IOleItemContainer,(void**)&poic);
    716716
     
    793793
    794794        *ppmkPrefix=iface;
    795        
     795
    796796        IMoniker_AddRef(iface);
    797        
     797
    798798        return MK_S_US;
    799799    }
     
    815815
    816816    *ppmkRelPath=0;
    817    
     817
    818818    return MK_E_NOTBINDABLE;
    819819}
     
    845845    strcpyW(*ppszDisplayName,This->itemDelimiter);
    846846    strcatW(*ppszDisplayName,This->itemName);
    847    
     847
    848848    return S_OK;
    849849}
     
    900900    if (!pwdMksys)
    901901        return E_POINTER;
    902    
     902
    903903    (*pwdMksys)=MKSYS_ITEMMONIKER;
    904904
     
    937937{
    938938    ICOM_THIS_From_IROTData(IMoniker, iface);
    939    
     939
    940940    TRACE("(%p)\n",iface);
    941941
  • trunk/src/ole32/marshal.c

    r8441 r8620  
    479479  hres = IMarshal_MarshalInterface(pMarshal,pStm,riid,pUnk,dwDestContext,pvDestContext,mshlflags);
    480480  if (hres) {
    481     FIXME("Failed to Marshal the interface, %lx?\n",hres);
     481    if (IsEqualGUID(riid,&IID_IClassFactory)) {
     482        MESSAGE("\nERROR: You need to merge the 'winedefault.reg' file into your\n");
     483        MESSAGE("       Wine registry by running: `regedit winedefault.reg'\n\n");
     484    } else {
     485        FIXME("Failed to Marshal the interface, %lx?\n",hres);
     486    }
    482487    goto release_marshal;
    483488  }
     
    541546 *              CoMarshalInterThreadInterfaceInStream   [OLE32.33]
    542547 *
    543  * Marshal interfaces across threads. We don't have a thread distinction, 
    544  * meaning most interfaces just work across different threads, the RPC 
     548 * Marshal interfaces across threads. We don't have a thread distinction,
     549 * meaning most interfaces just work across different threads, the RPC
    545550 * handles it.
    546551 */
     
    601606      StdMarshalImpl    *dm;
    602607      dm=(StdMarshalImpl*)HeapAlloc(GetProcessHeap(),0,sizeof(StdMarshalImpl));
    603       if (!dm) 
     608      if (!dm)
    604609          return E_FAIL;
    605610      dm->lpvtbl        = &stdmvtbl;
  • trunk/src/ole32/memlockbytes.c

    r8441 r8620  
    4343{
    4444  /*
    45    * Needs to be the first item in the stuct 
     45   * Needs to be the first item in the stuct
    4646   * since we want to cast this in an ILockBytes pointer
    4747   */
     
    206206  HGLOBALLockBytesImpl* newLockBytes;
    207207  newLockBytes = HeapAlloc(GetProcessHeap(), 0, sizeof(HGLOBALLockBytesImpl));
    208  
     208
    209209  if (newLockBytes!=0)
    210210  {
     
    214214    ICOM_VTBL(newLockBytes) = &HGLOBALLockBytesImpl_Vtbl;
    215215    newLockBytes->ref    = 0;
    216  
     216
    217217    /*
    218218     * Initialize the support.
     
    312312  HGLOBALLockBytesImpl_AddRef(iface);
    313313
    314   return S_OK;;
     314  return S_OK;
    315315}
    316316
     
    416416   * The function returns S_OK if the specified number of bytes were read
    417417   * or the end of the array was reached.
    418    * It returns STG_E_READFAULT if the number of bytes to read does not equal 
     418   * It returns STG_E_READFAULT if the number of bytes to read does not equal
    419419   * the number of bytes actually read.
    420420   */
     
    521521  if (libNewSize.s.HighPart != 0)
    522522    return STG_E_INVALIDFUNCTION;
    523  
     523
    524524  if (This->byteArraySize.s.LowPart == libNewSize.s.LowPart)
    525525    return S_OK;
     
    536536
    537537  This->byteArraySize.s.LowPart = libNewSize.s.LowPart;
    538  
     538
    539539  return S_OK;
    540540}
  • trunk/src/ole32/moniker.c

    r8441 r8620  
    6262    DWORD      runObjTabLastIndx;  /* first free index element in the table.        */
    6363    DWORD      runObjTabRegister; /* registration key of the next registered object */
    64    
     64
    6565} RunningObjectTableImpl;
    6666
     
    152152{
    153153    TRACE("()\n");
    154    
     154
    155155    if (runningObjectTableInstance==NULL)
    156156        return E_INVALIDARG;
     
    185185            if (( This->runObjTab[i].regTypeObj &  ROTFLAGS_REGISTRATIONKEEPSALIVE) != 0)
    186186                IUnknown_Release(This->runObjTab[i].pObj);
    187  
     187
    188188            IMoniker_Release(This->runObjTab[i].pmkObj);
    189189        }
     
    245245    if (runningObjectTableInstance==NULL)
    246246        return E_POINTER;
    247    
     247
    248248    RunningObjectTableImpl_Release((IRunningObjectTable*)runningObjectTableInstance);
    249249
     
    286286    This->runObjTab[This->runObjTabLastIndx].identRegObj = This->runObjTabRegister;
    287287    CoFileTimeNow(&(This->runObjTab[This->runObjTabLastIndx].lastModifObj));
    288    
     288
    289289    /* gives a registration identifier to the registered object*/
    290290    (*pdwRegister)= This->runObjTabRegister;
     
    297297    This->runObjTabRegister++;
    298298    This->runObjTabLastIndx++;
    299    
     299
    300300    if (This->runObjTabLastIndx == This->runObjTabSize){ /* table is full ! so it must be resized */
    301301
     
    311311
    312312    IMoniker_AddRef(pmkObjectName);
    313    
     313
    314314    return res;
    315315}
     
    337337
    338338    IMoniker_Release(This->runObjTab[index].pmkObj);
    339    
     339
    340340    /* remove the object from the table */
    341341    for(j=index; j<This->runObjTabLastIndx-1; j++)
    342342        This->runObjTab[j]= This->runObjTab[j+1];
    343    
     343
    344344    This->runObjTabLastIndx--;
    345345
     
    352352HRESULT WINAPI RunningObjectTableImpl_IsRunning(  IRunningObjectTable* iface,
    353353                                                  IMoniker *pmkObjectName)  /* Pointer to the moniker of the object whose status is desired */
    354 {   
     354{
    355355    ICOM_THIS(RunningObjectTableImpl,iface);
    356356
     
    374374    if (ppunkObject==NULL)
    375375        return E_POINTER;
    376    
     376
    377377    *ppunkObject=0;
    378378
     
    409409    return S_OK;
    410410}
    411    
     411
    412412/***********************************************************************
    413413 *        RunningObjectTable_GetTimeOfLastChange
     
    427427    /* verify if the object was registered before or not */
    428428    if (RunningObjectTableImpl_GetObjectIndex(This,-1,pmkObjectName,&index)==S_FALSE)
    429         return MK_E_UNAVAILABLE;;
     429        return MK_E_UNAVAILABLE;
    430430
    431431    (*pfiletime)= This->runObjTab[index].lastModifObj;
     
    463463        /* search object identified by a register identifier */
    464464        for(i=0;((i<This->runObjTabLastIndx)&&(This->runObjTab[i].identRegObj!=identReg));i++);
    465    
     465
    466466    if (i==This->runObjTabLastIndx)  return S_FALSE;
    467467
     
    511511
    512512  ret = IRunnableObject_QueryInterface(This,&IID_IRunnableObject,(LPVOID*)&runable);
    513   if (ret) 
     513  if (ret)
    514514        return 0; /* Appears to return no error. */
    515515  ret  = IRunnableObject_Run(runable,NULL);
  • trunk/src/ole32/ole2stubs.c

    r8441 r8620  
    5050}
    5151
    52  
     52
    5353/***********************************************************************
    5454 *               WriteFmtUserTypeStg (OLE32.160)
     
    9595  HRESULT hres, hres1;
    9696  IUnknown * pUnk = NULL;
    97    
     97
    9898  FIXME("\n\t%s\n\t%s stub!\n", debugstr_guid(rclsid), debugstr_guid(riid));
    9999
     
    212212 */
    213213HRESULT     WINAPI OleRegEnumFormatEtc (
    214   REFCLSID clsid, 
     214  REFCLSID clsid,
    215215  DWORD    dwDirection,
    216216  LPENUMFORMATETC* ppenumFormatetc)
  • trunk/src/ole32/oleobj.c

    r8441 r8620  
    8787                                         0,
    8888                                         sizeof(OleAdviseHolderImpl));
    89  
     89
    9090  ICOM_VTBL(lpoah) = &oahvt;
    9191  lpoah->ref = 1;
     
    119119    }
    120120  }
    121  
     121
    122122  HeapFree(GetProcessHeap(),
    123123           0,
    124124           ptrToDestroy->arrayOfSinks);
    125  
     125
    126126
    127127  HeapFree(GetProcessHeap(),
     
    135135static HRESULT WINAPI OleAdviseHolderImpl_QueryInterface(
    136136  LPOLEADVISEHOLDER iface,
    137   REFIID            riid, 
     137  REFIID            riid,
    138138  LPVOID*           ppvObj)
    139139{
    140   ICOM_THIS(OleAdviseHolderImpl, iface); 
     140  ICOM_THIS(OleAdviseHolderImpl, iface);
    141141  TRACE("(%p)->(%s,%p)\n",This,debugstr_guid(riid),ppvObj);
    142142  /*
     
    148148  *ppvObj = NULL;
    149149
    150   if (IsEqualIID(riid, &IID_IUnknown)) 
     150  if (IsEqualIID(riid, &IID_IUnknown))
    151151  {
    152152    /* IUnknown */
    153     *ppvObj = This; 
    154   }
    155   else if(IsEqualIID(riid, &IID_IOleAdviseHolder)) 
     153    *ppvObj = This;
     154  }
     155  else if(IsEqualIID(riid, &IID_IOleAdviseHolder))
    156156  {
    157157    /* IOleAdviseHolder */
     
    161161  if(*ppvObj == NULL)
    162162    return E_NOINTERFACE;
    163  
     163
    164164  /*
    165165   * A successful QI always increments the reference count.
     
    176176  LPOLEADVISEHOLDER iface)
    177177{
    178   ICOM_THIS(OleAdviseHolderImpl, iface); 
    179   TRACE("(%p)->(ref=%ld)\n", This, This->ref); 
     178  ICOM_THIS(OleAdviseHolderImpl, iface);
     179  TRACE("(%p)->(ref=%ld)\n", This, This->ref);
    180180  return ++(This->ref);
    181181}
     
    187187  LPOLEADVISEHOLDER iface)
    188188{
    189   ICOM_THIS(OleAdviseHolderImpl, iface); 
    190   TRACE("(%p)->(ref=%ld)\n", This, This->ref); 
     189  ICOM_THIS(OleAdviseHolderImpl, iface);
     190  TRACE("(%p)->(ref=%ld)\n", This, This->ref);
    191191  This->ref--;
    192192
     
    210210{
    211211  DWORD index;
    212  
    213   ICOM_THIS(OleAdviseHolderImpl, iface); 
     212
     213  ICOM_THIS(OleAdviseHolderImpl, iface);
    214214
    215215  TRACE("(%p)->(%p, %p)\n", This, pAdvise, pdwConnection);
     
    220220  if (pdwConnection==NULL)
    221221    return E_POINTER;
    222  
     222
    223223  *pdwConnection = 0;
    224224
     
    241241    This->maxSinks+=INITIAL_SINKS;
    242242
    243     This->arrayOfSinks = HeapReAlloc(GetProcessHeap(), 
     243    This->arrayOfSinks = HeapReAlloc(GetProcessHeap(),
    244244                                     0,
    245245                                     This->arrayOfSinks,
     
    247247
    248248    for (i=index;i < This->maxSinks; i++)
    249       This->arrayOfSinks[i]=0;     
     249      This->arrayOfSinks[i]=0;
    250250  }
    251251
     
    272272 */
    273273static HRESULT WINAPI OleAdviseHolderImpl_Unadvise(
    274   LPOLEADVISEHOLDER iface, 
     274  LPOLEADVISEHOLDER iface,
    275275  DWORD             dwConnection)
    276276{
    277   ICOM_THIS(OleAdviseHolderImpl, iface); 
     277  ICOM_THIS(OleAdviseHolderImpl, iface);
    278278
    279279  TRACE("(%p)->(%lu)\n", This, dwConnection);
    280280
    281281  /*
    282    * So we don't return 0 as a cookie, the index was 
     282   * So we don't return 0 as a cookie, the index was
    283283   * incremented by 1 in OleAdviseHolderImpl_Advise
    284284   * we have to compensate.
    285285   */
    286286  dwConnection--;
    287  
     287
    288288  /*
    289289   * Check for invalid cookies.
    290290   */
    291   if ( (dwConnection < 0) || 
     291  if ( (dwConnection < 0) ||
    292292       (dwConnection >= This->maxSinks) )
    293293    return OLE_E_NOCONNECTION;
     
    311311OleAdviseHolderImpl_EnumAdvise (LPOLEADVISEHOLDER iface, IEnumSTATDATA **ppenumAdvise)
    312312{
    313     ICOM_THIS(OleAdviseHolderImpl, iface); 
     313    ICOM_THIS(OleAdviseHolderImpl, iface);
    314314    FIXME("(%p)->(%p)\n", This, ppenumAdvise);
    315315
     
    325325OleAdviseHolderImpl_SendOnRename (LPOLEADVISEHOLDER iface, IMoniker *pmk)
    326326{
    327     ICOM_THIS(OleAdviseHolderImpl, iface); 
     327    ICOM_THIS(OleAdviseHolderImpl, iface);
    328328    FIXME("(%p)->(%p)\n", This, pmk);
    329329
     
    338338OleAdviseHolderImpl_SendOnSave (LPOLEADVISEHOLDER iface)
    339339{
    340     ICOM_THIS(OleAdviseHolderImpl, iface); 
     340    ICOM_THIS(OleAdviseHolderImpl, iface);
    341341    FIXME("(%p)\n", This);
    342342
     
    350350OleAdviseHolderImpl_SendOnClose (LPOLEADVISEHOLDER iface)
    351351{
    352     ICOM_THIS(OleAdviseHolderImpl, iface); 
     352    ICOM_THIS(OleAdviseHolderImpl, iface);
    353353    FIXME("(%p)\n", This);
    354354
     
    364364  FORMATETC fmat;
    365365  DWORD advf;
    366 } DataAdviseConnection; 
     366} DataAdviseConnection;
    367367
    368368typedef struct DataAdviseHolder
     
    384384                            REFIID                  riid,
    385385                            void**                  ppvObject);
    386 static ULONG WINAPI       DataAdviseHolder_AddRef( 
     386static ULONG WINAPI       DataAdviseHolder_AddRef(
    387387                            IDataAdviseHolder*      iface);
    388 static ULONG WINAPI       DataAdviseHolder_Release( 
     388static ULONG WINAPI       DataAdviseHolder_Release(
    389389                            IDataAdviseHolder*      iface);
    390 static HRESULT WINAPI     DataAdviseHolder_Advise( 
     390static HRESULT WINAPI     DataAdviseHolder_Advise(
    391391                            IDataAdviseHolder*      iface,
    392                             IDataObject*            pDataObject, 
    393                             FORMATETC*              pFetc, 
    394                             DWORD                   advf, 
    395                             IAdviseSink*            pAdvise, 
     392                            IDataObject*            pDataObject,
     393                            FORMATETC*              pFetc,
     394                            DWORD                   advf,
     395                            IAdviseSink*            pAdvise,
    396396                            DWORD*                  pdwConnection);
    397 static HRESULT WINAPI     DataAdviseHolder_Unadvise( 
     397static HRESULT WINAPI     DataAdviseHolder_Unadvise(
    398398                            IDataAdviseHolder*      iface,
    399399                            DWORD                   dwConnection);
    400 static HRESULT WINAPI     DataAdviseHolder_EnumAdvise( 
    401                             IDataAdviseHolder*      iface,       
     400static HRESULT WINAPI     DataAdviseHolder_EnumAdvise(
     401                            IDataAdviseHolder*      iface,
    402402                            IEnumSTATDATA**         ppenumAdvise);
    403 static HRESULT WINAPI     DataAdviseHolder_SendOnDataChange( 
    404                             IDataAdviseHolder*      iface, 
    405                             IDataObject*            pDataObject, 
    406                             DWORD                   dwReserved, 
     403static HRESULT WINAPI     DataAdviseHolder_SendOnDataChange(
     404                            IDataAdviseHolder*      iface,
     405                            IDataObject*            pDataObject,
     406                            DWORD                   dwReserved,
    407407                            DWORD                   advf);
    408408
     
    432432                                           0,
    433433                                           sizeof(DataAdviseHolder));
    434  
     434
    435435  ICOM_VTBL(newHolder) = &DataAdviseHolderImpl_VTable;
    436436  newHolder->ref = 1;
     
    438438  newHolder->Connections = HeapAlloc(GetProcessHeap(),
    439439                                     HEAP_ZERO_MEMORY,
    440                                      newHolder->maxCons * 
     440                                     newHolder->maxCons *
    441441                                     sizeof(DataAdviseConnection));
    442442
     
    461461    }
    462462  }
    463  
     463
    464464  HeapFree(GetProcessHeap(), 0, ptrToDestroy->Connections);
    465465  HeapFree(GetProcessHeap(), 0, ptrToDestroy);
     
    476476  void**                  ppvObject)
    477477{
    478   ICOM_THIS(DataAdviseHolder, iface); 
     478  ICOM_THIS(DataAdviseHolder, iface);
    479479  TRACE("(%p)->(%s,%p)\n",This,debugstr_guid(riid),ppvObject);
    480480  /*
     
    483483  if ( (This==0) || (ppvObject==0) )
    484484    return E_INVALIDARG;
    485  
     485
    486486  /*
    487487   * Initialize the return parameter.
     
    497497    *ppvObject = iface;
    498498  }
    499  
     499
    500500  /*
    501501   * Check that we obtained an interface.
     
    505505    return E_NOINTERFACE;
    506506  }
    507  
     507
    508508  /*
    509509   * Query Interface always increases the reference count by one when it is
    510    * successful. 
     510   * successful.
    511511   */
    512512  IUnknown_AddRef((IUnknown*)*ppvObject);
    513513
    514   return S_OK;
     514  return S_OK;
    515515}
    516516
     
    520520 * See Windows documentation for more details on IUnknown methods.
    521521 */
    522 static ULONG WINAPI       DataAdviseHolder_AddRef(                             
     522static ULONG WINAPI       DataAdviseHolder_AddRef(
    523523  IDataAdviseHolder*      iface)
    524524{
    525   ICOM_THIS(DataAdviseHolder, iface); 
     525  ICOM_THIS(DataAdviseHolder, iface);
    526526  TRACE("(%p) (ref=%ld)\n", This, This->ref);
    527527  This->ref++;
     
    535535 * See Windows documentation for more details on IUnknown methods.
    536536 */
    537 static ULONG WINAPI DataAdviseHolder_Release( 
     537static ULONG WINAPI DataAdviseHolder_Release(
    538538  IDataAdviseHolder*      iface)
    539539{
     
    555555    return 0;
    556556  }
    557  
     557
    558558  return This->ref;
    559559}
     
    565565static HRESULT WINAPI DataAdviseHolder_Advise(
    566566  IDataAdviseHolder*      iface,
    567   IDataObject*            pDataObject, 
    568   FORMATETC*              pFetc, 
    569   DWORD                   advf, 
    570   IAdviseSink*            pAdvise, 
     567  IDataObject*            pDataObject,
     568  FORMATETC*              pFetc,
     569  DWORD                   advf,
     570  IAdviseSink*            pAdvise,
    571571  DWORD*                  pdwConnection)
    572572{
    573573  DWORD index;
    574  
    575   ICOM_THIS(DataAdviseHolder, iface); 
     574
     575  ICOM_THIS(DataAdviseHolder, iface);
    576576
    577577  TRACE("(%p)->(%p, %p, %08lx, %p, %p)\n", This, pDataObject, pFetc, advf,
     
    582582  if (pdwConnection==NULL)
    583583    return E_POINTER;
    584  
     584
    585585  *pdwConnection = 0;
    586586
     
    630630 * DataAdviseHolder_Unadvise
    631631 */
    632 static HRESULT WINAPI     DataAdviseHolder_Unadvise( 
     632static HRESULT WINAPI     DataAdviseHolder_Unadvise(
    633633  IDataAdviseHolder*      iface,
    634634  DWORD                   dwConnection)
    635635{
    636   ICOM_THIS(DataAdviseHolder, iface); 
     636  ICOM_THIS(DataAdviseHolder, iface);
    637637
    638638  TRACE("(%p)->(%lu)\n", This, dwConnection);
    639639
    640640  /*
    641    * So we don't return 0 as a cookie, the index was 
     641   * So we don't return 0 as a cookie, the index was
    642642   * incremented by 1 in OleAdviseHolderImpl_Advise
    643643   * we have to compensate.
    644644   */
    645645  dwConnection--;
    646  
     646
    647647  /*
    648648   * Check for invalid cookies.
    649649   */
    650   if ( (dwConnection < 0) || 
     650  if ( (dwConnection < 0) ||
    651651       (dwConnection >= This->maxCons) )
    652652    return OLE_E_NOCONNECTION;
     
    663663}
    664664
    665 static HRESULT WINAPI     DataAdviseHolder_EnumAdvise( 
    666   IDataAdviseHolder*      iface,       
     665static HRESULT WINAPI     DataAdviseHolder_EnumAdvise(
     666  IDataAdviseHolder*      iface,
    667667  IEnumSTATDATA**         ppenumAdvise)
    668668{
    669   ICOM_THIS(DataAdviseHolder, iface); 
     669  ICOM_THIS(DataAdviseHolder, iface);
    670670
    671671  FIXME("(%p)->(%p)\n", This, ppenumAdvise);
     
    676676 * DataAdviseHolder_SendOnDataChange
    677677 */
    678 static HRESULT WINAPI     DataAdviseHolder_SendOnDataChange( 
    679   IDataAdviseHolder*      iface, 
    680   IDataObject*            pDataObject, 
    681   DWORD                   dwReserved, 
     678static HRESULT WINAPI     DataAdviseHolder_SendOnDataChange(
     679  IDataAdviseHolder*      iface,
     680  IDataObject*            pDataObject,
     681  DWORD                   dwReserved,
    682682  DWORD                   advf)
    683683{
    684   ICOM_THIS(DataAdviseHolder, iface); 
     684  ICOM_THIS(DataAdviseHolder, iface);
    685685  DWORD index;
    686686  STGMEDIUM stg;
  • trunk/src/ole32/oleproxy.c

    r8441 r8620  
    250250}
    251251
    252 /* Since we create proxy buffers and classfactory in a pair, there is 
    253  * no need for 2 seperate structs. Just put them in one, but remember 
     252/* Since we create proxy buffers and classfactory in a pair, there is
     253 * no need for 2 seperate structs. Just put them in one, but remember
    254254 * the refcount.
    255255 */
     
    348348    TRACE("(%p,%s,%p)\n",pUnkOuter,debugstr_guid(riid),ppv);
    349349
    350     /* Send CreateInstance to the remote classfactory. 
     350    /* Send CreateInstance to the remote classfactory.
    351351     *
    352352     * Data: Only the 'IID'.
     
    437437PSFacBuf_QueryInterface(LPPSFACTORYBUFFER iface, REFIID iid, LPVOID *ppv) {
    438438    if (IsEqualIID(iid,&IID_IPSFactoryBuffer)||IsEqualIID(iid,&IID_IUnknown)) {
    439         *ppv = (LPVOID)iface; 
     439        *ppv = (LPVOID)iface;
    440440        /* No ref counting, static class */
    441441        return S_OK;
     
    453453    IRpcProxyBuffer **ppProxy, LPVOID *ppv
    454454) {
    455     if (IsEqualIID(&IID_IClassFactory,riid))
     455    if (IsEqualIID(&IID_IClassFactory,riid) ||
     456        IsEqualIID(&IID_IUnknown,riid)
     457    )
    456458        return CFProxy_Construct(ppv,(LPVOID*)ppProxy);
    457459    FIXME("proxying not implemented for (%s) yet!\n",debugstr_guid(riid));
     
    468470    TRACE("(%s,%p,%p)\n",debugstr_guid(riid),pUnkServer,ppStub);
    469471
    470     if (IsEqualIID(&IID_IClassFactory,riid)) {
     472    if (IsEqualIID(&IID_IClassFactory,riid) ||
     473        IsEqualIID(&IID_IUnknown,riid)
     474    ) {
    471475        hres = CFStub_Construct(ppStub);
    472476        if (!hres)
     
    498502    if (IsEqualIID(rclsid,&CLSID_PSFactoryBuffer)) {
    499503        *ppv = &lppsfac;
    500         /* If we create a ps factory, we might need a stub manager later 
     504        /* If we create a ps factory, we might need a stub manager later
    501505         * anyway
    502506         */
     
    504508        return S_OK;
    505509    }
    506     if (IsEqualIID(rclsid,&CLSID_DfMarshal)&&IsEqualIID(iid,&IID_IClassFactory))
     510    if (IsEqualIID(rclsid,&CLSID_DfMarshal)&&(
     511                IsEqualIID(iid,&IID_IClassFactory) ||
     512                IsEqualIID(iid,&IID_IUnknown)
     513        )
     514    )
    507515        return MARSHAL_GetStandardMarshalCF(ppv);
    508516    FIXME("\n\tCLSID:\t%s,\n\tIID:\t%s\n",debugstr_guid(rclsid),debugstr_guid(iid));
  • trunk/src/ole32/rpc.c

    r8441 r8620  
    9595    }
    9696    if (res!=size) {
    97         FIXME("Read only %ld of %ld bytes.\n",res,size);
     97        FIXME("Read only %ld of %ld bytes from %x.\n",res,size,hf);
    9898        return E_FAIL;
    9999    }
     
    131131    }
    132132    if (res!=size) {
    133         FIXME("Wrote only %ld of %ld bytes.\n",res,size);
     133        FIXME("Wrote only %ld of %ld bytes to %x.\n",res,size,hf);
    134134        return E_FAIL;
    135135    }
     
    143143  int   i;
    144144  char  pipefn[100];
     145  wine_pipe *new_pipes;
    145146
    146147  for (i=0;i<nrofpipes;i++)
     
    148149      return S_OK;
    149150  if (pipes)
    150     pipes=(wine_pipe*)HeapReAlloc(GetProcessHeap(),0,pipes,sizeof(pipes[0])*(nrofpipes+1));
     151    new_pipes=(wine_pipe*)HeapReAlloc(GetProcessHeap(),0,pipes,sizeof(pipes[0])*(nrofpipes+1));
    151152  else
    152     pipes=(wine_pipe*)HeapAlloc(GetProcessHeap(),0,sizeof(pipes[0]));
    153   if (!pipes) return E_OUTOFMEMORY;
     153    new_pipes=(wine_pipe*)HeapAlloc(GetProcessHeap(),0,sizeof(pipes[0]));
     154  if (!new_pipes) return E_OUTOFMEMORY;
     155  pipes = new_pipes;
    154156  sprintf(pipefn,OLESTUBMGR"_%08lx",mid->processid);
    155157  memcpy(&(pipes[nrofpipes].mid),mid,sizeof(*mid));
     
    158160  nrofpipes++;
    159161  if (startreader) {
    160 #ifdef __WIN32OS2__
    161162      pipes[nrofpipes-1].hThread = CreateThread(NULL,0,_StubReaderThread,(LPVOID)(pipes+(nrofpipes-1)),0,&(pipes[nrofpipes-1].tid));
    162 #else
    163       pipes[nrofpipes-1].hThread = CreateThread(NULL,0,_StubReaderThread,(LPVOID)pipes+(nrofpipes-1),0,&(pipes[nrofpipes-1].tid));
    164 #endif
    165163  } else {
    166164      pipes[nrofpipes-1].tid     = GetCurrentThreadId();
     
    192190}
    193191
    194 static HRESULT 
     192static HRESULT
    195193RPC_GetRequest(wine_rpc_request **req) {
    196194    static int reqid = 0xdeadbeef;
     
    484482
    485483  if (hres != ERROR_SUCCESS)
    486       return REGDB_E_CLASSNOTREG;
     484      return REGDB_E_READREGDB; /* Probably */
    487485
    488486  memset(dllName,0,sizeof(dllName));
    489487  hres= RegQueryValueExW(key,NULL,NULL,NULL,(LPBYTE)dllName,&dllNameLen);
     488  RegCloseKey(key);
    490489  if (hres)
    491490          return REGDB_E_CLASSNOTREG; /* FIXME: check retval */
    492   RegCloseKey(key);
    493491  memset(&sinfo,0,sizeof(sinfo));
    494492  sinfo.cb = sizeof(sinfo);
     
    543541      break;
    544542  }
    545   if (tries>=MAXTRIES) 
     543  if (tries>=MAXTRIES)
    546544      return E_NOINTERFACE;
    547545  hres = CreateStreamOnHGlobal(0,TRUE,&pStm);
  • trunk/src/ole32/stg_bigblockfile.c

    r8441 r8620  
    33 * BigBlockFile
    44 *
    5  * This is the implementation of a file that consists of blocks of 
     5 * This is the implementation of a file that consists of blocks of
    66 * a predetermined size.
    7  * This class is used in the Compound File implementation of the 
    8  * IStorage and IStream interfaces. It provides the functionality 
    9  * to read and write any blocks in the file as well as setting and 
     7 * This class is used in the Compound File implementation of the
     8 * IStorage and IStream interfaces. It provides the functionality
     9 * to read and write any blocks in the file as well as setting and
    1010 * obtaining the size of the file.
    1111 * The blocks are indexed sequentially from the start of the file
    1212 * starting with -1.
    13  * 
     13 *
    1414 * TODO:
    1515 * - Support for a transacted mode
     
    7373/***
    7474 * This structure identifies the paged that are mapped
    75  * from the file and their position in memory. It is 
     75 * from the file and their position in memory. It is
    7676 * also used to hold a reference count to those pages.
    7777 *
     
    106106                                                 ULONG          index,
    107107                                                 DWORD          desired_access);
    108 static MappedPage* BIGBLOCKFILE_GetPageFromPointer(LPBIGBLOCKFILE This, 
     108static MappedPage* BIGBLOCKFILE_GetPageFromPointer(LPBIGBLOCKFILE This,
    109109                                                   void*         pBlock);
    110110static MappedPage* BIGBLOCKFILE_CreatePage(LPBIGBLOCKFILE This,
     
    154154 *      BIGBLOCKFILE_Construct
    155155 *
    156  * Construct a big block file. Create the file mapping object. 
     156 * Construct a big block file. Create the file mapping object.
    157157 * Create the read only mapped pages list, the writable mapped page list
    158158 * and the blocks in use list.
     
    327327  /*
    328328   * validate the block index
    329    * 
     329   *
    330330   */
    331331  if (This->blocksize * (index + 1)
     
    397397 *
    398398 * Sets the size of the file.
    399  * 
     399 *
    400400 */
    401401void BIGBLOCKFILE_SetSize(LPBIGBLOCKFILE This, ULARGE_INTEGER newSize)
     
    409409   */
    410410  BIGBLOCKFILE_UnmapAllMappedPages(This);
    411  
     411
    412412  if (This->fileBased)
    413413  {
     
    427427     *
    428428     * The problem is that the SetFilePointer-SetEndOfFile combo below
    429      * doesn't always succeed. The file is not grown. It seems like the 
     429     * doesn't always succeed. The file is not grown. It seems like the
    430430     * operation is cached. By doing the WriteFile, the file is actually
    431431     * grown on disk.
     
    436436    WriteFile(This->hfile, buf, 10, NULL, NULL);
    437437    /*
    438      * END HACK 
     438     * END HACK
    439439     */
    440440
     
    444444    SetFilePointer(This->hfile, newSize.s.LowPart, NULL, FILE_BEGIN);
    445445    SetEndOfFile(This->hfile);
    446  
     446
    447447    /*
    448448     * re-create the file mapping object
     
    451451                                        NULL,
    452452                                        This->flProtect,
    453                                         0, 0, 
     453                                        0, 0,
    454454                                        NULL);
    455455  }
     
    480480 *
    481481 * Returns the size of the file.
    482  * 
     482 *
    483483 */
    484484ULARGE_INTEGER BIGBLOCKFILE_GetSize(LPBIGBLOCKFILE This)
     
    523523 */
    524524static void* BIGBLOCKFILE_GetBigBlockPointer(
    525   LPBIGBLOCKFILE This, 
    526   ULONG          block_index, 
     525  LPBIGBLOCKFILE This,
     526  ULONG          block_index,
    527527  DWORD          desired_access)
    528528{
  • trunk/src/ole32/stg_stream.c

    r8441 r8620  
    7979
    8080  newStream = HeapAlloc(GetProcessHeap(), 0, sizeof(StgStreamImpl));
    81  
     81
    8282  if (newStream!=0)
    8383  {
     
    8787    ICOM_VTBL(newStream) = &StgStreamImpl_Vtbl;
    8888    newStream->ref       = 0;
    89    
     89
    9090    /*
    9191     * We want to nail-down the reference to the storage in case the
     
    9595    IStorage_AddRef((IStorage*)newStream->parentStorage);
    9696
    97     newStream->grfMode = grfMode;   
     97    newStream->grfMode = grfMode;
    9898    newStream->ownerProperty = ownerProperty;
    99    
     99
    100100    /*
    101101     * Start the stream at the beginning.
     
    103103    newStream->currentPosition.s.HighPart = 0;
    104104    newStream->currentPosition.s.LowPart = 0;
    105    
     105
    106106    /*
    107107     * Initialize the rest of the data.
     
    111111    newStream->bigBlockChain       = 0;
    112112    newStream->smallBlockChain     = 0;
    113    
     113
    114114    /*
    115115     * Read the size from the property and determine if the blocks forming
     
    118118    StgStreamImpl_OpenBlockChain(newStream);
    119119  }
    120  
     120
    121121  return newStream;
    122122}
     
    125125 * This is the destructor of the StgStreamImpl class.
    126126 *
    127  * This method will clean-up all the resources used-up by the given StgStreamImpl 
     127 * This method will clean-up all the resources used-up by the given StgStreamImpl
    128128 * class. The pointer passed-in to this function will be freed and will not
    129129 * be valid anymore.
     
    157157   * Finally, free the memory used-up by the class.
    158158   */
    159   HeapFree(GetProcessHeap(), 0, This); 
     159  HeapFree(GetProcessHeap(), 0, This);
    160160}
    161161
     
    166166HRESULT WINAPI StgStreamImpl_QueryInterface(
    167167                  IStream*     iface,
    168                   REFIID         riid,        /* [in] */         
    169                   void**         ppvObject)   /* [iid_is][out] */ 
     168                  REFIID         riid,        /* [in] */
     169                  void**         ppvObject)   /* [iid_is][out] */
    170170{
    171171  StgStreamImpl* const This=(StgStreamImpl*)iface;
     
    176176  if (ppvObject==0)
    177177    return E_INVALIDARG;
    178  
     178
    179179  /*
    180180   * Initialize the return parameter.
    181181   */
    182182  *ppvObject = 0;
    183  
     183
    184184  /*
    185185   * Compare the riid with the interface IDs implemented by this object.
    186186   */
    187   if (memcmp(&IID_IUnknown, riid, sizeof(IID_IUnknown)) == 0) 
     187  if (memcmp(&IID_IUnknown, riid, sizeof(IID_IUnknown)) == 0)
    188188  {
    189189    *ppvObject = (IStream*)This;
    190190  }
    191   else if (memcmp(&IID_IStream, riid, sizeof(IID_IStream)) == 0) 
     191  else if (memcmp(&IID_IStream, riid, sizeof(IID_IStream)) == 0)
    192192  {
    193193    *ppvObject = (IStream*)This;
    194194  }
    195  
     195
    196196  /*
    197197   * Check that we obtained an interface.
     
    199199  if ((*ppvObject)==0)
    200200    return E_NOINTERFACE;
    201  
     201
    202202  /*
    203203   * Query Interface always increases the reference count by one when it is
     
    205205   */
    206206  StgStreamImpl_AddRef(iface);
    207  
    208   return S_OK;;
     207
     208  return S_OK;
    209209}
    210210
     
    219219
    220220  This->ref++;
    221  
     221
    222222  return This->ref;
    223223}
     
    233233
    234234  ULONG newRef;
    235  
     235
    236236  This->ref--;
    237  
     237
    238238  newRef = This->ref;
    239  
     239
    240240  /*
    241241   * If the reference count goes down to 0, perform suicide.
     
    245245    StgStreamImpl_Destroy(This);
    246246  }
    247  
     247
    248248  return newRef;
    249249}
     
    281281                                             This->ownerProperty,
    282282                                             &curProperty);
    283  
     283
    284284  if (readSucessful)
    285285  {
    286286    This->streamSize = curProperty.size;
    287    
     287
    288288    /*
    289289     * This code supports only streams that are <32 bits in size.
    290290     */
    291291    assert(This->streamSize.s.HighPart == 0);
    292    
     292
    293293    if(curProperty.startingBlock == BLOCK_END_OF_CHAIN)
    294294    {
     
    301301      {
    302302        This->smallBlockChain = SmallBlockChainStream_Construct(
    303                                                                 This->parentStorage->ancestorStorage,   
     303                                                                This->parentStorage->ancestorStorage,
    304304                                                                This->ownerProperty);
    305305      }
     
    324324 * See the documentation of ISequentialStream for more info.
    325325 */
    326 HRESULT WINAPI StgStreamImpl_Read( 
     326HRESULT WINAPI StgStreamImpl_Read(
    327327                  IStream*     iface,
    328328                  void*          pv,        /* [length_is][size_is][out] */
    329                   ULONG          cb,        /* [in] */                     
    330                   ULONG*         pcbRead)   /* [out] */                   
     329                  ULONG          cb,        /* [in] */
     330                  ULONG*         pcbRead)   /* [out] */
    331331{
    332332  StgStreamImpl* const This=(StgStreamImpl*)iface;
     
    339339        iface, pv, cb, pcbRead);
    340340
    341   /* 
     341  /*
    342342   * If the caller is not interested in the number of bytes read,
    343343   * we use another buffer to avoid "if" statements in the code.
     
    345345  if (pcbRead==0)
    346346    pcbRead = &bytesReadBuffer;
    347  
     347
    348348  /*
    349349   * Using the known size of the stream, calculate the number of bytes
     
    351351   */
    352352  bytesToReadFromBuffer = min( This->streamSize.s.LowPart - This->currentPosition.s.LowPart, cb);
    353  
     353
    354354  /*
    355355   * Depending on the type of chain that was opened when the stream was constructed,
     
    363363                                 pv,
    364364                                 pcbRead);
    365    
     365
    366366  }
    367367  else if (This->bigBlockChain!=0)
     
    395395   */
    396396  This->currentPosition.s.LowPart += *pcbRead;
    397  
     397
    398398  if(*pcbRead != cb)
    399399  {
     
    409409  else
    410410    res = S_OK;
    411  
     411
    412412end:
    413413  TRACE("<-- %08lx\n", res);
    414414  return res;
    415415}
    416        
     416
    417417/***
    418418 * This method is part of the ISequentialStream interface.
     
    427427HRESULT WINAPI StgStreamImpl_Write(
    428428                  IStream*     iface,
    429                   const void*    pv,          /* [size_is][in] */ 
    430                   ULONG          cb,          /* [in] */         
    431                   ULONG*         pcbWritten)  /* [out] */         
     429                  const void*    pv,          /* [size_is][in] */
     430                  ULONG          cb,          /* [in] */
     431                  ULONG*         pcbWritten)  /* [out] */
    432432{
    433433  StgStreamImpl* const This=(StgStreamImpl*)iface;
     
    438438  TRACE("(%p, %p, %ld, %p)\n",
    439439        iface, pv, cb, pcbWritten);
    440  
     440
    441441  /*
    442442   * Do we have permission to write to this stream?
     
    452452  if (pcbWritten == 0)
    453453    pcbWritten = &bytesWritten;
    454  
     454
    455455  /*
    456456   * Initialize the out parameter
     
    467467    newSize.s.LowPart = This->currentPosition.s.LowPart + cb;
    468468  }
    469  
     469
    470470  /*
    471471   * Verify if we need to grow the stream
     
    476476    IStream_SetSize(iface, newSize);
    477477  }
    478  
     478
    479479  /*
    480480   * Depending on the type of chain that was opened when the stream was constructed,
     
    488488                                  pv,
    489489                                  pcbWritten);
    490    
     490
    491491  }
    492492  else if (This->bigBlockChain!=0)
     
    500500  else
    501501    assert(FALSE);
    502  
     502
    503503  /*
    504504   * Advance the position pointer for the number of positions written.
    505505   */
    506506  This->currentPosition.s.LowPart += *pcbWritten;
    507  
     507
    508508  return S_OK;
    509509}
     
    516516 *
    517517 * See the documentation of IStream for more info.
    518  */       
    519 HRESULT WINAPI StgStreamImpl_Seek( 
     518 */
     519HRESULT WINAPI StgStreamImpl_Seek(
    520520                  IStream*      iface,
    521                   LARGE_INTEGER   dlibMove,         /* [in] */ 
    522                   DWORD           dwOrigin,         /* [in] */ 
     521                  LARGE_INTEGER   dlibMove,         /* [in] */
     522                  DWORD           dwOrigin,         /* [in] */
    523523                  ULARGE_INTEGER* plibNewPosition) /* [out] */
    524524{
     
    530530        iface, dlibMove.s.LowPart, dwOrigin, plibNewPosition);
    531531
    532   /* 
     532  /*
    533533   * The caller is allowed to pass in NULL as the new position return value.
    534534   * If it happens, we assign it to a dynamic variable to avoid special cases
     
    570570   */
    571571  This->currentPosition = *plibNewPosition;
    572  
     572
    573573  return S_OK;
    574574}
     
    583583 * See the documentation of IStream for more info.
    584584 */
    585 HRESULT WINAPI StgStreamImpl_SetSize( 
     585HRESULT WINAPI StgStreamImpl_SetSize(
    586586                                     IStream*      iface,
    587                                      ULARGE_INTEGER  libNewSize)   /* [in] */ 
     587                                     ULARGE_INTEGER  libNewSize)   /* [in] */
    588588{
    589589  StgStreamImpl* const This=(StgStreamImpl*)iface;
     
    634634  Success = StorageImpl_ReadProperty(This->parentStorage->ancestorStorage,
    635635                                       This->ownerProperty,
    636                                        &curProperty); 
     636                                       &curProperty);
    637637  /*
    638638   * Determine if we have to switch from small to big blocks or vice versa
    639    */ 
    640   if ( (This->smallBlockChain!=0) && 
     639   */
     640  if ( (This->smallBlockChain!=0) &&
    641641       (curProperty.size.s.LowPart < LIMIT_TO_USE_SMALL_BLOCK) )
    642642  {
     
    670670  curProperty.size.s.HighPart = libNewSize.s.HighPart;
    671671  curProperty.size.s.LowPart = libNewSize.s.LowPart;
    672  
     672
    673673  if (Success)
    674674  {
     
    677677                                &curProperty);
    678678  }
    679  
     679
    680680  This->streamSize = libNewSize;
    681  
     681
    682682  return S_OK;
    683683}
    684        
     684
    685685/***
    686686 * This method is part of the IStream interface.
     
    690690 * See the documentation of IStream for more info.
    691691 */
    692 HRESULT WINAPI StgStreamImpl_CopyTo( 
     692HRESULT WINAPI StgStreamImpl_CopyTo(
    693693                                    IStream*      iface,
    694                                     IStream*      pstm,         /* [unique][in] */ 
    695                                     ULARGE_INTEGER  cb,           /* [in] */         
    696                                     ULARGE_INTEGER* pcbRead,      /* [out] */       
    697                                     ULARGE_INTEGER* pcbWritten)   /* [out] */       
     694                                    IStream*      pstm,         /* [unique][in] */
     695                                    ULARGE_INTEGER  cb,           /* [in] */
     696                                    ULARGE_INTEGER* pcbRead,      /* [out] */
     697                                    ULARGE_INTEGER* pcbWritten)   /* [out] */
    698698{
    699699  HRESULT        hr = S_OK;
     
    703703  ULARGE_INTEGER totalBytesWritten;
    704704
    705   TRACE("(%p, %p, %ld, %p, %p)\n", 
     705  TRACE("(%p, %p, %ld, %p, %p)\n",
    706706        iface, pstm, cb.s.LowPart, pcbRead, pcbWritten);
    707707
     
    726726    else
    727727      copySize = cb.s.LowPart;
    728    
     728
    729729    IStream_Read(iface, tmpBuffer, copySize, &bytesRead);
    730730
    731731    totalBytesRead.s.LowPart += bytesRead;
    732    
     732
    733733    IStream_Write(pstm, tmpBuffer, bytesRead, &bytesWritten);
    734734
     
    743743      break;
    744744    }
    745    
     745
    746746    if (bytesRead!=copySize)
    747747      cb.s.LowPart = 0;
     
    774774 *
    775775 * See the documentation of IStream for more info.
    776  */       
    777 HRESULT WINAPI StgStreamImpl_Commit( 
     776 */
     777HRESULT WINAPI StgStreamImpl_Commit(
    778778                  IStream*      iface,
    779                   DWORD           grfCommitFlags)  /* [in] */ 
     779                  DWORD           grfCommitFlags)  /* [in] */
    780780{
    781781  return S_OK;
     
    789789 *
    790790 * See the documentation of IStream for more info.
    791  */       
    792 HRESULT WINAPI StgStreamImpl_Revert( 
     791 */
     792HRESULT WINAPI StgStreamImpl_Revert(
    793793                  IStream* iface)
    794794{
     
    796796}
    797797
    798 HRESULT WINAPI StgStreamImpl_LockRegion( 
     798HRESULT WINAPI StgStreamImpl_LockRegion(
    799799                                        IStream*     iface,
    800                                         ULARGE_INTEGER libOffset,   /* [in] */ 
    801                                         ULARGE_INTEGER cb,          /* [in] */ 
    802                                         DWORD          dwLockType)  /* [in] */ 
     800                                        ULARGE_INTEGER libOffset,   /* [in] */
     801                                        ULARGE_INTEGER cb,          /* [in] */
     802                                        DWORD          dwLockType)  /* [in] */
    803803{
    804804  FIXME("not implemented!\n");
     
    806806}
    807807
    808 HRESULT WINAPI StgStreamImpl_UnlockRegion( 
     808HRESULT WINAPI StgStreamImpl_UnlockRegion(
    809809                                          IStream*     iface,
    810                                           ULARGE_INTEGER libOffset,   /* [in] */ 
    811                                           ULARGE_INTEGER cb,          /* [in] */ 
    812                                           DWORD          dwLockType)  /* [in] */ 
     810                                          ULARGE_INTEGER libOffset,   /* [in] */
     811                                          ULARGE_INTEGER cb,          /* [in] */
     812                                          DWORD          dwLockType)  /* [in] */
    813813{
    814814  FIXME("not implemented!\n");
     
    823823 *
    824824 * See the documentation of IStream for more info.
    825  */       
    826 HRESULT WINAPI StgStreamImpl_Stat( 
     825 */
     826HRESULT WINAPI StgStreamImpl_Stat(
    827827                  IStream*     iface,
    828828                  STATSTG*       pstatstg,     /* [out] */
    829                   DWORD          grfStatFlag)  /* [in] */ 
     829                  DWORD          grfStatFlag)  /* [in] */
    830830{
    831831  StgStreamImpl* const This=(StgStreamImpl*)iface;
     
    833833  StgProperty    curProperty;
    834834  BOOL         readSucessful;
    835  
     835
    836836  /*
    837837   * Read the information from the property.
     
    840840                                             This->ownerProperty,
    841841                                             &curProperty);
    842  
     842
    843843  if (readSucessful)
    844844  {
    845     StorageUtl_CopyPropertyToSTATSTG(pstatstg, 
    846                                      &curProperty, 
     845    StorageUtl_CopyPropertyToSTATSTG(pstatstg,
     846                                     &curProperty,
    847847                                     grfStatFlag);
    848848
    849849    pstatstg->grfMode = This->grfMode;
    850    
     850
    851851    return S_OK;
    852852  }
    853  
     853
    854854  return E_FAIL;
    855855}
    856        
     856
    857857/***
    858858 * This method is part of the IStream interface.
     
    866866 * should be basically as simple as creating a new stream with the same
    867867 * parent etc and positioning its seek cursor.
    868  */       
    869 HRESULT WINAPI StgStreamImpl_Clone( 
     868 */
     869HRESULT WINAPI StgStreamImpl_Clone(
    870870                                   IStream*     iface,
    871                                    IStream**    ppstm) /* [out] */ 
     871                                   IStream**    ppstm) /* [out] */
    872872{
    873873  StgStreamImpl* const This=(StgStreamImpl*)iface;
     
    889889  *ppstm = (IStream*) new_stream;
    890890  seek_pos.QuadPart = This->currentPosition.QuadPart;
    891  
     891
    892892  hres=StgStreamImpl_Seek (*ppstm, seek_pos, STREAM_SEEK_SET, NULL);
    893  
     893
    894894  assert (SUCCEEDED(hres));
    895895
  • trunk/src/ole32/storage32.c

    r8441 r8620  
    2424 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
    2525 */
    26 
    2726#ifdef __WIN32OS2__
    2827#include "ole32.h"
     
    6059/* OLESTREAM memory structure to use for Get and Put Routines */
    6160/* Used for OleConvertIStorageToOLESTREAM and OleConvertOLESTREAMToIStorage */
    62 typedef struct 
     61typedef struct
    6362{
    6463    DWORD dwOleID;
     
    9897    DWORD dwExtentX;
    9998    DWORD dwExtentY;
    100     DWORD dwSize; 
     99    DWORD dwSize;
    101100    BYTE *pData;
    102101}OLECONVERT_ISTORAGE_OLEPRES;
     
    123122  INT         typeOfRelation);
    124123
    125 static HRESULT adjustPropertyChain( 
     124static HRESULT adjustPropertyChain(
    126125  StorageImpl *This,
    127126  StgProperty   propertyToDelete,
     
    150149 * Declaration of miscellaneous functions...
    151150 */
    152 static HRESULT validateSTGM(DWORD stgmValue); 
     151static HRESULT validateSTGM(DWORD stgmValue);
    153152
    154153static DWORD GetShareModeFromSTGM(DWORD stgm);
     
    236235 * This method implements the common QueryInterface for all IStorage32
    237236 * implementations contained in this file.
    238  * 
     237 *
    239238 * See Windows documentation for more details on IUnknown methods.
    240239 */
     
    250249  if ( (This==0) || (ppvObject==0) )
    251250    return E_INVALIDARG;
    252  
     251
    253252  /*
    254253   * Initialize the return parameter.
    255254   */
    256255  *ppvObject = 0;
    257  
     256
    258257  /*
    259258   * Compare the riid with the interface IDs implemented by this object.
    260259   */
    261   if (memcmp(&IID_IUnknown, riid, sizeof(IID_IUnknown)) == 0) 
     260  if (memcmp(&IID_IUnknown, riid, sizeof(IID_IUnknown)) == 0)
    262261  {
    263262    *ppvObject = (IStorage*)This;
    264263  }
    265   else if (memcmp(&IID_IStorage, riid, sizeof(IID_IStorage)) == 0) 
     264  else if (memcmp(&IID_IStorage, riid, sizeof(IID_IStorage)) == 0)
    266265  {
    267266    *ppvObject = (IStorage*)This;
    268267  }
    269  
     268
    270269  /*
    271270   * Check that we obtained an interface.
     
    273272  if ((*ppvObject)==0)
    274273    return E_NOINTERFACE;
    275  
     274
    276275  /*
    277276   * Query Interface always increases the reference count by one when it is
     
    282281  return S_OK;
    283282}
    284        
     283
    285284/************************************************************************
    286285 * Storage32BaseImpl_AddRef (IUnknown)
     
    288287 * This method implements the common AddRef for all IStorage32
    289288 * implementations contained in this file.
    290  * 
     289 *
    291290 * See Windows documentation for more details on IUnknown methods.
    292291 */
    293 ULONG WINAPI StorageBaseImpl_AddRef( 
     292ULONG WINAPI StorageBaseImpl_AddRef(
    294293            IStorage* iface)
    295294{
     
    299298  return This->ref;
    300299}
    301        
     300
    302301/************************************************************************
    303302 * Storage32BaseImpl_Release (IUnknown)
     
    305304 * This method implements the common Release for all IStorage32
    306305 * implementations contained in this file.
    307  * 
     306 *
    308307 * See Windows documentation for more details on IUnknown methods.
    309308 */
    310 ULONG WINAPI StorageBaseImpl_Release( 
     309ULONG WINAPI StorageBaseImpl_Release(
    311310      IStorage* iface)
    312311{
     
    323322  {
    324323    /*
    325      * Since we are using a system of base-classes, we want to call the 
    326      * destructor of the appropriate derived class. To do this, we are 
     324     * Since we are using a system of base-classes, we want to call the
     325     * destructor of the appropriate derived class. To do this, we are
    327326     * using virtual functions to implement the destructor.
    328327     */
     
    331330    return 0;
    332331  }
    333  
     332
    334333  return This->ref;
    335334}
     
    342341 * See Windows documentation for more details on IStorage methods.
    343342 */
    344 HRESULT WINAPI StorageBaseImpl_OpenStream( 
     343HRESULT WINAPI StorageBaseImpl_OpenStream(
    345344  IStorage*        iface,
    346345  const OLECHAR*   pwcsName,  /* [string][in] */
    347346  void*            reserved1, /* [unique][in] */
    348   DWORD            grfMode,   /* [in]  */       
    349   DWORD            reserved2, /* [in]  */       
    350   IStream**        ppstm)     /* [out] */       
     347  DWORD            grfMode,   /* [in]  */
     348  DWORD            reserved2, /* [in]  */
     349  IStream**        ppstm)     /* [out] */
    351350{
    352351  ICOM_THIS(StorageBaseImpl,iface);
     
    357356  HRESULT           res = STG_E_UNKNOWN;
    358357
    359   TRACE("(%p, %s, %p, %lx, %ld, %p)\n", 
     358  TRACE("(%p, %s, %p, %lx, %ld, %p)\n",
    360359        iface, debugstr_w(pwcsName), reserved1, grfMode, reserved2, ppstm);
    361360
     
    368367    goto end;
    369368  }
    370  
     369
    371370  /*
    372371   * Initialize the out parameter
    373372   */
    374373  *ppstm = NULL;
    375  
     374
    376375  /*
    377376   * Validate the STGM flags
     
    398397   */
    399398  propertyEnumeration = IEnumSTATSTGImpl_Construct(
    400     This->ancestorStorage, 
     399    This->ancestorStorage,
    401400    This->rootPropertySetIndex);
    402  
     401
    403402  /*
    404403   * Search the enumeration for the property with the given name
     
    408407    pwcsName,
    409408    &currentProperty);
    410  
     409
    411410  /*
    412411   * Delete the property enumeration since we don't need it anymore
    413412   */
    414413  IEnumSTATSTGImpl_Destroy(propertyEnumeration);
    415  
     414
    416415  /*
    417416   * If it was found, construct the stream object and return a pointer to it.
    418417   */
    419   if ( (foundPropertyIndex!=PROPERTY_NULL) && 
     418  if ( (foundPropertyIndex!=PROPERTY_NULL) &&
    420419       (currentProperty.propertyType==PROPTYPE_STREAM) )
    421420  {
    422421    newStream = StgStreamImpl_Construct(This, grfMode, foundPropertyIndex);
    423    
     422
    424423    if (newStream!=0)
    425424    {
     
    428427
    429428      /*
    430        * Since we are returning a pointer to the interface, we have to 
     429       * Since we are returning a pointer to the interface, we have to
    431430       * nail down the reference.
    432431       */
    433432      StgStreamImpl_AddRef(*ppstm);
    434      
     433
    435434      res = S_OK;
    436435      goto end;
    437436    }
    438    
     437
    439438    res = E_OUTOFMEMORY;
    440439    goto end;
    441440  }
    442  
     441
    443442  res = STG_E_FILENOTFOUND;
    444443
     
    454453 *
    455454 * This method will open a new storage object from the current storage.
    456  * 
     455 *
    457456 * See Windows documentation for more details on IStorage methods.
    458  */       
    459 HRESULT WINAPI StorageBaseImpl_OpenStorage( 
     457 */
     458HRESULT WINAPI StorageBaseImpl_OpenStorage(
    460459  IStorage*        iface,
    461   const OLECHAR*   pwcsName,      /* [string][unique][in] */ 
    462   IStorage*        pstgPriority,  /* [unique][in] */         
    463   DWORD            grfMode,       /* [in] */                 
    464   SNB              snbExclude,    /* [unique][in] */         
    465   DWORD            reserved,      /* [in] */                 
    466   IStorage**       ppstg)         /* [out] */                       
     460  const OLECHAR*   pwcsName,      /* [string][unique][in] */
     461  IStorage*        pstgPriority,  /* [unique][in] */
     462  DWORD            grfMode,       /* [in] */
     463  SNB              snbExclude,    /* [unique][in] */
     464  DWORD            reserved,      /* [in] */
     465  IStorage**       ppstg)         /* [out] */
    467466{
    468467  ICOM_THIS(StorageBaseImpl,iface);
     
    473472  HRESULT                res = STG_E_UNKNOWN;
    474473
    475   TRACE("(%p, %s, %p, %lx, %p, %ld, %p)\n", 
    476         iface, debugstr_w(pwcsName), pstgPriority, 
     474  TRACE("(%p, %s, %p, %lx, %p, %ld, %p)\n",
     475        iface, debugstr_w(pwcsName), pstgPriority,
    477476        grfMode, snbExclude, reserved, ppstg);
    478  
     477
    479478  /*
    480479   * Perform a sanity check on the parameters.
     
    485484    goto end;
    486485  }
    487  
     486
    488487  /* as documented */
    489488  if (snbExclude != NULL)
     
    492491    goto end;
    493492  }
    494  
     493
    495494  /*
    496495   * Validate the STGM flags
     
    505504   * As documented.
    506505   */
    507   if ( !(grfMode & STGM_SHARE_EXCLUSIVE) || 
     506  if ( !(grfMode & STGM_SHARE_EXCLUSIVE) ||
    508507        (grfMode & STGM_DELETEONRELEASE) ||
    509508        (grfMode & STGM_PRIORITY) )
     
    517516   */
    518517  *ppstg = NULL;
    519  
     518
    520519  /*
    521520   * Create a property enumeration to search the properties
    522521   */
    523522  propertyEnumeration = IEnumSTATSTGImpl_Construct(
    524                           This->ancestorStorage, 
     523                          This->ancestorStorage,
    525524                          This->rootPropertySetIndex);
    526  
     525
    527526  /*
    528527   * Search the enumeration for the property with the given name
     
    532531                         pwcsName,
    533532                         &currentProperty);
    534  
     533
    535534  /*
    536535   * Delete the property enumeration since we don't need it anymore
    537536   */
    538537  IEnumSTATSTGImpl_Destroy(propertyEnumeration);
    539  
     538
    540539  /*
    541540   * If it was found, construct the stream object and return a pointer to it.
    542541   */
    543   if ( (foundPropertyIndex!=PROPERTY_NULL) && 
     542  if ( (foundPropertyIndex!=PROPERTY_NULL) &&
    544543       (currentProperty.propertyType==PROPTYPE_STORAGE) )
    545544  {
     
    550549                   This->ancestorStorage,
    551550                   foundPropertyIndex);
    552    
     551
    553552    if (newStorage != 0)
    554553    {
     
    556555
    557556      /*
    558        * Since we are returning a pointer to the interface, 
     557       * Since we are returning a pointer to the interface,
    559558       * we have to nail down the reference.
    560559       */
    561560      StorageBaseImpl_AddRef(*ppstg);
    562      
     561
    563562      res = S_OK;
    564563      goto end;
    565564    }
    566    
     565
    567566    res = STG_E_INSUFFICIENTMEMORY;
    568567    goto end;
    569568  }
    570  
     569
    571570  res = STG_E_FILENOTFOUND;
    572571
     
    579578 * Storage32BaseImpl_EnumElements (IStorage)
    580579 *
    581  * This method will create an enumerator object that can be used to 
     580 * This method will create an enumerator object that can be used to
    582581 * retrieve informatino about all the properties in the storage object.
    583  * 
     582 *
    584583 * See Windows documentation for more details on IStorage methods.
    585  */       
    586 HRESULT WINAPI StorageBaseImpl_EnumElements( 
     584 */
     585HRESULT WINAPI StorageBaseImpl_EnumElements(
    587586  IStorage*       iface,
    588   DWORD           reserved1, /* [in] */                 
    589   void*           reserved2, /* [size_is][unique][in] */ 
    590   DWORD           reserved3, /* [in] */                 
    591   IEnumSTATSTG**  ppenum)    /* [out] */                 
     587  DWORD           reserved1, /* [in] */
     588  void*           reserved2, /* [size_is][unique][in] */
     589  DWORD           reserved3, /* [in] */
     590  IEnumSTATSTG**  ppenum)    /* [out] */
    592591{
    593592  ICOM_THIS(StorageBaseImpl,iface);
    594593  IEnumSTATSTGImpl* newEnum;
    595594
    596   TRACE("(%p, %ld, %p, %ld, %p)\n", 
     595  TRACE("(%p, %ld, %p, %ld, %p)\n",
    597596        iface, reserved1, reserved2, reserved3, ppenum);
    598597
     
    602601  if ( (This==0) || (ppenum==0))
    603602    return E_INVALIDARG;
    604  
     603
    605604  /*
    606605   * Construct the enumerator.
     
    619618     */
    620619    IEnumSTATSTGImpl_AddRef(*ppenum);
    621    
     620
    622621    return S_OK;
    623622  }
     
    630629 *
    631630 * This method will retrieve information about this storage object.
    632  * 
     631 *
    633632 * See Windows documentation for more details on IStorage methods.
    634  */       
    635 HRESULT WINAPI StorageBaseImpl_Stat( 
     633 */
     634HRESULT WINAPI StorageBaseImpl_Stat(
    636635  IStorage*        iface,
    637   STATSTG*         pstatstg,     /* [out] */ 
    638   DWORD            grfStatFlag)  /* [in] */ 
     636  STATSTG*         pstatstg,     /* [out] */
     637  DWORD            grfStatFlag)  /* [in] */
    639638{
    640639  ICOM_THIS(StorageBaseImpl,iface);
     
    643642  HRESULT        res = STG_E_UNKNOWN;
    644643
    645   TRACE("(%p, %p, %lx)\n", 
     644  TRACE("(%p, %p, %lx)\n",
    646645        iface, pstatstg, grfStatFlag);
    647646
     
    666665  {
    667666    StorageUtl_CopyPropertyToSTATSTG(
    668       pstatstg, 
    669       &curProperty, 
     667      pstatstg,
     668      &curProperty,
    670669      grfStatFlag);
    671    
     670
    672671    res = S_OK;
    673672    goto end;
    674673  }
    675  
     674
    676675  res = E_FAIL;
    677676
     
    688687 * Storage32BaseImpl_RenameElement (IStorage)
    689688 *
    690  * This method will rename the specified element. 
     689 * This method will rename the specified element.
    691690 *
    692691 * See Windows documentation for more details on IStorage methods.
    693  * 
    694  * Implementation notes: The method used to rename consists of creating a clone 
    695  *    of the deleted StgProperty object setting it with the new name and to 
     692 *
     693 * Implementation notes: The method used to rename consists of creating a clone
     694 *    of the deleted StgProperty object setting it with the new name and to
    696695 *    perform a DestroyElement of the old StgProperty.
    697696 */
     
    706705  ULONG             foundPropertyIndex;
    707706
    708   TRACE("(%p, %s, %s)\n", 
     707  TRACE("(%p, %s, %s)\n",
    709708        iface, debugstr_w(pwcsOldName), debugstr_w(pwcsNewName));
    710709
     
    753752     * Setup a new property for the renamed property
    754753     */
    755     renamedProperty.sizeOfNameString = 
     754    renamedProperty.sizeOfNameString =
    756755      ( lstrlenW(pwcsNewName)+1 ) * sizeof(WCHAR);
    757  
     756
    758757    if (renamedProperty.sizeOfNameString > PROPERTY_NAME_BUFFER_LEN)
    759758      return STG_E_INVALIDNAME;
    760  
     759
    761760    strcpyW(renamedProperty.name, pwcsNewName);
    762  
     761
    763762    renamedProperty.propertyType  = currentProperty.propertyType;
    764763    renamedProperty.startingBlock = currentProperty.startingBlock;
    765764    renamedProperty.size.s.LowPart  = currentProperty.size.s.LowPart;
    766765    renamedProperty.size.s.HighPart = currentProperty.size.s.HighPart;
    767  
     766
    768767    renamedProperty.previousProperty = PROPERTY_NULL;
    769768    renamedProperty.nextProperty     = PROPERTY_NULL;
    770  
     769
    771770    /*
    772771     * Bring the dirProperty link in case it is a storage and in which
     
    774773     */
    775774    renamedProperty.dirProperty = currentProperty.dirProperty;
    776  
    777     /* call CoFileTime to get the current time 
     775
     776    /* call CoFileTime to get the current time
    778777    renamedProperty.timeStampS1
    779778    renamedProperty.timeStampD1
    780779    renamedProperty.timeStampS2
    781780    renamedProperty.timeStampD2
    782     renamedProperty.propertyUniqueID 
     781    renamedProperty.propertyUniqueID
    783782    */
    784  
    785     /* 
     783
     784    /*
    786785     * Obtain a free property in the property chain
    787786     */
    788787    renamedPropertyIndex = getFreeProperty(This->ancestorStorage);
    789  
     788
    790789    /*
    791790     * Save the new property into the new property spot
    792      */ 
     791     */
    793792    StorageImpl_WriteProperty(
    794793      This->ancestorStorage,
    795       renamedPropertyIndex, 
     794      renamedPropertyIndex,
    796795      &renamedProperty);
    797  
    798     /* 
     796
     797    /*
    799798     * Find a spot in the property chain for our newly created property.
    800799     */
    801800    updatePropertyChain(
    802801      (StorageImpl*)This,
    803       renamedPropertyIndex, 
     802      renamedPropertyIndex,
    804803      renamedProperty);
    805804
    806805    /*
    807      * At this point the renamed property has been inserted in the tree, 
    808      * now, before to Destroy the old property we must zeroed it's dirProperty 
    809      * otherwise the DestroyProperty below will zap it all and we do not want 
     806     * At this point the renamed property has been inserted in the tree,
     807     * now, before to Destroy the old property we must zeroed it's dirProperty
     808     * otherwise the DestroyProperty below will zap it all and we do not want
    810809     * this to happen.
    811810     * Also, we fake that the old property is a storage so the DestroyProperty
    812811     * will not do a SetSize(0) on the stream data.
    813      * 
     812     *
    814813     * This means that we need to tweek the StgProperty if it is a stream or a
    815814     * non empty storage.
     
    823822    StorageImpl_WriteProperty(
    824823      This->ancestorStorage,
    825       foundPropertyIndex, 
     824      foundPropertyIndex,
    826825      &currentProperty);
    827826
    828     /* 
    829      * Invoke Destroy to get rid of the ole property and automatically redo 
    830      * the linking of it's previous and next members... 
    831      */ 
    832     StorageImpl_DestroyElement((IStorage*)This->ancestorStorage, pwcsOldName); 
     827    /*
     828     * Invoke Destroy to get rid of the ole property and automatically redo
     829     * the linking of it's previous and next members...
     830     */
     831    StorageImpl_DestroyElement((IStorage*)This->ancestorStorage, pwcsOldName);
    833832
    834833  }
     
    847846 * Storage32BaseImpl_CreateStream (IStorage)
    848847 *
    849  * This method will create a stream object within this storage 
     848 * This method will create a stream object within this storage
    850849 *
    851850 * See Windows documentation for more details on IStorage methods.
     
    865864  ULONG             foundPropertyIndex, newPropertyIndex;
    866865
    867   TRACE("(%p, %s, %lx, %ld, %ld, %p)\n", 
    868         iface, debugstr_w(pwcsName), grfMode, 
     866  TRACE("(%p, %s, %lx, %ld, %ld, %p)\n",
     867        iface, debugstr_w(pwcsName), grfMode,
    869868        reserved1, reserved2, ppstm);
    870869
     
    912911  {
    913912    /*
    914      * An element with this name already exists 
     913     * An element with this name already exists
    915914     */
    916915    if (grfMode & STGM_CREATE)
    917916    {
    918       IStorage_DestroyElement(iface, pwcsName); 
    919     }
    920     else 
     917      IStorage_DestroyElement(iface, pwcsName);
     918    }
     919    else
    921920      return STG_E_FILEALREADYEXISTS;
    922921  }
    923922
    924   /* 
    925    * memset the empty property 
     923  /*
     924   * memset the empty property
    926925   */
    927926  memset(&newStreamProperty, 0, sizeof(StgProperty));
     
    944943  newStreamProperty.dirProperty      = PROPERTY_NULL;
    945944
    946   /* call CoFileTime to get the current time 
     945  /* call CoFileTime to get the current time
    947946  newStreamProperty.timeStampS1
    948947  newStreamProperty.timeStampD1
     
    954953
    955954  /*
    956    * Get a free property or create a new one 
     955   * Get a free property or create a new one
    957956   */
    958957  newPropertyIndex = getFreeProperty(This->ancestorStorage);
     
    960959  /*
    961960   * Save the new property into the new property spot
    962    */ 
     961   */
    963962  StorageImpl_WriteProperty(
    964963    This->ancestorStorage,
    965     newPropertyIndex, 
     964    newPropertyIndex,
    966965    &newStreamProperty);
    967966
    968   /* 
     967  /*
    969968   * Find a spot in the property chain for our newly created property.
    970969   */
    971970  updatePropertyChain(
    972971    (StorageImpl*)This,
    973     newPropertyIndex, 
     972    newPropertyIndex,
    974973    newStreamProperty);
    975974
    976   /* 
     975  /*
    977976   * Open the stream to return it.
    978977   */
     
    1000999 * Storage32BaseImpl_SetClass (IStorage)
    10011000 *
    1002  * This method will write the specified CLSID in the property of this 
     1001 * This method will write the specified CLSID in the property of this
    10031002 * storage.
    10041003 *
     
    10151014
    10161015  TRACE("(%p, %p)\n", iface, clsid);
    1017  
     1016
    10181017  success = StorageImpl_ReadProperty(This->ancestorStorage,
    10191018                                       This->rootPropertySetIndex,
     
    10361035** Storage32Impl implementation
    10371036*/
    1038        
     1037
    10391038/************************************************************************
    10401039 * Storage32Impl_CreateStorage (IStorage)
     
    10441043 * See Windows documentation for more details on IStorage methods.
    10451044 */
    1046 HRESULT WINAPI StorageImpl_CreateStorage( 
     1045HRESULT WINAPI StorageImpl_CreateStorage(
    10471046  IStorage*      iface,
    1048   const OLECHAR  *pwcsName, /* [string][in] */ 
    1049   DWORD            grfMode,   /* [in] */ 
    1050   DWORD            reserved1, /* [in] */ 
    1051   DWORD            reserved2, /* [in] */ 
    1052   IStorage       **ppstg)   /* [out] */ 
     1047  const OLECHAR  *pwcsName, /* [string][in] */
     1048  DWORD            grfMode,   /* [in] */
     1049  DWORD            reserved1, /* [in] */
     1050  DWORD            reserved2, /* [in] */
     1051  IStorage       **ppstg)   /* [out] */
    10531052{
    10541053  StorageImpl* const This=(StorageImpl*)iface;
     
    10611060  HRESULT          hr;
    10621061
    1063   TRACE("(%p, %s, %lx, %ld, %ld, %p)\n", 
    1064         iface, debugstr_w(pwcsName), grfMode, 
     1062  TRACE("(%p, %s, %lx, %ld, %ld, %p)\n",
     1063        iface, debugstr_w(pwcsName), grfMode,
    10651064        reserved1, reserved2, ppstg);
    1066  
     1065
    10671066  /*
    10681067   * Validate parameters
     
    11001099  {
    11011100    /*
    1102      * An element with this name already exists 
     1101     * An element with this name already exists
    11031102     */
    11041103    if (grfMode & STGM_CREATE)
    1105       IStorage_DestroyElement(iface, pwcsName); 
    1106     else 
     1104      IStorage_DestroyElement(iface, pwcsName);
     1105    else
    11071106      return STG_E_FILEALREADYEXISTS;
    11081107  }
    11091108
    1110   /* 
    1111    * memset the empty property 
     1109  /*
     1110   * memset the empty property
    11121111   */
    11131112  memset(&newProperty, 0, sizeof(StgProperty));
     
    11291128  newProperty.dirProperty      = PROPERTY_NULL;
    11301129
    1131   /* call CoFileTime to get the current time 
     1130  /* call CoFileTime to get the current time
    11321131  newProperty.timeStampS1
    11331132  newProperty.timeStampD1
     
    11381137  /*  newStorageProperty.propertyUniqueID */
    11391138
    1140   /* 
     1139  /*
    11411140   * Obtain a free property in the property chain
    11421141   */
     
    11451144  /*
    11461145   * Save the new property into the new property spot
    1147    */ 
     1146   */
    11481147  StorageImpl_WriteProperty(
    11491148    This->ancestorStorage,
    1150     newPropertyIndex, 
     1149    newPropertyIndex,
    11511150    &newProperty);
    11521151
    1153   /* 
     1152  /*
    11541153   * Find a spot in the property chain for our newly created property.
    11551154   */
    11561155  updatePropertyChain(
    11571156    This,
    1158     newPropertyIndex, 
     1157    newPropertyIndex,
    11591158    newProperty);
    11601159
    1161   /* 
     1160  /*
    11621161   * Open it to get a pointer to return.
    11631162   */
     
    11761175  }
    11771176
    1178  
     1177
    11791178  return S_OK;
    11801179}
     
    12071206      if (currentProperty.sizeOfNameString == 0)
    12081207      {
    1209         /* 
     1208        /*
    12101209         * The property existis and is available, we found it.
    12111210         */
     
    12241223  } while (newPropertyIndex == PROPERTY_NULL);
    12251224
    1226   /* 
    1227    * grow the property chain 
     1225  /*
     1226   * grow the property chain
    12281227   */
    12291228  if (! readSuccessful)
     
    12351234    ULONG          blockCount    = 0;
    12361235
    1237     /* 
    1238      * obtain the new count of property blocks 
     1236    /*
     1237     * obtain the new count of property blocks
    12391238     */
    12401239    blockCount = BlockChainStream_GetCount(
    12411240                   storage->ancestorStorage->rootBlockChain)+1;
    12421241
    1243     /* 
    1244      * initialize the size used by the property stream 
     1242    /*
     1243     * initialize the size used by the property stream
    12451244     */
    12461245    newSize.s.HighPart = 0;
    12471246    newSize.s.LowPart  = storage->bigBlockSize * blockCount;
    12481247
    1249     /* 
    1250      * add a property block to the property chain 
     1248    /*
     1249     * add a property block to the property chain
    12511250     */
    12521251    BlockChainStream_SetSize(storage->ancestorStorage->rootBlockChain, newSize);
    12531252
    1254     /* 
    1255      * memset the empty property in order to initialize the unused newly 
     1253    /*
     1254     * memset the empty property in order to initialize the unused newly
    12561255     * created property
    12571256     */
    12581257    memset(&emptyProperty, 0, sizeof(StgProperty));
    12591258
    1260     /* 
     1259    /*
    12611260     * initialize them
    12621261     */
    1263     lastProperty = storage->bigBlockSize / PROPSET_BLOCK_SIZE * blockCount; 
    1264    
     1262    lastProperty = storage->bigBlockSize / PROPSET_BLOCK_SIZE * blockCount;
     1263
    12651264    for(
    12661265      propertyIndex = newPropertyIndex;
     
    12701269      StorageImpl_WriteProperty(
    12711270        storage->ancestorStorage,
    1272         propertyIndex, 
     1271        propertyIndex,
    12731272        &emptyProperty);
    12741273    }
     
    12821281 * Internal Method
    12831282 *
    1284  * Case insensitive comparaison of StgProperty.name by first considering 
     1283 * Case insensitive comparaison of StgProperty.name by first considering
    12851284 * their size.
    12861285 *
     
    12951294  LONG diff      = lstrlenW(newProperty) - lstrlenW(currentProperty);
    12961295
    1297   if (diff == 0) 
    1298   {
    1299     /* 
     1296  if (diff == 0)
     1297  {
     1298    /*
    13001299     * We compare the string themselves only when they are of the same lenght
    13011300     */
     
    13031302  }
    13041303
    1305   return diff; 
     1304  return diff;
    13061305}
    13071306
     
    13151314  StorageImpl *storage,
    13161315  ULONG         newPropertyIndex,
    1317   StgProperty   newProperty) 
     1316  StgProperty   newProperty)
    13181317{
    13191318  StgProperty currentProperty;
     
    13281327  if (currentProperty.dirProperty != PROPERTY_NULL)
    13291328  {
    1330     /* 
     1329    /*
    13311330     * The root storage contains some element, therefore, start the research
    13321331     * for the appropriate location.
     
    13411340
    13421341    /*
    1343      * Read 
     1342     * Read
    13441343     */
    13451344    StorageImpl_ReadProperty(storage->ancestorStorage,
     
    13541353    {
    13551354      LONG diff = propertyNameCmp( newProperty.name, currentProperty.name);
    1356  
     1355
    13571356      if (diff < 0)
    13581357      {
     
    14061405  else
    14071406  {
    1408     /* 
     1407    /*
    14091408     * The root storage is empty, link the new property to it's dir property
    14101409     */
     
    14161415}
    14171416
    1418      
     1417
    14191418/*************************************************************************
    14201419 * CopyTo (IStorage)
    14211420 */
    1422 HRESULT WINAPI StorageImpl_CopyTo( 
     1421HRESULT WINAPI StorageImpl_CopyTo(
    14231422  IStorage*   iface,
    1424   DWORD       ciidExclude,  /* [in] */ 
    1425   const IID*  rgiidExclude, /* [size_is][unique][in] */ 
    1426   SNB         snbExclude,   /* [unique][in] */ 
    1427   IStorage*   pstgDest)     /* [unique][in] */ 
     1423  DWORD       ciidExclude,  /* [in] */
     1424  const IID*  rgiidExclude, /* [size_is][unique][in] */
     1425  SNB         snbExclude,   /* [unique][in] */
     1426  IStorage*   pstgDest)     /* [unique][in] */
    14281427{
    14291428  IEnumSTATSTG *elements     = 0;
     
    14361435    FIXME("Exclude option not implemented\n");
    14371436
    1438   TRACE("(%p, %ld, %p, %p, %p)\n", 
    1439         iface, ciidExclude, rgiidExclude, 
     1437  TRACE("(%p, %ld, %p, %p, %p)\n",
     1438        iface, ciidExclude, rgiidExclude,
    14401439        snbExclude, pstgDest);
    14411440
     
    14461445    return STG_E_INVALIDPOINTER;
    14471446
    1448   /* 
     1447  /*
    14491448   * Enumerate the elements
    14501449   */
     
    14591458  IStorage_Stat( iface, &curElement, STATFLAG_NONAME);
    14601459  IStorage_SetClass( pstgDest, &curElement.clsid );
    1461  
     1460
    14621461  do
    14631462  {
     
    14951494        return STG_E_ACCESSDENIED;
    14961495      }
    1497            
     1496
    14981497      /*
    14991498       * create a new storage in destination storage
     
    15121511                                   NULL, 0, &pstgTmp );
    15131512      }
    1514        
     1513
    15151514      if (hr != S_OK)
    15161515        break;
    15171516
    1518        
     1517
    15191518      /*
    15201519       * do the copy recursively
     
    15221521      hr = IStorage_CopyTo( pstgChild, ciidExclude, rgiidExclude,
    15231522                               snbExclude, pstgTmp );
    1524                                
     1523
    15251524      IStorage_Release( pstgTmp );
    15261525      IStorage_Release( pstgChild );
     
    15581557       */
    15591558      IStream_SetSize(pstrTmp, strStat.cbSize);
    1560      
     1559
    15611560      /*
    15621561       * do the copy
     
    15641563      hr = IStream_CopyTo( pstrChild, pstrTmp, strStat.cbSize,
    15651564                           NULL, NULL );
    1566                                
     1565
    15671566      IStream_Release( pstrTmp );
    15681567      IStream_Release( pstrChild );
     
    15791578   */
    15801579  IEnumSTATSTG_Release(elements);
    1581  
     1580
    15821581  return hr;
    15831582}
    1584        
     1583
    15851584/*************************************************************************
    15861585 * MoveElementTo (IStorage)
    15871586 */
    1588 HRESULT WINAPI StorageImpl_MoveElementTo( 
     1587HRESULT WINAPI StorageImpl_MoveElementTo(
    15891588  IStorage*     iface,
    1590   const OLECHAR *pwcsName,   /* [string][in] */ 
    1591   IStorage      *pstgDest,   /* [unique][in] */ 
    1592   const OLECHAR *pwcsNewName,/* [string][in] */ 
    1593   DWORD           grfFlags)    /* [in] */ 
     1589  const OLECHAR *pwcsName,   /* [string][in] */
     1590  IStorage      *pstgDest,   /* [unique][in] */
     1591  const OLECHAR *pwcsNewName,/* [string][in] */
     1592  DWORD           grfFlags)    /* [in] */
    15941593{
    15951594  FIXME("not implemented!\n");
    15961595  return E_NOTIMPL;
    15971596}
    1598        
     1597
    15991598/*************************************************************************
    16001599 * Commit (IStorage)
    16011600 */
    1602 HRESULT WINAPI StorageImpl_Commit( 
     1601HRESULT WINAPI StorageImpl_Commit(
    16031602  IStorage*   iface,
    1604   DWORD         grfCommitFlags)/* [in] */ 
     1603  DWORD         grfCommitFlags)/* [in] */
    16051604{
    16061605  FIXME("(%ld): stub!\n", grfCommitFlags);
    16071606  return S_OK;
    16081607}
    1609        
     1608
    16101609/*************************************************************************
    16111610 * Revert (IStorage)
    16121611 */
    1613 HRESULT WINAPI StorageImpl_Revert( 
     1612HRESULT WINAPI StorageImpl_Revert(
    16141613  IStorage* iface)
    16151614{
     
    16211620 * DestroyElement (IStorage)
    16221621 *
    1623  * Stategy: This implementation is build this way for simplicity not for speed. 
     1622 * Stategy: This implementation is build this way for simplicity not for speed.
    16241623 *          I always delete the top most element of the enumeration and adjust
    1625  *          the deleted element pointer all the time.  This takes longer to 
    1626  *          do but allow to reinvoke DestroyElement whenever we encounter a 
     1624 *          the deleted element pointer all the time.  This takes longer to
     1625 *          do but allow to reinvoke DestroyElement whenever we encounter a
    16271626 *          storage object.  The optimisation reside in the usage of another
    1628  *          enumeration stategy that would give all the leaves of a storage 
     1627 *          enumeration stategy that would give all the leaves of a storage
    16291628 *          first. (postfix order)
    16301629 */
    1631 HRESULT WINAPI StorageImpl_DestroyElement( 
     1630HRESULT WINAPI StorageImpl_DestroyElement(
    16321631  IStorage*     iface,
    1633   const OLECHAR *pwcsName)/* [string][in] */ 
     1632  const OLECHAR *pwcsName)/* [string][in] */
    16341633{
    16351634  StorageImpl* const This=(StorageImpl*)iface;
     
    16441643  ULONG             parentPropertyId;
    16451644
    1646   TRACE("(%p, %s)\n", 
     1645  TRACE("(%p, %s)\n",
    16471646        iface, debugstr_w(pwcsName));
    16481647
     
    16501649   * Perform a sanity check on the parameters.
    16511650   */
    1652   if (pwcsName==NULL) 
     1651  if (pwcsName==NULL)
    16531652    return STG_E_INVALIDPOINTER;
    1654  
     1653
    16551654  /*
    16561655   * Create a property enumeration to search the property with the given name
    16571656   */
    16581657  propertyEnumeration = IEnumSTATSTGImpl_Construct(
    1659     This->ancestorStorage, 
     1658    This->ancestorStorage,
    16601659    This->rootPropertySetIndex);
    1661  
     1660
    16621661  foundPropertyIndexToDelete = IEnumSTATSTGImpl_FindProperty(
    16631662    propertyEnumeration,
     
    16671666  IEnumSTATSTGImpl_Destroy(propertyEnumeration);
    16681667
    1669   if ( foundPropertyIndexToDelete == PROPERTY_NULL ) 
     1668  if ( foundPropertyIndexToDelete == PROPERTY_NULL )
    16701669  {
    16711670    return STG_E_FILENOTFOUND;
    16721671  }
    16731672
    1674   /* 
    1675    * Find the parent property of the property to delete (the one that 
    1676    * link to it).  If This->dirProperty == foundPropertyIndexToDelete, 
     1673  /*
     1674   * Find the parent property of the property to delete (the one that
     1675   * link to it).  If This->dirProperty == foundPropertyIndexToDelete,
    16771676   * the parent is This. Otherwise, the parent is one of it's sibling...
    16781677   */
    16791678
    1680   /* 
     1679  /*
    16811680   * First, read This's StgProperty..
    16821681   */
    1683   res = StorageImpl_ReadProperty( 
     1682  res = StorageImpl_ReadProperty(
    16841683          This->ancestorStorage,
    16851684          This->rootPropertySetIndex,
     
    16881687  assert(res==TRUE);
    16891688
    1690   /* 
     1689  /*
    16911690   * Second, check to see if by any chance the actual storage (This) is not
    16921691   * the parent of the property to delete... We never know...
     
    16941693  if ( parentProperty.dirProperty == foundPropertyIndexToDelete )
    16951694  {
    1696     /* 
     1695    /*
    16971696     * Set data as it would have been done in the else part...
    16981697     */
     
    17001699    parentPropertyId = This->rootPropertySetIndex;
    17011700  }
    1702   else 
    1703   { 
    1704     /*
    1705      * Create a property enumeration to search the parent properties, and 
     1701  else
     1702  {
     1703    /*
     1704     * Create a property enumeration to search the parent properties, and
    17061705     * delete it once done.
    17071706     */
     
    17091708
    17101709    propertyEnumeration2 = IEnumSTATSTGImpl_Construct(
    1711       This->ancestorStorage, 
     1710      This->ancestorStorage,
    17121711      This->rootPropertySetIndex);
    1713  
     1712
    17141713    typeOfRelation = IEnumSTATSTGImpl_FindParentProperty(
    17151714      propertyEnumeration2,
     
    17211720  }
    17221721
    1723   if ( propertyToDelete.propertyType == PROPTYPE_STORAGE ) 
     1722  if ( propertyToDelete.propertyType == PROPTYPE_STORAGE )
    17241723  {
    17251724    hr = deleteStorageProperty(
    1726            This, 
     1725           This,
    17271726           foundPropertyIndexToDelete,
    17281727           propertyToDelete);
    1729   } 
     1728  }
    17301729  else if ( propertyToDelete.propertyType == PROPTYPE_STREAM )
    17311730  {
    17321731    hr = deleteStreamProperty(
    1733            This, 
     1732           This,
    17341733           foundPropertyIndexToDelete,
    17351734           propertyToDelete);
    17361735  }
    17371736
    1738   if (hr!=S_OK) 
     1737  if (hr!=S_OK)
    17391738    return hr;
    17401739
     
    17441743  hr = adjustPropertyChain(
    17451744        This,
    1746         propertyToDelete, 
     1745        propertyToDelete,
    17471746        parentProperty,
    17481747        parentPropertyId,
     
    17531752
    17541753
    1755 /************************************************************************ 
    1756  * StorageImpl_Stat (IStorage) 
    1757  * 
    1758  * This method will retrieve information about this storage object. 
    1759  * 
    1760  * See Windows documentation for more details on IStorage methods. 
     1754/************************************************************************
     1755 * StorageImpl_Stat (IStorage)
     1756 *
     1757 * This method will retrieve information about this storage object.
     1758 *
     1759 * See Windows documentation for more details on IStorage methods.
    17611760 */
    17621761HRESULT WINAPI StorageImpl_Stat( IStorage* iface,
     
    18141813  }
    18151814
    1816   /* 
     1815  /*
    18171816   * Enumerate the elements
    18181817   */
     
    18281827    {
    18291828      destroyHr = StorageImpl_DestroyElement(
    1830                     (IStorage*)childStorage, 
     1829                    (IStorage*)childStorage,
    18311830                    (OLECHAR*)currentElement.pwcsName);
    18321831
     
    18531852  IStorage_Release(childStorage);
    18541853  IEnumSTATSTG_Release(elements);
    1855    
     1854
    18561855  return destroyHr;
    18571856}
     
    18831882         0,
    18841883         &pis);
    1885    
     1884
    18861885  if (hr!=S_OK)
    18871886  {
     
    18891888  }
    18901889
    1891   /* 
    1892    * Zap the stream 
    1893    */ 
    1894   hr = IStream_SetSize(pis, size); 
     1890  /*
     1891   * Zap the stream
     1892   */
     1893  hr = IStream_SetSize(pis, size);
    18951894
    18961895  if(hr != S_OK)
     
    19041903  IStream_Release(pis);
    19051904
    1906   /* 
     1905  /*
    19071906   * Invalidate the property by zeroing it's name member.
    19081907   */
    19091908  propertyToDelete.sizeOfNameString = 0;
    19101909
    1911   /* 
     1910  /*
    19121911   * Here we should re-read the property so we get the updated pointer
    19131912   * but since we are here to zap it, I don't do it...
    19141913   */
    19151914  StorageImpl_WriteProperty(
    1916     parentStorage->ancestorStorage, 
     1915    parentStorage->ancestorStorage,
    19171916    indexOfPropertyToDelete,
    19181917    &propertyToDelete);
     
    19431942  res = StorageImpl_ReadProperty(
    19441943          storage->ancestorStorage,
    1945           storePropertyIndex, 
     1944          storePropertyIndex,
    19461945          &storeProperty);
    19471946
     
    19571956      return findPlaceholder(
    19581957               storage,
    1959                propertyIndexToStore, 
     1958               propertyIndexToStore,
    19601959               storeProperty.previousProperty,
    19611960               typeOfRelation);
     
    19721971      return findPlaceholder(
    19731972               storage,
    1974                propertyIndexToStore, 
     1973               propertyIndexToStore,
    19751974               storeProperty.nextProperty,
    19761975               typeOfRelation);
     
    19801979      storeProperty.nextProperty = propertyIndexToStore;
    19811980    }
    1982   } 
     1981  }
    19831982  else if (typeOfRelation == PROPERTY_RELATION_DIR)
    19841983  {
     
    19871986      return findPlaceholder(
    19881987               storage,
    1989                propertyIndexToStore, 
     1988               propertyIndexToStore,
    19901989               storeProperty.dirProperty,
    19911990               typeOfRelation);
     
    19991998  hr = StorageImpl_WriteProperty(
    20001999         storage->ancestorStorage,
    2001          storePropertyIndex, 
     2000         storePropertyIndex,
    20022001         &storeProperty);
    20032002
     
    20142013 * Internal Method
    20152014 *
    2016  * This method takes the previous and the next property link of a property 
     2015 * This method takes the previous and the next property link of a property
    20172016 * to be deleted and find them a place in the Storage.
    20182017 */
    2019 static HRESULT adjustPropertyChain( 
     2018static HRESULT adjustPropertyChain(
    20202019  StorageImpl *This,
    20212020  StgProperty   propertyToDelete,
     
    20312030  HRESULT hr                     = S_OK;
    20322031  BOOL  res                    = TRUE;
    2033  
    2034   if (typeOfRelation == PROPERTY_RELATION_PREVIOUS) 
    2035   {
    2036     if (propertyToDelete.previousProperty != PROPERTY_NULL) 
    2037     {
    2038       /* 
     2032
     2033  if (typeOfRelation == PROPERTY_RELATION_PREVIOUS)
     2034  {
     2035    if (propertyToDelete.previousProperty != PROPERTY_NULL)
     2036    {
     2037      /*
    20392038       * Set the parent previous to the property to delete previous
    20402039       */
    20412040      newLinkProperty = propertyToDelete.previousProperty;
    20422041
    2043       if (propertyToDelete.nextProperty != PROPERTY_NULL) 
     2042      if (propertyToDelete.nextProperty != PROPERTY_NULL)
    20442043      {
    20452044        /*
    2046          * We also need to find a storage for the other link, setup variables 
     2045         * We also need to find a storage for the other link, setup variables
    20472046         * to do this at the end...
    2048          */     
     2047         */
    20492048        needToFindAPlaceholder = TRUE;
    20502049        storeNode              = propertyToDelete.previousProperty;
     
    20522051        relationType           = PROPERTY_RELATION_NEXT;
    20532052      }
    2054     } 
    2055     else if (propertyToDelete.nextProperty != PROPERTY_NULL) 
    2056     {
    2057       /* 
     2053    }
     2054    else if (propertyToDelete.nextProperty != PROPERTY_NULL)
     2055    {
     2056      /*
    20582057       * Set the parent previous to the property to delete next
    20592058       */
    20602059      newLinkProperty = propertyToDelete.nextProperty;
    20612060    }
    2062    
    2063     /* 
     2061
     2062    /*
    20642063     * Link it for real...
    2065      */ 
     2064     */
    20662065    parentProperty.previousProperty = newLinkProperty;
    2067  
    2068   } 
    2069   else if (typeOfRelation == PROPERTY_RELATION_NEXT) 
    2070   {
    2071     if (propertyToDelete.previousProperty != PROPERTY_NULL) 
    2072     {
    2073       /* 
     2066
     2067  }
     2068  else if (typeOfRelation == PROPERTY_RELATION_NEXT)
     2069  {
     2070    if (propertyToDelete.previousProperty != PROPERTY_NULL)
     2071    {
     2072      /*
    20742073       * Set the parent next to the property to delete next previous
    20752074       */
    20762075      newLinkProperty = propertyToDelete.previousProperty;
    2077      
    2078       if (propertyToDelete.nextProperty != PROPERTY_NULL) 
     2076
     2077      if (propertyToDelete.nextProperty != PROPERTY_NULL)
    20792078      {
    20802079        /*
    2081          * We also need to find a storage for the other link, setup variables 
     2080         * We also need to find a storage for the other link, setup variables
    20822081         * to do this at the end...
    2083          */     
     2082         */
    20842083        needToFindAPlaceholder = TRUE;
    20852084        storeNode              = propertyToDelete.previousProperty;
     
    20872086        relationType           = PROPERTY_RELATION_NEXT;
    20882087      }
    2089     } 
    2090     else if (propertyToDelete.nextProperty != PROPERTY_NULL) 
    2091     {
    2092       /* 
     2088    }
     2089    else if (propertyToDelete.nextProperty != PROPERTY_NULL)
     2090    {
     2091      /*
    20932092       * Set the parent next to the property to delete next
    20942093       */
     
    20962095    }
    20972096
    2098     /* 
     2097    /*
    20992098     * Link it for real...
    2100      */ 
     2099     */
    21012100    parentProperty.nextProperty = newLinkProperty;
    2102   } 
     2101  }
    21032102  else /* (typeOfRelation == PROPERTY_RELATION_DIR) */
    21042103  {
    2105     if (propertyToDelete.previousProperty != PROPERTY_NULL) 
    2106     {
    2107       /* 
     2104    if (propertyToDelete.previousProperty != PROPERTY_NULL)
     2105    {
     2106      /*
    21082107       * Set the parent dir to the property to delete previous
    21092108       */
    21102109      newLinkProperty = propertyToDelete.previousProperty;
    21112110
    2112       if (propertyToDelete.nextProperty != PROPERTY_NULL) 
     2111      if (propertyToDelete.nextProperty != PROPERTY_NULL)
    21132112      {
    21142113        /*
    2115          * We also need to find a storage for the other link, setup variables 
     2114         * We also need to find a storage for the other link, setup variables
    21162115         * to do this at the end...
    2117          */     
     2116         */
    21182117        needToFindAPlaceholder = TRUE;
    21192118        storeNode              = propertyToDelete.previousProperty;
     
    21212120        relationType           = PROPERTY_RELATION_NEXT;
    21222121      }
    2123     } 
    2124     else if (propertyToDelete.nextProperty != PROPERTY_NULL) 
    2125     {
    2126       /* 
     2122    }
     2123    else if (propertyToDelete.nextProperty != PROPERTY_NULL)
     2124    {
     2125      /*
    21272126       * Set the parent dir to the property to delete next
    21282127       */
     
    21302129    }
    21312130
    2132     /* 
     2131    /*
    21332132     * Link it for real...
    2134      */ 
     2133     */
    21352134    parentProperty.dirProperty = newLinkProperty;
    21362135  }
    21372136
    2138   /* 
    2139    * Write back the parent property   
     2137  /*
     2138   * Write back the parent property
    21402139   */
    21412140  res = StorageImpl_WriteProperty(
    2142           This->ancestorStorage, 
     2141          This->ancestorStorage,
    21432142          parentPropertyId,
    21442143          &parentProperty);
     
    21492148
    21502149  /*
    2151    * If a placeholder is required for the other link, then, find one and 
     2150   * If a placeholder is required for the other link, then, find one and
    21522151   * get out of here...
    21532152   */
    2154   if (needToFindAPlaceholder) 
     2153  if (needToFindAPlaceholder)
    21552154  {
    21562155    hr = findPlaceholder(
    2157            This, 
    2158            toStoreNode, 
     2156           This,
     2157           toStoreNode,
    21592158           storeNode,
    21602159           relationType);
     
    21682167 * SetElementTimes (IStorage)
    21692168 */
    2170 HRESULT WINAPI StorageImpl_SetElementTimes( 
     2169HRESULT WINAPI StorageImpl_SetElementTimes(
    21712170  IStorage*     iface,
    2172   const OLECHAR *pwcsName,/* [string][in] */ 
    2173   const FILETIME  *pctime,  /* [in] */ 
    2174   const FILETIME  *patime,  /* [in] */ 
    2175   const FILETIME  *pmtime)  /* [in] */ 
     2171  const OLECHAR *pwcsName,/* [string][in] */
     2172  const FILETIME  *pctime,  /* [in] */
     2173  const FILETIME  *patime,  /* [in] */
     2174  const FILETIME  *pmtime)  /* [in] */
    21762175{
    21772176  FIXME("(%s,...), stub!\n",debugstr_w(pwcsName));
     
    21822181 * SetStateBits (IStorage)
    21832182 */
    2184 HRESULT WINAPI StorageImpl_SetStateBits( 
     2183HRESULT WINAPI StorageImpl_SetStateBits(
    21852184  IStorage*   iface,
    2186   DWORD         grfStateBits,/* [in] */ 
    2187   DWORD         grfMask)     /* [in] */ 
     2185  DWORD         grfStateBits,/* [in] */
     2186  DWORD         grfMask)     /* [in] */
    21882187{
    21892188  FIXME("not implemented!\n");
     
    22092208
    22102209  memset(This, 0, sizeof(StorageImpl));
    2211  
     2210
    22122211  /*
    22132212   * Initialize the virtual function table.
     
    22152214  ICOM_VTBL(This)    = &Storage32Impl_Vtbl;
    22162215  This->v_destructor = &StorageImpl_Destroy;
    2217  
     2216
    22182217  /*
    22192218   * This is the top-level storage so initialize the ancestor pointer
     
    22212220   */
    22222221  This->ancestorStorage = This;
    2223  
     2222
    22242223  /*
    22252224   * Initialize the physical support of the storage.
    22262225   */
    22272226  This->hFile = hFile;
    2228  
     2227
    22292228  /*
    22302229   * Store copy of file path.
    22312230   */
    22322231  if(pwcsName) {
    2233       This->pwcsName = HeapAlloc(GetProcessHeap(), 0, 
     2232      This->pwcsName = HeapAlloc(GetProcessHeap(), 0,
    22342233                                (lstrlenW(pwcsName)+1)*sizeof(WCHAR));
    22352234      if (!This->pwcsName)
    22362235         return STG_E_INSUFFICIENTMEMORY;
    2237       strcpyW(This->pwcsName, pwcsName); 
     2236      strcpyW(This->pwcsName, pwcsName);
    22382237  }
    22392238
     
    22512250  if (This->bigBlockFile == 0)
    22522251    return E_FAIL;
    2253  
     2252
    22542253  if (fileCreate)
    22552254  {
     
    22632262     * - There is no small block depot
    22642263     */
    2265     memset( This->bigBlockDepotStart,     
    2266             BLOCK_UNUSED, 
     2264    memset( This->bigBlockDepotStart,
     2265            BLOCK_UNUSED,
    22672266            sizeof(This->bigBlockDepotStart));
    22682267
     
    23182317   */
    23192318  This->prevFreeBlock = 0;
    2320  
     2319
    23212320  /*
    23222321   * Create the block chain abstractions.
    23232322   */
    2324   This->rootBlockChain = 
     2323  This->rootBlockChain =
    23252324    BlockChainStream_Construct(This, &This->rootStartBlock, PROPERTY_NULL);
    23262325
    23272326  This->smallBlockDepotChain = BlockChainStream_Construct(
    2328                                  This, 
    2329                                  &This->smallBlockDepotStart, 
     2327                                 This,
     2328                                 &This->smallBlockDepotStart,
    23302329                                 PROPERTY_NULL);
    23312330
    23322331  /*
    2333    * Write the root property 
     2332   * Write the root property
    23342333   */
    23352334  if (fileCreate)
     
    23582357   */
    23592358  currentPropertyIndex = 0;
    2360  
     2359
    23612360  do
    23622361  {
    23632362    readSuccessful = StorageImpl_ReadProperty(
    2364                       This, 
    2365                       currentPropertyIndex, 
     2363                      This,
     2364                      currentPropertyIndex,
    23662365                      &currentProperty);
    2367    
     2366
    23682367    if (readSuccessful)
    23692368    {
     
    23762375
    23772376    currentPropertyIndex++;
    2378    
     2377
    23792378  } while (readSuccessful && (This->rootPropertySetIndex == PROPERTY_NULL) );
    2380  
     2379
    23812380  if (!readSuccessful)
    23822381  {
     
    23892388   */
    23902389  This->smallBlockRootChain = BlockChainStream_Construct(
    2391                                 This, 
    2392                                 NULL, 
     2390                                This,
     2391                                NULL,
    23932392                                This->rootPropertySetIndex);
    2394  
     2393
    23952394  return hr;
    23962395}
     
    29282927
    29292928    StorageUtl_ReadWord(
    2930       headerBigBlock, 
    2931       OFFSET_BIGBLOCKSIZEBITS,   
     2929      headerBigBlock,
     2930      OFFSET_BIGBLOCKSIZEBITS,
    29322931      &This->bigBlockSizeBits);
    29332932
    29342933    StorageUtl_ReadWord(
    2935       headerBigBlock, 
    2936       OFFSET_SMALLBLOCKSIZEBITS, 
     2934      headerBigBlock,
     2935      OFFSET_SMALLBLOCKSIZEBITS,
    29372936      &This->smallBlockSizeBits);
    29382937
    29392938    StorageUtl_ReadDWord(
    2940       headerBigBlock, 
    2941       OFFSET_BBDEPOTCOUNT,     
     2939      headerBigBlock,
     2940      OFFSET_BBDEPOTCOUNT,
    29422941      &This->bigBlockDepotCount);
    29432942
    29442943    StorageUtl_ReadDWord(
    2945       headerBigBlock, 
    2946       OFFSET_ROOTSTARTBLOCK,   
     2944      headerBigBlock,
     2945      OFFSET_ROOTSTARTBLOCK,
    29472946      &This->rootStartBlock);
    29482947
    29492948    StorageUtl_ReadDWord(
    2950       headerBigBlock, 
    2951       OFFSET_SBDEPOTSTART,     
     2949      headerBigBlock,
     2950      OFFSET_SBDEPOTSTART,
    29522951      &This->smallBlockDepotStart);
    29532952
    2954     StorageUtl_ReadDWord( 
    2955       headerBigBlock, 
    2956       OFFSET_EXTBBDEPOTSTART,   
     2953    StorageUtl_ReadDWord(
     2954      headerBigBlock,
     2955      OFFSET_EXTBBDEPOTSTART,
    29572956      &This->extBigBlockDepotStart);
    29582957
    29592958    StorageUtl_ReadDWord(
    2960       headerBigBlock, 
    2961       OFFSET_EXTBBDEPOTCOUNT,   
     2959      headerBigBlock,
     2960      OFFSET_EXTBBDEPOTCOUNT,
    29622961      &This->extBigBlockDepotCount);
    2963    
     2962
    29642963    for (index = 0; index < COUNT_BBDEPOTINHEADER; index ++)
    29652964    {
    29662965      StorageUtl_ReadDWord(
    2967         headerBigBlock, 
     2966        headerBigBlock,
    29682967        OFFSET_BBDEPOTSTART + (sizeof(ULONG)*index),
    29692968        &(This->bigBlockDepotStart[index]));
    29702969    }
    2971    
     2970
    29722971    /*
    29732972     * Make the bitwise arithmetic to get the size of the blocks in bytes.
     
    29832982      This->smallBlockSize = 0x000000001 >> (DWORD)This->smallBlockSizeBits;
    29842983    }
    2985    
    2986     /*
    2987      * Right now, the code is making some assumptions about the size of the 
     2984
     2985    /*
     2986     * Right now, the code is making some assumptions about the size of the
    29882987     * blocks, just make sure they are what we're expecting.
    29892988     */
     
    29962995    else
    29972996        hr = S_OK;
    2998    
     2997
    29992998    /*
    30002999     * Release the block.
     
    30023001    StorageImpl_ReleaseBigBlock(This, headerBigBlock);
    30033002  }
    3004  
     3003
    30053004  return hr;
    30063005}
     
    30223021   */
    30233022  success = StorageImpl_ReadBigBlock(This, -1, headerBigBlock);
    3024  
     3023
    30253024  /*
    30263025   * If the block read failed, the file is probably new.
     
    30323031     */
    30333032    memset(headerBigBlock, 0, BIG_BLOCK_SIZE);
    3034    
     3033
    30353034    /*
    30363035     * Initialize the magic number.
    30373036     */
    30383037    memcpy(headerBigBlock, STORAGE_magic, sizeof(STORAGE_magic));
    3039    
     3038
    30403039    /*
    30413040     * And a bunch of things we don't know what they mean
     
    30473046    StorageUtl_WriteDWord(headerBigBlock, 0x40, (DWORD)0x0001);
    30483047  }
    3049  
     3048
    30503049  /*
    30513050   * Write the information to the header.
     
    30543053  {
    30553054    StorageUtl_WriteWord(
    3056       headerBigBlock, 
    3057       OFFSET_BIGBLOCKSIZEBITS,   
     3055      headerBigBlock,
     3056      OFFSET_BIGBLOCKSIZEBITS,
    30583057      This->bigBlockSizeBits);
    30593058
    30603059    StorageUtl_WriteWord(
    3061       headerBigBlock, 
    3062       OFFSET_SMALLBLOCKSIZEBITS, 
     3060      headerBigBlock,
     3061      OFFSET_SMALLBLOCKSIZEBITS,
    30633062      This->smallBlockSizeBits);
    30643063
    30653064    StorageUtl_WriteDWord(
    3066       headerBigBlock, 
    3067       OFFSET_BBDEPOTCOUNT,     
     3065      headerBigBlock,
     3066      OFFSET_BBDEPOTCOUNT,
    30683067      This->bigBlockDepotCount);
    30693068
    30703069    StorageUtl_WriteDWord(
    3071       headerBigBlock, 
    3072       OFFSET_ROOTSTARTBLOCK,   
     3070      headerBigBlock,
     3071      OFFSET_ROOTSTARTBLOCK,
    30733072      This->rootStartBlock);
    30743073
    30753074    StorageUtl_WriteDWord(
    3076       headerBigBlock, 
    3077       OFFSET_SBDEPOTSTART,     
     3075      headerBigBlock,
     3076      OFFSET_SBDEPOTSTART,
    30783077      This->smallBlockDepotStart);
    30793078
    30803079    StorageUtl_WriteDWord(
    3081       headerBigBlock, 
    3082       OFFSET_EXTBBDEPOTSTART,   
     3080      headerBigBlock,
     3081      OFFSET_EXTBBDEPOTSTART,
    30833082      This->extBigBlockDepotStart);
    30843083
    30853084    StorageUtl_WriteDWord(
    3086       headerBigBlock, 
    3087       OFFSET_EXTBBDEPOTCOUNT,   
     3085      headerBigBlock,
     3086      OFFSET_EXTBBDEPOTCOUNT,
    30883087      This->extBigBlockDepotCount);
    30893088
     
    30913090    {
    30923091      StorageUtl_WriteDWord(
    3093         headerBigBlock, 
     3092        headerBigBlock,
    30943093        OFFSET_BBDEPOTSTART + (sizeof(ULONG)*index),
    30953094        (This->bigBlockDepotStart[index]));
    30963095    }
    30973096  }
    3098  
     3097
    30993098  /*
    31003099   * Write the big block back to the file.
     
    31203119  offsetInPropSet.s.HighPart = 0;
    31213120  offsetInPropSet.s.LowPart  = index * PROPSET_BLOCK_SIZE;
    3122  
     3121
    31233122  readSuccessful = BlockChainStream_ReadAt(
    31243123                    This->rootBlockChain,
     
    31363135    memset(buffer->name, 0, sizeof(buffer->name));
    31373136    memcpy(
    3138       buffer->name, 
    3139       propName, 
     3137      buffer->name,
     3138      propName,
    31403139      PROPERTY_NAME_BUFFER_LEN );
    31413140    TRACE("storage name: %s\n", debugstr_w(buffer->name));
    31423141
    31433142    memcpy(&buffer->propertyType, currentProperty + OFFSET_PS_PROPERTYTYPE, 1);
    3144    
     3143
    31453144    StorageUtl_ReadWord(
    3146       currentProperty, 
    3147       OFFSET_PS_NAMELENGTH, 
     3145      currentProperty,
     3146      OFFSET_PS_NAMELENGTH,
    31483147      &buffer->sizeOfNameString);
    31493148
    31503149    StorageUtl_ReadDWord(
    3151       currentProperty, 
    3152       OFFSET_PS_PREVIOUSPROP, 
     3150      currentProperty,
     3151      OFFSET_PS_PREVIOUSPROP,
    31533152      &buffer->previousProperty);
    31543153
    31553154    StorageUtl_ReadDWord(
    3156       currentProperty, 
    3157       OFFSET_PS_NEXTPROP,     
     3155      currentProperty,
     3156      OFFSET_PS_NEXTPROP,
    31583157      &buffer->nextProperty);
    31593158
    31603159    StorageUtl_ReadDWord(
    3161       currentProperty, 
    3162       OFFSET_PS_DIRPROP,     
     3160      currentProperty,
     3161      OFFSET_PS_DIRPROP,
    31633162      &buffer->dirProperty);
    31643163
    31653164    StorageUtl_ReadGUID(
    3166       currentProperty, 
    3167       OFFSET_PS_GUID,       
     3165      currentProperty,
     3166      OFFSET_PS_GUID,
    31683167      &buffer->propertyUniqueID);
    31693168
    31703169    StorageUtl_ReadDWord(
    3171       currentProperty, 
    3172       OFFSET_PS_TSS1,         
     3170      currentProperty,
     3171      OFFSET_PS_TSS1,
    31733172      &buffer->timeStampS1);
    31743173
    31753174    StorageUtl_ReadDWord(
    3176       currentProperty, 
    3177       OFFSET_PS_TSD1,         
     3175      currentProperty,
     3176      OFFSET_PS_TSD1,
    31783177      &buffer->timeStampD1);
    31793178
    31803179    StorageUtl_ReadDWord(
    3181       currentProperty, 
    3182       OFFSET_PS_TSS2,         
     3180      currentProperty,
     3181      OFFSET_PS_TSS2,
    31833182      &buffer->timeStampS2);
    31843183
    31853184    StorageUtl_ReadDWord(
    3186       currentProperty, 
    3187       OFFSET_PS_TSD2,         
     3185      currentProperty,
     3186      OFFSET_PS_TSD2,
    31883187      &buffer->timeStampD2);
    31893188
    31903189    StorageUtl_ReadDWord(
    3191       currentProperty, 
    3192       OFFSET_PS_STARTBLOCK,   
     3190      currentProperty,
     3191      OFFSET_PS_STARTBLOCK,
    31933192      &buffer->startingBlock);
    31943193
    31953194    StorageUtl_ReadDWord(
    3196       currentProperty, 
    3197       OFFSET_PS_SIZE,         
     3195      currentProperty,
     3196      OFFSET_PS_SIZE,
    31983197      &buffer->size.s.LowPart);
    31993198
     
    32233222
    32243223  memcpy(
    3225     currentProperty + OFFSET_PS_NAME, 
    3226     buffer->name, 
     3224    currentProperty + OFFSET_PS_NAME,
     3225    buffer->name,
    32273226    PROPERTY_NAME_BUFFER_LEN );
    32283227
     
    32303229
    32313230  StorageUtl_WriteWord(
    3232     currentProperty, 
    3233       OFFSET_PS_NAMELENGTH,   
     3231    currentProperty,
     3232      OFFSET_PS_NAMELENGTH,
    32343233      buffer->sizeOfNameString);
    32353234
    32363235  StorageUtl_WriteDWord(
    3237     currentProperty, 
    3238       OFFSET_PS_PREVIOUSPROP, 
     3236    currentProperty,
     3237      OFFSET_PS_PREVIOUSPROP,
    32393238      buffer->previousProperty);
    32403239
    32413240  StorageUtl_WriteDWord(
    3242     currentProperty, 
    3243       OFFSET_PS_NEXTPROP,     
     3241    currentProperty,
     3242      OFFSET_PS_NEXTPROP,
    32443243      buffer->nextProperty);
    32453244
    32463245  StorageUtl_WriteDWord(
    3247     currentProperty, 
    3248       OFFSET_PS_DIRPROP,     
     3246    currentProperty,
     3247      OFFSET_PS_DIRPROP,
    32493248      buffer->dirProperty);
    32503249
    32513250  StorageUtl_WriteGUID(
    3252     currentProperty, 
    3253       OFFSET_PS_GUID,       
     3251    currentProperty,
     3252      OFFSET_PS_GUID,
    32543253      &buffer->propertyUniqueID);
    32553254
    32563255  StorageUtl_WriteDWord(
    3257     currentProperty, 
    3258       OFFSET_PS_TSS1,         
     3256    currentProperty,
     3257      OFFSET_PS_TSS1,
    32593258      buffer->timeStampS1);
    32603259
    32613260  StorageUtl_WriteDWord(
    3262     currentProperty, 
    3263       OFFSET_PS_TSD1,         
     3261    currentProperty,
     3262      OFFSET_PS_TSD1,
    32643263      buffer->timeStampD1);
    32653264
    32663265  StorageUtl_WriteDWord(
    3267     currentProperty, 
    3268       OFFSET_PS_TSS2,         
     3266    currentProperty,
     3267      OFFSET_PS_TSS2,
    32693268      buffer->timeStampS2);
    32703269
    32713270  StorageUtl_WriteDWord(
    3272     currentProperty, 
    3273       OFFSET_PS_TSD2,         
     3271    currentProperty,
     3272      OFFSET_PS_TSD2,
    32743273      buffer->timeStampD2);
    32753274
    32763275  StorageUtl_WriteDWord(
    3277     currentProperty, 
    3278       OFFSET_PS_STARTBLOCK,   
     3276    currentProperty,
     3277      OFFSET_PS_STARTBLOCK,
    32793278      buffer->startingBlock);
    32803279
    32813280  StorageUtl_WriteDWord(
    3282     currentProperty, 
    3283       OFFSET_PS_SIZE,         
     3281    currentProperty,
     3282      OFFSET_PS_SIZE,
    32843283      buffer->size.s.LowPart);
    32853284
     
    33273326
    33283327    StorageImpl_ReleaseBigBlock(This, bigBlockBuffer);
    3329    
     3328
    33303329    return TRUE;
    33313330  }
    3332  
     3331
    33333332  return FALSE;
    33343333}
     
    34603459
    34613460StorageInternalImpl* StorageInternalImpl_Construct(
    3462   StorageImpl* ancestorStorage, 
     3461  StorageImpl* ancestorStorage,
    34633462  ULONG          rootPropertyIndex)
    34643463{
     
    35113510** does nothing.
    35123511*/
    3513 HRESULT WINAPI StorageInternalImpl_Commit( 
     3512HRESULT WINAPI StorageInternalImpl_Commit(
    35143513  IStorage*            iface,
    3515   DWORD                  grfCommitFlags)  /* [in] */ 
     3514  DWORD                  grfCommitFlags)  /* [in] */
    35163515{
    35173516  return S_OK;
    35183517}
    3519        
     3518
    35203519/******************************************************************************
    35213520**
     
    35253524** does nothing.
    35263525*/
    3527 HRESULT WINAPI StorageInternalImpl_Revert( 
     3526HRESULT WINAPI StorageInternalImpl_Revert(
    35283527  IStorage*            iface)
    35293528{
     
    35423541
    35433542  newEnumeration = HeapAlloc(GetProcessHeap(), 0, sizeof(IEnumSTATSTGImpl));
    3544  
     3543
    35453544  if (newEnumeration!=0)
    35463545  {
     
    35503549    ICOM_VTBL(newEnumeration) = &IEnumSTATSTGImpl_Vtbl;
    35513550    newEnumeration->ref       = 0;
    3552    
     3551
    35533552    /*
    35543553     * We want to nail-down the reference to the storage in case the
     
    35573556    newEnumeration->parentStorage = parentStorage;
    35583557    IStorage_AddRef((IStorage*)newEnumeration->parentStorage);
    3559    
     3558
    35603559    newEnumeration->firstPropertyNode   = firstPropertyNode;
    3561    
     3560
    35623561    /*
    35633562     * Initialize the search stack
     
    35653564    newEnumeration->stackSize    = 0;
    35663565    newEnumeration->stackMaxSize = ENUMSTATSGT_SIZE_INCREMENT;
    3567     newEnumeration->stackToVisit = 
     3566    newEnumeration->stackToVisit =
    35683567      HeapAlloc(GetProcessHeap(), 0, sizeof(ULONG)*ENUMSTATSGT_SIZE_INCREMENT);
    3569    
     3568
    35703569    /*
    35713570     * Make sure the current node of the iterator is the first one.
     
    35733572    IEnumSTATSTGImpl_Reset((IEnumSTATSTG*)newEnumeration);
    35743573  }
    3575  
     3574
    35763575  return newEnumeration;
    35773576}
     
    36053604   * Compare the riid with the interface IDs implemented by this object.
    36063605   */
    3607   if (memcmp(&IID_IUnknown, riid, sizeof(IID_IUnknown)) == 0) 
     3606  if (memcmp(&IID_IUnknown, riid, sizeof(IID_IUnknown)) == 0)
    36083607  {
    36093608    *ppvObject = (IEnumSTATSTG*)This;
    36103609  }
    3611   else if (memcmp(&IID_IStorage, riid, sizeof(IID_IEnumSTATSTG)) == 0) 
     3610  else if (memcmp(&IID_IStorage, riid, sizeof(IID_IEnumSTATSTG)) == 0)
    36123611  {
    36133612    *ppvObject = (IEnumSTATSTG*)This;
     
    36283627  return S_OK;
    36293628}
    3630        
     3629
    36313630ULONG   WINAPI IEnumSTATSTGImpl_AddRef(
    36323631  IEnumSTATSTG* iface)
     
    36373636  return This->ref;
    36383637}
    3639        
     3638
    36403639ULONG   WINAPI IEnumSTATSTGImpl_Release(
    36413640  IEnumSTATSTG* iface)
     
    36563655  }
    36573656
    3658   return newRef;;
     3657  return newRef;
    36593658}
    36603659
     
    36763675   */
    36773676  if ( (rgelt==0) || ( (celt!=1) && (pceltFetched==0) ) )
    3678     return E_INVALIDARG; 
    3679  
     3677    return E_INVALIDARG;
     3678
    36803679  /*
    36813680   * To avoid the special case, get another pointer to a ULONG value if
     
    36843683  if (pceltFetched==0)
    36853684    pceltFetched = &objectFetched;
    3686  
     3685
    36873686  /*
    36883687   * Start the iteration, we will iterate until we hit the end of the
     
    36963695  currentSearchNode = IEnumSTATSTGImpl_PopSearchNode(This, FALSE);
    36973696
    3698   while ( ( *pceltFetched < celt) && 
     3697  while ( ( *pceltFetched < celt) &&
    36993698          ( currentSearchNode!=PROPERTY_NULL) )
    37003699  {
    3701     /* 
     3700    /*
    37023701     * Remove the top node from the stack
    37033702     */
     
    37083707     */
    37093708    StorageImpl_ReadProperty(This->parentStorage,
    3710       currentSearchNode, 
     3709      currentSearchNode,
    37113710      &currentProperty);
    37123711
     
    37173716      &currentProperty,
    37183717      STATFLAG_DEFAULT);
    3719        
     3718
    37203719    /*
    37213720     * Step to the next item in the iteration
     
    37413740}
    37423741
    3743        
     3742
    37443743HRESULT WINAPI IEnumSTATSTGImpl_Skip(
    37453744  IEnumSTATSTG* iface,
     
    37573756  currentSearchNode = IEnumSTATSTGImpl_PopSearchNode(This, FALSE);
    37583757
    3759   while ( (objectFetched < celt) && 
     3758  while ( (objectFetched < celt) &&
    37603759          (currentSearchNode!=PROPERTY_NULL) )
    37613760  {
    3762     /* 
     3761    /*
    37633762     * Remove the top node from the stack
    37643763     */
     
    37693768     */
    37703769    StorageImpl_ReadProperty(This->parentStorage,
    3771       currentSearchNode, 
     3770      currentSearchNode,
    37723771      &currentProperty);
    3773    
     3772
    37743773    /*
    37753774     * Step to the next item in the iteration
     
    37933792  return S_FALSE;
    37943793}
    3795        
     3794
    37963795HRESULT WINAPI IEnumSTATSTGImpl_Reset(
    37973796  IEnumSTATSTG* iface)
     
    38123811  readSuccessful = StorageImpl_ReadProperty(
    38133812                    This->parentStorage,
    3814                     This->firstPropertyNode, 
     3813                    This->firstPropertyNode,
    38153814                    &rootProperty);
    38163815
     
    38273826  return S_OK;
    38283827}
    3829        
     3828
    38303829HRESULT WINAPI IEnumSTATSTGImpl_Clone(
    38313830  IEnumSTATSTG* iface,
     
    38413840  if (ppenum==0)
    38423841    return E_INVALIDARG;
    3843  
     3842
    38443843  newClone = IEnumSTATSTGImpl_Construct(This->parentStorage,
    38453844               This->firstPropertyNode);
    38463845
    3847  
     3846
    38483847  /*
    38493848   * The new clone enumeration must point to the same current node as
     
    38523851  newClone->stackSize    = This->stackSize    ;
    38533852  newClone->stackMaxSize = This->stackMaxSize ;
    3854   newClone->stackToVisit = 
     3853  newClone->stackToVisit =
    38553854    HeapAlloc(GetProcessHeap(), 0, sizeof(ULONG) * newClone->stackMaxSize);
    38563855
    38573856  memcpy(
    3858     newClone->stackToVisit, 
    3859     This->stackToVisit, 
     3857    newClone->stackToVisit,
     3858    This->stackToVisit,
    38603859    sizeof(ULONG) * newClone->stackSize);
    38613860
     
    38733872INT IEnumSTATSTGImpl_FindParentProperty(
    38743873  IEnumSTATSTGImpl *This,
    3875   ULONG             childProperty, 
     3874  ULONG             childProperty,
    38763875  StgProperty      *currentProperty,
    38773876  ULONG            *thisNodeId)
     
    38913890   */
    38923891  currentSearchNode = IEnumSTATSTGImpl_PopSearchNode(This, FALSE);
    3893  
     3892
    38943893
    38953894  while (currentSearchNode!=PROPERTY_NULL)
     
    39003899    *thisNodeId = currentSearchNode;
    39013900
    3902     /* 
     3901    /*
    39033902     * Remove the top node from the stack
    39043903     */
     
    39103909    StorageImpl_ReadProperty(
    39113910      This->parentStorage,
    3912       currentSearchNode, 
     3911      currentSearchNode,
    39133912      currentProperty);
    3914      
     3913
    39153914    if (currentProperty->previousProperty == childProperty)
    39163915      return PROPERTY_RELATION_PREVIOUS;
    39173916
    3918     else if (currentProperty->nextProperty == childProperty) 
     3917    else if (currentProperty->nextProperty == childProperty)
    39193918      return PROPERTY_RELATION_NEXT;
    3920  
     3919
    39213920    else if (currentProperty->dirProperty == childProperty)
    39223921      return PROPERTY_RELATION_DIR;
    3923        
     3922
    39243923    /*
    39253924     * Push the next search node in the search stack.
     
    39503949  while (currentSearchNode!=PROPERTY_NULL)
    39513950  {
    3952     /* 
     3951    /*
    39533952     * Remove the top node from the stack
    39543953     */
     
    39593958     */
    39603959    StorageImpl_ReadProperty(This->parentStorage,
    3961       currentSearchNode, 
     3960      currentSearchNode,
    39623961      currentProperty);
    39633962
    39643963    if ( propertyNameCmp(
    3965           (OLECHAR*)currentProperty->name, 
     3964          (OLECHAR*)currentProperty->name,
    39663965          (OLECHAR*)lpszPropName) == 0)
    39673966      return currentSearchNode;
     
    40024001
    40034002    This->stackToVisit = HeapReAlloc(
    4004                            GetProcessHeap(), 
     4003                           GetProcessHeap(),
    40054004                           0,
    40064005                           This->stackToVisit,
     
    40164015  readSuccessful = StorageImpl_ReadProperty(
    40174016                    This->parentStorage,
    4018                     nodeToPush, 
     4017                    nodeToPush,
    40194018                    &rootProperty);
    40204019
     
    41034102  else
    41044103  {
    4105     destination->pwcsName = 
     4104    destination->pwcsName =
    41064105      CoTaskMemAlloc((lstrlenW(source->name)+1)*sizeof(WCHAR));
    41074106
    41084107    strcpyW((LPWSTR)destination->pwcsName, source->name);
    41094108  }
    4110  
     4109
    41114110  switch (source->propertyType)
    41124111  {
     
    41204119    default:
    41214120      destination->type = STGTY_STREAM;
    4122       break;       
     4121      break;
    41234122  }
    41244123
    41254124  destination->cbSize            = source->size;
    4126 /*   
     4125/*
    41274126  currentReturnStruct->mtime     = {0}; TODO
    41284127  currentReturnStruct->ctime     = {0};
    4129   currentReturnStruct->atime     = {0}; 
     4128  currentReturnStruct->atime     = {0};
    41304129*/
    41314130  destination->grfMode           = 0;
    4132   destination->grfLocksSupported = 0; 
     4131  destination->grfLocksSupported = 0;
    41334132  destination->clsid             = source->propertyUniqueID;
    4134   destination->grfStateBits      = 0; 
    4135   destination->reserved          = 0; 
     4133  destination->grfStateBits      = 0;
     4134  destination->reserved          = 0;
    41364135}
    41374136
     
    41414140
    41424141BlockChainStream* BlockChainStream_Construct(
    4143   StorageImpl* parentStorage, 
     4142  StorageImpl* parentStorage,
    41444143  ULONG*         headOfStreamPlaceHolder,
    41454144  ULONG          propertyIndex)
     
    42144213 * Returns the number of blocks that comprises this chain.
    42154214 * This is not the size of the stream as the last block may not be full!
    4216  * 
     4215 *
    42174216 */
    42184217ULONG BlockChainStream_GetCount(BlockChainStream* This)
     
    42284227
    42294228    blockIndex = StorageImpl_GetNextBlockInChain(
    4230                    This->parentStorage, 
     4229                   This->parentStorage,
    42314230                   blockIndex);
    42324231  }
     
    42364235
    42374236/******************************************************************************
    4238  *      BlockChainStream_ReadAt 
     4237 *      BlockChainStream_ReadAt
    42394238 *
    42404239 * Reads a specified number of bytes from this chain at the specified offset.
     
    42764275  while ( (blockNoInSequence > 0) &&  (blockIndex != BLOCK_END_OF_CHAIN))
    42774276  {
    4278     blockIndex = 
     4277    blockIndex =
    42794278      StorageImpl_GetNextBlockInChain(This->parentStorage, blockIndex);
    4280    
     4279
    42814280    blockNoInSequence--;
    42824281  }
     
    42894288  *bytesRead   = 0;
    42904289  bufferWalker = buffer;
    4291  
     4290
    42924291  while ( (size > 0) && (blockIndex != BLOCK_END_OF_CHAIN) )
    42934292  {
     
    42954294     * Calculate how many bytes we can copy from this big block.
    42964295     */
    4297     bytesToReadInBuffer = 
     4296    bytesToReadInBuffer =
    42984297      min(This->parentStorage->bigBlockSize - offsetInBlock, size);
    4299    
     4298
    43004299    /*
    43014300     * Copy those bytes to the buffer
    43024301     */
    4303     bigBlockBuffer = 
     4302    bigBlockBuffer =
    43044303      StorageImpl_GetROBigBlock(This->parentStorage, blockIndex);
    4305    
     4304
    43064305    memcpy(bufferWalker, bigBlockBuffer + offsetInBlock, bytesToReadInBuffer);
    4307    
     4306
    43084307    StorageImpl_ReleaseBigBlock(This->parentStorage, bigBlockBuffer);
    4309    
     4308
    43104309    /*
    43114310     * Step to the next big block.
    43124311     */
    4313     blockIndex    = 
     4312    blockIndex    =
    43144313      StorageImpl_GetNextBlockInChain(This->parentStorage, blockIndex);
    43154314
     
    43204319
    43214320  }
    4322  
     4321
    43234322  return (size == 0);
    43244323}
     
    43654364  while ( (blockNoInSequence > 0) &&  (blockIndex != BLOCK_END_OF_CHAIN))
    43664365  {
    4367     blockIndex = 
     4366    blockIndex =
    43684367      StorageImpl_GetNextBlockInChain(This->parentStorage, blockIndex);
    4369    
     4368
    43704369    blockNoInSequence--;
    43714370  }
     
    43854384     * Calculate how many bytes we can copy from this big block.
    43864385     */
    4387     bytesToWrite = 
     4386    bytesToWrite =
    43884387      min(This->parentStorage->bigBlockSize - offsetInBlock, size);
    4389    
     4388
    43904389    /*
    43914390     * Copy those bytes to the buffer
    43924391     */
    43934392    bigBlockBuffer = StorageImpl_GetBigBlock(This->parentStorage, blockIndex);
    4394    
     4393
    43954394    memcpy(bigBlockBuffer + offsetInBlock, bufferWalker, bytesToWrite);
    4396    
     4395
    43974396    StorageImpl_ReleaseBigBlock(This->parentStorage, bigBlockBuffer);
    4398    
     4397
    43994398    /*
    44004399     * Step to the next big block.
    44014400     */
    4402     blockIndex    = 
     4401    blockIndex    =
    44034402      StorageImpl_GetNextBlockInChain(This->parentStorage, blockIndex);
    44044403
     
    44084407    offsetInBlock  = 0;      /* There is no offset on the next block */
    44094408  }
    4410  
     4409
    44114410  return (size == 0);
    44124411}
     
    44454444  while (count < numBlocks)
    44464445  {
    4447     blockIndex = 
     4446    blockIndex =
    44484447      StorageImpl_GetNextBlockInChain(This->parentStorage, blockIndex);
    44494448
     
    44524451
    44534452  /* Get the next block before marking the new end */
    4454   extraBlock = 
     4453  extraBlock =
    44554454    StorageImpl_GetNextBlockInChain(This->parentStorage, blockIndex);
    44564455
    44574456  /* Mark the new end of chain */
    44584457  StorageImpl_SetNextBlockInChain(
    4459     This->parentStorage, 
    4460     blockIndex, 
     4458    This->parentStorage,
     4459    blockIndex,
    44614460    BLOCK_END_OF_CHAIN);
    44624461
     
    44694468  while (extraBlock != BLOCK_END_OF_CHAIN)
    44704469  {
    4471     blockIndex = 
     4470    blockIndex =
    44724471      StorageImpl_GetNextBlockInChain(This->parentStorage, extraBlock);
    44734472
     
    45134512
    45144513      StorageImpl_ReadProperty(
    4515         This->parentStorage, 
     4514        This->parentStorage,
    45164515        This->ownerPropertyIndex,
    45174516        &chainProp);
    45184517
    4519       chainProp.startingBlock = blockIndex; 
     4518      chainProp.startingBlock = blockIndex;
    45204519
    45214520      StorageImpl_WriteProperty(
    4522         This->parentStorage, 
     4521        This->parentStorage,
    45234522        This->ownerPropertyIndex,
    45244523        &chainProp);
     
    45694568
    45704569      StorageImpl_SetNextBlockInChain(
    4571         This->parentStorage, 
    4572         currentBlock, 
     4570        This->parentStorage,
     4571        currentBlock,
    45734572        blockIndex);
    45744573
    45754574      StorageImpl_SetNextBlockInChain(
    4576         This->parentStorage, 
    4577         blockIndex, 
     4575        This->parentStorage,
     4576        blockIndex,
    45784577        BLOCK_END_OF_CHAIN);
    45794578
     
    45974596 * TODO: Free the actual blocks in the file when we shrink the chain.
    45984597 *       Currently, the blocks are still in the file. So the file size
    4599  *       doesn't shrink even if we shrink streams. 
     4598 *       doesn't shrink even if we shrink streams.
    46004599 */
    46014600BOOL BlockChainStream_SetSize(
     
    46144613  else
    46154614  {
    4616     ULARGE_INTEGER fileSize = 
     4615    ULARGE_INTEGER fileSize =
    46174616      BIGBLOCKFILE_GetSize(This->parentStorage->bigBlockFile);
    46184617
     
    46234622     */
    46244623    if ((diff % This->parentStorage->bigBlockSize) != 0)
    4625       diff += (This->parentStorage->bigBlockSize - 
     4624      diff += (This->parentStorage->bigBlockSize -
    46264625                (diff % This->parentStorage->bigBlockSize) );
    46274626
     
    46474646  if(This->headOfStreamPlaceHolder == NULL)
    46484647  {
    4649     /* 
    4650      * This chain is a data stream read the property and return 
     4648    /*
     4649     * This chain is a data stream read the property and return
    46514650     * the appropriate size
    46524651     */
     
    46614660  {
    46624661    /*
    4663      * this chain is a chain that does not have a property, figure out the 
    4664      * size by making the product number of used blocks times the 
     4662     * this chain is a chain that does not have a property, figure out the
     4663     * size by making the product number of used blocks times the
    46654664     * size of them
    46664665     */
     
    46684667    result.s.HighPart = 0;
    46694668
    4670     result.s.LowPart  = 
    4671       BlockChainStream_GetCount(This) * 
     4669    result.s.LowPart  =
     4670      BlockChainStream_GetCount(This) *
    46724671      This->parentStorage->bigBlockSize;
    46734672
     
    46814680
    46824681SmallBlockChainStream* SmallBlockChainStream_Construct(
    4683   StorageImpl* parentStorage, 
     4682  StorageImpl* parentStorage,
    46844683  ULONG          propertyIndex)
    46854684{
     
    47324731 *
    47334732 * Returns the index of the next small block in this chain.
    4734  * 
     4733 *
    47354734 * Return Values:
    47364735 *    - BLOCK_END_OF_CHAIN: end of this chain
     
    48594858    else
    48604859    {
    4861       ULONG count = 
     4860      ULONG count =
    48624861        BlockChainStream_GetCount(This->parentStorage->smallBlockDepotChain);
    48634862
     
    48704869      {
    48714870        sbdIndex = nextBlock;
    4872         nextBlock = 
     4871        nextBlock =
    48734872          StorageImpl_GetNextBlockInChain(This->parentStorage, sbdIndex);
    48744873      }
     
    48774876      if (sbdIndex != BLOCK_END_OF_CHAIN)
    48784877        StorageImpl_SetNextBlockInChain(
    4879           This->parentStorage, 
    4880           sbdIndex, 
     4878          This->parentStorage,
     4879          sbdIndex,
    48814880          newsbdIndex);
    48824881
    48834882      StorageImpl_SetNextBlockInChain(
    4884         This->parentStorage, 
    4885         newsbdIndex, 
     4883        This->parentStorage,
     4884        newsbdIndex,
    48864885        BLOCK_END_OF_CHAIN);
    48874886
     
    48894888       * Initialize all the small blocks to free
    48904889       */
    4891       smallBlockDepot = 
     4890      smallBlockDepot =
    48924891        StorageImpl_GetBigBlock(This->parentStorage, newsbdIndex);
    48934892
     
    49014900         */
    49024901        StgProperty rootProp;
    4903         ULONG sbStartIndex; 
     4902        ULONG sbStartIndex;
    49044903
    49054904        /*
     
    49104909
    49114910        /*
    4912          * And allocate the first big block that will contain small blocks 
     4911         * And allocate the first big block that will contain small blocks
    49134912         */
    4914         sbStartIndex = 
     4913        sbStartIndex =
    49154914          StorageImpl_GetNextFreeBigBlock(This->parentStorage);
    49164915
    49174916        StorageImpl_SetNextBlockInChain(
    4918           This->parentStorage, 
    4919           sbStartIndex, 
     4917          This->parentStorage,
     4918          sbStartIndex,
    49204919          BLOCK_END_OF_CHAIN);
    49214920
    49224921        StorageImpl_ReadProperty(
    4923           This->parentStorage, 
    4924           This->parentStorage->rootPropertySetIndex, 
     4922          This->parentStorage,
     4923          This->parentStorage->rootPropertySetIndex,
    49254924          &rootProp);
    49264925
     
    49304929
    49314930        StorageImpl_WriteProperty(
    4932           This->parentStorage, 
    4933           This->parentStorage->rootPropertySetIndex, 
     4931          This->parentStorage,
     4932          This->parentStorage->rootPropertySetIndex,
    49344933          &rootProp);
    49354934      }
     
    49374936  }
    49384937
    4939   smallBlocksPerBigBlock = 
     4938  smallBlocksPerBigBlock =
    49404939    This->parentStorage->bigBlockSize / This->parentStorage->smallBlockSize;
    49414940
     
    49494948
    49504949    StorageImpl_ReadProperty(
    4951       This->parentStorage, 
    4952       This->parentStorage->rootPropertySetIndex, 
     4950      This->parentStorage,
     4951      This->parentStorage->rootPropertySetIndex,
    49534952      &rootProp);
    49544953
    4955     if (rootProp.size.s.LowPart < 
     4954    if (rootProp.size.s.LowPart <
    49564955       (blocksRequired * This->parentStorage->bigBlockSize))
    49574956    {
     
    49594958
    49604959      BlockChainStream_SetSize(
    4961         This->parentStorage->smallBlockRootChain, 
     4960        This->parentStorage->smallBlockRootChain,
    49624961        rootProp.size);
    49634962
    49644963      StorageImpl_WriteProperty(
    4965         This->parentStorage, 
    4966         This->parentStorage->rootPropertySetIndex, 
     4964        This->parentStorage,
     4965        This->parentStorage->rootPropertySetIndex,
    49674966        &rootProp);
    49684967    }
     
    49774976 * Reads a specified number of bytes from this chain at the specified offset.
    49784977 * bytesRead may be NULL.
    4979  * Failure will be returned if the specified number of bytes has not been read. 
     4978 * Failure will be returned if the specified number of bytes has not been read.
    49804979 */
    49814980BOOL SmallBlockChainStream_ReadAt(
     
    49874986{
    49884987  ULARGE_INTEGER offsetInBigBlockFile;
    4989   ULONG blockNoInSequence = 
     4988  ULONG blockNoInSequence =
    49904989    offset.s.LowPart / This->parentStorage->smallBlockSize;
    49914990
     
    50245023     * Calculate how many bytes we can copy from this small block.
    50255024     */
    5026     bytesToReadInBuffer = 
     5025    bytesToReadInBuffer =
    50275026      min(This->parentStorage->smallBlockSize - offsetInBlock, size);
    50285027
     
    50315030     */
    50325031    offsetInBigBlockFile.s.HighPart  = 0;
    5033     offsetInBigBlockFile.s.LowPart   = 
     5032    offsetInBigBlockFile.s.LowPart   =
    50345033      blockIndex * This->parentStorage->smallBlockSize;
    50355034
     
    50755074{
    50765075  ULARGE_INTEGER offsetInBigBlockFile;
    5077   ULONG blockNoInSequence = 
     5076  ULONG blockNoInSequence =
    50785077    offset.s.LowPart / This->parentStorage->smallBlockSize;
    50795078
     
    50835082  ULONG bytesWrittenFromBigBlockFile;
    50845083  BYTE* bufferWalker;
    5085  
     5084
    50865085  /*
    50875086   * This should never happen on a small block file.
    50885087   */
    50895088  assert(offset.s.HighPart==0);
    5090  
     5089
    50915090  /*
    50925091   * Find the first block in the stream that contains part of the buffer.
    50935092   */
    50945093  blockIndex = SmallBlockChainStream_GetHeadOfChain(This);
    5095  
     5094
    50965095  while ( (blockNoInSequence > 0) &&  (blockIndex != BLOCK_END_OF_CHAIN))
    50975096  {
    50985097    blockIndex = SmallBlockChainStream_GetNextBlockInChain(This, blockIndex);
    5099    
     5098
    51005099    blockNoInSequence--;
    51015100  }
    5102  
     5101
    51035102  /*
    51045103   * Start writing the buffer.
     
    51145113     * Calculate how many bytes we can copy to this small block.
    51155114     */
    5116     bytesToWriteInBuffer = 
     5115    bytesToWriteInBuffer =
    51175116      min(This->parentStorage->smallBlockSize - offsetInBlock, size);
    5118    
     5117
    51195118    /*
    51205119     * Calculate the offset of the small block in the small block file.
    51215120     */
    51225121    offsetInBigBlockFile.s.HighPart  = 0;
    5123     offsetInBigBlockFile.s.LowPart   = 
     5122    offsetInBigBlockFile.s.LowPart   =
    51245123      blockIndex * This->parentStorage->smallBlockSize;
    51255124
    51265125    offsetInBigBlockFile.s.LowPart  += offsetInBlock;
    5127    
     5126
    51285127    /*
    51295128     * Write those bytes in the buffer to the small block file.
     
    51345133      bufferWalker,
    51355134      &bytesWrittenFromBigBlockFile);
    5136    
     5135
    51375136    assert(bytesWrittenFromBigBlockFile == bytesToWriteInBuffer);
    5138    
     5137
    51395138    /*
    51405139     * Step to the next big block.
     
    51465145    offsetInBlock  = 0;     /* There is no offset on the next block */
    51475146  }
    5148  
     5147
    51495148  return (size == 0);
    51505149}
     
    51535152 *       SmallBlockChainStream_Shrink
    51545153 *
    5155  * Shrinks this chain in the small block depot. 
     5154 * Shrinks this chain in the small block depot.
    51565155 */
    51575156BOOL SmallBlockChainStream_Shrink(
     
    51815180  /*
    51825181   * If the count is 0, we have a special case, the head of the chain was
    5183    * just freed. 
     5182   * just freed.
    51845183   */
    51855184  if (count == 0)
     
    51875186    StgProperty chainProp;
    51885187
    5189     StorageImpl_ReadProperty(This->parentStorage, 
     5188    StorageImpl_ReadProperty(This->parentStorage,
    51905189                             This->ownerPropertyIndex,
    51915190                             &chainProp);
     
    52095208    /* Mark the new end of chain */
    52105209    SmallBlockChainStream_SetNextBlockInChain(
    5211       This, 
    5212       blockIndex, 
     5210      This,
     5211      blockIndex,
    52135212      BLOCK_END_OF_CHAIN);
    52145213  }
     
    52245223  }
    52255224
    5226   return TRUE; 
     5225  return TRUE;
    52275226}
    52285227
     
    52605259    blockIndex = chainProp.startingBlock;
    52615260    SmallBlockChainStream_SetNextBlockInChain(
    5262       This, 
    5263       blockIndex, 
     5261      This,
     5262      blockIndex,
    52645263      BLOCK_END_OF_CHAIN);
    52655264  }
     
    52945293
    52955294    SmallBlockChainStream_SetNextBlockInChain(
    5296       This, 
    5297       blockIndex, 
     5295      This,
     5296      blockIndex,
    52985297      BLOCK_END_OF_CHAIN);
    52995298
     
    53365335 * TODO: Free the actual blocks in the file when we shrink the chain.
    53375336 *       Currently, the blocks are still in the file. So the file size
    5338  *       doesn't shrink even if we shrink streams. 
     5337 *       doesn't shrink even if we shrink streams.
    53395338 */
    53405339BOOL SmallBlockChainStream_SetSize(
     
    53945393  WCHAR          tempFileName[MAX_PATH];
    53955394
    5396   TRACE("(%s, %lx, %ld, %p)\n", 
    5397         debugstr_w(pwcsName), grfMode, 
     5395  TRACE("(%s, %lx, %ld, %p)\n",
     5396        debugstr_w(pwcsName), grfMode,
    53985397        reserved, ppstgOpen);
    53995398
     
    54425441
    54435442  /*
    5444    * Interpret the STGM value grfMode 
     5443   * Interpret the STGM value grfMode
    54455444   */
    54465445  shareMode    = GetShareModeFromSTGM(grfMode);
     
    54675466                        fileAttributes,
    54685467            0);
    5469  
     5468
    54705469  if (hFile == INVALID_HANDLE_VALUE)
    54715470  {
     
    54775476   */
    54785477  newStorage = HeapAlloc(GetProcessHeap(), 0, sizeof(StorageImpl));
    5479  
     5478
    54805479  if (newStorage == 0)
    54815480    return STG_E_INSUFFICIENTMEMORY;
     
    54895488         TRUE,
    54905489         TRUE);
    5491  
     5490
    54925491  if (FAILED(hr))
    54935492  {
     
    55155514  DWORD           grfMode,
    55165515  SNB           snbExclude,
    5517   DWORD           reserved, 
     5516  DWORD           reserved,
    55185517  IStorage      **ppstgOpen)
    55195518{
     
    55265525  DWORD          length;
    55275526
    5528   TRACE("(%s, %p, %lx, %p, %ld, %p)\n", 
     5527  TRACE("(%s, %p, %lx, %p, %ld, %p)\n",
    55295528        debugstr_w(pwcsName), pstgPriority, grfMode,
    55305529        snbExclude, reserved, ppstgOpen);
     
    55585557   */
    55595558  *ppstgOpen = 0;
    5560  
    5561   hFile = CreateFileW( pwcsName, 
     5559
     5560  hFile = CreateFileW( pwcsName,
    55625561                       accessMode,
    55635562                       shareMode,
     
    55665565                       FILE_ATTRIBUTE_NORMAL | FILE_FLAG_RANDOM_ACCESS,
    55675566                       0);
    5568  
     5567
    55695568  length = GetFileSize(hFile, NULL);
    5570  
     5569
    55715570  if (hFile==INVALID_HANDLE_VALUE)
    55725571  {
     
    56055604   */
    56065605  newStorage = HeapAlloc(GetProcessHeap(), 0, sizeof(StorageImpl));
    5607  
     5606
    56085607  if (newStorage == 0)
    56095608  {
     
    56215620         TRUE,
    56225621         !length );
    5623  
     5622
    56245623  if (FAILED(hr))
    56255624  {
     
    56325631    goto end;
    56335632  }
    5634  
     5633
    56355634  /* prepare the file name string given in lieu of the root property name */
    56365635  GetFullPathNameW(pwcsName, MAX_PATH, fullname, NULL);
     
    56455644         (REFIID)&IID_IStorage,
    56465645         (void**)ppstgOpen);
    5647  
     5646
    56485647end:
    56495648  TRACE("<-- %08lx, IStorage %p\n", hr, ppstgOpen ? *ppstgOpen : NULL);
     
    57005699         (void**)ppstgOpen);
    57015700
    5702   return hr; 
     5701  return hr;
    57035702}
    57045703
     
    57385737   */
    57395738  newStorage = HeapAlloc(GetProcessHeap(), 0, sizeof(StorageImpl));
    5740  
     5739
    57415740  if (newStorage == 0)
    57425741    return STG_E_INSUFFICIENTMEMORY;
     
    58265825    STATSTG pstatstg;
    58275826    HRESULT hRes;
    5828    
     5827
    58295828    TRACE("()\n");
    58305829
     
    58875886    CLSID clsid;
    58885887    HRESULT res;
    5889    
     5888
    58905889    TRACE("(%p,%p)\n",pPStm,pStm);
    58915890
     
    58935892
    58945893    if (SUCCEEDED(res)){
    5895        
     5894
    58965895        res=WriteClassStm(pStm,&clsid);
    58975896
     
    59115910 * STGM_TRANSACTED           0x00010000
    59125911 * STGM_SIMPLE               0x08000000
    5913  * 
     5912 *
    59145913 * STGM_READ                 0x00000000
    59155914 * STGM_WRITE                0x00000001
    59165915 * STGM_READWRITE            0x00000002
    5917  * 
     5916 *
    59185917 * STGM_SHARE_DENY_NONE      0x00000040
    59195918 * STGM_SHARE_DENY_READ      0x00000030
    59205919 * STGM_SHARE_DENY_WRITE     0x00000020
    59215920 * STGM_SHARE_EXCLUSIVE      0x00000010
    5922  * 
     5921 *
    59235922 * STGM_PRIORITY             0x00040000
    59245923 * STGM_DELETEONRELEASE      0x04000000
     
    59365935  BOOL bSTGM_SIMPLE           = ((stgm & STGM_SIMPLE) == STGM_SIMPLE);
    59375936  BOOL bSTGM_DIRECT           = ! (bSTGM_TRANSACTED || bSTGM_SIMPLE);
    5938    
     5937
    59395938  BOOL bSTGM_WRITE            = ((stgm & STGM_WRITE) == STGM_WRITE);
    59405939  BOOL bSTGM_READWRITE        = ((stgm & STGM_READWRITE) == STGM_READWRITE);
    59415940  BOOL bSTGM_READ             = ! (bSTGM_WRITE || bSTGM_READWRITE);
    5942    
     5941
    59435942  BOOL bSTGM_SHARE_DENY_NONE  =
    59445943                     ((stgm & STGM_SHARE_DENY_NONE)  == STGM_SHARE_DENY_NONE);
     
    59555954  BOOL bSTGM_CREATE           = ((stgm & STGM_CREATE) == STGM_CREATE);
    59565955  BOOL bSTGM_CONVERT          = ((stgm & STGM_CONVERT) == STGM_CONVERT);
    5957    
     5956
    59585957  BOOL bSTGM_NOSCRATCH        = ((stgm & STGM_NOSCRATCH) == STGM_NOSCRATCH);
    59595958  BOOL bSTGM_NOSNAPSHOT       = ((stgm & STGM_NOSNAPSHOT) == STGM_NOSNAPSHOT);
    59605959
    5961   /* 
     5960  /*
    59625961   * STGM_DIRECT | STGM_TRANSACTED | STGM_SIMPLE
    59635962   */
     
    59665965      return E_FAIL;
    59675966
    5968   /* 
     5967  /*
    59695968   * STGM_WRITE |  STGM_READWRITE | STGM_READ
    59705969   */
     
    59745973
    59755974  /*
    5976    * STGM_SHARE_DENY_NONE | others 
     5975   * STGM_SHARE_DENY_NONE | others
    59775976   * (I assume here that DENY_READ implies DENY_WRITE)
    59785977   */
    59795978  if ( bSTGM_SHARE_DENY_NONE )
    59805979    if ( bSTGM_SHARE_DENY_READ ||
    5981          bSTGM_SHARE_DENY_WRITE || 
    5982          bSTGM_SHARE_EXCLUSIVE) 
     5980         bSTGM_SHARE_DENY_WRITE ||
     5981         bSTGM_SHARE_EXCLUSIVE)
    59835982      return E_FAIL;
    59845983
     
    59955994  if ( bSTGM_NOSCRATCH && ! bSTGM_TRANSACTED )
    59965995    return E_FAIL;
    5997  
    5998   /*
    5999    * STGM_NOSNAPSHOT requires STGM_TRANSACTED and 
     5996
     5997  /*
     5998   * STGM_NOSNAPSHOT requires STGM_TRANSACTED and
    60005999   * not STGM_SHARE_EXCLUSIVE or STGM_SHARE_DENY_WRITE`
    60016000   */
    60026001  if (bSTGM_NOSNAPSHOT)
    60036002  {
    6004     if ( ! ( bSTGM_TRANSACTED && 
     6003    if ( ! ( bSTGM_TRANSACTED &&
    60056004           !(bSTGM_SHARE_EXCLUSIVE || bSTGM_SHARE_DENY_WRITE)) )
    60066005    return E_FAIL;
     
    60146013 *
    60156014 * This method will return a share mode flag from a STGM value.
    6016  * The STGM value is assumed valid. 
     6015 * The STGM value is assumed valid.
    60176016 */
    60186017static DWORD GetShareModeFromSTGM(DWORD stgm)
     
    60906089
    60916090/*************************************************************************
    6092  * OLECONVERT_LoadOLE10 [Internal] 
    6093  *
    6094  * Loads the OLE10 STREAM to memory 
     6091 * OLECONVERT_LoadOLE10 [Internal]
     6092 *
     6093 * Loads the OLE10 STREAM to memory
    60956094 *
    60966095 * PARAMS
     
    61056104 * NOTES
    61066105 *     This function is used by OleConvertOLESTREAMToIStorage only.
    6107  *     
     6106 *
    61086107 *     Memory allocated for pData must be freed by the caller
    61096108 */
     
    62606259
    62616260/*************************************************************************
    6262  * OLECONVERT_SaveOLE10 [Internal] 
    6263  *
    6264  * Saves the OLE10 STREAM From memory 
     6261 * OLECONVERT_SaveOLE10 [Internal]
     6262 *
     6263 * Saves the OLE10 STREAM From memory
    62656264 *
    62666265 * PARAMS
     
    62746273 * NOTES
    62756274 *     This function is used by OleConvertIStorageToOLESTREAM only.
    6276  *     
     6275 *
    62776276 */
    62786277HRESULT OLECONVERT_SaveOLE10(OLECONVERT_OLESTREAM_DATA *pData, LPOLESTREAM pOleStream)
     
    63686367
    63696368/*************************************************************************
    6370  * OLECONVERT_GetOLE20FromOLE10[Internal] 
     6369 * OLECONVERT_GetOLE20FromOLE10[Internal]
    63716370 *
    63726371 * This function copies OLE10 Data (the IStorage in the OLESTREAM) to disk,
    6373  * opens it, and copies the content to the dest IStorage for 
     6372 * opens it, and copies the content to the dest IStorage for
    63746373 * OleConvertOLESTREAMToIStorage
    6375  * 
     6374 *
    63766375 *
    63776376 * PARAMS
     
    63846383 *
    63856384 * NOTES
    6386  *     
    6387  *     
     6385 *
     6386 *
    63886387 */
    63896388void OLECONVERT_GetOLE20FromOLE10(LPSTORAGE pDestStorage, BYTE *pBuffer, DWORD nBufferLength)
     
    64206419
    64216420/*************************************************************************
    6422  * OLECONVERT_WriteOLE20ToBuffer [Internal] 
    6423  *
    6424  * Saves the OLE10 STREAM From memory 
     6421 * OLECONVERT_WriteOLE20ToBuffer [Internal]
     6422 *
     6423 * Saves the OLE10 STREAM From memory
    64256424 *
    64266425 * PARAMS
     
    64356434 *
    64366435 *     Used by OleConvertIStorageToOLESTREAM only.
    6437  *     
     6436 *
    64386437 */
    64396438DWORD OLECONVERT_WriteOLE20ToBuffer(LPSTORAGE pStorage, BYTE **pData)
     
    64476446
    64486447    *pData = NULL;
    6449    
     6448
    64506449    /* Create temp Storage */
    64516450    GetTempPathW(MAX_PATH, wstrTempDir);
     
    64746473
    64756474/*************************************************************************
    6476  * OLECONVERT_CreateOleStream [Internal] 
     6475 * OLECONVERT_CreateOleStream [Internal]
    64776476 *
    64786477 * Creates the "\001OLE" stream in the IStorage if neccessary.
     
    64896488 *     This stream is still unknown, MS Word seems to have extra data
    64906489 *     but since the data is stored in the OLESTREAM there should be
    6491  *     no need to recreate the stream.  If the stream is manually 
     6490 *     no need to recreate the stream.  If the stream is manually
    64926491 *     deleted it will create it with this default data.
    6493  *     
     6492 *
    64946493 */
    64956494void OLECONVERT_CreateOleStream(LPSTORAGE pStorage)
     
    64986497    IStream *pStream;
    64996498    WCHAR wstrStreamName[] = {1,'O', 'l', 'e', 0};
    6500     BYTE pOleStreamHeader [] = 
    6501     {
    6502         0x01, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 
    6503         0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
    6504         0x00, 0x00, 0x00, 0x00 
     6499    BYTE pOleStreamHeader [] =
     6500    {
     6501        0x01, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00,
     6502        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
     6503        0x00, 0x00, 0x00, 0x00
    65056504    };
    6506    
     6505
    65076506    /* Create stream if not present */
    6508     hRes = IStorage_CreateStream(pStorage, wstrStreamName, 
     6507    hRes = IStorage_CreateStream(pStorage, wstrStreamName,
    65096508        STGM_WRITE  | STGM_SHARE_EXCLUSIVE, 0, 0, &pStream );
    65106509
     
    65196518
    65206519/*************************************************************************
    6521  * OLECONVERT_CreateCompObjStream [Internal] 
     6520 * OLECONVERT_CreateCompObjStream [Internal]
    65226521 *
    65236522 * Creates a "\001CompObj" is the destination IStorage if necessary.
    65246523 *
    65256524 * PARAMS
    6526  *     pStorage       [I] The dest IStorage to create the CompObj Stream 
     6525 *     pStorage       [I] The dest IStorage to create the CompObj Stream
    65276526 *                        if necessary.
    65286527 *     strOleTypeName [I] The ProgID
     
    65366535 *
    65376536 *     The stream data is stored in the OLESTREAM and there should be
    6538  *     no need to recreate the stream.  If the stream is manually 
     6537 *     no need to recreate the stream.  If the stream is manually
    65396538 *     deleted it will attempt to create it by querying the registry.
    65406539 *
    6541  *     
     6540 *
    65426541 */
    65436542HRESULT OLECONVERT_CreateCompObjStream(LPSTORAGE pStorage, LPCSTR strOleTypeName)
     
    65586557
    65596558    /*  Create a CompObj stream if it doesn't exist */
    6560     hStorageRes = IStorage_CreateStream(pStorage, wstrStreamName, 
     6559    hStorageRes = IStorage_CreateStream(pStorage, wstrStreamName,
    65616560        STGM_WRITE  | STGM_SHARE_EXCLUSIVE, 0, 0, &pStream );
    65626561    if(hStorageRes == S_OK)
     
    65796578            LONG hErr;
    65806579            /* Get the CLSID Default Name from the Registry */
    6581             hErr = RegOpenKeyA(HKEY_CLASSES_ROOT, IStorageCompObj.strProgIDName, &hKey); 
     6580            hErr = RegOpenKeyA(HKEY_CLASSES_ROOT, IStorageCompObj.strProgIDName, &hKey);
    65826581            if(hErr == ERROR_SUCCESS)
    65836582            {
     
    66216620
    66226621/*************************************************************************
    6623  * OLECONVERT_CreateOlePresStream[Internal] 
     6622 * OLECONVERT_CreateOlePresStream[Internal]
    66246623 *
    66256624 * Creates the "\002OlePres000" Stream with the Metafile data
     
    66286627 *     pStorage     [I] The dest IStorage to create \002OLEPres000 stream in.
    66296628 *     dwExtentX    [I] Width of the Metafile
    6630  *     dwExtentY    [I] Height of the Metafile 
     6629 *     dwExtentY    [I] Height of the Metafile
    66316630 *     pData        [I] Metafile data
    66326631 *     dwDataLength [I] Size of the Metafile data
     
    66386637 * NOTES
    66396638 *     This function is used by OleConvertOLESTREAMToIStorage only.
    6640  *     
     6639 *
    66416640 */
    66426641void OLECONVERT_CreateOlePresStream(LPSTORAGE pStorage, DWORD dwExtentX, DWORD dwExtentY , BYTE *pData, DWORD dwDataLength)
     
    66456644    IStream *pStream;
    66466645    WCHAR wstrStreamName[] = {2, 'O', 'l', 'e', 'P', 'r', 'e', 's', '0', '0', '0', 0};
    6647     BYTE pOlePresStreamHeader [] = 
    6648     {
    6649         0xFF, 0xFF, 0xFF, 0xFF, 0x03, 0x00, 0x00, 0x00, 
    6650         0x04, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 
     6646    BYTE pOlePresStreamHeader [] =
     6647    {
     6648        0xFF, 0xFF, 0xFF, 0xFF, 0x03, 0x00, 0x00, 0x00,
     6649        0x04, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
    66516650        0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00,
    66526651        0x00, 0x00, 0x00, 0x00
    66536652    };
    66546653
    6655     BYTE pOlePresStreamHeaderEmpty [] = 
    6656     {
    6657         0x00, 0x00, 0x00, 0x00, 
    6658         0x04, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 
     6654    BYTE pOlePresStreamHeaderEmpty [] =
     6655    {
     6656        0x00, 0x00, 0x00, 0x00,
     6657        0x04, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
    66596658        0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00,
    66606659        0x00, 0x00, 0x00, 0x00
    66616660    };
    6662      
     6661
    66636662    /* Create the OlePres000 Stream */
    6664     hRes = IStorage_CreateStream(pStorage, wstrStreamName, 
     6663    hRes = IStorage_CreateStream(pStorage, wstrStreamName,
    66656664        STGM_CREATE | STGM_WRITE  | STGM_SHARE_EXCLUSIVE, 0, 0, &pStream );
    66666665
     
    67066705
    67076706/*************************************************************************
    6708  * OLECONVERT_CreateOle10NativeStream [Internal] 
     6707 * OLECONVERT_CreateOle10NativeStream [Internal]
    67096708 *
    67106709 * Creates the "\001Ole10Native" Stream (should contain a BMP)
     
    67226721 *
    67236722 *     Might need to verify the data and return appropriate error message
    6724  *     
     6723 *
    67256724 */
    67266725void OLECONVERT_CreateOle10NativeStream(LPSTORAGE pStorage, BYTE *pData, DWORD dwDataLength)
     
    67296728    IStream *pStream;
    67306729    WCHAR wstrStreamName[] = {1, 'O', 'l', 'e', '1', '0', 'N', 'a', 't', 'i', 'v', 'e', 0};
    6731    
     6730
    67326731    /* Create the Ole10Native Stream */
    6733     hRes = IStorage_CreateStream(pStorage, wstrStreamName, 
     6732    hRes = IStorage_CreateStream(pStorage, wstrStreamName,
    67346733        STGM_CREATE | STGM_WRITE  | STGM_SHARE_EXCLUSIVE, 0, 0, &pStream );
    67356734
     
    67456744
    67466745/*************************************************************************
    6747  * OLECONVERT_GetOLE10ProgID [Internal] 
     6746 * OLECONVERT_GetOLE10ProgID [Internal]
    67486747 *
    67496748 * Finds the ProgID (or OleTypeID) from the IStorage
     
    67616760 *     This function is used by OleConvertIStorageToOLESTREAM only.
    67626761 *
    6763  *     
     6762 *
    67646763 */
    67656764HRESULT OLECONVERT_GetOLE10ProgID(LPSTORAGE pStorage, char *strProgID, DWORD *dwSize)
     
    67726771
    67736772    /* Open the CompObj Stream */
    6774     hRes = IStorage_OpenStream(pStorage, wstrStreamName, NULL, 
     6773    hRes = IStorage_OpenStream(pStorage, wstrStreamName, NULL,
    67756774        STGM_READ  | STGM_SHARE_EXCLUSIVE, 0, &pStream );
    67766775    if(hRes == S_OK)
     
    68096808            *dwSize = WideCharToMultiByte(CP_ACP, 0, wstrProgID, -1, strProgID, *dwSize, NULL, FALSE);
    68106809        }
    6811  
     6810
    68126811    }
    68136812    return hRes;
     
    68156814
    68166815/*************************************************************************
    6817  * OLECONVERT_GetOle10PresData [Internal] 
     6816 * OLECONVERT_GetOle10PresData [Internal]
    68186817 *
    68196818 * Converts IStorage "/001Ole10Native" stream to a OLE10 Stream
     
    68306829 *
    68316830 *     Memory allocated for pData must be freed by the caller
    6832  *     
    6833  *     
     6831 *
     6832 *
    68346833 */
    68356834void OLECONVERT_GetOle10PresData(LPSTORAGE pStorage, OLECONVERT_OLESTREAM_DATA *pOleStreamData)
     
    68516850
    68526851    /* Open Ole10Native Stream */
    6853     hRes = IStorage_OpenStream(pStorage, wstrStreamName, NULL, 
     6852    hRes = IStorage_OpenStream(pStorage, wstrStreamName, NULL,
    68546853        STGM_READ  | STGM_SHARE_EXCLUSIVE, 0, &pStream );
    68556854    if(hRes == S_OK)
     
    68706869
    68716870/*************************************************************************
    6872  * OLECONVERT_GetOle20PresData[Internal] 
     6871 * OLECONVERT_GetOle20PresData[Internal]
    68736872 *
    68746873 * Converts IStorage "/002OlePres000" stream to a OLE10 Stream
     
    68836882 * NOTES
    68846883 *     This function is used by OleConvertIStorageToOLESTREAM only.
    6885  *     
     6884 *
    68866885 *     Memory allocated for pData must be freed by the caller
    68876886 */
     
    69106909
    69116910    /* Open OlePress000 stream */
    6912     hRes = IStorage_OpenStream(pStorage, wstrStreamName, NULL, 
     6911    hRes = IStorage_OpenStream(pStorage, wstrStreamName, NULL,
    69136912        STGM_READ  | STGM_SHARE_EXCLUSIVE, 0, &pStream );
    69146913    if(hRes == S_OK)
     
    69586957
    69596958/*************************************************************************
    6960  * OleConvertOLESTREAMToIStorage [OLE32.87] 
     6959 * OleConvertOLESTREAMToIStorage [OLE32.87]
    69616960 *
    69626961 * Read info on MSDN
     
    69676966 *      Still some unknowns for the IStorage: "\002OlePres000", "\001CompObj",
    69686967 *      and "\001OLE" streams
    6969  *     
     6968 *
    69706969 */
    69716970HRESULT WINAPI OleConvertOLESTREAMToIStorage (
    6972     LPOLESTREAM pOleStream, 
    6973     LPSTORAGE pstg, 
     6971    LPOLESTREAM pOleStream,
     6972    LPSTORAGE pstg,
    69746973    const DVTARGETDEVICE* ptd)
    69756974{
     
    70627061 *      Still some unknowns for the IStorage: "\002OlePres000", "\001CompObj",
    70637062 *      and "\001OLE" streams.
    7064  *     
     7063 *
    70657064 */
    70667065HRESULT WINAPI OleConvertIStorageToOLESTREAM (
    7067     LPSTORAGE pstg, 
     7066    LPSTORAGE pstg,
    70687067    LPOLESTREAM pOleStream)
    70697068{
     
    70907089    {
    70917090        /* Was it originally Ole10 */
    7092         hRes = IStorage_OpenStream(pstg, wstrStreamName, 0, STGM_READ | STGM_SHARE_EXCLUSIVE, 0, &pStream);   
     7091        hRes = IStorage_OpenStream(pstg, wstrStreamName, 0, STGM_READ | STGM_SHARE_EXCLUSIVE, 0, &pStream);
    70937092        if(hRes == S_OK)
    70947093        {
Note: See TracChangeset for help on using the changeset viewer.