Old 4th August 2008, 13:41   #1
TomyLobo
Major Dude
 
TomyLobo's Avatar
 
Join Date: Feb 2004
Location: Germany
Posts: 580
gen_tray SDK defects

the gen_tray source code provided with the winamp SDK 5.02, as available from NSDN, has a number of defects:

1.
winamp's main window is sub-classed but never un-subclassed
since winamp possibly calls FreeLibrary on gen_tray.dll before destroying its main window, this might cause windows to call a window procedure in an invalid piece of memory.
(the fix is present in the Winamp 5.34 (BETA) SDK, but for some reason it's commented.)

2.
by default, the code does not work when compiled as C++
being the only gen plugin example provided with the SDK, it should at least do that. the required changes are minimal.
(still present in Winamp 5.34 (BETA) SDK)

3.
there is a file called "systray.c" that is not used in the project file
(fixed in Winamp 5.34 (BETA) SDK)

4.
the headers lack header guards
(fixed in Winamp 5.34 (BETA) SDK)


in the Winamp 5.34 (BETA) SDK, 1. and 2. remain.
i consider 1. to be a bug that should be fixed, even more so if it is present in the version of gen_tray that is distributed with winamp.

2. is an SDK defect, that can cause confusion with people oblivious of the differences between C and C++

If you can't say something nice, say something surrealistic.

Last edited by TomyLobo; 4th August 2008 at 13:59.
TomyLobo is offline   Reply With Quote
Old 4th August 2008, 14:29   #2
DrO
 
Join Date: Sep 2003
Posts: 27,873
don't use the 5.02 version then since what's in the current sdk is what is used to build gen_tray for official builds (unless things have been messed with since i stopped working on things).

the lack of unsubclassing is fine as of 5.5+ (and possibly earlier) since the plugins are left loaded until later in the exit process which means that the unsubclass can be left out as it won't cause the process to crash since the dlls are still loaded in the winamp process space.

basically you're looking for someone who can do so to get the updated sdk in the right place though seeing as the famed 'new' sdk still hasn't appeared who knows if/when it'll ever appear on the site and if nsdn will even be updated...

-daz
DrO is offline   Reply With Quote
Old 4th August 2008, 16:54   #3
TomyLobo
Major Dude
 
TomyLobo's Avatar
 
Join Date: Feb 2004
Location: Germany
Posts: 580
i wonder if that behaviour is documented somewhere or just "happens" to be that way

i really thought that'd explain that winamp sometimes crashes inside gen_tray when exiting...

so something _is_ wrong with gen_tray, i just dont know what

If you can't say something nice, say something surrealistic.
TomyLobo is offline   Reply With Quote
Old 4th August 2008, 17:01   #4
Benski
Ben Allison
Former Winamp Developer
 
Benski's Avatar
 
Join Date: Jan 2005
Location: Brooklyn, NY
Posts: 1,057
Plugins shouldn't be unsubclassing during quit(). The problem is that a plugin's quit() function is being called from within the main Winamp WndProc itself, so unsubclassing is massively dangerous, especially when combined with a FreeLibrary().
The main window is in the midst of being destroyed anyway so it doesn't really matter that you 'clean up after yourself'.
Benski is offline   Reply With Quote
Reply
Go Back   Winamp & Shoutcast Forums > Developer Center > Winamp Development

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump