Author: fireball
Date: Thu Aug 27 10:56:03 2009
New Revision: 42952

URL: http://svn.reactos.org/svn/reactos?rev=42952&view=rev
Log:
[user32]
- In a process initialization phase, replase CreateWindowStationW and 
CreateDesktopW calls with OpenWindowStationW and OpenDesktopW so that they 
don't force creation of a winstation or a new desktop if one doesn't exist. 
After this commit, a default desktop is properly created by winlogon after 
csrss is attached, and thus can repaint its background without problems. A hack 
for a missing window station remains.

Modified:
    branches/arwinss/reactos/dll/win32/user32/user_main.c

Modified: branches/arwinss/reactos/dll/win32/user32/user_main.c
URL: 
http://svn.reactos.org/svn/reactos/branches/arwinss/reactos/dll/win32/user32/user_main.c?rev=42952&r1=42951&r2=42952&view=diff
==============================================================================
--- branches/arwinss/reactos/dll/win32/user32/user_main.c [iso-8859-1] 
(original)
+++ branches/arwinss/reactos/dll/win32/user32/user_main.c [iso-8859-1] Thu Aug 
27 10:56:03 2009
@@ -238,7 +238,15 @@
     /* set winstation if explicitly specified, or if we don't have one yet */
     if (buffer || !GetProcessWindowStation())
     {
-        handle = CreateWindowStationW( winstation ? winstation : WinSta0, 0, 
WINSTA_ALL_ACCESS, NULL );
+        handle = OpenWindowStationW( winstation ? winstation : WinSta0, FALSE, 
WINSTA_ALL_ACCESS );
+
+        if (!handle)
+        {
+            /* the process has no window station */
+            FIXME("A process without a window station! Creating one for 
it...\n");
+            handle = CreateWindowStationW( winstation ? winstation : WinSta0, 
0, WINSTA_ALL_ACCESS, NULL );
+        }
+
         if (handle)
         {
             SetProcessWindowStation( handle );
@@ -255,8 +263,9 @@
     }
     if (buffer || !GetThreadDesktop( GetCurrentThreadId() ))
     {
-        handle = CreateDesktopW( desktop ? desktop : get_default_desktop(),
-                                 NULL, NULL, 0, DESKTOP_ALL_ACCESS, NULL );
+        handle = OpenDesktopW(desktop ? desktop : get_default_desktop(),
+                            0, FALSE, DESKTOP_ALL_ACCESS);
+
         if (handle) SetThreadDesktop( handle );
     }
     HeapFree( GetProcessHeap(), 0, buffer );


Reply via email to