Go Back   Winamp Forums > Developer Center > Winamp Development

Reply
Thread Tools Search this Thread Display Modes
Old 4th July 2009, 03:48   #1
mre521
Junior Member
 
Join Date: Jul 2009
Location: Behind You
Posts: 4
General Purpose Plugin MASM(asm)

Hey if anyone is wondering how to make a general purpose plugin(gen_whatever.dll) in MASM then here is some code that gives you the bare bones you will need to make one.
code:
.386
.model flat,stdcall
option casemap:none

include windows.inc
include user32.inc
include kernel32.inc
include gdi32.inc

includelib \masm32\lib\user32.lib
includelib \masm32\lib\kernel32.lib
includelib \masm32\lib\gdi32.lib

winampGetGeneralPurposePlugin proto
Init proto
Config proto
Quit proto

GPPHDR_VER equ 10h
GEN_INIT_SUCCESS equ 0
GEN_PLUGIN_UNINSTALL_NOW equ 01h
GEN_PLUGIN_UNINSTALL_REBOOT equ 00h

winampGeneralPurposePlugin struct
version UINT ?
description PCHAR ?
init PVOID ?
config PVOID ?
quit PVOID ?
hwndParent HWND ?
hDllInstance HINSTANCE ?
winampGeneralPurposePlugin ends

.const
.data
szDesc db "MASM32 Gen Plugin Test",0
plugin winampGeneralPurposePlugin <GPPHDR_VER,offset szDesc,Init,Config,Quit,0,0>
.data?
.code

DllEntry proc hInst: HINSTANCE, reason: DWORD, reserved1: DWORD

mov eax,1
ret

DllEntry Endp

winampGetGeneralPurposePlugin proc

mov eax,offset plugin
ret

winampGetGeneralPurposePlugin endp

Init proc
xor eax,eax
ret
Init endp

Config proc
ret
Config endp

Quit proc
ret
Quit endp


End DllEntry

mre521 is offline   Reply With Quote
Old 14th July 2009, 18:43   #2
griffins_Grader
Senior Member
 
Join Date: Aug 2008
Posts: 114
I always wanted to try something like this.
griffins_Grader is offline   Reply With Quote
Old 14th July 2009, 18:59   #3
dndculix
Junior Member
 
Join Date: Jun 2009
Posts: 6
Re: General Purpose Plugin MASM(asm)

mre521 said:
>>here is some code that gives you the bare bones for a general purpose plugin in MASM

Hey, thanks, this is cool. By MASM do you mean the Microsoft Macro Assembler, i.e. http://en.wikipedia.org/wiki/MASM ? I don't really know anything about this. How common is it to do Winamp development with MASM? Can you explain why you use it instead of other methods?

This page could make a good tutorial for doing MASM on the Winamp Wiki - http://dev.winamp.com/wiki/ . Would you mind if we started a page for it there?


--culix/dndculix
dndculix is offline   Reply With Quote
Old 14th July 2009, 19:13   #4
griffins_Grader
Senior Member
 
Join Date: Aug 2008
Posts: 114
Quote:
By MASM do you mean the Microsoft Macro Assembler...
It is assembly language.
griffins_Grader is offline   Reply With Quote
Old 14th July 2009, 21:34   #5
dndculix
Junior Member
 
Join Date: Jun 2009
Posts: 6
Quote:
MASM is assembly language.
Er, yes. Is it very common to do Winamp development in assembly? What would make someone choose assembly rather than writing C code?

--culix/dndculix
dndculix is offline   Reply With Quote
Old 14th July 2009, 22:21   #6
DrO
-
 
DrO's Avatar
 
Join Date: Sep 2003
Location: UK
Posts: 22,265
not generally, there are a few but there's more chance of people doing plugins in delphi than in assembler only from my experience.

-daz
DrO is offline   Reply With Quote
Old 15th July 2009, 08:28   #7
griffins_Grader
Senior Member
 
Join Date: Aug 2008
Posts: 114
Quote:
What would make someone choose assembly rather than writing C code?
From my sources here; it deals with computer hardware in a very intimate way. It can run faster and take up less space in memory. I'd say for Winamp if one is considering controlling external devices which I am very sure there are c/c++ variants out there dependent on 3rd party modules.

I have never gone beyond simple std::in std:ut variants in assembly. I could not find any official support for it, the downloads I found were harmful. I don't know if Microsoft still support it. Just as earlier i tried to assemble the code above I got a fatal A1000: cannot open file : windows.inc which I searched for and nowhere to be found in my library, checked the internet and I was presented with a "slightly modified" one. I'd really appreciate it if I could get links to reliable MASM library.
griffins_Grader is offline   Reply With Quote
Old 15th July 2009, 19:17   #8
dndculix
Junior Member
 
Join Date: Jun 2009
Posts: 6
Re: MASM libraries

Quote:
I'd really appreciate it if I could get links to reliable MASM library.
Google points me here -

* http://www.masm32.com/
* http://www.microsoft.com/downloads/details.aspx?FamilyID=7a1c9da0-0510-44a2-b042-7ef370530c64&displaylang=en .

Have you tried those already? Or is that not what you're looking for?
dndculix is offline   Reply With Quote
Old 15th July 2009, 19:52   #9
griffins_Grader
Senior Member
 
Join Date: Aug 2008
Posts: 114
as per Microsoft downloads I have the tools already.
griffins_Grader is offline   Reply With Quote
Reply
Go Back   Winamp 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