ntdll: Stop when we can't map the shared user data

André Hentschel nerv at dawncrow.de
Fri Jan 14 14:49:37 CST 2011


It can happen that the adress 0x7ffe0000 is blocked by some loaded libraries already.
I got that case on real ARM Hardware (pandaboard)
and worked around it by replacing 0x7ffe0000 with 0x5ffe0000 in ntdll and kernel32,
but that's to ugly for upstream of course.

Maybe we should have a macro in a header for that address, so that it's cleaner and
easier to work around...?

---
 dlls/ntdll/thread.c |    9 ++++++++-
 1 files changed, 8 insertions(+), 1 deletions(-)

diff --git a/dlls/ntdll/thread.c b/dlls/ntdll/thread.c
index 56eca23..035be06 100644
--- a/dlls/ntdll/thread.c
+++ b/dlls/ntdll/thread.c
@@ -197,6 +197,7 @@ HANDLE thread_init(void)
     SIZE_T size, info_size;
     HANDLE exe_file = 0;
     LARGE_INTEGER now;
+    NTSTATUS status;
     struct ntdll_thread_data *thread_data;
     static struct debug_info debug_info;  /* debug info for initial thread */
 
@@ -206,7 +207,13 @@ HANDLE thread_init(void)
 
     addr = (void *)0x7ffe0000;
     size = 0x10000;
-    NtAllocateVirtualMemory( NtCurrentProcess(), &addr, 0, &size, MEM_RESERVE|MEM_COMMIT, PAGE_READWRITE );
+    status = NtAllocateVirtualMemory( NtCurrentProcess(), &addr, 0, &size,
+                                      MEM_RESERVE|MEM_COMMIT, PAGE_READWRITE );
+    if (status)
+    {
+        MESSAGE( "wine: failed to map the shared user data: %x\n", status );
+        exit(1);
+    }
     user_shared_data = addr;
 
     /* allocate and initialize the PEB */
-- 

Best Regards, André Hentschel



More information about the wine-patches mailing list