2007-08-05 03:32:24 +00:00
|
|
|
INT
|
|
|
|
Test_CreateCompatibleDC(PTESTINFO pti)
|
|
|
|
{
|
|
|
|
HDC hDCScreen, hOldDC, hDC, hDC2;
|
|
|
|
|
|
|
|
// Create a DC
|
|
|
|
hDCScreen = GetDC(NULL);
|
|
|
|
if (hDCScreen == NULL)
|
|
|
|
{
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
|
|
|
hDC = CreateCompatibleDC(hDCScreen);
|
2007-08-05 23:05:02 +00:00
|
|
|
RTEST(hDC != NULL);
|
2007-08-05 03:32:24 +00:00
|
|
|
|
|
|
|
// Test if first selected pen is BLACK_PEN (? or same as screen DC's pen?)
|
|
|
|
TEST(SelectObject(hDC, GetStockObject(DC_PEN)) == GetStockObject(BLACK_PEN));
|
|
|
|
TEST(SelectObject(hDC, GetStockObject(BLACK_PEN)) == GetStockObject(DC_PEN));
|
|
|
|
|
|
|
|
// Test for the starting Color == RGB(0,0,0)
|
|
|
|
TEST(SetDCPenColor(hDC, RGB(1,2,3)) == RGB(0,0,0));
|
|
|
|
|
|
|
|
// Check for reuse counter
|
|
|
|
hOldDC = hDC;
|
|
|
|
DeleteDC(hDC);
|
|
|
|
hDC = CreateCompatibleDC(hDCScreen);
|
|
|
|
hDC2 = CreateCompatibleDC(hOldDC);
|
2007-08-05 23:05:02 +00:00
|
|
|
RTEST(hDC2 == NULL);
|
2007-08-05 03:32:24 +00:00
|
|
|
if (hDC2 != NULL) DeleteDC(hDC2);
|
|
|
|
|
|
|
|
// cleanup
|
|
|
|
DeleteDC(hDC);
|
|
|
|
|
|
|
|
ReleaseDC(NULL, hDCScreen);
|
|
|
|
return APISTATUS_NORMAL;
|
|
|
|
}
|