Using varargs like Andre tried doesn't work because pushing a va_list
isn't the same as pushing a list of arguments.
So I think we need assembly. The assembly I gave earlier is wrong
because it cleans up the stack, which it's not allowed to do.
I've attached an updated patch to
http://bugs.winehq.
On Fri, Aug 10, 2012 at 7:37 PM, Dan Kegel wrote:
> Yes indeed, this works:
>
> extern void WINAPIV VCOMP__vcomp_fork(DWORD parallel, int ncount, void
> (__cdecl *helper)(__ms_va_list), ...);
> __ASM_GLOBAL_FUNC( VCOMP__vcomp_fork,
>"pop %eax\n\t" /* save return addre
Yes indeed, this works:
extern void WINAPIV VCOMP__vcomp_fork(DWORD parallel, int ncount, void
(__cdecl *helper)(__ms_va_list), ...);
__ASM_GLOBAL_FUNC( VCOMP__vcomp_fork,
"pop %eax\n\t" /* save return address */
"add $8,%esp\n\t"/* skip para
Yeah, it might be as simple as
_vcomp_vfork proc
add sp,4 ; skip parallel flag and arg count
ret ; jump to helper function, leaving its args on stack
or something like that.
Am 09.08.2012 07:49, schrieb Dan Kegel:
> It seems like Andre's varargs code should be right,
> but something's not connecting. I even tried beer,
> and it still didn't work.
:D
maybe you should try to write it in assembler and later try to move things to
C...
--
Best Regards, André Hentsche
Having fun trying to figure out what's in the black box of _vcomp_fork(),
the helper function that spawns threads in Visual C's OpenMP
support library.
The C source code
#include
#include
int main(int argc, char **argv)
{
double d;
double e;
int i;
printf("&d is %p, &e is %p\n",