Hi!, I'm developing an application to record what is going on in the screen. In order to do that I'm trying to load a Mirror Driver (DemoForge Mirage Driver in this case). Everything goes fine until I call the extEscape function which returns zero as a result.

Could any one tell what I'm doing wrong please?

Here is my code:

#define MAP 1030

hDC = (void *)GetDC(NULL);

logger.log( 1, "[LoadDriver]: Attaching to desktop...\n");
if( SetAttachToDesktop( videoDriverShortName, 1) )
{
logger.log( 0, "[LoadDriver]: Could not set AttachToDesktop value.\n");
retVal = -1;
}

logger.log( 1, "[LoadDriver]: CommitDisplayChanges\n");
if( CommitDisplayChanges( deviceInfo, &deviceMode ) )
{
logger.log( 0, "[LoadDriver]: CommitDisplayChanges ( FAILED ).\n");
SetAttachToDesktop( videoDriverShortName, 0);
retVal = -1;
}

logger.log( 1, "[LoadDriver]:ExtEscape\n" );

int extEscapeV = ExtEscape( (HDC)hDC, MAP, 0, NULL, sizeof(DRIVER_INTERFACE), (LPSTR)drvInt );

if (extEscapeV < 0)
{
DWORD error = GetLastError();
logger.log( 0, "[LoadDriver]: ExtEscape failed with error(%d)\n", error );
logger.log( 0, "[LoadDriver]: ATENTION: Maybe you need to restart the PC.\n", error );
}
else if (extEscapeV == 0) {
logger.log( 0, "[LoadDriver]: ExtEscape failed with error(%d) [RETURN ZERO - It's not implemented in the SO!]\n", error );
DeleteObject(hDC);
retVal = -1;
}

The variable hDC has data, the deviceInfo and deviceMode seem to be OK too.

It would be great if anyone could give me some advice!
Thanks in advance!