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

Resync with latest Wine

File:
1 edited

Legend:

Unmodified
Added
Removed
  • 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}
Note: See TracChangeset for help on using the changeset viewer.