loader: Reserve and allocate SharedUserData.

Vitaliy Margolen wine-patch at kievinfo.com
Fri Dec 9 11:57:16 CST 2005


ChangeLog:
loader: Reserve and allocate SharedUserData.

 dlls/ntdll/loader.c |    7 +++++++
 loader/preloader.c  |    1 +
 2 files changed, 8 insertions(+), 0 deletions(-)
-------------- next part --------------
eca7544c7cd7f69ebddb5aa58e7bd038afdf60d9
diff --git a/dlls/ntdll/loader.c b/dlls/ntdll/loader.c
index f0a4eed..8fbcad1 100644
--- a/dlls/ntdll/loader.c
+++ b/dlls/ntdll/loader.c
@@ -42,6 +42,7 @@
 #include "wine/debug.h"
 #include "wine/server.h"
 #include "ntdll_misc.h"
+#include "ddk/wdm.h"
 
 WINE_DEFAULT_DEBUG_CHANNEL(module);
 WINE_DECLARE_DEBUG_CHANNEL(relay);
@@ -2166,6 +2167,8 @@ void __wine_process_init( int argc, char
     ANSI_STRING func_name;
     void (* DECLSPEC_NORETURN init_func)();
     extern mode_t FILE_umask;
+    PKSHARED_USER_DATA SUD = (PVOID)0x7ffe0000;
+    ULONG size = 0x1000;
 
     thread_init();
 
@@ -2176,6 +2179,10 @@ void __wine_process_init( int argc, char
     /* setup the load callback and create ntdll modref */
     wine_dll_set_callback( load_builtin_callback );
 
+    /* Map SharedUserData */
+    NtAllocateVirtualMemory( NtCurrentProcess(), (PVOID)&SUD, 0, &size, MEM_RESERVE | MEM_COMMIT, PAGE_READWRITE);
+    SUD->TickCountLowDeprecated = 123456;
+
     if ((status = load_builtin_dll( NULL, kernel32W, 0, &wm )) != STATUS_SUCCESS)
     {
         MESSAGE( "wine: could not load kernel32.dll, status %lx\n", status );
diff --git a/loader/preloader.c b/loader/preloader.c
index f4343a7..cf057b8 100644
--- a/loader/preloader.c
+++ b/loader/preloader.c
@@ -111,6 +111,7 @@ static struct wine_preload_info preload_
     { (void *)0x00000000, 0x00110000 },  /* DOS area */
     { (void *)0x80000000, 0x01000000 },  /* shared heap */
     { (void *)0x00110000, 0x1fef0000 },  /* PE exe range (may be set with WINEPRELOADRESERVE), defaults to 512mb */
+    { (void *)0x7ffe0000, 0x00001000 },  /* SharedUserData */
     { 0, 0 }                             /* end of list */
 };
 


More information about the wine-patches mailing list