Exemple #1
0
VOID vUninitializePalette(PDEV* ppdev)
{
    // Delete the default palette if we created one:

    if (ppdev->hpalDefault != 0)
        EngDeletePalette(ppdev->hpalDefault);
}
Exemple #2
0
VOID DrvDisablePDEV(DHPDEV dhpdev)
{
    PPDEV   ppdev;

    ppdev = (PPDEV) dhpdev;

    DISPDBG((2, "disabling PDEV\n"));

    EngDeletePalette(devinfoVGA.hpalDefault);

// Free the preallocated saved screen bits buffer, if there is one.

    if (ppdev->pjPreallocSSBBuffer != NULL)
    {
        EngFreeMem(ppdev->pjPreallocSSBBuffer);
    }

// Free the conversion table buffer

    if (ppdev->pucDIB4ToVGAConvBuffer != NULL)
    {
        EngFreeMem(ppdev->pucDIB4ToVGAConvBuffer);
    }

// Delete the PDEV

    EngFreeMem(dhpdev);

    DISPDBG((2, "disabled PDEV\n"));

}
Exemple #3
0
VOID vUninitializePalette(PDEV* ppdev)
{
    // Delete the default palette if we created one:

    if (ppdev->hpalDefault != 0)
        EngDeletePalette(ppdev->hpalDefault);

    if (ppdev->pPal != (PALETTEENTRY*) NULL)
        EngFreeMem(ppdev->pPal);
}
Exemple #4
0
void VBoxDispDestroyPalette(PVBOXDISPDEV pDev)
{
    if (pDev->hDefaultPalette)
    {
        EngDeletePalette(pDev->hDefaultPalette);
        pDev->hDefaultPalette = 0;
    }

    if (pDev->pPalette)
    {
        EngFreeMem(pDev->pPalette);
    }
}
Exemple #5
0
VOID vDisablePalette(PPDEV ppdev)
{
// Delete the default palette if we created one.

    if (ppdev->hpalDefault)
    {
        EngDeletePalette(ppdev->hpalDefault);
        ppdev->hpalDefault = (HPALETTE) 0;
    }

    if (ppdev->pPal != (PPALETTEENTRY)NULL)
        EngFreeMem((PVOID)ppdev->pPal);
}
Exemple #6
0
VOID vDisablePalette(PPDEV ppdev)
{
// Delete the default palette if we created one.

    if (ppdev->hpalDefault)
    {
        EngDeletePalette(ppdev->hpalDefault);
        ppdev->hpalDefault = (HPALETTE) 0;
    }

// eVb: 4.2 [VGARISC Change] - VGA Palette is static, no need to free
#if 0
    if (ppdev->pPal != (PPALETTEENTRY)NULL)
        EngFreeMem((PVOID)ppdev->pPal);
#endif
// eVb: 4.2 [END]
}
Exemple #7
0
VOID DrvDisablePDEV(DHPDEV  dhpdev)
{
    LPFAXDEV lpSrvFaxDev = (LPFAXDEV) dhpdev;

    LOGDEBUG(("WOWFAX!DrvDisablePDEV, dhpdev %X\n", dhpdev));

    if (ValidateFaxDev(lpSrvFaxDev)) {
        if (lpSrvFaxDev->devinfo.hpalDefault) {
            EngDeletePalette(lpSrvFaxDev->devinfo.hpalDefault);
        }
        EngFreeMem(lpSrvFaxDev);
        LOGDEBUG(("WOWFAX!DrvDisablePDEV, deallocated lpSrvFaxDev: %X\n", lpSrvFaxDev));
    }
    else {
        LOGDEBUG(("WOWFAX!DrvDisablePDEV, failed\n"));
    }
    return;
}
Exemple #8
0
VOID vDisablePalette(PPDEV ppdev)
{

    DISPBLTDBG ((1, "TGA.DLL!vDisablePaletteInfo - Entry\n"));

    // Delete the default palette if we created one.

    if (ppdev->hpalDefault)
    {
        EngDeletePalette (ppdev->hpalDefault);
        ppdev->hpalDefault = NULL;
    }

    if (ppdev->pPal != (PPALETTEENTRY)NULL)
        EngFreeMem ((PVOID)ppdev->pPal);

    DISPBLTDBG ((1, "TGA.DLL!vDisablePaletteInfo - Exit\n"));

}
Exemple #9
0
DHPDEV DrvEnablePDEV
(
    DEVMODEW *pdrivw,
    PWSTR     pwszLogAddress,
    ULONG     cPatterns,
    HSURF    *ahsurfPatterns,
    ULONG     cjGdiInfo,
    ULONG    *pdevcaps,
    ULONG     cb,
    PDEVINFO  pdevinfo,
    HDEV      hdev,           // HDEV, used for callbacks
    PWSTR     pwszDeviceName,
    HANDLE    hDriver          // Handle to base driver
)
{
    PPDEV   ppdev;

    DISPDBG((2, "enabling PDEV\n"));

    //
    // Define flag to keep track of allocation
    //

    ppdev = (PPDEV) EngAllocMem(0, sizeof(PDEV), ALLOC_TAG);

    if (ppdev == NULL)
    {
        goto errorAllocPDEV;
    }


    memset(ppdev, 0, sizeof(PDEV));

    //
    // Identifier, for debugging purposes
    //

    ppdev->ident = PDEV_IDENT;

    //
    // Cache the device driver handle away for later use.
    //

    ppdev->hDriver = hDriver;

    //
    // Initialize the cursor stuff.  We can violate the atomic rule here
    // since nobody can talk to the driver yet.
    //

    ppdev->xyCursor.x = 320;            // Non-atomic
    ppdev->xyCursor.y = 240;            // Non-atomic

    ppdev->ptlExtent.x = 0;
    ppdev->ptlExtent.y = 0;
    ppdev->cExtent = 0;

    ppdev->flCursor = CURSOR_DOWN;

    //
    // Get the current screen mode information.  Set up device caps and devinfo.
    //

    if (!bInitPDEV(ppdev, pdrivw, &gaulCap, &devinfoVGA))
    {
        DISPDBG((1, "DrvEnablePDEV failed bInitPDEV\n"));
        goto errorbInitPDEV;
    }

    cjGdiInfo=min(cjGdiInfo, sizeof(GDIINFO));

    memcpy(pdevcaps, &gaulCap, cjGdiInfo);

     // Now let's pass back the devinfo

    devinfoVGA.hpalDefault = EngCreatePalette(PAL_INDEXED, 16,
                                              (PULONG) (logPalVGA.palPalEntry),
                                              0, 0, 0);

    if (devinfoVGA.hpalDefault == (HPALETTE) 0)
    {
        goto errorEngCreatePalette;
    }

    *pdevinfo = devinfoVGA;

    // Try to preallocate a saved screen bits buffer. If we fail, set the flag
    // to indicate the buffer is in use, so that we'll never attempt to use it.
    // If we succeed, mark the buffer as free.

    if ((ppdev->pjPreallocSSBBuffer = (PUCHAR)
              EngAllocMem(0, PREALLOC_SSB_SIZE, ALLOC_TAG)) != NULL)
    {
        ppdev->flPreallocSSBBufferInUse = FALSE;
        ppdev->ulPreallocSSBSize = PREALLOC_SSB_SIZE;
    }
    else
    {
        ppdev->flPreallocSSBBufferInUse = TRUE;
    }

    // Fill in the DIB4->VGA conversion tables. Allow 256 extra bytes so that
    // we can always safely align the tables to a 256-byte boundary, for
    // look-up reasons. There are four tables, each 256 bytes long

    ppdev->pucDIB4ToVGAConvBuffer =
            (UCHAR *) EngAllocMem(0, (256*4+256)*sizeof(UCHAR), ALLOC_TAG);

    if (ppdev->pucDIB4ToVGAConvBuffer == NULL)
    {
        goto errorAllocpucDIB4ToVGAConvBuffer;
    }

    // Round the table start up to the nearest 256 byte boundary, because the
    // tables must start on 256-byte boundaries for look-up reasons

    ppdev->pucDIB4ToVGAConvTables =
            (UCHAR *) ((ULONG) (ppdev->pucDIB4ToVGAConvBuffer + 0xFF) & ~0xFF);

    vSetDIB4ToVGATables(ppdev->pucDIB4ToVGAConvTables);

    return((DHPDEV) ppdev);

errorAllocpucDIB4ToVGAConvBuffer:

    //
    // Free the preallocated saved screen bits buffer, if there is one.
    //

    if (ppdev->pjPreallocSSBBuffer != NULL)
    {
        EngFreeMem(ppdev->pjPreallocSSBBuffer);
    }

    EngDeletePalette(devinfoVGA.hpalDefault);

errorEngCreatePalette:
errorbInitPDEV:

    EngFreeMem(ppdev);

errorAllocPDEV:

    return((DHPDEV) 0);

    UNREFERENCED_PARAMETER(cb);
    UNREFERENCED_PARAMETER(pwszLogAddress);
    UNREFERENCED_PARAMETER(pwszDeviceName);
}