Share via


DDHAL Functionality Implementation

This topic describes the steps required to implement minimal DirectDraw HAL functionality in your display driver, and assumes that you do not want to move an existing DirectDraw HAL from the Windows desktop to Windows CE. For more information about performing that task, see DDHAL Porting from the Desktop.

The source code for Windows CE's sample display drivers is located in driver-specific subdirectories of %_WINCEROOT\Public\Common\OAK\Drivers\Display. The basic HAL source code is located in the %_WINCEROOT\Public\Common\OAK\Drivers\Display\DDGPE directory. For information about the basic DDGPE header and library files, see DDGPE Resources.

The following list shows the items you need to implement a simple DDHAL in your display driver:

  • The build files used to export functions from your compiled code. This usually has the name of your compiled binary, as defined in the TARGETNAME=BINARYNAME section of your sources file, and ends with the .def extension.
  • The build files used to define include paths, and to attach source code and libraries to your project, usually called sources.

First, modify the file used to export functions from your compiled binary. It should export the HALInit function. To see how this is done, you can consult the sample driver source code file DDI.def. The HALInit function is part of the Ddgpe.lib. This should already be linked to your project.

Next, modify your include path to include directory for DDHFuncs.h. This is a public header file that can be used by any display driver and should not be modified. For more information, see DDGPE Resources.

Copy the Ddgpeusr.h header file from one of the sample driver's source directories, such as %_WINCEROOT%\Public\Common\OAK\Drivers\Display\VGAFlat, into an appropriate location inside your display driver's build directory. This header file is private to your display driver and can be modified. You must customize this file to implement the IN_VBLANK and IS_BUSY macros because they are required by the sample DDHAL implementation.

Copy the following source code files from the basic HAL source code in the sample display drivers into your display driver's build directory, and add them to the appropriate build files:

  • HalCaps.cpp
  • HalDD.cpp
  • HalSurf.cpp
  • HalPalette.cpp

Use the sample display driver that most closely matches the architecture of your display driver.

Finally, compile and build your display driver and ensure that it continues to work properly. Once you verify that it is still functional, your driver is ready to be tested with DirectDraw programs. Keep in mind that the code is not in an optimized state and will require some customization to improve performance.

See Also

DirectDraw Display Driver Creation | Driver Extension Using DDGPE | DDHAL Customization

 Last updated on Tuesday, May 18, 2004

© 1992-2003 Microsoft Corporation. All rights reserved.