mirror of
https://github.com/reactos/reactos.git
synced 2025-02-22 08:25:03 +00:00
[WIN32K:ENG] Pass correct display name to EngpFindGraphicsDevice (#4128)
It actually should look like '\\.\DISPLAY<n>' (since it comes from user mode),
which the function expects, and not '\\Device\\Video<n>', like done in the
kernel mode. Otherwise, passing wrong name causes a mismatch.
Fix the problem with video device access (failure with status 0xc0000022 when
trying to open it). Hence, it also fixes the following debug log spam:
'err: Could not open device \Device\Video0, 0xc0000022'.
Addendum to 77e891b8
. CORE-17719 CORE-17786
This commit is contained in:
parent
67ad4e7f60
commit
c05a45e17e
1 changed files with 5 additions and 2 deletions
|
@ -36,7 +36,7 @@ NTSTATUS
|
|||
EngpUpdateGraphicsDeviceList(VOID)
|
||||
{
|
||||
ULONG iDevNum, iVGACompatible = -1, ulMaxObjectNumber = 0;
|
||||
WCHAR awcDeviceName[20];
|
||||
WCHAR awcDeviceName[20], awcWinDeviceName[20];
|
||||
UNICODE_STRING ustrDeviceName;
|
||||
WCHAR awcBuffer[256];
|
||||
NTSTATUS Status;
|
||||
|
@ -74,7 +74,10 @@ EngpUpdateGraphicsDeviceList(VOID)
|
|||
{
|
||||
/* Create the adapter's key name */
|
||||
swprintf(awcDeviceName, L"\\Device\\Video%lu", iDevNum);
|
||||
RtlInitUnicodeString(&ustrDeviceName, awcDeviceName);
|
||||
|
||||
/* Create the display device name */
|
||||
swprintf(awcWinDeviceName, L"\\\\.\\DISPLAY%lu", iDevNum + 1);
|
||||
RtlInitUnicodeString(&ustrDeviceName, awcWinDeviceName);
|
||||
|
||||
/* Check if the device exists already */
|
||||
pGraphicsDevice = EngpFindGraphicsDevice(&ustrDeviceName, iDevNum, 0);
|
||||
|
|
Loading…
Reference in a new issue