I'd like to know whether each thread in an application gets its own stack space that isn't modified by other applications. I'd also like to confirm that parameters to functions are sent to the functions by being pushed onto the stack in reverse order and popped off in the correct order. To illustrate my point, are these two statements essentially the same?
Code:
ExecuteMyFunction(param1,param2,param3);
and
__asm
{
push param3
push param2
push param1
call ExecuteMyFunction
}
The reason is that I'm trying to make a printf-style function that outputs in a different way. It's defined (very simplified) as follows:
Code:
//ignore amtldlm :D
void Message(void *amtldlm,char *stri,...)
{
printf("Message: ");
printf(stri); //other parameters still sitting on stack
printf("\n");
}
The idea is that the user passes a printf-format string (stri) and any additional parameters. The additional params are never retrieved so should be one the stack, right?
Looking at stdarg.h, it looks instead like each parameter is just copied side-by-side into memory; in which case is there some way (easier than parsing the string

and using va_arg) that I can transfer the extra parameters from one function to the other?
Rgds.