enable.c revision 677833bc953b6cb418c701facbdcf4aa18d6c44e
/******************************Module*Header*******************************\
*
* *******************
* * GDI SAMPLE CODE *
* *******************
*
* Module Name: enable.c
*
* This module contains the functions that enable and disable the
* driver, the pdev, and the surface.
*
* Copyright (c) 1992-1998 Microsoft Corporation
\**************************************************************************/
#define DBG 1
#include "driver.h"
{
};
//
// always hook these routines to ensure the mirrored driver
// is called for our surfaces
//
// Define the functions you want to hook for 8/16/24/32 pel formats
#define HOOKS_BMF8BPP 0
#define HOOKS_BMF16BPP 0
#define HOOKS_BMF24BPP 0
#define HOOKS_BMF32BPP 0
/******************************Public*Routine******************************\
* DrvEnableDriver
*
* Enables the driver by retrieving the drivers function table and version.
*
\**************************************************************************/
{
// Engine Version is passed down so future drivers can support previous
// engine versions. A next generation driver can support both the old
// and new engine conventions if told what version of engine it is
// working with. For the first version the driver does nothing with it.
DISPDBG((0,"DrvEnableDriver: mirror\n"));
// Fill in as much as we can.
if (cj >= sizeof(DRVENABLEDATA))
// DDI version this driver was targeted for is passed back to engine.
// Future graphic's engine may break calls down to old driver format.
// DDI_DRIVER_VERSION is now out-dated. See winddi.h
// DDI_DRIVER_VERSION_NT4 is equivalent to the old DDI_DRIVER_VERSION
return(TRUE);
}
/******************************Public*Routine******************************\
* DrvEnablePDEV
*
* DDI function, Enables the Physical Device.
*
* Return Value: device handle to pdev.
*
\**************************************************************************/
{
DISPDBG((0,"DrvEnablePDEV\n"));
// Allocate a physical device structure.
{
RIP("DISP DrvEnablePDEV failed EngAllocMem\n");
return((DHPDEV) 0);
}
// Save the screen handle in the PDEV.
// Get the current screen mode information. Set up device caps and devinfo.
{
DISPDBG((0,"DISP DrvEnablePDEV failed\n"));
goto error_free;
}
// Copy the devinfo into the engine buffer.
// Set the pdevCaps with GdiInfo we have prepared to the list of caps for this
// pdev.
//
DISPDBG((0,"DrvEnablePDEV OK\n"));
// Error case for failure.
DISPDBG((0,"DrvEnablePDEV FAIL!!!\n"));
return((DHPDEV) 0);
}
/******************************Public*Routine******************************\
* DrvCompletePDEV
*
* Store the HPDEV, the engines handle for this PDEV, in the DHPDEV.
*
\**************************************************************************/
{
DISPDBG((0,"DrvCompletePDEV\n"));
DISPDBG((0,"DrvCompletePDEV OK\n"));
}
/******************************Public*Routine******************************\
* DrvDisablePDEV
*
* Release the resources allocated in DrvEnablePDEV. If a surface has been
* enabled DrvDisableSurface will have already been called.
*
\**************************************************************************/
{
DISPDBG((0,"DrvDisablePDEV\n"));
}
/******************************Public*Routine******************************\
* DrvEnableSurface
*
* Enable the surface for the device. Hook the calls this driver supports.
*
* Return: Handle to the surface if successful, 0 for failure.
*
\**************************************************************************/
{
// Create engine bitmap around frame buffer.
DISPDBG((0,"DrvEnableSurface:\n"));
{
}
{
}
else
{
}
flHooks |= flGlobalHooks;
0x4D495252);
if (!mirrsurf) {
RIP("DISP DrvEnableSurface failed EngAllocMem\n");
return(FALSE);
}
// dhsurf = (DHSURF) ppdev;
sizl,
{
RIP("DISP DrvEnableSurface failed EngCreateBitmap\n");
return(FALSE);
}
{
RIP("DISP DrvEnableSurface failed EngAssociateSurface\n");
return(FALSE);
}
DISPDBG((0,"DrvEnableSurface OK\n"));
return(hsurf);
}
/******************************Public*Routine******************************\
* DrvDisableSurface
*
* Free resources allocated by DrvEnableSurface. Release the surface.
*
\**************************************************************************/
{
DISPDBG((0,"DrvDisableSurface:\n"));
// deallocate MIRRSURF structure.
}
/******************************Public*Routine******************************\
* DrvCopyBits
*
\**************************************************************************/
)
{
DISPDBG((0,"DrvCopyBits\n"));
return TRUE;
}
/******************************Public*Routine******************************\
* DrvBitBlt
*
\**************************************************************************/
)
{
DISPDBG((0,"DrvBitBlt\n"));
return TRUE;
}
)
{
DISPDBG((0,"DrvTextOut\n"));
return TRUE;
}
{
DISPDBG((0,"DrvStrokePath\n"));
return TRUE;
}
{
DISPDBG((0,"DrvAssertMode\n"));
return TRUE;
}