Module: wine Branch: refs/heads/master Commit: 93acfeb7f0d4c332c62765888f323524c0eb87db URL: http://source.winehq.org/git/?p=wine.git;a=commit;h=93acfeb7f0d4c332c6276588...
Author: Robert Shearman rob@codeweavers.com Date: Sun Mar 5 13:36:56 2006 +0000
oleaut: Fix VarFormat for VT_NULL variants.
---
dlls/oleaut32/tests/vartest.c | 2 -- dlls/oleaut32/varformat.c | 3 +++ 2 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/dlls/oleaut32/tests/vartest.c b/dlls/oleaut32/tests/vartest.c index 2da6371..2d60b86 100644 --- a/dlls/oleaut32/tests/vartest.c +++ b/dlls/oleaut32/tests/vartest.c @@ -1785,10 +1785,8 @@ static void test_VarFormat(void) /* VT_NULL */ V_VT(&in) = VT_NULL; hres = pVarFormat(&in,NULL,fd,fw,0,&out); - todo_wine { ok(hres == S_OK, "VarFormat failed with 0x%08lx\n", hres); ok(out == NULL, "expected NULL formatted string\n"); - }
/* Invalid args */ hres = pVarFormat(&in,NULL,fd,fw,flags,NULL); diff --git a/dlls/oleaut32/varformat.c b/dlls/oleaut32/varformat.c index 29bf3a7..f0d3b09 100644 --- a/dlls/oleaut32/varformat.c +++ b/dlls/oleaut32/varformat.c @@ -2007,6 +2007,9 @@ HRESULT WINAPI VarFormatFromTokens(LPVAR if (!pVarIn || !rgbTok) return E_INVALIDARG;
+ if (V_VT(pVarIn) == VT_NULL) + return S_OK; + if (*rgbTok == FMT_TO_STRING || header->type == FMT_TYPE_GENERAL) { /* According to MSDN, general format acts somewhat like the 'Str'