Allow to choose between 800x600x16 and 640x480x8 as default resolution in first stage installer.

svn path=/trunk/; revision=20313
This commit is contained in:
Maarten Bosma 2005-12-23 18:03:12 +00:00
parent d40178810d
commit a2603641ae
2 changed files with 69 additions and 4 deletions

View file

@ -66,9 +66,10 @@ hal.dll = 2
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>

View file

@ -521,12 +521,14 @@ ProcessDisplayRegistry(HINF InfFile, PGENERIC_LIST List)
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 @@ ProcessDisplayRegistry(HINF InfFile, PGENERIC_LIST List)
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;