Exemplo n.º 1
0
Arquivo: dc.c Projeto: GYGit/reactos
/*
 * @implemented
 */
BOOL
WINAPI
DeleteDC(HDC hdc)
{
    BOOL bResult = TRUE;
    PLDC pLDC = NULL;
    HANDLE hPrinter = NULL;
    ULONG hType = GDI_HANDLE_GET_TYPE(hdc);

    pLDC = GdiGetLDC(hdc);

    if (hType != GDILoObjType_LO_DC_TYPE)
    {
        return METADC_DeleteDC(hdc);
    }

    bResult = NtGdiDeleteObjectApp(hdc);

    if (bResult && pLDC)
    {
        DPRINT1("Delete the Local DC structure\n");
        LocalFree( pLDC );
    }

    if (hPrinter)
        fpClosePrinter(hPrinter);

    return bResult;
}
Exemplo n.º 2
0
INT
Test_NtGdiCreateCompatibleDC(PTESTINFO pti)
{
	HDC hDC;
	HGDIOBJ hObj;

	/* Test if aa NULL DC is accepted */
	hDC = NtGdiCreateCompatibleDC(NULL);
	TEST(hDC != NULL);

	/* We select a nwe palette. Note: SelectObject doesn't work with palettes! */
	hObj = SelectPalette(hDC, GetStockObject(DEFAULT_PALETTE), 0);
	/* The old palette should be GetStockObject(DEFAULT_PALETTE) */
	TEST(hObj == GetStockObject(DEFAULT_PALETTE));

	/* The default bitmap should be GetStockObject(21) */
	hObj = SelectObject(hDC, GetStockObject(21));
	TEST(hObj == GetStockObject(21));

	/* The default pen should be GetStockObject(BLACK_PEN) */
	hObj = SelectObject(hDC, GetStockObject(WHITE_PEN));
	TEST(hObj == GetStockObject(BLACK_PEN));
	
	TEST(NtGdiDeleteObjectApp(hDC) != 0);

	return APISTATUS_NORMAL;
}
Exemplo n.º 3
0
/*
 * I thought it was okay to have this in DeleteObject but~ Speed. (jt)
 */
BOOL
FASTCALL
DeleteRegion(
    _In_ HRGN hrgn)
{
#if 0
    PRGN_ATTR Rgn_Attr;

    if ((GdiGetHandleUserData(hrgn, GDI_OBJECT_TYPE_REGION, (PVOID) &Rgn_Attr)) &&
            ( Rgn_Attr != NULL ))
    {
        PGDIBSOBJECT pgO;

        pgO = GdiAllocBatchCommand(NULL, GdiBCDelRgn);
        if (pgO)
        {
            pgO->hgdiobj = hrgn;
            return TRUE;
        }
    }
#endif
    return NtGdiDeleteObjectApp(hrgn);
}