Ignore:
Timestamp:
Sep 17, 2000, 12:31:07 PM (25 years ago)
Author:
davidr
Message:

Updates from wine

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/ole32/defaulthandler.cpp

    r1033 r4274  
    1 /* $Id: defaulthandler.cpp,v 1.1 1999-09-24 21:49:43 davidr Exp $ */
     1/* $Id: defaulthandler.cpp,v 1.2 2000-09-17 10:31:03 davidr Exp $ */
    22/*
    33 *  OLE 2 default object handler
     
    101101   * Name of the container and object contained
    102102   */
    103   BSTR containerApp;
    104   BSTR containerObj;
     103  LPWSTR containerApp;
     104  LPWSTR containerObj;
    105105
    106106};
     
    830830   * Be sure to cleanup before re-assinging the strings.
    831831   */
    832   if (This->containerApp!=NULL)
    833   {
    834     SysFreeString(This->containerApp);
     832  if (This->containerApp != NULL)
     833  {
     834    HeapFree( GetProcessHeap(), 0, This->containerApp );
    835835    This->containerApp = NULL;
    836836  }
    837837
    838   if (This->containerObj!=NULL)
    839   {
    840     SysFreeString(This->containerObj);
     838  if (This->containerObj != NULL)
     839  {
     840    HeapFree( GetProcessHeap(), 0, This->containerObj );
    841841    This->containerObj = NULL;
    842842  }
     
    846846   */
    847847  if (szContainerApp != NULL)
    848     This->containerApp = SysAllocString(szContainerApp);
     848  {
     849      if ((This->containerApp = (LPWSTR)HeapAlloc( GetProcessHeap(), 0,
     850                                       (lstrlenW(szContainerApp) + 1) * sizeof(WCHAR) )) != NULL)
     851          lstrcpyW( This->containerApp, szContainerApp );
     852  }
    849853
    850854  if (szContainerObj != NULL)
    851     This->containerObj = SysAllocString(szContainerObj);
    852  
     855  {
     856      if ((This->containerObj = (LPWSTR)HeapAlloc( GetProcessHeap(), 0,
     857                                       (lstrlenW(szContainerObj) + 1) * sizeof(WCHAR) )) != NULL)
     858          lstrcpyW( This->containerObj, szContainerObj );
     859  }
     860
    853861  return S_OK;
    854862}
     
    13071315}
    13081316
     1317/************************************************************************
     1318 * DefaultHandler_GetData
     1319 *
     1320 * Get Data from a source dataobject using format pformatetcIn->cfFormat
     1321 * See Windows documentation for more details on GetData.
     1322 * Default handler's implementation of this method delegates to the cache.
     1323 */
    13091324static HRESULT WINAPI DefaultHandler_GetData(
    1310             IDataObject*     iface,
    1311             LPFORMATETC      pformatetcIn,
    1312             STGMEDIUM*       pmedium)
    1313 {
    1314   FIXME(": Stub\n");
    1315   return E_NOTIMPL;
     1325            IDataObject*     iface,
     1326            LPFORMATETC      pformatetcIn,
     1327            STGMEDIUM*       pmedium)
     1328{
     1329  IDataObject* cacheDataObject = NULL;
     1330  HRESULT      hres;
     1331
     1332  _ICOM_THIS_From_IDataObject(DefaultHandler, iface);
     1333
     1334  TRACE("(%p, %p, %p)\n", iface, pformatetcIn, pmedium);
     1335
     1336  hres = IUnknown_QueryInterface(This->dataCache,
     1337                                 &IID_IDataObject,
     1338                                 (void**)&cacheDataObject);
     1339
     1340  if (FAILED(hres))
     1341    return E_UNEXPECTED;
     1342
     1343  hres = IDataObject_GetData(cacheDataObject,
     1344                             pformatetcIn,
     1345                             pmedium);
     1346
     1347  IDataObject_Release(cacheDataObject);
     1348
     1349  return hres;
    13161350}
    13171351
Note: See TracChangeset for help on using the changeset viewer.