Warstone
Contributor
Contributor

Dwm related APIs dosn't working on guest win10 (host win10) / Faster screenshot on guest

HI,

I'm trying to create fast windowshot under VMWare. Guest is Windows 10 x64, Host is Windows 10 x64. VMWare tools are installed.

1) I can use PrintWindow from user32. It runs about 50ms per frame on test dx app.

2) On host I can use undocumented DwmGetDxSharedSurface from user32. It runs about 5ms per frame on test dx app but only on host. It returns "Invalid function" on guest.

3) There is Dwm(p)DxGetWindowSharedSurface API from dwmapi.dll with DWM_REDIRECTION_FLAG_SUPPORT_PRESENT_TO_GDI_SURFACE ( from DwmDxGetWindowSharedSurface function - Win32 apps | Microsoft Docs  ) this is also works on host but returns "DWM_S_GDI_REDIRECTION_SURFACE_BLT_VIA_GDI GDI redirection surface is either on a different adapter or in system memory. Perform blt via GDI" on guest.

So the only working solution avaliable so far is first one. Question is: Do we have faster method in guest Win10 OS than PrintWindow?

0 Kudos
0 Replies