Re: _vcomp_fork stack frame puzzle

2012-08-12 Thread Dan Kegel
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.

Re: _vcomp_fork stack frame puzzle

2012-08-10 Thread Dan Kegel
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

Re: _vcomp_fork stack frame puzzle

2012-08-10 Thread Dan Kegel
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

Re: _vcomp_fork stack frame puzzle

2012-08-10 Thread Dan Kegel
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.

Re: _vcomp_fork stack frame puzzle

2012-08-09 Thread André Hentschel
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

_vcomp_fork stack frame puzzle

2012-08-08 Thread Dan Kegel
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",