Disabling or detecting the use of Desktop Duplication API

HFU-8017 0 Reputation points
2025-01-15T12:21:37.38+00:00

We provide software that locks down devices in order to ensure the user remains within our application, and that they don't have access to any outside resources. One class of software that we block is remote desktop clients. We block this through several means, including blocking specific remote desktop applications, as well as using CreateDesktopW to create a private desktop for our application to operate within.

However, remote desktop applications that use the Desktop Duplication API (https://learn.microsoft.com/en-us/windows/win32/direct3ddxgi/desktop-dup-api) in order to access the screen seem to still be able to operate. Is there any way to disable this API, or to detect when it is being used?

We have already considered the following, but not found a viable path yet:

  • Group Policy Settings: There are Group Policy settings relevant to remote access, but nothing specific to the Desktop Duplication API. Even after updating the Group Policy settings, we are still able to remotely access the device through e.g. Sunshine remote desktop
  • Windows Security Auditing: Windows Security Auditing doesn’t provide a way to list processes attempting to use the Desktop Duplication API. While processes attempting to access dxgi.dll can be detected, there are many legitimate uses of this DLL, which would lead to false positives.
  • Kernel-Level Hooks (Advanced and Risky): We consider this a last resort.
Windows API - Win32
Windows API - Win32
A core set of Windows application programming interfaces (APIs) for desktop and server applications. Previously known as Win32 API.
2,723 questions
{count} votes

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.