Go Back   Winamp & Shoutcast Forums > Developer Center > Winamp Development

Reply
Thread Tools Search this Thread Display Modes
Old 27th November 2003, 22:26   #1
orlandocurioso
Junior Member
 
Join Date: Oct 2003
Posts: 9
Solution: Using API functions restricted for plugins in outofproc app

HeikoSS showed a method to read string pointers from an external app.
(http://forums.winamp.com/showthread....rnal+app%2Fdll)
Thus API's restricted for plugins like IPC_GETPLAYLISTFILE can be used also by outofprocess apps.

Other API's like IPC_SETSKIN or IPC_GETSKIN expect a stringbuffer in winamp memoryspace to read or return data.
HowTo setup a stringbuffer in external memory?
A solution: Steal a string pointer, save its data, 'misuse' it for expected stringbuffer, restore the data after use.
IPC_GETINIFILE is the ideal candidate to steal its returned pointer to winamp.ini file.

Code in VB:
A module containing functions,which can be used in- or outofprocess (handy for debugging plugin in VB IDE).
HeikoSS's method is packaged in a common GetWinampString function. GetSkinFont is an example how to use it.
IPC_GETINIFILE,IPC_GETPLAYLISTFILE,IPC_GETPLAYLISTTITLE etc can be implemented alike.

My hack wraps in a StolenPointer property and a WriteWinampString function.
SetSkin is an example, if API reads string data.Similiar IPC's are IPC_EXECPLUG,IPC_MBOPEN,IPC_CHANGECURRENTFILE.
GetSkinDir as an example, if API returns string data.Similiar IPC is IPC_GETMBURL.
Notice the different SendMessage declarations for in/outofproc.

Code tested with Winamp 2.91,Win2000,VB6 .no harm noticed on winamp or other plugins

3(& a lot more) questions:
Is there any 'official' way to place a string in external memory?
HowTo deal with structs in a similiar fashion?
Why is returned fontsize 30% larger than actual? (sngCorr in GetSkinFont)
Attached Files
File Type: zip winampmod2.zip (3.4 KB, 375 views)
orlandocurioso is offline   Reply With Quote
Old 3rd December 2003, 14:15   #2
orlandocurioso
Junior Member
 
Join Date: Oct 2003
Posts: 9
Quote:
Originally posted by orlandocurioso
Why is returned fontsize 30% larger than actual? (sngCorr in GetSkinFont)
I will answer that myself,since this is such a busy thread.
Winamp returns pixels, VB StdFont is in points,stupid me.

Updated GetSkinFont in module:
Attached Files
File Type: zip modwinamp2.zip (3.4 KB, 287 views)
orlandocurioso 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