I’m trying to recover my video overlay surface after ctrl-alt-del is pressed.
The problem is that I’m writing directly to the raw surface pointer.
A ctrl-alt-del switches to the SAS desktop, which destroys the overlay on the user desktop.
The pointer to the overlay surface pixels (my_overlay->pixels[0]) remains the same value though.
Is there any way I can detect that the pointer is no longer pointing to a valid surface?
I tried to Create a new surface at various SDL_Events, but no luck there so far.
if (SDL_mutexP(m_sdlmutex) == 0)
{
SDL_LockYUVOverlay(my_overlay);
LPBYTE pSurf = (LPBYTE) my_overlay->pixels[0];
int x = 0, y = 0;
Uint16 lPitch = my_overlay->pitches[0];;
LPBYTE pWork = m_lpMyVideoData;
Uint16 dwBytesInRow = my_overlay->w*2;
for(y=0; y<m_nDataHeight; y++)
{
for (x=0; x<m_nDataWidth;x++)
{
*(pSurf++) = *(pWork++);
*(pSurf++) = *(pWork++);
}
pSurf+=(lPitch-dwBytesInRow);
}
//---SNIP---
...
}
Basically I need a way to validate the ‘my_overlay->pixels[0]’ pointer. Any ideas?
Davy