News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

typedef

Started by RedGhost, April 21, 2005, 09:31:35 AM

Previous topic - Next topic

RedGhost

okay well, i am terrible in masm, only coded for one app and it was a hello world app,
and one dll but it was a pre-done basehook  :U
anyways, i am okay in inline asm for c++, well actually no, i am terrible in that aswell!
my question:
    i dont know how to initialize data in masm very well, how would go about doing ->


//c++
typedef void ( APIENTRY* func )( arg1, arg2, etc );
func orig;


in masm!

hutch--

I may be wrong as I don't read C++ properly but it looks like a function with no return value (VOID) and no arguments.

MASM prototypes are in this form,

FuncName [calling convention] PROTO [arg1:DATASIZE, arg2:DATASIZE etc ...]

Calling convention is either C or STDCALL

DATASZIE is any generic ASM date size.
Download site for MASM32      New MASM Forum
https://masm32.com          https://masm32.com/board/index.php

thomasantony

Yeah ,
And you dont have to declare any thing in convention if it is STDCALL and you have declared STDCALL as the default calling convention by .model flat,stdcall . You dont have a whole sh*tload of datatypes like in C++, you just have a DWORD. In asm everything is a DWORD whether it be HICON, HANDLE, HINSTANCE anything. And you don't have to give a return type. Return a value inside the function if you want by putting the value in eax. See Iczelion's tutorials
http://win32asm.cjb.net/ and AoA Book http://webster.cs.ucr.edu/


Thomas :U
There are 10 types of people in the world. Those who understand binary and those who don't.


Programmer's Directory. Submit for free

Tedd

That looks to me like redefining the void type (? - to be: APIENTRY* func(...))
Anyway, you don't really need to worry about such things in masm - things are whatever type you want :lol
All functions are defined in the same way and they have no actual return type - it's however you treat it :wink
No snowflake in an avalanche feels responsible.

RedGhost

thanks guys, your help and masm programmers guide

problem resolved :)

roticv

You want a pointer to a function right? But a pointer is a dword. So the whole thing is just a dword.

RedGhost

Quote from: roticv on April 21, 2005, 11:59:16 AM
You want a pointer to a function right? But a pointer is a dword. So the whole thing is just a dword.

yeah thats what i ended up realizing and doing xD