Using the Win32 DDK with Visual C++

Last reviewed: February 15, 1996
Article ID: Q119459
The information in this article applies to:
  • Microsoft Visual C++ 32-bit Edition, version 1.0

SUMMARY

Visual C++ comes with a Help file titled "Moving to Visual C++," which includes a section on building device drivers using Visual C++. The information in this section is correct; however, it is not complete. There is another issue that needs to be addressed if you are using the initial release of the Win32 DDK: the checksum.

MORE INFORMATION

The following information is taken from the Help file "Moving to Visual C++":

   Q. How do I build device drivers with Visual C++?

   A. Although Visual C++ does not supply all of the libraries,
      headers, and tools needed to create device drivers for Windows
      NT, you can still use many Visual C++ components.

      1. Update the command-line tools included with the DDK with
         the versions provided with Visual C++.

         Note: Not all of the tools provided in the DDK (such as
         MASM) are supplied with Visual C++, so be careful when
         deleting files.

      2. Make appropriate changes to the source files and makefile.

         See:
          - How do I migrate my Win32 SDK source files to Visual C++?
          - How do I use my Win32 SDK makefiles with Visual C++?

      3. Use the BUILD or NMAKE utility to build the device driver.

You will also need to take the checksum into account. The ability to produce a checksum was added to the SDK tools just before their release times. The Visual C++ linker was changed to support checksums as well, but not by default; this is because checksum support is not always necessary and checksum support increases the time it takes to perform a link.

To set the checksum in the header file of the executable file, use "link /release" or "editbin /release". The documentation for editbin (EDITBIN.WRI), includes the following description of "/release":

   This option sets the checksum in the header of an executable file.

   The operating system requires the checksum for certain files such
   as device drivers. It is recommended that you set the checksum for
   release versions of your programs to ensure compatibility with
   future operating systems.

This option is included in the MAKEFILE.DEF file included with later releases of the Win32 DDK in MSDN Level 2.


Additional reference words: kbinf 1.00
KBCategory: kbinterop
KBSubcategory: TlsMisc


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: February 15, 1996
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.