[ros-diffs] [tkreuzer] 52132: [NTOSKRNL/USERINIT/WIN32K] Implement support for SafeMode boot Patch by Adam Kachwalla (geekdundee at gmail dot com) See issue #6275 for more details.

tkreuzer at svn.reactos.org tkreuzer at svn.reactos.org
Tue Jun 7 16:42:43 UTC 2011


Author: tkreuzer
Date: Tue Jun  7 16:42:43 2011
New Revision: 52132

URL: http://svn.reactos.org/svn/reactos?rev=52132&view=rev
Log:
[NTOSKRNL/USERINIT/WIN32K]
Implement support for SafeMode boot
Patch by Adam Kachwalla (geekdundee at gmail dot com)

See issue #6275 for more details.

Modified:
    trunk/reactos/base/shell/explorer/services/startup.c
    trunk/reactos/base/system/services/database.c
    trunk/reactos/base/system/userinit/userinit.c
    trunk/reactos/boot/bootdata/hivesys_amd64.inf
    trunk/reactos/boot/bootdata/hivesys_i386.inf
    trunk/reactos/ntoskrnl/config/cmboot.c
    trunk/reactos/ntoskrnl/ex/init.c
    trunk/reactos/ntoskrnl/include/internal/cm.h
    trunk/reactos/subsystems/win32/win32k/ntuser/desktop.c
    trunk/reactos/subsystems/win32/win32k/ntuser/metric.c
    trunk/reactos/subsystems/win32/win32k/objects/freetype.c

Modified: trunk/reactos/base/shell/explorer/services/startup.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/base/shell/explorer/services/startup.c?rev=52132&r1=52131&r2=52132&view=diff
==============================================================================
--- trunk/reactos/base/shell/explorer/services/startup.c [iso-8859-1] (original)
+++ trunk/reactos/base/shell/explorer/services/startup.c [iso-8859-1] Tue Jun  7 16:42:43 2011
@@ -369,6 +369,9 @@
             continue;
         }
 
+        /* safe mode - force to run if prefixed with asterisk */
+        if (GetSystemMetrics(SM_CLEANBOOT) && (szValue[0] != L'*')) continue;
+
         if (bDelete && (res=RegDeleteValueW(hkRun, szValue))!=ERROR_SUCCESS)
         {
             printf("Couldn't delete value - %ld, %ld. Running command anyways.\n", i, res);
@@ -466,6 +469,9 @@
         }
     } else
         ops=DEFAULT;
+
+    /* do not run certain items in Safe Mode */
+    if(GetSystemMetrics(SM_CLEANBOOT)) ops.startup = FALSE;
 
     /* Perform the ops by order, stopping if one fails, skipping if necessary */
     /* Shachar: Sorry for the perl syntax */

Modified: trunk/reactos/base/system/services/database.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/base/system/services/database.c?rev=52132&r1=52131&r2=52132&view=diff
==============================================================================
--- trunk/reactos/base/system/services/database.c [iso-8859-1] (original)
+++ trunk/reactos/base/system/services/database.c [iso-8859-1] Tue Jun  7 16:42:43 2011
@@ -1135,14 +1135,65 @@
     PLIST_ENTRY ServiceEntry;
     PSERVICE_GROUP CurrentGroup;
     PSERVICE CurrentService;
+    WCHAR szSafeBootServicePath[MAX_PATH];
+    DWORD dwError;
+    HKEY hKey;
     ULONG i;
 
-    /* Clear 'ServiceVisited' flag */
+    /* Clear 'ServiceVisited' flag (or set if not to start in Safe Mode) */
     ServiceEntry = ServiceListHead.Flink;
     while (ServiceEntry != &ServiceListHead)
     {
       CurrentService = CONTAINING_RECORD(ServiceEntry, SERVICE, ServiceListEntry);
-      CurrentService->ServiceVisited = FALSE;
+        /* Build the safe boot path */
+        wcscpy(szSafeBootServicePath,
+               L"SYSTEM\\CurrentControlSet\\Control\\SafeBoot");
+        switch(GetSystemMetrics(SM_CLEANBOOT))
+        {
+            /* NOTE: Assumes MINIMAL (1) and DSREPAIR (3) load same items */
+            case 1:
+            case 3: wcscat(szSafeBootServicePath, L"\\Minimal\\"); break;
+            case 2: wcscat(szSafeBootServicePath, L"\\Network\\"); break;
+        }
+        if(GetSystemMetrics(SM_CLEANBOOT))
+        {
+            /* If key does not exist then do not assume safe mode */
+            dwError = RegOpenKeyExW(HKEY_LOCAL_MACHINE,
+                                    szSafeBootServicePath,
+                                    0,
+                                    KEY_READ,
+                                    &hKey);
+            if(dwError == ERROR_SUCCESS)
+            {
+                RegCloseKey(hKey);
+                /* Finish Safe Boot path off */
+                wcsncat(szSafeBootServicePath,
+                        CurrentService->lpServiceName,
+                        MAX_PATH - wcslen(szSafeBootServicePath));
+                /* Check that the key is in the Safe Boot path */
+                dwError = RegOpenKeyExW(HKEY_LOCAL_MACHINE,
+                                        szSafeBootServicePath,
+                                        0,
+                                        KEY_READ,
+                                        &hKey);
+                if(dwError != ERROR_SUCCESS)
+                {
+                    /* Mark service as visited so it is not auto-started */
+                    CurrentService->ServiceVisited = TRUE;
+                }
+                else
+                {
+                    /* Must be auto-started in safe mode - mark as unvisited */
+                    RegCloseKey(hKey);
+                    CurrentService->ServiceVisited = FALSE;
+                }
+            }
+            else
+            {
+                DPRINT1("WARNING: Could not open the associated Safe Boot key!");
+                CurrentService->ServiceVisited = FALSE;
+            }
+        }
       ServiceEntry = ServiceEntry->Flink;
     }
 

