Alex Henrie : ole32: Implement StgCreatePropStg.

Alexandre Julliard julliard at winehq.org
Fri Oct 7 15:09:13 CDT 2016


Module: wine
Branch: stable
Commit: 956c242e81fa9af7791f3cbb6968adfe455eaa87
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=956c242e81fa9af7791f3cbb6968adfe455eaa87

Author: Alex Henrie <alexhenrie24 at gmail.com>
Date:   Sun Apr 10 16:22:25 2016 -0600

ole32: Implement StgCreatePropStg.

Signed-off-by: Alex Henrie <alexhenrie24 at gmail.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
(cherry picked from commit 004e9f94e15020be35763324a8a311dfc3361cce)
Signed-off-by: Michael Stefaniuc <mstefani at winehq.org>

---

 dlls/ole32/ole32.spec |  1 +
 dlls/ole32/stg_prop.c | 43 +++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 44 insertions(+)

diff --git a/dlls/ole32/ole32.spec b/dlls/ole32/ole32.spec
index 04c9f1e..b56e5d5 100644
--- a/dlls/ole32/ole32.spec
+++ b/dlls/ole32/ole32.spec
@@ -262,6 +262,7 @@
 @ stdcall StgCreateDocfile(wstr long long ptr)
 @ stdcall StgCreateDocfileOnILockBytes(ptr long long ptr)
 @ stdcall StgCreatePropSetStg(ptr long ptr)
+@ stdcall StgCreatePropStg(ptr ptr ptr long long ptr)
 @ stdcall StgCreateStorageEx(wstr long long long ptr ptr ptr ptr)
 @ stub StgGetIFillLockBytesOnFile
 @ stub StgGetIFillLockBytesOnILockBytes
diff --git a/dlls/ole32/stg_prop.c b/dlls/ole32/stg_prop.c
index da361ce..c3db945 100644
--- a/dlls/ole32/stg_prop.c
+++ b/dlls/ole32/stg_prop.c
@@ -2767,3 +2767,46 @@ SERIALIZEDPROPERTYVALUE* WINAPI StgConvertVariantToProperty(const PROPVARIANT *p
 
     return NULL;
 }
+
+HRESULT WINAPI StgCreatePropStg(IUnknown *unk, REFFMTID fmt, const CLSID *clsid,
+                                DWORD flags, DWORD reserved, IPropertyStorage **prop_stg)
+{
+    IStorage *stg;
+    IStream *stm;
+    HRESULT r;
+
+    TRACE("%p %s %s %08x %d %p\n", unk, debugstr_guid(fmt), debugstr_guid(clsid), flags, reserved, prop_stg);
+
+    if (!fmt || reserved)
+    {
+        r = E_INVALIDARG;
+        goto end;
+    }
+
+    if (flags & PROPSETFLAG_NONSIMPLE)
+    {
+        r = IUnknown_QueryInterface(unk, &IID_IStorage, (void **)&stg);
+        if (FAILED(r))
+            goto end;
+
+        /* FIXME: if (flags & PROPSETFLAG_NONSIMPLE), we need to create a
+         * storage, not a stream.  For now, disallow it.
+         */
+        FIXME("PROPSETFLAG_NONSIMPLE not supported\n");
+        IStorage_Release(stg);
+        r = STG_E_INVALIDFLAG;
+    }
+    else
+    {
+        r = IUnknown_QueryInterface(unk, &IID_IStream, (void **)&stm);
+        if (FAILED(r))
+            goto end;
+
+        r = PropertyStorage_ConstructEmpty(stm, fmt, flags,
+                STGM_CREATE|STGM_READWRITE|STGM_SHARE_EXCLUSIVE, prop_stg);
+    }
+
+end:
+    TRACE("returning 0x%08x\n", r);
+    return r;
+}




More information about the wine-cvs mailing list