[WIN32SS:ENG] Fix handling of Acceleration.Level parameter (was not read anymore)

This commit is contained in:
Hervé Poussineau 2022-06-05 14:49:47 +02:00
parent dd2c7ea3ce
commit cd8305494c
4 changed files with 44 additions and 14 deletions

View file

@ -167,21 +167,12 @@ EngpGetRegistryHandleFromDeviceMap(
NTSTATUS
EngpGetDisplayDriverParameters(
_In_ PGRAPHICS_DEVICE pGraphicsDevice,
_Out_ PDEVMODEW pdm,
_Out_opt_ PDWORD pdwAccelerationLevel)
_Out_ PDEVMODEW pdm)
{
HKEY hKey;
DWORD dwDummy;
NTSTATUS Status;
RTL_QUERY_REGISTRY_TABLE DisplaySettingsTable[] =
{
{
NULL,
RTL_QUERY_REGISTRY_DIRECT,
L"Acceleration.Level",
pdwAccelerationLevel ? pdwAccelerationLevel : &dwDummy,
REG_NONE, NULL, 0
},
#define READ(field, str) \
{ \
NULL, \
@ -219,6 +210,38 @@ EngpGetDisplayDriverParameters(
return Status;
}
DWORD
EngpGetDisplayDriverAccelerationLevel(
_In_ PGRAPHICS_DEVICE pGraphicsDevice)
{
HKEY hKey;
DWORD dwAccelerationLevel = 0;
RTL_QUERY_REGISTRY_TABLE DisplaySettingsTable[] =
{
{
NULL,
RTL_QUERY_REGISTRY_DIRECT,
L"Acceleration.Level",
&dwAccelerationLevel,
REG_NONE, NULL, 0
},
{0}
};
hKey = EngpGetRegistryHandleFromDeviceMap(pGraphicsDevice);
if (!hKey)
return 0;
RtlQueryRegistryValues(RTL_REGISTRY_HANDLE,
(PWSTR)hKey,
DisplaySettingsTable,
NULL,
NULL);
ZwClose(hKey);
return dwAccelerationLevel;
}
extern VOID
UserRefreshDisplay(IN PPDEVOBJ ppdev);

View file

@ -38,15 +38,20 @@ EngpUpdateGraphicsDeviceList(VOID);
/* Read configuration of a graphics card from registry:
* - pGraphicsDevice: instance of the graphics card
* - pdm: on output, contains the values read in registry
* - pdwAccelerationLevel: acceleration level stored in registry
* Return value: a STATUS_* value
* Assume that pdm has already been zero-filled.
* Note that dmFields is not updated. */
NTSTATUS
EngpGetDisplayDriverParameters(
_In_ PGRAPHICS_DEVICE pGraphicsDevice,
_Out_ PDEVMODEW pdm,
_Out_opt_ PDWORD pdwAccelerationLevel);
_Out_ PDEVMODEW pdm);
/* Read acceleration level of a graphics card from registry
* - pGraphicsDevice: instance of the graphics card
* - Return value: acceleration level stored in registry */
DWORD
EngpGetDisplayDriverAccelerationLevel(
_In_ PGRAPHICS_DEVICE pGraphicsDevice);
CODE_SEG("INIT")
NTSTATUS

View file

@ -750,7 +750,7 @@ LDEVOBJ_bProbeAndCaptureDevmode(
/* At first, load information from registry */
RtlZeroMemory(&dmSearch, sizeof(dmSearch));
Status = EngpGetDisplayDriverParameters(pGraphicsDevice, &dmSearch, NULL);
Status = EngpGetDisplayDriverParameters(pGraphicsDevice, &dmSearch);
if (!NT_SUCCESS(Status))
{
ERR("EngpGetDisplayDriverParameters() failed with status 0x%08x\n", Status);

View file

@ -105,6 +105,8 @@ MDEVOBJ_Create(
dmDefault.dmSize = sizeof(dmDefault);
}
dwAccelerationLevel = EngpGetDisplayDriverAccelerationLevel(pGraphicsDevice);
/* Get or create a PDEV for these settings */
if (LDEVOBJ_bProbeAndCaptureDevmode(pGraphicsDevice, pdm ? pdm : &dmDefault, &localPdm, !pdm))
{