Superseded patch 158584 to 158587.
ChangeLog: v3: - Rewrite implementation of PropVariantToBuffer().(4/4) - Add more tests for PropVariantToBuffer().(4/4) v2: - Fix test failures on Windows 64 bit.(1/3) - Use PropVariantToStringAlloc() for implementing PropVariantToString().(1/3) - Use IsEqualGUID() for checking GUID instread of memcmp().(2/3) - Add more tests for PropVariantToBuffer().(3/3)
Signed-off-by: Jactry Zeng jzeng@codeweavers.com --- dlls/propsys/propvar.c | 1 + dlls/propsys/tests/propsys.c | 6 ++++++ 2 files changed, 7 insertions(+)
diff --git a/dlls/propsys/propvar.c b/dlls/propsys/propvar.c index 0edf4621b3..396afbf050 100644 --- a/dlls/propsys/propvar.c +++ b/dlls/propsys/propvar.c @@ -314,6 +314,7 @@ HRESULT WINAPI PropVariantToStringAlloc(REFPROPVARIANT propvarIn, WCHAR **ret)
switch(propvarIn->vt) { + case VT_EMPTY: case VT_NULL: res = CoTaskMemAlloc(1*sizeof(WCHAR)); res[0] = '\0'; diff --git a/dlls/propsys/tests/propsys.c b/dlls/propsys/tests/propsys.c index a9c0a7730b..926dc3de71 100644 --- a/dlls/propsys/tests/propsys.c +++ b/dlls/propsys/tests/propsys.c @@ -641,6 +641,12 @@ static void test_PropVariantToStringAlloc(void) ok(!lstrcmpW(str, topicW), "got %s\n", wine_dbgstr_w(str)); CoTaskMemFree(str); PropVariantClear(&prop); + + prop.vt = VT_EMPTY; + hres = PropVariantToStringAlloc(&prop, &str); + ok(hres == S_OK, "returned %x\n", hres); + ok(!lstrcmpW(str, emptyW), "got %s\n", wine_dbgstr_w(str)); + CoTaskMemFree(str); }
static void test_PropVariantCompare(void)