loader: Reserve and allocate SharedUserData.

Robert Shearman rob at codeweavers.com
Fri Dec 9 13:18:26 CST 2005


Vitaliy Margolen wrote:

>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;
>  
>

This is a bad choice of name. SharedUserData or shared_user_data would 
be better.

>+    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);
>  
>

Wouldn't it be better to use NtCreateSection/NtMapViewOfSection instead?

>+    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 );
>  
>

-- 
Rob Shearman




More information about the wine-devel mailing list