mirror of
https://github.com/reactos/reactos.git
synced 2024-10-02 15:34:13 +00:00
Allow to choose between 800x600x16 and 640x480x8 as default resolution in first stage installer.
svn path=/trunk/; revision=20313
This commit is contained in:
parent
d40178810d
commit
a2603641ae
|
@ -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>
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue