Nikolay Sivov : ole32: Use CoTaskMemAlloc() instead of IMalloc directly.

Alexandre Julliard julliard at winehq.org
Mon Feb 10 13:06:55 CST 2014


Module: wine
Branch: master
Commit: d1c4871012d537f1a1568261c6e661c9c646b358
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=d1c4871012d537f1a1568261c6e661c9c646b358

Author: Nikolay Sivov <nsivov at codeweavers.com>
Date:   Sun Feb  9 17:56:38 2014 +0400

ole32: Use CoTaskMemAlloc() instead of IMalloc directly.

---

 dlls/ole32/compobj.c |    6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)

diff --git a/dlls/ole32/compobj.c b/dlls/ole32/compobj.c
index 3e99097..2160cba 100644
--- a/dlls/ole32/compobj.c
+++ b/dlls/ole32/compobj.c
@@ -2215,11 +2215,7 @@ HRESULT WINAPI CLSIDFromString(LPCOLESTR idstr, LPCLSID id )
  */
 HRESULT WINAPI StringFromCLSID(REFCLSID id, LPOLESTR *idstr)
 {
-    HRESULT ret;
-    LPMALLOC mllc;
-
-    if ((ret = CoGetMalloc(0,&mllc))) return ret;
-    if (!(*idstr = IMalloc_Alloc( mllc, CHARS_IN_GUID * sizeof(WCHAR) ))) return E_OUTOFMEMORY;
+    if (!(*idstr = CoTaskMemAlloc(CHARS_IN_GUID * sizeof(WCHAR)))) return E_OUTOFMEMORY;
     StringFromGUID2( id, *idstr, CHARS_IN_GUID );
     return S_OK;
 }




More information about the wine-cvs mailing list