Last Comment Bug 284156 - SHGetMalloc API call is deprecated (in nsIconChannel.cpp)
: SHGetMalloc API call is deprecated (in nsIconChannel.cpp)
Product: Core
Classification: Components
Component: ImageLib (show other bugs)
: Trunk
: x86 Windows XP
-- normal (vote)
: mozilla6
Assigned To: David Gardiner
: Milan Sreckovic [:milan]
Depends on:
Blocks: 282804
  Show dependency treegraph
Reported: 2005-02-28 14:23 PST by David Gardiner
Modified: 2011-05-02 10:38 PDT (History)
4 users (show)
bzbarsky: in‑testsuite-
See Also:
Crash Signature:
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---

Use CoTaskMemFree to release memory (2.44 KB, patch)
2005-03-03 03:09 PST, David Gardiner
joe: review+
Details | Diff | Splinter Review
unbitrotted (2.06 KB, patch)
2011-04-28 15:04 PDT, Masatoshi Kimura [:emk]
no flags Details | Diff | Splinter Review

Description User image David Gardiner 2005-02-28 14:23:37 PST
/modules/libpr0n/decoders/icon/win/nsIconChannel.cpp, line 265 -- hr =

According to the MSDN documentation

"This function should no longer be used. Use the CoTaskMemFree and
CoTaskMemAlloc functions in its place"

Comment 1 User image David Gardiner 2005-03-03 03:09:22 PST
Created attachment 176124 [details] [diff] [review]
Use CoTaskMemFree to release memory
Comment 2 User image Stuart Parmenter 2005-03-07 12:47:37 PST
reading that document seems to imply that if we start using CoTaskMem* that
we'll need to link against ole32.dll.... do we already do that or would it be a
new dependancy?  If its new, we might want to avoid doing this.
Comment 3 User image David Gardiner 2005-03-07 14:30:05 PST
I did need to add a reference to the ole32 library, though for the number of
occasions in Mozilla code that used this API call, the image library was the
only one so far that I needed to do that.

It is a new dependency for the image library, but I guess you have to weigh that
up against the fact that Microsoft have said that the current API call we are
using is deprecated, and the alternative one is supported since at least win95
so we aren't losing any platform support.

Also, if I'm reading correctly, it
appears that we end up using OLE32 in anycase (on WinXP at least), so there's
probably not much difference.

Comment 4 User image Jean-Marc Desperrier 2005-05-16 04:29:14 PDT
At the end of the day, SHGetMalloc is an old hack to avoid loading OLE when in
fact it should have been loaded, and points to OLE as soon as any other
application in the system starts using the real OLE.

I doubt libpr0n is actually used by anybody who doesn't have the real OLE too,
so there's no real reason not to keep using this hack.

Comment 5 User image Joe Drew (not getting mail) 2011-04-26 15:38:15 PDT
Comment on attachment 176124 [details] [diff] [review]
Use CoTaskMemFree to release memory

This is an incredibly old patch, entirely bitrotten, but I approve of it in principle once it has been tryservered. If someone wants to update it to work and commit it, you have my blessing.
Comment 6 User image Masatoshi Kimura [:emk] 2011-04-28 15:04:11 PDT
Created attachment 528959 [details] [diff] [review]
Comment 7 User image Masatoshi Kimura [:emk] 2011-04-28 15:04:50 PDT
I pushed this patch to tryserver.
Test failures look to be unrelated (caused by bug 647176, bug 647570, and bug 652301).
Comment 8 User image Masatoshi Kimura [:emk] 2011-04-28 15:06:26 PDT
> bug 647176
Sorry, bug 647126
Comment 9 User image Boris Zbarsky [:bz] (still a bit busy) 2011-04-29 18:07:27 PDT
Comment 10 User image Boris Zbarsky [:bz] (still a bit busy) 2011-05-02 10:38:00 PDT

David, thank you for the patch!

Note You need to log in before you can comment on or make changes to this bug.