[PATCH] Do not return length in StringFromGUID2 with cmax=-1
Michael Karcher
wine at mkarcher.dialup.fu-berlin.de
Tue May 20 03:31:41 CDT 2008
Microsoft doesn't do it, so wine should not do it, too. And
furthermore, MSDN says so.
---
dlls/ole32/compobj.c | 3 +++
dlls/ole32/tests/compobj.c | 1 -
2 files changed, 3 insertions(+), 1 deletions(-)
diff --git a/dlls/ole32/compobj.c b/dlls/ole32/compobj.c
index c4eec23..78a1797 100644
--- a/dlls/ole32/compobj.c
+++ b/dlls/ole32/compobj.c
@@ -1415,6 +1415,9 @@ HRESULT WINAPI StringFromCLSID(REFCLSID id, LPOLESTR *idstr)
INT WINAPI StringFromGUID2(REFGUID id, LPOLESTR str, INT cmax)
{
char xguid[80];
+
+ if (cmax < 0)
+ return 0;
if (WINE_StringFromCLSID(id,xguid))
return 0;
diff --git a/dlls/ole32/tests/compobj.c b/dlls/ole32/tests/compobj.c
index da665cf..670de15 100644
--- a/dlls/ole32/tests/compobj.c
+++ b/dlls/ole32/tests/compobj.c
@@ -219,7 +219,6 @@ void test_StringFromGUID2()
/* -1 is an invalid length, wine returns size */
len = StringFromGUID2(&CLSID_CDeviceMoniker,str,-1);
- todo_wine
ok(len == 0, "len: %d (expected 0)\n",len);
}
--
1.5.5.1
More information about the wine-patches
mailing list