C DLL in MASM Dll uebersetzen

Offizieller deutscher Support für das MASM32 SDK. Download FAQ

Moderatoren: crack, Krüsty, Marwin

C DLL in MASM Dll uebersetzen

Beitragvon AVt » Samstag 16. April 2005, 22:18

Playing with callbacks in Excel (and Maple) i found the
following code in an old MS article (KB171729) to be
compiled in C into a DLL with standard convention:

__declspec(naked) void Callback()
{

/* For procedures with return values of 8 bytes or less */
/* Get address to be called and fix-up return address */

_asm pop eax; // save return address
_asm pop ecx; // get address to JMP to
_asm push eax; // restore return address
_asm jmp ecx; // Jump to callback function....
}

Which works. And as Excel is slow that would be enough (for
concrete situations i do not need that 'general' solution),
the nice things is, that this will be called from Excel by
value (not by reference).

Out of curiousity i wanted to do that directly as assembler
DLL using MASM, not MSVC. But can not find out how to define
the function in MASM (ok, it is a proc, not a function ...,
but what to use for the parameters?).

Any advice what to do (i am a assembler moron)? TIA.

Axel

mail (at) axelvogt.de
AVt
 

Re: C DLL in MASM Dll uebersetzen

Beitragvon AVt » Samstag 16. April 2005, 22:22

sorry, aus gewohnheit hab ich das auf englisch geschrieben ...
AVt
 

Re: C DLL in MASM Dll uebersetzen

Beitragvon Gast » Sonntag 17. April 2005, 12:15

ok, ich glaub ich hab's, man laesst einfach die parameter fuer den aufruf weg.
Gast
 


Zurück zu MASM32-Package


Social Bookmarking
Bookmark bei: Mr. Wong Bookmark bei: Del.icio.us Bookmark bei: Webnews Bookmark bei: Icio Bookmark bei: Oneview Bookmark bei: Linkarena Bookmark bei: Newskick Bookmark bei: Folkd Bookmark bei: Yigg Bookmark bei: Digg Bookmark bei: Reddit Bookmark bei: Simpy Bookmark bei: StumbleUpon Bookmark bei: Slashdot Bookmark bei: Netscape Bookmark bei: Furl Bookmark bei: Yahoo Bookmark bei: Spurl Bookmark bei: Google Bookmark bei: Blinklist Bookmark bei: Blogmarks Bookmark bei: Diigo Bookmark bei: Technorati Bookmark bei: Newsvine Bookmark bei: Blinkbits Bookmark bei: Ma.Gnolia Bookmark bei: Smarking Bookmark bei: Netvouz

Wer ist online?

Mitglieder in diesem Forum: 0 Mitglieder

cron