I am maintaining an old application that, among other things, displays tiny video feeds on screen. The application works fine unless you run it while viewing the desktop through RDP.
When we go to acquire the write pointer via IDirectDrawSurface7
's Lock
function:
DDSURFACEDESC2 dsd;
ZeroMemory(&dsd, sizeof(dsd));
dsd.dwSize = sizeof(dsd);
hr = m_pSurface->Lock(NULL, &dsd, DDLOCK_NOSYSLOCK|DDLOCK_WRITEONLY/*|DDLOCK_DONOTWAIT*/, NULL);
Everything works fine unless you are connected to the system via RDP. In that case the lock fails, with the HRESULT
of DDERR_WASSTILLDRAWING
.
The remarks on the MSDN Page state that this error should only occur, under "default conditions", when the flag DDLOCK_DONOTWAIT
is used, which I have diagnostically commented out.
Is there any hope for getting this application working over RDP 8 / Windows 7 without a major redesign?
Both having the application open and connecting a new RDP session and launching the application through an existing RDP session cause this behavior.