Allow to choose between 800x600x16 and 640x480x8 as default resolution
in first stage installer.
Modified: trunk/reactos/bootdata/txtsetup.sif
Modified: trunk/reactos/subsys/system/usetup/settings.c
_____
Modified: trunk/reactos/bootdata/txtsetup.sif
--- trunk/reactos/bootdata/txtsetup.sif 2005-12-23 17:46:17 UTC (rev
20312)
+++ trunk/reactos/bootdata/txtsetup.sif 2005-12-23 18:03:12 UTC (rev
20313)
@@ -66,9 +66,10 @@
halmp.dll = 2,hal.dll
[Display]
-;<id> = <user friendly name>,<spare>,<service key name>
-vga = "VGA Display",,Vga
-vbe = "VESA Display",,VBE
+;<id> = <user friendly name>,<spare>,<service key
name>,<hight>,<width>,<bpp>
+vga = "VGA Display (640x680x8)",,Vga,640,480,8
+vbe_lowres = "VESA Display (640x680x8)",,VBE,640,480,8
+vbe = "VESA Display (800x600x16)",,VBE,800,600,16
[Map.Display]
;<id> = <pnp id string>
_____
Modified: trunk/reactos/subsys/system/usetup/settings.c
--- trunk/reactos/subsys/system/usetup/settings.c 2005-12-23
17:46:17 UTC (rev 20312)
+++ trunk/reactos/subsys/system/usetup/settings.c 2005-12-23
18:03:12 UTC (rev 20313)
@@ -521,12 +521,14 @@
return FALSE;
}
+ /* Enable the right driver */
if (!InfGetDataField(Context, 3, &ServiceName))
{
DPRINT("InfGetDataField() failed\n");
return FALSE;
}
+ ASSERT(wcslen(ServiceName) < 10);
DPRINT("Service name: %S\n", ServiceName);
StartValue = 1;
@@ -536,13 +538,75 @@
REG_DWORD,
&StartValue,
sizeof(ULONG));
- InfFreeContext(Context);
+
if (!NT_SUCCESS(Status))
{
DPRINT("RtlWriteRegistryValue() failed (Status %lx)\n", Status);
return FALSE;
}
+ /* Set the resolution */
+ WCHAR RegPath [255];
+ swprintf(RegPath,
L"\\Registry\\Machine\\System\\CurrentControlSet\\Hardware
Profiles\\Current\\System\\CurrentControlSet\\Services\\%s\\Device0",
ServiceName);
+
+ PWCHAR Buffer;
+ if (!InfGetDataField(Context, 4, &Buffer))
+ {
+ DPRINT("InfGetDataField() failed\n");
+ return FALSE;
+ }
+ ULONG Width = wcstoul(Buffer, NULL, 10);
+ Status = RtlWriteRegistryValue(RTL_REGISTRY_ABSOLUTE,
+ RegPath,
+ L"DefaultSettings.XResolution",
+ REG_DWORD,
+ &Width,
+ sizeof(ULONG));
+ if (!NT_SUCCESS(Status))
+ {
+ DPRINT("RtlWriteRegistryValue() failed (Status %lx)\n", Status);
+ return FALSE;
+ }
+
+
+ if (!InfGetDataField(Context, 5, &Buffer))
+ {
+ DPRINT("InfGetDataField() failed\n");
+ return FALSE;
+ }
+ ULONG Hight = wcstoul(Buffer, 0, 0);
+ Status = RtlWriteRegistryValue(RTL_REGISTRY_ABSOLUTE,
+ RegPath,
+ L"DefaultSettings.YResolution",
+ REG_DWORD,
+ &Hight,
+ sizeof(ULONG));
+ if (!NT_SUCCESS(Status))
+ {
+ DPRINT("RtlWriteRegistryValue() failed (Status %lx)\n", Status);
+ return FALSE;
+ }
+
+ if (!InfGetDataField(Context, 6, &Buffer))
+ {
+ DPRINT("InfGetDataField() failed\n");
+ return FALSE;
+ }
+ ULONG Bpp = wcstoul(Buffer, 0, 0);
+ Status = RtlWriteRegistryValue(RTL_REGISTRY_ABSOLUTE,
+ RegPath,
+ L"DefaultSettings.BitsPerPel",
+ REG_DWORD,
+ &Bpp,
+ sizeof(ULONG));
+ if (!NT_SUCCESS(Status))
+ {
+ DPRINT("RtlWriteRegistryValue() failed (Status %lx)\n", Status);
+ return FALSE;
+ }
+
+ InfFreeContext(Context);
+
DPRINT("ProcessDisplayRegistry() done\n");
return TRUE;