From a95984145caa33f4f5b85f76708559c3696db33f Mon Sep 17 00:00:00 2001
From: Sebastian Lackner <sebastian@fds-team.de>
Date: Sat, 7 Mar 2015 18:09:37 +0100
Subject: [PATCH] ntdll: Process APC calls before starting process.

alesliehughes - rebase conflict - not sure if this is correct anymore.
---
 dlls/ntdll/loader.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/dlls/ntdll/loader.c b/dlls/ntdll/loader.c
index 77a16b3..49e8619 100644
--- a/dlls/ntdll/loader.c
+++ b/dlls/ntdll/loader.c
@@ -3113,6 +3113,7 @@ void WINAPI LdrInitializeThunk( void *kernel_start, ULONG_PTR unknown2,
                                 ULONG_PTR unknown3, ULONG_PTR unknown4 )
 {
     static const WCHAR globalflagW[] = {'G','l','o','b','a','l','F','l','a','g',0};
+    LARGE_INTEGER timeout;
     NTSTATUS status;
     WINE_MODREF *wm;
     PEB *peb = NtCurrentTeb()->Peb;
@@ -3152,6 +3153,10 @@ void WINAPI LdrInitializeThunk( void *kernel_start, ULONG_PTR unknown2,
              debugstr_w(peb->ProcessParameters->ImagePathName.Buffer), status );
         NtTerminateProcess( GetCurrentProcess(), status );
     }
+
+    timeout.QuadPart = 0;
+    NtDelayExecution( TRUE, &timeout );
+
     server_init_process_done();
 }
 
-- 
1.9.1