Modified: trunk/reactos/base/system/userinit/userinit.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/base/system/userinit/userinit.c?rev=52132&r1=52131&r2=52132&view=diff
==============================================================================
--- trunk/reactos/base/system/userinit/userinit.c [iso-8859-1] (original)
+++ trunk/reactos/base/system/userinit/userinit.c [iso-8859-1] Tue Jun  7 16:42:43 2011
@@ -274,9 +274,70 @@
 {
     WCHAR Shell[MAX_PATH];
     TCHAR szMsg[RC_STRING_MAX_SIZE];
+    DWORD Type, Size;
+    DWORD Value = 0;
+    LONG rc;
+    HKEY hKey;
 
     TRACE("()\n");
 
+    /* Safe Mode shell run */
+    rc = RegOpenKeyExW(HKEY_LOCAL_MACHINE,
+                       L"SYSTEM\\CurrentControlSet\\Control\\SafeBoot\\Option",
+                       0, KEY_QUERY_VALUE, &hKey);
+    if(rc == ERROR_SUCCESS)
+    {
+        Size = sizeof(Value);
+        rc = RegQueryValueExW(hKey, L"UseAlternateShell", NULL,
+                              &Type, (LPBYTE)&Value, &Size);
+        if(rc == ERROR_SUCCESS)
+        {
+            RegCloseKey(hKey);
+            if(Type == REG_DWORD)
+            {
+                if(Value)
+                {
+                    /* Safe Mode Alternate Shell required */
+                    rc = RegOpenKeyExW(HKEY_LOCAL_MACHINE,
+                                       L"SYSTEM\\CurrentControlSet\\Control\\SafeBoot",
+                                       0, KEY_READ, &hKey);
+                    if(rc == ERROR_SUCCESS)
+                    {
+                        Size = MAX_PATH * sizeof(WCHAR);
+                        rc = RegQueryValueExW(hKey, L"AlternateShell", NULL,
+                                              &Type, (LPBYTE)Shell, &Size);
+                        if(rc == ERROR_SUCCESS)
+                        {
+                            RegCloseKey(hKey);
+                            if ((Type == REG_SZ) || (Type == REG_EXPAND_SZ))
+                            {
+                                TRACE("Key located - %s\n", debugstr_w(Shell));
+                                /* Try to run alternate shell */
+                                if (TryToStartShell(Shell))
+                                {
+                                    TRACE("Alternate shell started (Safe Mode)\n");
+                                    return;
+                                }
+                            }
+                            else
+                            {
+                                WARN("Wrong type %lu (expected %u or %u)\n",
+                                     Type, REG_SZ, REG_EXPAND_SZ);
+                            }
+                        }
+                        else
+                        {
+                            WARN("Alternate shell in Safe Mode required but not specified.");
+                        }
+                    }
+                }
+            }
+            else
+            {
+                WARN("Wrong type %lu (expected %u)\n", Type, REG_DWORD);
+            }
+        }
+    }
     /* Try to run shell in user key */
     if (GetShell(Shell, HKEY_CURRENT_USER) && TryToStartShell(Shell))
     {

Modified: trunk/reactos/boot/bootdata/hivesys_amd64.inf
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/boot/bootdata/hivesys_amd64.inf?rev=52132&r1=52131&r2=52132&view=diff
==============================================================================
--- trunk/reactos/boot/bootdata/hivesys_amd64.inf [iso-8859-1] (original)
+++ trunk/reactos/boot/bootdata/hivesys_amd64.inf [iso-8859-1] Tue Jun  7 16:42:43 2011
@@ -8,6 +8,143 @@
 HKLM,"SYSTEM\CurrentControlSet\Control\Biosinfo","InfName",2,"biosinfo.inf"
 HKLM,"SYSTEM\CurrentControlSet\Control\PnP",,0x00000012
 
+HKLM,"SYSTEM\CurrentControlSet\Control\SafeBoot","AlternateShell",2,"cmd.exe"
+
+; Safe Boot drivers
+HKLM,"SYSTEM\CurrentControlSet\Control\SafeBoot\Minimal\AppMgmt","",0x00000000,"Service"
+HKLM,"SYSTEM\CurrentControlSet\Control\SafeBoot\Minimal\Base","",0x00000000,"Driver Group"
+HKLM,"SYSTEM\CurrentControlSet\Control\SafeBoot\Minimal\Boot Bus Extender","",0x00000000,"Driver Group"
+HKLM,"SYSTEM\CurrentControlSet\Control\SafeBoot\Minimal\Boot file system","",0x00000000,"Driver Group"
+HKLM,"SYSTEM\CurrentControlSet\Control\SafeBoot\Minimal\CryptSvc","",0x00000000,"Service"
+HKLM,"SYSTEM\CurrentControlSet\Control\SafeBoot\Minimal\DcomLaunch","",0x00000000,"Service"
+HKLM,"SYSTEM\CurrentControlSet\Control\SafeBoot\Minimal\dmadmin","",0x00000000,"Service"
+HKLM,"SYSTEM\CurrentControlSet\Control\SafeBoot\Minimal\dmboot.sys","",0x00000000,"Driver"
+HKLM,"SYSTEM\CurrentControlSet\Control\SafeBoot\Minimal\dmio.sys","",0x00000000,"Driver"
+HKLM,"SYSTEM\CurrentControlSet\Control\SafeBoot\Minimal\dmload.sys","",0x00000000,"Driver"
+HKLM,"SYSTEM\CurrentControlSet\Control\SafeBoot\Minimal\dmserver","",0x00000000,"Service"
+HKLM,"SYSTEM\CurrentControlSet\Control\SafeBoot\Minimal\EventLog","",0x00000000,"Service"
+HKLM,"SYSTEM\CurrentControlSet\Control\SafeBoot\Minimal\File system","",0x00000000,"Driver Group"
+HKLM,"SYSTEM\CurrentControlSet\Control\SafeBoot\Minimal\Filter","",0x00000000,"Driver Group"
+HKLM,"SYSTEM\CurrentControlSet\Control\SafeBoot\Minimal\HelpSvc","",0x00000000,"Service"
+HKLM,"SYSTEM\CurrentControlSet\Control\SafeBoot\Minimal\Netlogon","",0x00000000,"Service"
+HKLM,"SYSTEM\CurrentControlSet\Control\SafeBoot\Minimal\PCI Configuration","",0x00000000,"Driver Group"
+HKLM,"SYSTEM\CurrentControlSet\Control\SafeBoot\Minimal\PlugPlay","",0x00000000,"Service"
+HKLM,"SYSTEM\CurrentControlSet\Control\SafeBoot\Minimal\PNP Filter","",0x00000000,"Driver Group"
+HKLM,"SYSTEM\CurrentControlSet\Control\SafeBoot\Minimal\Primary disk","",0x00000000,"Driver Group"
+HKLM,"SYSTEM\CurrentControlSet\Control\SafeBoot\Minimal\RpcSs","",0x00000000,"Service"
+HKLM,"SYSTEM\CurrentControlSet\Control\SafeBoot\Minimal\SCSI Class","",0x00000000,"Driver Group"
+HKLM,"SYSTEM\CurrentControlSet\Control\SafeBoot\Minimal\sermouse.sys","",0x00000000,"Driver"
+HKLM,"SYSTEM\CurrentControlSet\Control\SafeBoot\Minimal\sr.sys","",0x00000000,"FSFilter System Recovery"
+HKLM,"SYSTEM\CurrentControlSet\Control\SafeBoot\Minimal\SRService","",0x00000000,"Service"
+HKLM,"SYSTEM\CurrentControlSet\Control\SafeBoot\Minimal\System Bus Extender","",0x00000000,"Driver Group"
+HKLM,"SYSTEM\CurrentControlSet\Control\SafeBoot\Minimal\vga.sys","",0x00000000,"Driver"
+HKLM,"SYSTEM\CurrentControlSet\Control\SafeBoot\Minimal\vgasave.sys","",0x00000000,"Driver"
+HKLM,"SYSTEM\CurrentControlSet\Control\SafeBoot\Minimal\WinMgmt","",0x00000000,"Service"
+HKLM,"SYSTEM\CurrentControlSet\Control\SafeBoot\Minimal\{36FC9E60-C465-11CF-8056-444553540000}","",0x00000000,"Universal Serial Bus controllers"
+HKLM,"SYSTEM\CurrentControlSet\Control\SafeBoot\Minimal\{4D36E965-E325-11CE-BFC1-08002BE10318}","",0x00000000,"CD-ROM Drive"
+HKLM,"SYSTEM\CurrentControlSet\Control\SafeBoot\Minimal\{4D36E967-E325-11CE-BFC1-08002BE10318}","",0x00000000,"DiskDrive"
+HKLM,"SYSTEM\CurrentControlSet\Control\SafeBoot\Minimal\{4D36E969-E325-11CE-BFC1-08002BE10318}","",0x00000000,"Standard floppy disk controller"
+HKLM,"SYSTEM\CurrentControlSet\Control\SafeBoot\Minimal\{4D36E96A-E325-11CE-BFC1-08002BE10318}","",0x00000000,"Hdc"
+HKLM,"SYSTEM\CurrentControlSet\Control\SafeBoot\Minimal\{4D36E96B-E325-11CE-BFC1-08002BE10318}","",0x00000000,"Keyboard"
+HKLM,"SYSTEM\CurrentControlSet\Control\SafeBoot\Minimal\{4D36E96F-E325-11CE-BFC1-08002BE10318}","",0x00000000,"Mouse"
+HKLM,"SYSTEM\CurrentControlSet\Control\SafeBoot\Minimal\{4D36E977-E325-11CE-BFC1-08002BE10318}","",0x00000000,"PCMCIA Adapters"
+HKLM,"SYSTEM\CurrentControlSet\Control\SafeBoot\Minimal\{4D36E97B-E325-11CE-BFC1-08002BE10318}","",0x00000000,"SCSIAdapter"
+HKLM,"SYSTEM\CurrentControlSet\Control\SafeBoot\Minimal\{4D36E97D-E325-11CE-BFC1-08002BE10318}","",0x00000000,"System"
+HKLM,"SYSTEM\CurrentControlSet\Control\SafeBoot\Minimal\{4D36E980-E325-11CE-BFC1-08002BE10318}","",0x00000000,"Floppy disk drive"
+HKLM,"SYSTEM\CurrentControlSet\Control\SafeBoot\Minimal\{71A27CDD-812A-11D0-BEC7-08002BE2092F}","",0x00000000,"Volume"
+HKLM,"SYSTEM\CurrentControlSet\Control\SafeBoot\Minimal\{745A17A0-74D3-11D0-B6FE-00A0C90F57DA}","",0x00000000,"Human Interface Devices"
+
+HKLM,"SYSTEM\CurrentControlSet\Control\SafeBoot\Network\AFD","",0x00000000,"Service"
+HKLM,"SYSTEM\CurrentControlSet\Control\SafeBoot\Network\AppMgmt","",0x00000000,"Service"
+HKLM,"SYSTEM\CurrentControlSet\Control\SafeBoot\Network\Base","",0x00000000,"Driver Group"
+HKLM,"SYSTEM\CurrentControlSet\Control\SafeBoot\Network\Boot Bus Extender","",0x00000000,"Driver Group"
+HKLM,"SYSTEM\CurrentControlSet\Control\SafeBoot\Network\Boot file system","",0x00000000,"Driver Group"
+HKLM,"SYSTEM\CurrentControlSet\Control\SafeBoot\Network\Browser","",0x00000000,"Service"
+HKLM,"SYSTEM\CurrentControlSet\Control\SafeBoot\Network\CryptSvc","",0x00000000,"Service"
+HKLM,"SYSTEM\CurrentControlSet\Control\SafeBoot\Network\DcomLaunch","",0x00000000,"Service"
+HKLM,"SYSTEM\CurrentControlSet\Control\SafeBoot\Network\Dhcp","",0x00000000,"Service"
+HKLM,"SYSTEM\CurrentControlSet\Control\SafeBoot\Network\dmadmin","",0x00000000,"Service"
+HKLM,"SYSTEM\CurrentControlSet\Control\SafeBoot\Network\dmboot.sys","",0x00000000,"Driver"
+HKLM,"SYSTEM\CurrentControlSet\Control\SafeBoot\Network\dmio.sys","",0x00000000,"Driver"
+HKLM,"SYSTEM\CurrentControlSet\Control\SafeBoot\Network\dmload.sys","",0x00000000,"Driver"
+HKLM,"SYSTEM\CurrentControlSet\Control\SafeBoot\Network\dmserver","",0x00000000,"Service"
+HKLM,"SYSTEM\CurrentControlSet\Control\SafeBoot\Network\DnsCache","",0x00000000,"Service"
+HKLM,"SYSTEM\CurrentControlSet\Control\SafeBoot\Network\EventLog","",0x00000000,"Service"
+HKLM,"SYSTEM\CurrentControlSet\Control\SafeBoot\Network\File system","",0x00000000,"Driver Group"
+HKLM,"SYSTEM\CurrentControlSet\Control\SafeBoot\Network\Filter","",0x00000000,"Driver Group"
+HKLM,"SYSTEM\CurrentControlSet\Control\SafeBoot\Network\HelpSvc","",0x00000000,"Service"
+HKLM,"SYSTEM\CurrentControlSet\Control\SafeBoot\Network\ip6fw.sys","",0x00000000,"Driver"
+HKLM,"SYSTEM\CurrentControlSet\Control\SafeBoot\Network\ipnat.sys","",0x00000000,"Driver"
+HKLM,"SYSTEM\CurrentControlSet\Control\SafeBoot\Network\LanmanServer","",0x00000000,"Service"
+HKLM,"SYSTEM\CurrentControlSet\Control\SafeBoot\Network\LanmanWorkstation","",0x00000000,"Service"
+HKLM,"SYSTEM\CurrentControlSet\Control\SafeBoot\Network\LmHosts","",0x00000000,"Service"
+HKLM,"SYSTEM\CurrentControlSet\Control\SafeBoot\Network\Messenger","",0x00000000,"Service"
+HKLM,"SYSTEM\CurrentControlSet\Control\SafeBoot\Network\NDIS","",0x00000000,"Driver Group"
+HKLM,"SYSTEM\CurrentControlSet\Control\SafeBoot\Network\NDIS Wrapper","",0x00000000,"Driver Group"
+HKLM,"SYSTEM\CurrentControlSet\Control\SafeBoot\Network\Ndisuio","",0x00000000,"Service"
+HKLM,"SYSTEM\CurrentControlSet\Control\SafeBoot\Network\NetBIOS","",0x00000000,"Service"
+HKLM,"SYSTEM\CurrentControlSet\Control\SafeBoot\Network\NetBIOSGroup","",0x00000000,"Driver Group"
+HKLM,"SYSTEM\CurrentControlSet\Control\SafeBoot\Network\NetBT","",0x00000000,"Service"
+HKLM,"SYSTEM\CurrentControlSet\Control\SafeBoot\Network\NetDDEGroup","",0x00000000,"Driver Group"
+HKLM,"SYSTEM\CurrentControlSet\Control\SafeBoot\Network\Netlogon","",0x00000000,"Service"
+HKLM,"SYSTEM\CurrentControlSet\Control\SafeBoot\Network\NetMan","",0x00000000,"Service"
+HKLM,"SYSTEM\CurrentControlSet\Control\SafeBoot\Network\Network","",0x00000000,"Driver Group"
+HKLM,"SYSTEM\CurrentControlSet\Control\SafeBoot\Network\NetworkProvider","",0x00000000,"Driver Group"
+HKLM,"SYSTEM\CurrentControlSet\Control\SafeBoot\Network\NtLmSsp","",0x00000000,"Service"
+HKLM,"SYSTEM\CurrentControlSet\Control\SafeBoot\Network\PCI Configuration","",0x00000000,"Driver Group"
+HKLM,"SYSTEM\CurrentControlSet\Control\SafeBoot\Network\PlugPlay","",0x00000000,"Service"
+HKLM,"SYSTEM\CurrentControlSet\Control\SafeBoot\Network\PNP Filter","",0x00000000,"Driver Group"
+HKLM,"SYSTEM\CurrentControlSet\Control\SafeBoot\Network\PNP_TDI","",0x00000000,"Driver Group"
+HKLM,"SYSTEM\CurrentControlSet\Control\SafeBoot\Network\Primary disk","",0x00000000,"Driver Group"
+HKLM,"SYSTEM\CurrentControlSet\Control\SafeBoot\Network\rdpcdd.sys","",0x00000000,"Driver"
+HKLM,"SYSTEM\CurrentControlSet\Control\SafeBoot\Network\rdpdd.sys","",0x00000000,"Driver"
+HKLM,"SYSTEM\CurrentControlSet\Control\SafeBoot\Network\rdpwd.sys","",0x00000000,"Driver"
+HKLM,"SYSTEM\CurrentControlSet\Control\SafeBoot\Network\rdsessmgr","",0x00000000,"Service"
+HKLM,"SYSTEM\CurrentControlSet\Control\SafeBoot\Network\RpcSs","",0x00000000,"Service"
+HKLM,"SYSTEM\CurrentControlSet\Control\SafeBoot\Network\SCSI Class","",0x00000000,"Driver Group"
+HKLM,"SYSTEM\CurrentControlSet\Control\SafeBoot\Network\sermouse.sys","",0x00000000,"Driver"
+HKLM,"SYSTEM\CurrentControlSet\Control\SafeBoot\Network\SharedAccess","",0x00000000,"Service"
+HKLM,"SYSTEM\CurrentControlSet\Control\SafeBoot\Network\sr.sys","",0x00000000,"FSFilter System Recovery"
+HKLM,"SYSTEM\CurrentControlSet\Control\SafeBoot\Network\SRService","",0x00000000,"Service"
+HKLM,"SYSTEM\CurrentControlSet\Control\SafeBoot\Network\Streams Drivers","",0x00000000,"Driver Group"
+HKLM,"SYSTEM\CurrentControlSet\Control\SafeBoot\Network\System Bus Extender","",0x00000000,"Driver Group"
+HKLM,"SYSTEM\CurrentControlSet\Control\SafeBoot\Network\Tcpip","",0x00000000,"Service"
+HKLM,"SYSTEM\CurrentControlSet\Control\SafeBoot\Network\TDI","",0x00000000,"Driver Group"
+HKLM,"SYSTEM\CurrentControlSet\Control\SafeBoot\Network\tdpipe.sys","",0x00000000,"Driver"
+HKLM,"SYSTEM\CurrentControlSet\Control\SafeBoot\Network\tdtcp.sys","",0x00000000,"Driver"
+HKLM,"SYSTEM\CurrentControlSet\Control\SafeBoot\Network\termservice","",0x00000000,"Service"
+HKLM,"SYSTEM\CurrentControlSet\Control\SafeBoot\Network\vga.sys","",0x00000000,"Driver"
+HKLM,"SYSTEM\CurrentControlSet\Control\SafeBoot\Network\vgasave.sys","",0x00000000,"Driver"
+HKLM,"SYSTEM\CurrentControlSet\Control\SafeBoot\Network\WinMgmt","",0x00000000,"Service"
+HKLM,"SYSTEM\CurrentControlSet\Control\SafeBoot\Network\WZCSVC","",0x00000000,"Service"
+HKLM,"SYSTEM\CurrentControlSet\Control\SafeBoot\Network\{36FC9E60-C465-11CF-8056-444553540000}","",0x00000000,"Universal Serial Bus controllers"
+HKLM,"SYSTEM\CurrentControlSet\Control\SafeBoot\Network\{4D36E965-E325-11CE-BFC1-08002BE10318}","",0x00000000,"CD-ROM Drive"
+HKLM,"SYSTEM\CurrentControlSet\Control\SafeBoot\Network\{4D36E967-E325-11CE-BFC1-08002BE10318}","",0x00000000,"DiskDrive"
+HKLM,"SYSTEM\CurrentControlSet\Control\SafeBoot\Network\{4D36E969-E325-11CE-BFC1-08002BE10318}","",0x00000000,"Standard floppy disk controller"
+HKLM,"SYSTEM\CurrentControlSet\Control\SafeBoot\Network\{4D36E96A-E325-11CE-BFC1-08002BE10318}","",0x00000000,"Hdc"
+HKLM,"SYSTEM\CurrentControlSet\Control\SafeBoot\Network\{4D36E96B-E325-11CE-BFC1-08002BE10318}","",0x00000000,"Keyboard"
+HKLM,"SYSTEM\CurrentControlSet\Control\SafeBoot\Network\{4D36E96F-E325-11CE-BFC1-08002BE10318}","",0x00000000,"Mouse"
+HKLM,"SYSTEM\CurrentControlSet\Control\SafeBoot\Network\{4D36E972-E325-11CE-BFC1-08002BE10318}","",0x00000000,"Net"
+HKLM,"SYSTEM\CurrentControlSet\Control\SafeBoot\Network\{4D36E973-E325-11CE-BFC1-08002BE10318}","",0x00000000,"NetClient"
+HKLM,"SYSTEM\CurrentControlSet\Control\SafeBoot\Network\{4D36E974-E325-11CE-BFC1-08002BE10318}","",0x00000000,"NetService"
+HKLM,"SYSTEM\CurrentControlSet\Control\SafeBoot\Network\{4D36E975-E325-11CE-BFC1-08002BE10318}","",0x00000000,"NetTrans"
+HKLM,"SYSTEM\CurrentControlSet\Control\SafeBoot\Network\{4D36E977-E325-11CE-BFC1-08002BE10318}","",0x00000000,"PCMCIA Adapters"
+HKLM,"SYSTEM\CurrentControlSet\Control\SafeBoot\Network\{4D36E97B-E325-11CE-BFC1-08002BE10318}","",0x00000000,"SCSIAdapter"
+HKLM,"SYSTEM\CurrentControlSet\Control\SafeBoot\Network\{4D36E97D-E325-11CE-BFC1-08002BE10318}","",0x00000000,"System"
+HKLM,"SYSTEM\CurrentControlSet\Control\SafeBoot\Network\{4D36E980-E325-11CE-BFC1-08002BE10318}","",0x00000000,"Floppy disk drive"
+HKLM,"SYSTEM\CurrentControlSet\Control\SafeBoot\Network\{71A27CDD-812A-11D0-BEC7-08002BE2092F}","",0x00000000,"Volume"
+HKLM,"SYSTEM\CurrentControlSet\Control\SafeBoot\Network\{745A17A0-74D3-11D0-B6FE-00A0C90F57DA}","",0x00000000,"Human Interface Devices"
+
+; ReactOS specific - required to load in Safe Mode and for debugging in Safe Mode (until vga.sys and vgasave.sys are implemented)
+HKLM,"SYSTEM\CurrentControlSet\Control\SafeBoot\Minimal\Debug","",0x00000000,"Driver Group"
+HKLM,"SYSTEM\CurrentControlSet\Control\SafeBoot\Minimal\vgamp.sys","",0x00000000,"Driver"
+HKLM,"SYSTEM\CurrentControlSet\Control\SafeBoot\Minimal\vbemp.sys","",0x00000000,"Driver"
+
+HKLM,"SYSTEM\CurrentControlSet\Control\SafeBoot\Network\Debug","",0x00000000,"Driver Group"
+HKLM,"SYSTEM\CurrentControlSet\Control\SafeBoot\Network\vgamp.sys","",0x00000000,"Driver"
+HKLM,"SYSTEM\CurrentControlSet\Control\SafeBoot\Network\vbemp.sys","",0x00000000,"Driver"
+
+; Other
 HKLM,"SYSTEM\CurrentControlSet\Control\FileSystem","NtfsDisable8dot3NameCreation",0x00010003,0
 HKLM,"SYSTEM\CurrentControlSet\Control\FileSystem","Win31FileSystem",0x00010001,0
 HKLM,"SYSTEM\CurrentControlSet\Control\FileSystem","Win95TruncatedExtensions",0x00010001,1

Modified: trunk/reactos/boot/bootdata/hivesys_i386.inf
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/boot/bootdata/hivesys_i386.inf?rev=52132&r1=52131&r2=52132&view=diff
==============================================================================
--- trunk/reactos/boot/bootdata/hivesys_i386.inf [iso-8859-1] (original)
+++ trunk/reactos/boot/bootdata/hivesys_i386.inf [iso-8859-1] Tue Jun  7 16:42:43 2011
@@ -7,6 +7,144 @@
 HKLM,"SYSTEM\CurrentControlSet\Control","WaitToKillServiceTimeout",2,"20000"
 HKLM,"SYSTEM\CurrentControlSet\Control\Biosinfo","InfName",2,"biosinfo.inf"
 HKLM,"SYSTEM\CurrentControlSet\Control\PnP",,0x00000012
+
+HKLM,"SYSTEM\CurrentControlSet\Control\SafeBoot","AlternateShell",2,"cmd.exe"
+
+; Safe Boot drivers
+HKLM,"SYSTEM\CurrentControlSet\Control\SafeBoot\Minimal\AppMgmt","",0x00000000,"Service"
+HKLM,"SYSTEM\CurrentControlSet\Control\SafeBoot\Minimal\Base","",0x00000000,"Driver Group"
+HKLM,"SYSTEM\CurrentControlSet\Control\SafeBoot\Minimal\Boot Bus Extender","",0x00000000,"Driver Group"
+HKLM,"SYSTEM\CurrentControlSet\Control\SafeBoot\Minimal\Boot file system","",0x00000000,"Driver Group"
+HKLM,"SYSTEM\CurrentControlSet\Control\SafeBoot\Minimal\CryptSvc","",0x00000000,"Service"
+HKLM,"SYSTEM\CurrentControlSet\Control\SafeBoot\Minimal\DcomLaunch","",0x00000000,"Service"
+HKLM,"SYSTEM\CurrentControlSet\Control\SafeBoot\Minimal\dmadmin","",0x00000000,"Service"
+HKLM,"SYSTEM\CurrentControlSet\Control\SafeBoot\Minimal\dmboot.sys","",0x00000000,"Driver"
+HKLM,"SYSTEM\CurrentControlSet\Control\SafeBoot\Minimal\dmio.sys","",0x00000000,"Driver"
+HKLM,"SYSTEM\CurrentControlSet\Control\SafeBoot\Minimal\dmload.sys","",0x00000000,"Driver"
+HKLM,"SYSTEM\CurrentControlSet\Control\SafeBoot\Minimal\dmserver","",0x00000000,"Service"
+HKLM,"SYSTEM\CurrentControlSet\Control\SafeBoot\Minimal\EventLog","",0x00000000,"Service"
+HKLM,"SYSTEM\CurrentControlSet\Control\SafeBoot\Minimal\File system","",0x00000000,"Driver Group"
+HKLM,"SYSTEM\CurrentControlSet\Control\SafeBoot\Minimal\Filter","",0x00000000,"Driver Group"
+HKLM,"SYSTEM\CurrentControlSet\Control\SafeBoot\Minimal\HelpSvc","",0x00000000,"Service"
+HKLM,"SYSTEM\CurrentControlSet\Control\SafeBoot\Minimal\Netlogon","",0x00000000,"Service"
+HKLM,"SYSTEM\CurrentControlSet\Control\SafeBoot\Minimal\PCI Configuration","",0x00000000,"Driver Group"
+HKLM,"SYSTEM\CurrentControlSet\Control\SafeBoot\Minimal\PlugPlay","",0x00000000,"Service"
+HKLM,"SYSTEM\CurrentControlSet\Control\SafeBoot\Minimal\PNP Filter","",0x00000000,"Driver Group"
+HKLM,"SYSTEM\CurrentControlSet\Control\SafeBoot\Minimal\Primary disk","",0x00000000,"Driver Group"
+HKLM,"SYSTEM\CurrentControlSet\Control\SafeBoot\Minimal\RpcSs","",0x00000000,"Service"
+HKLM,"SYSTEM\CurrentControlSet\Control\SafeBoot\Minimal\SCSI Class","",0x00000000,"Driver Group"
+HKLM,"SYSTEM\CurrentControlSet\Control\SafeBoot\Minimal\sermouse.sys","",0x00000000,"Driver"
+HKLM,"SYSTEM\CurrentControlSet\Control\SafeBoot\Minimal\sr.sys","",0x00000000,"FSFilter System Recovery"
+HKLM,"SYSTEM\CurrentControlSet\Control\SafeBoot\Minimal\SRService","",0x00000000,"Service"
+HKLM,"SYSTEM\CurrentControlSet\Control\SafeBoot\Minimal\System Bus Extender","",0x00000000,"Driver Group"
+HKLM,"SYSTEM\CurrentControlSet\Control\SafeBoot\Minimal\vga.sys","",0x00000000,"Driver"
+HKLM,"SYSTEM\CurrentControlSet\Control\SafeBoot\Minimal\vgasave.sys","",0x00000000,"Driver"
+HKLM,"SYSTEM\CurrentControlSet\Control\SafeBoot\Minimal\WinMgmt","",0x00000000,"Service"
+HKLM,"SYSTEM\CurrentControlSet\Control\SafeBoot\Minimal\{36FC9E60-C465-11CF-8056-444553540000}","",0x00000000,"Universal Serial Bus controllers"
+HKLM,"SYSTEM\CurrentControlSet\Control\SafeBoot\Minimal\{4D36E965-E325-11CE-BFC1-08002BE10318}","",0x00000000,"CD-ROM Drive"
+HKLM,"SYSTEM\CurrentControlSet\Control\SafeBoot\Minimal\{4D36E967-E325-11CE-BFC1-08002BE10318}","",0x00000000,"DiskDrive"
+HKLM,"SYSTEM\CurrentControlSet\Control\SafeBoot\Minimal\{4D36E969-E325-11CE-BFC1-08002BE10318}","",0x00000000,"Standard floppy disk controller"
+HKLM,"SYSTEM\CurrentControlSet\Control\SafeBoot\Minimal\{4D36E96A-E325-11CE-BFC1-08002BE10318}","",0x00000000,"Hdc"
+HKLM,"SYSTEM\CurrentControlSet\Control\SafeBoot\Minimal\{4D36E96B-E325-11CE-BFC1-08002BE10318}","",0x00000000,"Keyboard"
+HKLM,"SYSTEM\CurrentControlSet\Control\SafeBoot\Minimal\{4D36E96F-E325-11CE-BFC1-08002BE10318}","",0x00000000,"Mouse"
+HKLM,"SYSTEM\CurrentControlSet\Control\SafeBoot\Minimal\{4D36E977-E325-11CE-BFC1-08002BE10318}","",0x00000000,"PCMCIA Adapters"
+HKLM,"SYSTEM\CurrentControlSet\Control\SafeBoot\Minimal\{4D36E97B-E325-11CE-BFC1-08002BE10318}","",0x00000000,"SCSIAdapter"
+HKLM,"SYSTEM\CurrentControlSet\Control\SafeBoot\Minimal\{4D36E97D-E325-11CE-BFC1-08002BE10318}","",0x00000000,"System"
+HKLM,"SYSTEM\CurrentControlSet\Control\SafeBoot\Minimal\{4D36E980-E325-11CE-BFC1-08002BE10318}","",0x00000000,"Floppy disk drive"
+HKLM,"SYSTEM\CurrentControlSet\Control\SafeBoot\Minimal\{71A27CDD-812A-11D0-BEC7-08002BE2092F}","",0x00000000,"Volume"
+HKLM,"SYSTEM\CurrentControlSet\Control\SafeBoot\Minimal\{745A17A0-74D3-11D0-B6FE-00A0C90F57DA}","",0x00000000,"Human Interface Devices"
+
+HKLM,"SYSTEM\CurrentControlSet\Control\SafeBoot\Network\AFD","",0x00000000,"Service"
+HKLM,"SYSTEM\CurrentControlSet\Control\SafeBoot\Network\AppMgmt","",0x00000000,"Service"
+HKLM,"SYSTEM\CurrentControlSet\Control\SafeBoot\Network\Base","",0x00000000,"Driver Group"
+HKLM,"SYSTEM\CurrentControlSet\Control\SafeBoot\Network\Boot Bus Extender","",0x00000000,"Driver Group"
+HKLM,"SYSTEM\CurrentControlSet\Control\SafeBoot\Network\Boot file system","",0x00000000,"Driver Group"
+HKLM,"SYSTEM\CurrentControlSet\Control\SafeBoot\Network\Browser","",0x00000000,"Service"
+HKLM,"SYSTEM\CurrentControlSet\Control\SafeBoot\Network\CryptSvc","",0x00000000,"Service"
+HKLM,"SYSTEM\CurrentControlSet\Control\SafeBoot\Network\DcomLaunch","",0x00000000,"Service"
+HKLM,"SYSTEM\CurrentControlSet\Control\SafeBoot\Network\Dhcp","",0x00000000,"Service"
+HKLM,"SYSTEM\CurrentControlSet\Control\SafeBoot\Network\dmadmin","",0x00000000,"Service"
+HKLM,"SYSTEM\CurrentControlSet\Control\SafeBoot\Network\dmboot.sys","",0x00000000,"Driver"
+HKLM,"SYSTEM\CurrentControlSet\Control\SafeBoot\Network\dmio.sys","",0x00000000,"Driver"
+HKLM,"SYSTEM\CurrentControlSet\Control\SafeBoot\Network\dmload.sys","",0x00000000,"Driver"
+HKLM,"SYSTEM\CurrentControlSet\Control\SafeBoot\Network\dmserver","",0x00000000,"Service"
+HKLM,"SYSTEM\CurrentControlSet\Control\SafeBoot\Network\DnsCache","",0x00000000,"Service"
+HKLM,"SYSTEM\CurrentControlSet\Control\SafeBoot\Network\EventLog","",0x00000000,"Service"
+HKLM,"SYSTEM\CurrentControlSet\Control\SafeBoot\Network\File system","",0x00000000,"Driver Group"
+HKLM,"SYSTEM\CurrentControlSet\Control\SafeBoot\Network\Filter","",0x00000000,"Driver Group"
+HKLM,"SYSTEM\CurrentControlSet\Control\SafeBoot\Network\HelpSvc","",0x00000000,"Service"
+HKLM,"SYSTEM\CurrentControlSet\Control\SafeBoot\Network\ip6fw.sys","",0x00000000,"Driver"
+HKLM,"SYSTEM\CurrentControlSet\Control\SafeBoot\Network\ipnat.sys","",0x00000000,"Driver"
+HKLM,"SYSTEM\CurrentControlSet\Control\SafeBoot\Network\LanmanServer","",0x00000000,"Service"
+HKLM,"SYSTEM\CurrentControlSet\Control\SafeBoot\Network\LanmanWorkstation","",0x00000000,"Service"
+HKLM,"SYSTEM\CurrentControlSet\Control\SafeBoot\Network\LmHosts","",0x00000000,"Service"
+HKLM,"SYSTEM\CurrentControlSet\Control\SafeBoot\Network\Messenger","",0x00000000,"Service"
+HKLM,"SYSTEM\CurrentControlSet\Control\SafeBoot\Network\NDIS","",0x00000000,"Driver Group"
+HKLM,"SYSTEM\CurrentControlSet\Control\SafeBoot\Network\NDIS Wrapper","",0x00000000,"Driver Group"
+HKLM,"SYSTEM\CurrentControlSet\Control\SafeBoot\Network\Ndisuio","",0x00000000,"Service"
+HKLM,"SYSTEM\CurrentControlSet\Control\SafeBoot\Network\NetBIOS","",0x00000000,"Service"
+HKLM,"SYSTEM\CurrentControlSet\Control\SafeBoot\Network\NetBIOSGroup","",0x00000000,"Driver Group"
+HKLM,"SYSTEM\CurrentControlSet\Control\SafeBoot\Network\NetBT","",0x00000000,"Service"
+HKLM,"SYSTEM\CurrentControlSet\Control\SafeBoot\Network\NetDDEGroup","",0x00000000,"Driver Group"
+HKLM,"SYSTEM\CurrentControlSet\Control\SafeBoot\Network\Netlogon","",0x00000000,"Service"
+HKLM,"SYSTEM\CurrentControlSet\Control\SafeBoot\Network\NetMan","",0x00000000,"Service"
+HKLM,"SYSTEM\CurrentControlSet\Control\SafeBoot\Network\Network","",0x00000000,"Driver Group"
+HKLM,"SYSTEM\CurrentControlSet\Control\SafeBoot\Network\NetworkProvider","",0x00000000,"Driver Group"
+HKLM,"SYSTEM\CurrentControlSet\Control\SafeBoot\Network\NtLmSsp","",0x00000000,"Service"
+HKLM,"SYSTEM\CurrentControlSet\Control\SafeBoot\Network\PCI Configuration","",0x00000000,"Driver Group"
+HKLM,"SYSTEM\CurrentControlSet\Control\SafeBoot\Network\PlugPlay","",0x00000000,"Service"
+HKLM,"SYSTEM\CurrentControlSet\Control\SafeBoot\Network\PNP Filter","",0x00000000,"Driver Group"
+HKLM,"SYSTEM\CurrentControlSet\Control\SafeBoot\Network\PNP_TDI","",0x00000000,"Driver Group"
+HKLM,"SYSTEM\CurrentControlSet\Control\SafeBoot\Network\Primary disk","",0x00000000,"Driver Group"
+HKLM,"SYSTEM\CurrentControlSet\Control\SafeBoot\Network\rdpcdd.sys","",0x00000000,"Driver"
+HKLM,"SYSTEM\CurrentControlSet\Control\SafeBoot\Network\rdpdd.sys","",0x00000000,"Driver"
+HKLM,"SYSTEM\CurrentControlSet\Control\SafeBoot\Network\rdpwd.sys","",0x00000000,"Driver"
+HKLM,"SYSTEM\CurrentControlSet\Control\SafeBoot\Network\rdsessmgr","",0x00000000,"Service"
+HKLM,"SYSTEM\CurrentControlSet\Control\SafeBoot\Network\RpcSs","",0x00000000,"Service"
+HKLM,"SYSTEM\CurrentControlSet\Control\SafeBoot\Network\SCSI Class","",0x00000000,"Driver Group"
+HKLM,"SYSTEM\CurrentControlSet\Control\SafeBoot\Network\sermouse.sys","",0x00000000,"Driver"
+HKLM,"SYSTEM\CurrentControlSet\Control\SafeBoot\Network\SharedAccess","",0x00000000,"Service"
+HKLM,"SYSTEM\CurrentControlSet\Control\SafeBoot\Network\sr.sys","",0x00000000,"FSFilter System Recovery"
+HKLM,"SYSTEM\CurrentControlSet\Control\SafeBoot\Network\SRService","",0x00000000,"Service"
+HKLM,"SYSTEM\CurrentControlSet\Control\SafeBoot\Network\Streams Drivers","",0x00000000,"Driver Group"
+HKLM,"SYSTEM\CurrentControlSet\Control\SafeBoot\Network\System Bus Extender","",0x00000000,"Driver Group"
+HKLM,"SYSTEM\CurrentControlSet\Control\SafeBoot\Network\Tcpip","",0x00000000,"Service"
+HKLM,"SYSTEM\CurrentControlSet\Control\SafeBoot\Network\TDI","",0x00000000,"Driver Group"
+HKLM,"SYSTEM\CurrentControlSet\Control\SafeBoot\Network\tdpipe.sys","",0x00000000,"Driver"
+HKLM,"SYSTEM\CurrentControlSet\Control\SafeBoot\Network\tdtcp.sys","",0x00000000,"Driver"
+HKLM,"SYSTEM\CurrentControlSet\Control\SafeBoot\Network\termservice","",0x00000000,"Service"
+HKLM,"SYSTEM\CurrentControlSet\Control\SafeBoot\Network\vga.sys","",0x00000000,"Driver"
+HKLM,"SYSTEM\CurrentControlSet\Control\SafeBoot\Network\vgasave.sys","",0x00000000,"Driver"
+HKLM,"SYSTEM\CurrentControlSet\Control\SafeBoot\Network\WinMgmt","",0x00000000,"Service"
+HKLM,"SYSTEM\CurrentControlSet\Control\SafeBoot\Network\WZCSVC","",0x00000000,"Service"
+HKLM,"SYSTEM\CurrentControlSet\Control\SafeBoot\Network\{36FC9E60-C465-11CF-8056-444553540000}","",0x00000000,"Universal Serial Bus controllers"
+HKLM,"SYSTEM\CurrentControlSet\Control\SafeBoot\Network\{4D36E965-E325-11CE-BFC1-08002BE10318}","",0x00000000,"CD-ROM Drive"
+HKLM,"SYSTEM\CurrentControlSet\Control\SafeBoot\Network\{4D36E967-E325-11CE-BFC1-08002BE10318}","",0x00000000,"DiskDrive"
+HKLM,"SYSTEM\CurrentControlSet\Control\SafeBoot\Network\{4D36E969-E325-11CE-BFC1-08002BE10318}","",0x00000000,"Standard floppy disk controller"
+HKLM,"SYSTEM\CurrentControlSet\Control\SafeBoot\Network\{4D36E96A-E325-11CE-BFC1-08002BE10318}","",0x00000000,"Hdc"
+HKLM,"SYSTEM\CurrentControlSet\Control\SafeBoot\Network\{4D36E96B-E325-11CE-BFC1-08002BE10318}","",0x00000000,"Keyboard"
+HKLM,"SYSTEM\CurrentControlSet\Control\SafeBoot\Network\{4D36E96F-E325-11CE-BFC1-08002BE10318}","",0x00000000,"Mouse"
+HKLM,"SYSTEM\CurrentControlSet\Control\SafeBoot\Network\{4D36E972-E325-11CE-BFC1-08002BE10318}","",0x00000000,"Net"
+HKLM,"SYSTEM\CurrentControlSet\Control\SafeBoot\Network\{4D36E973-E325-11CE-BFC1-08002BE10318}","",0x00000000,"NetClient"
+HKLM,"SYSTEM\CurrentControlSet\Control\SafeBoot\Network\{4D36E974-E325-11CE-BFC1-08002BE10318}","",0x00000000,"NetService"
+HKLM,"SYSTEM\CurrentControlSet\Control\SafeBoot\Network\{4D36E975-E325-11CE-BFC1-08002BE10318}","",0x00000000,"NetTrans"
+HKLM,"SYSTEM\CurrentControlSet\Control\SafeBoot\Network\{4D36E977-E325-11CE-BFC1-08002BE10318}","",0x00000000,"PCMCIA Adapters"
+HKLM,"SYSTEM\CurrentControlSet\Control\SafeBoot\Network\{4D36E97B-E325-11CE-BFC1-08002BE10318}","",0x00000000,"SCSIAdapter"
+HKLM,"SYSTEM\CurrentControlSet\Control\SafeBoot\Network\{4D36E97D-E325-11CE-BFC1-08002BE10318}","",0x00000000,"System"
+HKLM,"SYSTEM\CurrentControlSet\Control\SafeBoot\Network\{4D36E980-E325-11CE-BFC1-08002BE10318}","",0x00000000,"Floppy disk drive"
+HKLM,"SYSTEM\CurrentControlSet\Control\SafeBoot\Network\{71A27CDD-812A-11D0-BEC7-08002BE2092F}","",0x00000000,"Volume"
+HKLM,"SYSTEM\CurrentControlSet\Control\SafeBoot\Network\{745A17A0-74D3-11D0-B6FE-00A0C90F57DA}","",0x00000000,"Human Interface Devices"
+
+; ReactOS specific - required to load in Safe Mode and for debugging in Safe Mode (until vga.sys and vgasave.sys are implemented)
+HKLM,"SYSTEM\CurrentControlSet\Control\SafeBoot\Minimal\Debug","",0x00000000,"Driver Group"
+HKLM,"SYSTEM\CurrentControlSet\Control\SafeBoot\Minimal\vgamp.sys","",0x00000000,"Driver"
+HKLM,"SYSTEM\CurrentControlSet\Control\SafeBoot\Minimal\vbemp.sys","",0x00000000,"Driver"
+
+HKLM,"SYSTEM\CurrentControlSet\Control\SafeBoot\Network\Debug","",0x00000000,"Driver Group"
+HKLM,"SYSTEM\CurrentControlSet\Control\SafeBoot\Network\vgamp.sys","",0x00000000,"Driver"
+HKLM,"SYSTEM\CurrentControlSet\Control\SafeBoot\Network\vbemp.sys","",0x00000000,"Driver"
+
+; Other
 HKLM,"SYSTEM\CurrentControlSet\Control\Arbiters",,0x00000012
 
 HKLM,"SYSTEM\CurrentControlSet\Control\Arbiters\AllocationOrder","Root",0x000a0001,\

Modified: trunk/reactos/ntoskrnl/config/cmboot.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/config/cmboot.c?rev=52132&r1=52131&r2=52132&view=diff
==============================================================================
--- trunk/reactos/ntoskrnl/config/cmboot.c [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/config/cmboot.c [iso-8859-1] Tue Jun  7 16:42:43 2011
@@ -12,7 +12,11 @@
 #include "ntoskrnl.h"
 #define NDEBUG
 #include "debug.h"
- 
+
+/* GLOBALS ********************************************************************/
+
+extern ULONG InitSafeBootMode;
+
 /* FUNCTIONS ******************************************************************/
 
 HCELL_INDEX
@@ -383,6 +387,7 @@
                IN PLIST_ENTRY DriverListHead)
 {
     HCELL_INDEX ServicesCell, ControlCell, GroupOrderCell, DriverCell;
+    HCELL_INDEX SafeBootCell = HCELL_NIL;
     UNICODE_STRING Name;
     ULONG i;
     WCHAR Buffer[128];
@@ -416,6 +421,31 @@
     GroupOrderCell = CmpFindSubKeyByName(Hive, Node, &Name);
     if (GroupOrderCell == HCELL_NIL) return FALSE;
 
+    /* Get Safe Boot cell */
+    if(InitSafeBootMode)
+    {
+        /* Open the Safe Boot key */
+        RtlInitUnicodeString(&Name, L"SafeBoot");
+        Node = HvGetCell(Hive, ControlCell);
+        ASSERT(Node);
+        SafeBootCell = CmpFindSubKeyByName(Hive, Node, &Name);
+        if (SafeBootCell == HCELL_NIL) return FALSE;
+
+        /* Open the correct start key (depending on the mode) */
+        Node = HvGetCell(Hive, SafeBootCell);
+        ASSERT(Node);
+        switch(InitSafeBootMode)
+        {
+            /* NOTE: Assumes MINIMAL (1) and DSREPAIR (3) load same items */
+            case 1:
+            case 3: RtlInitUnicodeString(&Name, L"Minimal"); break;
+            case 2: RtlInitUnicodeString(&Name, L"Network"); break;
+            default: return FALSE;
+        }
+        SafeBootCell = CmpFindSubKeyByName(Hive, Node, &Name);
+        if(SafeBootCell == HCELL_NIL) return FALSE;
+    }
+
     /* Build the root registry path */
     RtlInitEmptyUnicodeString(&KeyPath, Buffer, sizeof(Buffer));
     RtlAppendUnicodeToString(&KeyPath, L"\\Registry\\Machine\\System\\CurrentControlSet\\Services\\");
@@ -425,8 +455,9 @@
     DriverCell = CmpFindSubKeyByNumber(Hive, ServicesNode, i);
     while (DriverCell != HCELL_NIL)
     {
-        /* Make sure it's a driver of this start type */
-        if (CmpIsLoadType(Hive, DriverCell, LoadType))
+        /* Make sure it's a driver of this start type AND is "safe" to load */
+        if (CmpIsLoadType(Hive, DriverCell, LoadType) &&
+            CmpIsSafe(Hive, SafeBootCell, DriverCell))
         {
             /* Add it to the list */
             CmpAddDriverToList(Hive,
@@ -687,4 +718,106 @@
     return TRUE;
 }
 
+BOOLEAN
+NTAPI
+INIT_FUNCTION
+CmpIsSafe(IN PHHIVE Hive,
+          IN HCELL_INDEX SafeBootCell,
+          IN HCELL_INDEX DriverCell)
+{
+    PCM_KEY_NODE SafeBootNode;
+    PCM_KEY_NODE DriverNode;
+    PCM_KEY_VALUE KeyValue;
+    HCELL_INDEX CellIndex;
+    ULONG Length = 0;
+    UNICODE_STRING Name;
+    PWCHAR OriginalName;
+    ASSERT(Hive->ReleaseCellRoutine == NULL);
+
+    /* Driver key node (mandatory) */
+    ASSERT(DriverCell != HCELL_NIL);
+    DriverNode = HvGetCell(Hive, DriverCell);
+    ASSERT(DriverNode);
+
+    /* Safe boot key node (optional but return TRUE if not present) */
+    if(SafeBootCell == HCELL_NIL) return TRUE;
+    SafeBootNode = HvGetCell(Hive, SafeBootCell);
+    if(!SafeBootNode) return FALSE;
+
+    /* Search by the name from the group */
+    RtlInitUnicodeString(&Name, L"Group");
+    CellIndex = CmpFindValueByName(Hive, DriverNode, &Name);
+    if(CellIndex != HCELL_NIL)
+    {
+        KeyValue = HvGetCell(Hive, CellIndex);
+        ASSERT(KeyValue);
+        if (KeyValue->Type == REG_SZ || KeyValue->Type == REG_EXPAND_SZ)
+        {
+            /* Compose the search 'key' */
+            Name.Buffer = (PWCHAR)CmpValueToData(Hive, KeyValue, &Length);
+            if (!Name.Buffer) return FALSE;
+            Name.Length = Length - sizeof(UNICODE_NULL);
+            Name.MaximumLength = Name.Length;
+            /* Search for corresponding key in the Safe Boot key */
+            CellIndex = CmpFindSubKeyByName(Hive, SafeBootNode, &Name);
+            if(CellIndex != HCELL_NIL) return TRUE;
+        }
+    }
+
+    /* Group has not been found - find driver name */
+    Name.Length = DriverNode->Flags & KEY_COMP_NAME ?
+                              CmpCompressedNameSize(DriverNode->Name,
+                                                    DriverNode->NameLength) :
+                              DriverNode->NameLength;
+    Name.MaximumLength = Name.Length;
+    /* Now allocate the buffer for it and copy the name */
+    Name.Buffer = CmpAllocate(Name.Length, FALSE, TAG_CM);
+    if (!Name.Buffer) return FALSE;
+    if (DriverNode->Flags & KEY_COMP_NAME)
+    {
+        /* Compressed name */
+        CmpCopyCompressedName(Name.Buffer,
+                              Name.Length,
+                              DriverNode->Name,
+                              DriverNode->NameLength);
+    }
+    else
+    {
+        /* Normal name */
+        RtlCopyMemory(Name.Buffer, DriverNode->Name, DriverNode->NameLength);
+    }
+    CellIndex = CmpFindSubKeyByName(Hive, SafeBootNode, &Name);
+    RtlFreeUnicodeString(&Name);
+    if(CellIndex != HCELL_NIL) return TRUE;
+
+    /* Not group or driver name - search by image name */
+    RtlInitUnicodeString(&Name, L"ImagePath");
+    CellIndex = CmpFindValueByName(Hive, DriverNode, &Name);
+    if(CellIndex != HCELL_NIL)
+    {
+        KeyValue = HvGetCell(Hive, CellIndex);
+        ASSERT(KeyValue);
+        if (KeyValue->Type == REG_SZ || KeyValue->Type == REG_EXPAND_SZ)
+        {
+            /* Compose the search 'key' */
+            OriginalName = (PWCHAR)CmpValueToData(Hive, KeyValue, &Length);
+            if (!OriginalName) return FALSE;
+            /* Get the base image file name */
+            Name.Buffer = wcsrchr(OriginalName, L'\\');
+            if (!Name.Buffer) return FALSE;
+            ++Name.Buffer;
+            /* Length of the base name must be >=1 */
+            Name.Length = Length - ((PUCHAR)Name.Buffer - (PUCHAR)OriginalName)
+                                 - sizeof(UNICODE_NULL);
+            if(Name.Length < 1) return FALSE;
+            Name.MaximumLength = Name.Length;
+            /* Search for corresponding key in the Safe Boot key */
+            CellIndex = CmpFindSubKeyByName(Hive, SafeBootNode, &Name);
+            if(CellIndex != HCELL_NIL) return TRUE;
+        }
+    }
+    /* Nothing found - nothing else to search */
+    return FALSE;
+}
+
 /* EOF */

Modified: trunk/reactos/ntoskrnl/ex/init.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/ex/init.c?rev=52132&r1=52131&r2=52132&view=diff
==============================================================================
--- trunk/reactos/ntoskrnl/ex/init.c [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/ex/init.c [iso-8859-1] Tue Jun  7 16:42:43 2011
@@ -1792,7 +1792,10 @@
                                          &KeyPartialInfo,
                                          sizeof(KeyPartialInfo),
                                          &Length);
-                if (!NT_SUCCESS(Status)) AlternateShell = FALSE;
+                if (!(NT_SUCCESS(Status) || Status == STATUS_BUFFER_OVERFLOW))
+                {
+                    AlternateShell = FALSE;
+                }
             }
 
             /* Create the option key */

Modified: trunk/reactos/ntoskrnl/include/internal/cm.h
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/include/internal/cm.h?rev=52132&r1=52131&r2=52132&view=diff
==============================================================================
--- trunk/reactos/ntoskrnl/include/internal/cm.h [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/include/internal/cm.h [iso-8859-1] Tue Jun  7 16:42:43 2011
@@ -1568,6 +1568,13 @@
 CmpResolveDriverDependencies(
     IN PLIST_ENTRY DriverListHead
 );
+
+BOOLEAN
+NTAPI
+CmpIsSafe(
+    IN PHHIVE Hive,
+    IN HCELL_INDEX SafeBootCell,
+    IN HCELL_INDEX DriverCell);
 
 //
 // Global variables accessible from all of Cm

Modified: trunk/reactos/subsystems/win32/win32k/ntuser/desktop.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/ntuser/desktop.c?rev=52132&r1=52131&r2=52132&view=diff
==============================================================================
--- trunk/reactos/subsystems/win32/win32k/ntuser/desktop.c [iso-8859-1] (original)
+++ trunk/reactos/subsystems/win32/win32k/ntuser/desktop.c [iso-8859-1] Tue Jun  7 16:42:43 2011
@@ -1346,6 +1346,7 @@
    HWND hWndDesktop;
    BOOL doPatBlt = TRUE;
    PWND WndDesktop;
+    static WCHAR s_wszSafeMode[] = L"Safe Mode";
    int len;
    COLORREF color_old;
    UINT align_old;
@@ -1367,133 +1368,132 @@
       RETURN(FALSE);
    }
 
-   DesktopBrush = (HBRUSH)WndDesktop->pcls->hbrBackground;
-
-
-   /*
-    * Paint desktop background
-    */
-
-   if (WinSta->hbmWallpaper != NULL)
-   {
-      PWND DeskWin;
-
-      DeskWin = UserGetWindowObject(hWndDesktop);
-
-      if (DeskWin)
-      {
-         SIZE sz;
-         int x, y;
-         HDC hWallpaperDC;
-
-         sz.cx = DeskWin->rcWindow.right - DeskWin->rcWindow.left;
-         sz.cy = DeskWin->rcWindow.bottom - DeskWin->rcWindow.top;
-
-         if (WinSta->WallpaperMode == wmStretch ||
-             WinSta->WallpaperMode == wmTile)
-         {
-            x = 0;
-            y = 0;
-         }
-         else
-         {
-            /* Find the upper left corner, can be negtive if the bitmap is bigger then the screen */
-            x = (sz.cx / 2) - (WinSta->cxWallpaper / 2);
-            y = (sz.cy / 2) - (WinSta->cyWallpaper / 2);
-         }
-
-         hWallpaperDC = NtGdiCreateCompatibleDC(hDC);
-         if(hWallpaperDC != NULL)
-         {
-            HBITMAP hOldBitmap;
-
-            /* fill in the area that the bitmap is not going to cover */
-            if (x > 0 || y > 0)
+    if (!UserGetSystemMetrics(SM_CLEANBOOT))
+    {
+        DesktopBrush = (HBRUSH)WndDesktop->pcls->hbrBackground;
+
+        /*
+        * Paint desktop background
+        */
+        if (WinSta->hbmWallpaper != NULL)
+        {
+            SIZE sz;
+            int x, y;
+            HDC hWallpaperDC;
+
+            sz.cx = WndDesktop->rcWindow.right - WndDesktop->rcWindow.left;
+            sz.cy = WndDesktop->rcWindow.bottom - WndDesktop->rcWindow.top;
+
+            if (WinSta->WallpaperMode == wmStretch ||
+                WinSta->WallpaperMode == wmTile)
             {
-               /* FIXME - clip out the bitmap
-                                            can be replaced with "NtGdiPatBlt(hDC, x, y, WinSta->cxWallpaper, WinSta->cyWallpaper, PATCOPY | DSTINVERT);"
-                                            once we support DSTINVERT */
-              PreviousBrush = NtGdiSelectBrush(hDC, DesktopBrush);
-              NtGdiPatBlt(hDC, Rect.left, Rect.top, Rect.right, Rect.bottom, PATCOPY);
-              NtGdiSelectBrush(hDC, PreviousBrush);
+                x = 0;
+                y = 0;
             }
-
-            /*Do not fill the background after it is painted no matter the size of the picture */
-            doPatBlt = FALSE;
-
-            hOldBitmap = NtGdiSelectBitmap(hWallpaperDC, WinSta->hbmWallpaper);
-
-            if (WinSta->WallpaperMode == wmStretch)
+            else
             {
-                if(Rect.right && Rect.bottom)
-	                NtGdiStretchBlt(hDC,
+                /* Find the upper left corner, can be negtive if the bitmap is bigger then the screen */
+                x = (sz.cx / 2) - (WinSta->cxWallpaper / 2);
+                y = (sz.cy / 2) - (WinSta->cyWallpaper / 2);
+            }
+
+            hWallpaperDC = NtGdiCreateCompatibleDC(hDC);
+            if(hWallpaperDC != NULL)
+            {
+                HBITMAP hOldBitmap;
+
+                /* fill in the area that the bitmap is not going to cover */
+                if (x > 0 || y > 0)
+                {
+                   /* FIXME - clip out the bitmap
+                                                can be replaced with "NtGdiPatBlt(hDC, x, y, WinSta->cxWallpaper, WinSta->cyWallpaper, PATCOPY | DSTINVERT);"
+                                                once we support DSTINVERT */
+                  PreviousBrush = NtGdiSelectBrush(hDC, DesktopBrush);
+                  NtGdiPatBlt(hDC, Rect.left, Rect.top, Rect.right, Rect.bottom, PATCOPY);
+                  NtGdiSelectBrush(hDC, PreviousBrush);
+                }
+
+                /*Do not fill the background after it is painted no matter the size of the picture */
+                doPatBlt = FALSE;
+
+                hOldBitmap = NtGdiSelectBitmap(hWallpaperDC, WinSta->hbmWallpaper);
+
+                if (WinSta->WallpaperMode == wmStretch)
+                {
+                    if(Rect.right && Rect.bottom)
+                        NtGdiStretchBlt(hDC,
+                                    x,
+                                    y,
+                                    sz.cx,
+                                    sz.cy,
+                                    hWallpaperDC,
+                                    0,
+                                    0,
+                                    WinSta->cxWallpaper,
+                                    WinSta->cyWallpaper,
+                                    SRCCOPY,
+                                    0);
+
+                }
+                else if (WinSta->WallpaperMode == wmTile)
+                {
+                    /* paint the bitmap across the screen then down */
+                    for(y = 0; y < Rect.bottom; y += WinSta->cyWallpaper)
+                    {
+                        for(x = 0; x < Rect.right; x += WinSta->cxWallpaper)
+                        {
+                            NtGdiBitBlt(hDC,
+                                        x,
+                                        y,
+                                        WinSta->cxWallpaper,
+                                        WinSta->cyWallpaper,
+                                        hWallpaperDC,
+                                        0,
+                                        0,
+                                        SRCCOPY,
+                                        0,
+                                        0);
+                        }
+                    }
+                }
+                else
+                {
+                    NtGdiBitBlt(hDC,
                                 x,
                                 y,
-                                sz.cx,
-                                sz.cy,
+                                WinSta->cxWallpaper,
+                                WinSta->cyWallpaper,
                                 hWallpaperDC,
                                 0,
                                 0,
-                                WinSta->cxWallpaper,
-                                WinSta->cyWallpaper,
                                 SRCCOPY,
+                                0,
                                 0);
-
+                }
+                NtGdiSelectBitmap(hWallpaperDC, hOldBitmap);
+                NtGdiDeleteObjectApp(hWallpaperDC);
             }
-            else if (WinSta->WallpaperMode == wmTile)
-            {
-                /* paint the bitmap across the screen then down */
-                for(y = 0; y < Rect.bottom; y += WinSta->cyWallpaper)
-                {
-                    for(x = 0; x < Rect.right; x += WinSta->cxWallpaper)
-                    {
-                        NtGdiBitBlt(hDC,
-                                    x,
-                                    y,
-                                    WinSta->cxWallpaper,
-                                    WinSta->cyWallpaper,
-                                    hWallpaperDC,
-                                    0,
-                                    0,
-                                    SRCCOPY,
-                                    0,
-                                    0);
-                    }
-                }
-            }
-            else
-            {
-                NtGdiBitBlt(hDC,
-                            x,
-                            y,
-                            WinSta->cxWallpaper,
-                            WinSta->cyWallpaper,
-                            hWallpaperDC,
-                            0,
-                            0,
-                            SRCCOPY,
-                            0,
-                            0);
-            }
-            NtGdiSelectBitmap(hWallpaperDC, hOldBitmap);
-            NtGdiDeleteObjectApp(hWallpaperDC);
-         }
-      }
-   }
-
-   /* Back ground is set to none, clear the screen */
-   if (doPatBlt)
-   {
+        }
+    }
+    else
+    {
+        /* Black desktop background in Safe Mode */
+        DesktopBrush = StockObjects[BLACK_BRUSH];
+    }
+
+    /* Back ground is set to none, clear the screen */
+    if (doPatBlt)
+    {
       PreviousBrush = NtGdiSelectBrush(hDC, DesktopBrush);
       NtGdiPatBlt(hDC, Rect.left, Rect.top, Rect.right, Rect.bottom, PATCOPY);
       NtGdiSelectBrush(hDC, PreviousBrush);
-   }
+    }
 
    /*
     * Display system version on the desktop background
     */
 
-   if (g_PaintDesktopVersion)
+   if (g_PaintDesktopVersion||UserGetSystemMetrics(SM_CLEANBOOT))
    {
       static WCHAR s_wszVersion[256] = {0};
       RECTL rect;
@@ -1519,7 +1519,29 @@
          align_old = IntGdiSetTextAlign(hDC, TA_RIGHT);
          mode_old = IntGdiSetBkMode(hDC, TRANSPARENT);
 
-         GreExtTextOutW(hDC, rect.right-16, rect.bottom-48, 0, NULL, s_wszVersion, len, NULL, 0);
+            if(!UserGetSystemMetrics(SM_CLEANBOOT))
+            {
+                GreExtTextOutW(hDC, rect.right-16, rect.bottom-48, 0, NULL, s_wszVersion, len, NULL, 0);
+            }
+            else
+            {
+                /* Safe Mode */
+                /* Version information text in top center */
+                IntGdiSetTextAlign(hDC, TA_CENTER|TA_TOP);
+                GreExtTextOutW(hDC, (rect.right+rect.left)/2, rect.top, 0, NULL, s_wszVersion, len, NULL, 0);
+                /* Safe Mode text in corners */
+                len = wcslen(s_wszSafeMode);
+                IntGdiSetTextAlign(hDC, TA_RIGHT|TA_TOP);
+                GreExtTextOutW(hDC, rect.right, rect.top, 0, NULL, s_wszSafeMode, len, NULL, 0);
+                IntGdiSetTextAlign(hDC, TA_RIGHT|TA_BASELINE);
+                GreExtTextOutW(hDC, rect.right, rect.bottom, 0, NULL, s_wszSafeMode, len, NULL, 0);
+                IntGdiSetTextAlign(hDC, TA_LEFT|TA_TOP);
+                GreExtTextOutW(hDC, rect.left, rect.top, 0, NULL, s_wszSafeMode, len, NULL, 0);
+                IntGdiSetTextAlign(hDC, TA_LEFT|TA_BASELINE);
+                GreExtTextOutW(hDC, rect.left, rect.bottom, 0, NULL, s_wszSafeMode, len, NULL, 0);
+
+            }
+
 
          IntGdiSetBkMode(hDC, mode_old);
          IntGdiSetTextAlign(hDC, align_old);

Modified: trunk/reactos/subsystems/win32/win32k/ntuser/metric.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/ntuser/metric.c?rev=52132&r1=52131&r2=52132&view=diff
==============================================================================
--- trunk/reactos/subsystems/win32/win32k/ntuser/metric.c [iso-8859-1] (original)
+++ trunk/reactos/subsystems/win32/win32k/ntuser/metric.c [iso-8859-1] Tue Jun  7 16:42:43 2011
@@ -23,8 +23,20 @@
 FASTCALL
 InitMetrics(VOID)
 {
-    INT *piSysMet;
+    INT *piSysMet = gpsi->aiSysMet;
     ULONG Width, Height;
+
+    /* note: used for the SM_CLEANBOOT metric */
+    DWORD dwValue = 0;
+    HKEY hKey = 0;
+
+    /* Clean boot */
+    piSysMet[SM_CLEANBOOT] = 0; // fallback value of 0 (normal mode)
+    if(NT_SUCCESS(RegOpenKey(L"\\REGISTRY\\MACHINE\\SYSTEM\\CurrentControlSet\\Control\\SafeBoot\\Option", &hKey)))
+    {
+        if(RegReadDWORD(hKey, L"OptionValue", &dwValue)) piSysMet[SM_CLEANBOOT] = (INT)dwValue;
+        ZwClose(hKey);
+    }
 
     /* FIXME: HACK, due to missing PDEV on first init */
     if (!pPrimarySurface)
@@ -37,8 +49,6 @@
         Width = pPrimarySurface->gdiinfo.ulHorzRes;
         Height = pPrimarySurface->gdiinfo.ulVertRes;
     }
-
-    piSysMet = gpsi->aiSysMet;
 
     /* Screen sizes */
     piSysMet[SM_CXSCREEN] = Width;
@@ -146,7 +156,6 @@
     piSysMet[SM_SLOWMACHINE] = 0;
     piSysMet[SM_SECURE] = 0;
     piSysMet[SM_DBCSENABLED] = 0;
-    piSysMet[SM_CLEANBOOT] = 0;
     piSysMet[SM_SHOWSOUNDS] = gspv.bShowSounds;
     piSysMet[SM_MIDEASTENABLED] = 0;
     piSysMet[SM_CMONITORS] = 1;

Modified: trunk/reactos/subsystems/win32/win32k/objects/freetype.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/objects/freetype.c?rev=52132&r1=52131&r2=52132&view=diff
==============================================================================
--- trunk/reactos/subsystems/win32/win32k/objects/freetype.c [iso-8859-1] (original)
+++ trunk/reactos/subsystems/win32/win32k/objects/freetype.c [iso-8859-1] Tue Jun  7 16:42:43 2011
@@ -2165,8 +2165,8 @@
     error = FT_Set_Pixel_Sizes(face,
                                TextObj->logfont.elfEnumLogfontEx.elfLogFont.lfWidth,
                                /* FIXME should set character height if neg */
-                               (TextObj->logfont.elfEnumLogfontEx.elfLogFont.lfHeight == 0 ? 
-							   dc->ppdev->devinfo.lfDefaultFont.lfHeight : abs(TextObj->logfont.elfEnumLogfontEx.elfLogFont.lfHeight)));							   
+                               (TextObj->logfont.elfEnumLogfontEx.elfLogFont.lfHeight == 0 ?
+							   dc->ppdev->devinfo.lfDefaultFont.lfHeight : abs(TextObj->logfont.elfEnumLogfontEx.elfLogFont.lfHeight)));
     if (error)
     {
         DPRINT1("Error in setting pixel sizes: %u\n", error);
@@ -3394,13 +3394,13 @@
 
         previous = 0;
 
-        if (pdcattr->lTextAlign & TA_RIGHT)
+        if ((pdcattr->lTextAlign & TA_CENTER) == TA_CENTER)
+        {
+            RealXStart -= TextWidth / 2;
+        }
+        else
         {
             RealXStart -= TextWidth;
-        }
-        else
-        {
-            RealXStart -= TextWidth / 2;
         }
     }
 




More information about the Ros-diffs mailing list