vcomp: Add stub for _vcomp_fork (resend)

André Hentschel nerv at
Thu Mar 8 15:31:55 CST 2012

_vcomp_fork is used to create a new process which starts at a compiler generated managment code.
This managment code then uses functions like _vcomp_for_static_end and _vcomp_for_static_simple_init, that's why we don't need stubs for these with that patch.
What happens if _vcomp_fork doesn't create a new process?
let's assume OpenMP code like:

#pragma omp parallel sections
#pragma omp section
        } /* omp section */
#pragma omp section
        } /* omp section */
    } /* omp parallel sections */

Here with real OpenMP support, function_A and function_B would "run on two Cores at the same time", without compile-time OpenMP support the pragmas would be ignored and function_B would simply run after function_A.
And that's what happens with a _vcomp_fork doing nothing: function_B simply runs after function_A.

This works for e.g.:
Enblend/Enfuse (
Bully: Scholarship Edition

It doesn't work for:
Risen, because it needs much more functions:

See also:
 dlls/vcomp/main.c     |    5 +++++
 dlls/vcomp/vcomp.spec |    2 +-
 2 files changed, 6 insertions(+), 1 deletions(-)

diff --git a/dlls/vcomp/main.c b/dlls/vcomp/main.c
index 0a3c4f5..5b8418c 100644
--- a/dlls/vcomp/main.c
+++ b/dlls/vcomp/main.c
@@ -46,3 +46,8 @@ BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
     return TRUE;
+void WINAPIV _vcomp_fork(DWORD arg1, DWORD varargs, void* arg3, ...)
+    FIXME("(%u, %u, %p, ...): stub\n", arg1, varargs, arg3);
diff --git a/dlls/vcomp/vcomp.spec b/dlls/vcomp/vcomp.spec
index cd5a964..22b1c3c 100644
--- a/dlls/vcomp/vcomp.spec
+++ b/dlls/vcomp/vcomp.spec
@@ -64,7 +64,7 @@
 @ stub _vcomp_for_static_init_i8
 @ stub _vcomp_for_static_simple_init
 @ stub _vcomp_for_static_simple_init_i8
-@ stub _vcomp_fork
+@ varargs _vcomp_fork(long long ptr)
 @ stub _vcomp_get_thread_num
 @ stub _vcomp_leave_critsect
 @ stub _vcomp_master_barrier

Best Regards, André Hentschel

-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: Nachrichtenteil als Anhang
URL: <>

More information about the wine-patches mailing list