diff --git a/dlls/oleaut32/tests/vartest.c b/dlls/oleaut32/tests/vartest.c index 2da6371186a..2d60b8663bf 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 29bf3a735e9..f0d3b09ba17 100644 --- a/dlls/oleaut32/varformat.c +++ b/dlls/oleaut32/varformat.c @@ -2007,6 +2007,9 @@ HRESULT WINAPI VarFormatFromTokens(LPVARIANT pVarIn, LPOLESTR lpszFormat, 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'