Do Not Call the Display Driver Directly

Last reviewed: August 13, 1997
Article ID: Q77402

The information in this article applies to:

  • Microsoft Windows Software Development Kit (SDK) for Windows versions 3.1 and 3.0
  • Microsoft Win32 Application Programming Interface (API) included with:

        - Microsoft Windows 95 version 4.0
    

SUMMARY

In general, a Windows-based application cannot call the Windows display driver directly to perform graphics primitives. This article details the reasons this restriction is in place.

MORE INFORMATION

The Windows display driver communicates with the Graphics Device Interface (GDI) to perform primitive graphics operations. The parameters of the entry points (or exported functions) in the display driver are set up according to the standard interface between GDI and the display driver. The parameters passed by GDI to the display driver are only meaningful to GDI and to the display driver. A Windows-based application has no way to obtain these parameters. For example, the parameter most-commonly passed by GDI to the display driver is a pointer to a structure called PDEVICE. Memory for this structure is allocated by GDI, and its contents are specified by the display driver during the driver's initialization. The pointer to the PDEVICE structure is private to GDI; furthermore, the structure of PDEVICE varies among display drivers.

To give another example, when a primitive is to be done to a memory bitmap, instead of passing a pointer to PDEVICE, GDI passes to the display driver a pointer to a structure; the structure is usually referred to as a physical bitmap. Note that this physical bitmap structure is also called "BITMAP"; do not confuse it with the BITMAP structure defined in the Windows Software Development Kit. Again, this physical bitmap structure is not designed to be used by a Windows-based application. Although the information described in this structure is somewhat related to the bitmap that the application uses, the pointer to the physical bitmap structure is private to GDI and cannot be obtained by the application.

Keywords          : GdiMisc kbgraphic kbhowto
Version           : 3.0 3.1 4.0
Platform          : WINDOWS
Issue type        : kbhowto


================================================================================


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: August 13, 1997
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.