From f3f4cc0f25e201c3ec220c6ce3d5a401717e8e78 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Herv=C3=A9=20Poussineau?= Date: Sun, 20 Mar 2022 18:05:36 +0100 Subject: [PATCH] [WIN32SS] Implement EngQueryDeviceAttribute --- win32ss/gdi/eng/pdevobj.c | 27 +++++++++++++++++++++++++++ win32ss/gdi/eng/stubs.c | 28 ---------------------------- 2 files changed, 27 insertions(+), 28 deletions(-) diff --git a/win32ss/gdi/eng/pdevobj.c b/win32ss/gdi/eng/pdevobj.c index 689e8653f97..f39afd18530 100644 --- a/win32ss/gdi/eng/pdevobj.c +++ b/win32ss/gdi/eng/pdevobj.c @@ -989,6 +989,33 @@ PDEVOBJ_vGetDeviceCaps( /** Exported functions ********************************************************/ +/* + * @implemented + */ +BOOL +APIENTRY +EngQueryDeviceAttribute( + _In_ HDEV hdev, + _In_ ENG_DEVICE_ATTRIBUTE devAttr, + _In_reads_bytes_(cjInSize) PVOID pvIn, + _In_ ULONG cjInSize, + _Out_writes_bytes_(cjOutSize) PVOID pvOut, + _In_ ULONG cjOutSize) +{ + PPDEVOBJ ppdev = (PPDEVOBJ)hdev; + + if (devAttr != QDA_ACCELERATION_LEVEL) + return FALSE; + + if (cjOutSize >= sizeof(DWORD)) + { + *(DWORD*)pvOut = ppdev->dwAccelerationLevel; + return TRUE; + } + + return FALSE; +} + _Must_inspect_result_ _Ret_z_ LPWSTR APIENTRY diff --git a/win32ss/gdi/eng/stubs.c b/win32ss/gdi/eng/stubs.c index 5cc878e0d80..e1b14af0448 100644 --- a/win32ss/gdi/eng/stubs.c +++ b/win32ss/gdi/eng/stubs.c @@ -577,34 +577,6 @@ EngPlgBlt( return FALSE; } -/* - * @unimplemented - */ -BOOL -APIENTRY -EngQueryDeviceAttribute( - _In_ HDEV hdev, - _In_ ENG_DEVICE_ATTRIBUTE devAttr, - _In_reads_bytes_(cjInSize) PVOID pvIn, - _In_ ULONG cjInSize, - _Out_writes_bytes_(cjOutSize) PVOID pvOut, - _In_ ULONG cjOutSize) -{ - if (devAttr != QDA_ACCELERATION_LEVEL) - return FALSE; - - UNIMPLEMENTED; - - if (cjOutSize >= sizeof(DWORD)) - { - /* Set all accelerations to enabled */ - *(DWORD*)pvOut = 0; - return TRUE; - } - - return FALSE; -} - /* * @unimplemented */