c_proc/func() bug ?

new topic     » topic index » view thread      » older message » newer message

I was playing around with the new ability to use define_c_proc/func and 
c_proc/func with machine code functions. What puzzled me a bit was the order 
in which arguments are pushed.

Assume the following:

foo = define_c_func("", function_pointer, {C_INT,C_INT,C_INT}, C_INT)
result = c_func(foo, {1, 2, 3})

Since this uses stdcall, the stack should look like this when the function 
is called:

esp+0:   return address
esp+4:   3
esp+8:   2
esp+12: 1

But what i got was this:

esp+0:   return address
esp+4:   1
esp+8:   2
esp+12: 3

What gives?

new topic     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu