loader: Reserve and allocate SharedUserData. [Try2]
Vitaliy Margolen
wine-patch at kievinfo.com
Fri Dec 9 14:23:58 CST 2005
ChangeLog:
loader: Reserve and allocate SharedUserData. [Try2]
dlls/ntdll/loader.c | 11 +++++++++++
loader/preloader.c | 1 +
2 files changed, 12 insertions(+), 0 deletions(-)
-------------- next part --------------
84f5197ab8f9c7657ee3d5dca13c53466540edb5
diff --git a/dlls/ntdll/loader.c b/dlls/ntdll/loader.c
index f0a4eed..17ce55d 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 SharedUserData = (PVOID)0x7ffe0000;
+ ULONG size = 0x1000;
thread_init();
@@ -2176,6 +2179,14 @@ void __wine_process_init( int argc, char
/* setup the load callback and create ntdll modref */
wine_dll_set_callback( load_builtin_callback );
+ /* Map SharedUserData */
+ status = NtAllocateVirtualMemory( NtCurrentProcess(), (PVOID)&SharedUserData, 0, &size,
+ MEM_RESERVE | MEM_COMMIT, PAGE_READWRITE );
+ if (status != STATUS_SUCCESS)
+ ERR( "wine: could not allocate SharedUserData, status %lx\n", status );
+ else
+ SharedUserData->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