Access Violation while executing Windows Magnification API

I am developing some application with Windows Magnification API.

The Model of video card is NVIDIA Geforce GT 520 and I’m using Dual Monitor. The Version of Video Driver is 9.18.13.2049. My First Screen’s size is 1280x1024, Secondry Screen is 1920x1080. My OS is Windows 7.

I don’t have any problem in using Primary display but I have a problem in using Seconday display.
The problem appear when call MagSetWindowSource function frequently. A memory leakage appear too. The error type is Access Violation.

I don’t know how to solve this problem. Please help me.

My Test Code is following.

void Ctest01Dlg::OnBnClickedButton1()
{

// Filter the main window
if (!MagSetWindowFilterList(hwndMag, MW_FILTERMODE_EXCLUDE, 1, pFilterList))
{
	return;
}

// Get the screen rectangle
RECT sourceRect;
sourceRect.top = 0;				
sourceRect.left = m_ScreenX;			
sourceRect.right = m_ScreenX + m_ScreenW;		

sourceRect.bottom = m_ScreenH;//m_ScreenY;	

// Prepare the flag for the callback function
bCallbacked = FALSE;

// Set window source to capture entire the desktop
if (!MagSetWindowSource(hwndMag, sourceRect))  [b][u]// Access violation frequently[/u][/b]
{
	MessageBox(_T("Magnification Error"));
	return;
}

// At this point, the callback function is called,
// so we wait until the callback function is completely finished
while (1)
{
	if (bCallbacked)
	{
		break;
	}
}

    :
    :

}

I had a lot of test. This problem is dependent on Video Card.
However, there hasn’t been an exact method to solve the problem.
I solved like this. Do capture the screen on half size and merge two capture data.