Re: Building a device driver using VC6 and VC2005
- From: Mark Roddy <markr@xxxxxxxxxxxxxx>
- Date: Tue, 06 Jun 2006 06:28:45 -0400
On Mon, 5 Jun 2006 22:08:01 -0700, mirage2k2
<mirage2k2@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote:
Firstly, whether one should attempt to build a device driver using anything
other than the ddk compiler and linker is a question I would like to throw
out there to see what you guys (especially the MS boys) think. From what I
understand, the ddk compiler and linker are not special, they are just
configured appropriately for building a device driver ... any comments on
this?
Yes sure it is a bad idea. Any problems with your driver that appear
to be Microsoft related will get you a 'sorry your driver is not
supported' response from Microsoft as soon as they figure out how you
built your driver, which won't take long. Any changes to the supported
build environment will require you to recreate by hand your VS project
settings. Thus what works today will not necessarily migrate forward
as Microsoft changes the DDK tool chain. Header files from specific
ddk releases for example may not work at all with arbitrary compiler
versions.
You should check out ddkbuild as it provides most of the benefits of
VS projects (and there are many here who will dispute that such
benefits exist.) It can be found at my website www.hollistech.com. Its
free and it provides a simple supported mechanism for integrating ddk
based driver builds into VS makefile projects.
I have successfully built a device driver, that runs without fault, using
both VC6 and VC2005. In both projects I've instructed the compiler/linker to
use the ddk includes and libraries, by setting Additional include/library
directories to the ddk directories, and I've also instructed the
compiler/linker to ignore all default includes and libraries, by setting
Ignore standard include path and Ignore all default libraries.
I have built the driver using the xp includes and libs and the project
settings I've used for both VC6 and VC2005 projects are listed below ...
C/C++ settings for VC6
C++ Language
Enable exception handling:unchecked ... no exception handling in the
kernel!
Enable Run-Time Type Information (RTTI):unchecked ... linker error if
checked
Preprocessor
Preprocessor definitions:
X86_=1
i386=1
_WIN32_WINNT=0x0501
WINVER=0x0501
WIN32_LEAN_AND_MEAN=1 ... dont know if this does much for a device
driver
Additional include directories:
C:\WINDDK\2600\inc\wxp
C:\WINDDK\2600\inc\ddk\wxp
C:\WINDDK\2600\inc\ddk\wdm\wxp
C:\WINDDK\2600\inc\crt
Ignore standard include paths:checked
C/C++ settings for VC2005
General
Additional Include Directories:
C:\WINDDK\2600\inc\wxp
C:\WINDDK\2600\inc\ddk\wxp
C:\WINDDK\2600\inc\ddk\wdm\wxp
C:\WINDDK\2600\inc\crt
Preprocessor
Preprocessor Definitions:
X86_=1
i386=1
_WIN32_WINNT=0x0501
WINVER=0x0501
WIN32_LEAN_AND_MEAN=1 ... dont know if this does much for a device
driver
Ignore Standard Include Path:Yes (/X)
Code Generation
Enable C++ Exceptions:No ... no exception handling in the kernel!
Buffer Security Check:No (/GS-) ... linker error if set to Yes
Language
Enable Run-Time Type Info:No (/GR-) ... linker error if set to Yes
Linker settings for VC6
Input
Object/library modules:int64.lib ntoskrnl.lib hal.lib ... etc.
Ignore all default libraries:checked
Additional library path:C:\WINDDK\2600\lib\wxp\i386
Output
Base address:0x10000
Entry-point symbol:DriverEntry
Linker settings for VC2005
Input
Additional Dependencies:int64.lib ntoskrnl.lib hal.lib ... etc.
Ignore All Default Libraries:Yes (/NODEFAULTLIB)
Manifest File
Generate Manifest:No
System
SubSystem:Native (/SUBSYSTEM:NATIVE)
Driver:Driver (/DRIVER)
Advanced
Base address:0x10000
Entry Point:DriverEntry
Target Machine:MachineX86 (/MACHINE:X86)
In addition, all compiler and linker settings that are required can be
obtained by the ddk build log file that is created after building a driver.
For my checked build this is buildchk_wxp_x86.log.
=====================
Mark Roddy DDK MVP
Windows Vista/2003/XP/2000 Consulting
Device and Filesystem Drivers
Hollis Technology Solutions 603-321-1032
www.hollistech.com
.
- References:
- Building a device driver using VC6 and VC2005
- From: mirage2k2
- Building a device driver using VC6 and VC2005
- Prev by Date: Re: Help, Can i set the value windows environment variable within WinXP DDK C code?
- Next by Date: Re: Build device driver using Microsoft Visual C++ 2005
- Previous by thread: Re: Building a device driver using VC6 and VC2005
- Next by thread: Re: Building a device driver using VC6 and VC2005
- Index(es):
Relevant Pages
|
Loading