Sync with trunk r58033.
[reactos.git] / dll / win32 / ole32 / ole2impl.c
index e4eccc1..5d92fec 100644 (file)
@@ -102,6 +102,8 @@ static inline void init_fmtetc(FORMATETC *fmt, CLIPFORMAT cf, TYMED tymed)
  */
 static HRESULT get_storage(IDataObject *data, IStorage *stg, UINT *src_cf)
 {
+    static const UINT fmt_id[] = { CF_METAFILEPICT, CF_BITMAP, CF_DIB };
+    UINT i;
     HRESULT hr;
     FORMATETC fmt;
     STGMEDIUM med;
@@ -132,6 +134,17 @@ static HRESULT get_storage(IDataObject *data, IStorage *stg, UINT *src_cf)
         return hr;
     }
 
+    for (i = 0; i < sizeof(fmt_id)/sizeof(fmt_id[0]); i++)
+    {
+        init_fmtetc(&fmt, fmt_id[i], TYMED_ISTORAGE);
+        hr = IDataObject_QueryGetData(data, &fmt);
+        if(SUCCEEDED(hr))
+        {
+            *src_cf = fmt_id[i];
+            return hr;
+        }
+    }
+
     /* IPersistStorage */
     hr = IDataObject_QueryInterface(data, &IID_IPersistStorage, (void**)&persist);
     if(FAILED(hr)) return hr;
@@ -196,6 +209,31 @@ HRESULT WINAPI OleCreateFromData(LPDATAOBJECT data, REFIID iid,
                                fmt, NULL, NULL, client_site, stg, obj);
 }
 
+/******************************************************************************
+ *              OleCreateLinkFromData        [OLE32.@]
+ */
+HRESULT WINAPI OleCreateLinkFromData(IDataObject *data, REFIID iid,
+                                     DWORD renderopt, FORMATETC *fmt,
+                                     IOleClientSite *client_site, IStorage *stg,
+                                     void **obj)
+{
+    FIXME("%p,%s,%08x,%p,%p,%p,%p: semi-stub\n",
+          data, debugstr_guid(iid), renderopt, fmt, client_site, stg, obj);
+    return OleCreateFromData(data, iid, renderopt, fmt, client_site, stg, obj);
+}
+
+/******************************************************************************
+ *              OleCreateStaticFromData        [OLE32.@]
+ */
+HRESULT WINAPI OleCreateStaticFromData(IDataObject *data, REFIID iid,
+                                       DWORD renderopt, FORMATETC *fmt,
+                                       IOleClientSite *client_site, IStorage *stg,
+                                       void **obj)
+{
+    FIXME("%p,%s,%08x,%p,%p,%p,%p: semi-stub\n",
+          data, debugstr_guid(iid), renderopt, fmt, client_site, stg, obj);
+    return OleCreateFromData(data, iid, renderopt, fmt, client_site, stg, obj);
+}
 
 /******************************************************************************
  *              OleDuplicateData        [OLE32.@]