VC6.0 + WDK-driven development environment configuration VC6.0 development environment configuration WDK driver +

VC6.0 + WDK-driven development environment configuration

 

1. Install good VC6 and DWK, irrespective of the order.
    From the Start menu, find the program directory of the WDK, enter "Windows XP Checked Build Environment", enter the command "build", this time the WDK will compile its own, it takes about 1 minute.

2.VC6 Set Include / Lib / Executable directory.
    To each his own need to compile a directory of the platform can, Include want to make sure you find ntddk.h etc., Lib and Include correspondence, Executable want to make sure you find cl.exe
such as settings for the XP platform:

the include section contains:

C: \ WinDDK \ 7600.16385.1 \ inc is \ DDK
C: \ WinDDK \ 7600.16385.1 \ inc is \ API
C: \ WinDDK \ 7600.16385.1 \ inc is \ CRT


lib library connection portion comprising:

C: \ WINDDK \ 7600.16385.1 \ the lIB \ WXP \ the I386
C: \ WINDDK \ 7600.16385.1 \ LIB \ WIN7 \ the I386


execute file contains:

C: \ WINDDK \ 7600.16385.1 \ BIN
C: \ WINDDK \ 7600.16385.1 \ BIN \ X86
C: \ WinDDK \ 7600.16385.1 \ bin \ x86 \ x86

For the original path VC, Include and Lib recommendations are deleted, and Executable will add your new set-top, the order can not be wrong. The remaining proposed to retain (although the drive will not be used to compile under VC Bin directory ml.exe, link.exe, etc., but vc code hinting and other functions that require some programs in the bin directory to complete, so it is at least want to keep VC the original Bin directory, but it must be after the DDK).

3. Create an empty project, Exe or Dll can then directly modify the project properties:

the place to change a lot, not as a direct description of the various options of text records, empty C / C ++ and Link below Option text box, press fill in the following.

C / C ++ option to fill in:
/ nologo / Gz / MLd / W3 / WX / Z7 / Od / D WIN32 = 100 / D _X86_ = 1 / D WINVER = 0x500 / D DBG = 1 / Fo "MyDriver_Check /" / Fd "MyDriver_Check / "/ FD / c

LINK options to fill:
    NT drive is
ntoskrnl.lib / nologo / base:" 0x10000 "/ stack: 0x400000,0x1000 / entry:" DriverEntry "/ subsystem: console / incremental: no / pdb:" MyDriver_Check /HelloDDK.pdb "/map:"MyDriver_Check/HelloDDK.map" / debug / machine : I386 / nodefaultlib /out:"MyDriver_Check/HelloDDK.sys "/ subsystem: native / driver / SECTION:

    WDM drive is

wdm.lib / nologo / base: "0x10000 " / stack: 0x400000,0x1000 / entry: "DriverEntry" / subsystem: console / incremental: no /pdb:"SYS_Check/HelloWDM.pdb "/ debug / machine: the I386 / NODEFAULTLIB /out:"SYS_Check/HelloWDM.sys "/ the Subsystem: Native / Driver / the SECTION: INIT, D / the RELEASE / IGNORE: 4078 

4. save the configuration, and now to the empty project to build a c file, copy the following:

#include <ntddk.h>
NTSTATUS the DriverEntry (
        the IN PDRIVER_OBJECT the DriverObject,
        the IN PUNICODE_STRING the RegistryPath
        )
{
        NTSTATUS Status = with STATUS_UNSUCCESSFUL;
        return Status;
}   

compile the configuration was successful! ! !

 

----------------------------------------------------------------------------------------------

Vc6 English version; (are everywhere)

WDK3790.1830 (1830_usa_ddk.iso of extracting file) or 2006.1106 version;

(http://download.microsoft.com/download/9/0/f/90f019ac-8243-48d3-91cf-81fc4093ecfd/1830_usa_ddk.iso)

DriverStudio3.2. (They are everywhere)

Second, the installation instructions

First install Vc6, Vc6 normal installation.

Second mounting the WDK, attached to the D: / WINDDK directory, all the examples were checked, the installation.

         WDK installation is relatively time-consuming, if you have installed during the AVAST or 360, then remember when they are prompted to allow, permit or move files to allow installation.

Finally, install DriverStudio3.2. It recommended to install to the default directory C drive, and later to the document, respectively.

Third, the reference book

Only a classic reference book, Zhang Fan's "Windows driver development techniques explain" (Collector's Edition).

There are many references in the optical disk code can be directly used.

Fourth, driving the WDK build tools to compile Windows

Tool position: Start -> Development Kit-> Windows DDK 3790.1830-> Build Environment-> Windows XP-> Windows XP Checked Build Environment (recommended sending it to the desktop to facilitate future compilation).

File needs: the need cpp, h, SOURCES, MakeFile four file. Makefile which do not have to write your own, you need to write your own SOURCES file. See specific way to write a reference book.

Compilation method: In the build tool to change the directory to the project directory (if the switch is not convenient, you can at D: establishing a exam folder, and then copy the directory to the project folder /WINDDK/3790.1183/ exam next, so you can easily switch to the project directory). Finally, type: build can be. If successful, the compiler can find the .sys files in the project directory, the file is what we ultimately want to get binaries.

Fifth, set when driving with VC compile Windows changes

1. Create a new VC project, select Win32 Application project. Select the empty project.

2, the written cpp and h files (or your own written in vc) copied to the empty project directory. In project-> add to project-> files in these two documents included.

3, in the build-> Configurationz, add a project Driver Check Edtion, select Win32. Then will generate a new Win32 Driver Check Edtion project. After the original two items are deleted.

4, at Project-> Settings-> General, content and Output files are intermediate files are changed MyDriver_Check

5, under Project-> Settings-> c / c ++, the original contents of the Project Options Delete all read:

/ Nologo / g / MLD / W3 / WX / Z7 / from / WIN32 D = 100 / D = 1 _X86

/D WINVER=0x500  /D DBG=1  /Fo"MyDriver_Check/"  /Fd"MyDriver_Check/"

/FD =1  /c

6, under Project-> Settings-> link, the original contents of the Project Options Delete all read:

ntoskrnl.lib /nologo /base:"0x10000" /stack:0x400000,0x1000 /entry:"DriverEntry"

/subsystem:console /incremental:no /pdb:"MyDriver_Check/hellodriv.pdb"

/debug /machine:I386 /nodefaultlib /out:"MyDriver_Check/hellodriv.sys"

/pdbtype:sept /subsystem:native /driver /SECTION:INIT,D /RELEASE

/IGNORE:4078

7, in Tool-> Options-> Directories, select, Show directories for: Include files,

Add one: D: /WINDDK/3790.1830/INC/W2K, before the move to the first position.

Add one: D: /WINDDK/3790.1830/INC/DDK/W2K, advanced to the second position.

Add one: D: /WINDDK/3790.1830/INC/DDK/WDM/W2K, advanced to the third.

(By browsing the Select Folder)

8, in Tool-> Options-> Directories, select, Show directories for: Library files,

Add one: D: /WINDDK/3790.1830/LIB/W2K/I386, advanced to the first.

(By browsing the Select Folder)

9, bringing the entire setup is complete, you can press F7 to compile a .sys files. (Do not press Ctrl + F5, can not produce an executable file)

Six, build tools files into a file that can be compiled VC method

When compiling with build tools, to use a SOURCES file (no extension, only the file name) and a MakeFile file (no extension, only the file name).

Now suppose you have these two files and the corresponding cpp and h files, and can be compiled with the build is successful, then we can use this SOURCES files to be compiled VC6 project file (.dsw and .dsp). Methods as below:

1、开始->Compuware DriverStudio->Develop->DDK sources to vcproj Converter

2, after opening the tool, select File-> Open, find the corresponding SOURCES file.

3. Select Convert-> Convert DDK dir / sources file, a dialog box appears.

4, in the dialogue selection, VC ++ 6 WorkSpace, press OK.

5. At this point, you will find more than two files in the directory .dsw and .dsp SOURCE file is located in the directory if there is a corresponding cpp and h files, then you can use VC6 open the project up, get the same .sys file compiled.

 

If you still can not find the tips SXXX.h, then D: /WINDDK/3790.1830/INC/CRT can be added to it.

1. Install good VC6 and DWK, irrespective of the order.
    From the Start menu, find the program directory of the WDK, enter "Windows XP Checked Build Environment", enter the command "build", this time the WDK will compile its own, it takes about 1 minute.

2.VC6 Set Include / Lib / Executable directory.
    To each his own need to compile a directory of the platform can, Include want to make sure you find ntddk.h etc., Lib and Include correspondence, Executable want to make sure you find cl.exe
such as settings for the XP platform:

the include section contains:

C: \ WinDDK \ 7600.16385.1 \ inc is \ DDK
C: \ WinDDK \ 7600.16385.1 \ inc is \ API
C: \ WinDDK \ 7600.16385.1 \ inc is \ CRT


lib library connection portion comprising:

C: \ WINDDK \ 7600.16385.1 \ the lIB \ WXP \ the I386
C: \ WINDDK \ 7600.16385.1 \ LIB \ WIN7 \ the I386


execute file contains:

C: \ WINDDK \ 7600.16385.1 \ BIN
C: \ WINDDK \ 7600.16385.1 \ BIN \ X86
C: \ WinDDK \ 7600.16385.1 \ bin \ x86 \ x86

For the original path VC, Include and Lib recommendations are deleted, and Executable will add your new set-top, the order can not be wrong. The remaining proposed to retain (although the drive will not be used to compile under VC Bin directory ml.exe, link.exe, etc., but vc code hinting and other functions that require some programs in the bin directory to complete, so it is at least want to keep VC the original Bin directory, but it must be after the DDK).

3. Create an empty project, Exe or Dll can then directly modify the project properties:

the place to change a lot, not as a direct description of the various options of text records, empty C / C ++ and Link below Option text box, press fill in the following.

C / C ++ option to fill in:
/ nologo / Gz / MLd / W3 / WX / Z7 / Od / D WIN32 = 100 / D _X86_ = 1 / D WINVER = 0x500 / D DBG = 1 / Fo "MyDriver_Check /" / Fd "MyDriver_Check / "/ FD / c

LINK options to fill:
    NT drive is
ntoskrnl.lib / nologo / base:" 0x10000 "/ stack: 0x400000,0x1000 / entry:" DriverEntry "/ subsystem: console / incremental: no / pdb:" MyDriver_Check /HelloDDK.pdb "/map:"MyDriver_Check/HelloDDK.map" / debug / machine : I386 / nodefaultlib /out:"MyDriver_Check/HelloDDK.sys "/ subsystem: native / driver / SECTION:

    WDM drive is

wdm.lib / nologo / base: "0x10000 " / stack: 0x400000,0x1000 / entry: "DriverEntry" / subsystem: console / incremental: no /pdb:"SYS_Check/HelloWDM.pdb "/ debug / machine: the I386 / NODEFAULTLIB /out:"SYS_Check/HelloWDM.sys "/ the Subsystem: Native / Driver / the SECTION: INIT, D / the RELEASE / IGNORE: 4078 

4. save the configuration, and now to the empty project to build a c file, copy the following:

#include <ntddk.h>
NTSTATUS the DriverEntry (
        the IN PDRIVER_OBJECT the DriverObject,
        the IN PUNICODE_STRING the RegistryPath
        )
{
        NTSTATUS Status = with STATUS_UNSUCCESSFUL;
        return Status;
}   

compile the configuration was successful! ! !

 

----------------------------------------------------------------------------------------------

Vc6 English version; (are everywhere)

WDK3790.1830 (1830_usa_ddk.iso of extracting file) or 2006.1106 version;

(http://download.microsoft.com/download/9/0/f/90f019ac-8243-48d3-91cf-81fc4093ecfd/1830_usa_ddk.iso)

DriverStudio3.2. (They are everywhere)

Second, the installation instructions

First install Vc6, Vc6 normal installation.

Second mounting the WDK, attached to the D: / WINDDK directory, all the examples were checked, the installation.

         WDK installation is relatively time-consuming, if you have installed during the AVAST or 360, then remember when they are prompted to allow, permit or move files to allow installation.

Finally, install DriverStudio3.2. It recommended to install to the default directory C drive, and later to the document, respectively.

Third, the reference book

Only a classic reference book, Zhang Fan's "Windows driver development techniques explain" (Collector's Edition).

There are many references in the optical disk code can be directly used.

Fourth, driving the WDK build tools to compile Windows

Tool position: Start -> Development Kit-> Windows DDK 3790.1830-> Build Environment-> Windows XP-> Windows XP Checked Build Environment (recommended sending it to the desktop to facilitate future compilation).

File needs: the need cpp, h, SOURCES, MakeFile four file. Makefile which do not have to write your own, you need to write your own SOURCES file. See specific way to write a reference book.

Compilation method: In the build tool to change the directory to the project directory (if the switch is not convenient, you can at D: establishing a exam folder, and then copy the directory to the project folder /WINDDK/3790.1183/ exam next, so you can easily switch to the project directory). Finally, type: build can be. If successful, the compiler can find the .sys files in the project directory, the file is what we ultimately want to get binaries.

Fifth, set when driving with VC compile Windows changes

1. Create a new VC project, select Win32 Application project. Select the empty project.

2, the written cpp and h files (or your own written in vc) copied to the empty project directory. In project-> add to project-> files in these two documents included.

3, in the build-> Configurationz, add a project Driver Check Edtion, select Win32. Then will generate a new Win32 Driver Check Edtion project. After the original two items are deleted.

4, at Project-> Settings-> General, content and Output files are intermediate files are changed MyDriver_Check

5, under Project-> Settings-> c / c ++, the original contents of the Project Options Delete all read:

/ Nologo / g / MLD / W3 / WX / Z7 / from / WIN32 D = 100 / D = 1 _X86

/D WINVER=0x500  /D DBG=1  /Fo"MyDriver_Check/"  /Fd"MyDriver_Check/"

/FD =1  /c

6, under Project-> Settings-> link, the original contents of the Project Options Delete all read:

ntoskrnl.lib /nologo /base:"0x10000" /stack:0x400000,0x1000 /entry:"DriverEntry"

/subsystem:console /incremental:no /pdb:"MyDriver_Check/hellodriv.pdb"

/debug /machine:I386 /nodefaultlib /out:"MyDriver_Check/hellodriv.sys"

/pdbtype:sept /subsystem:native /driver /SECTION:INIT,D /RELEASE

/IGNORE:4078

7, in Tool-> Options-> Directories, select, Show directories for: Include files,

Add one: D: /WINDDK/3790.1830/INC/W2K, before the move to the first position.

Add one: D: /WINDDK/3790.1830/INC/DDK/W2K, advanced to the second position.

Add one: D: /WINDDK/3790.1830/INC/DDK/WDM/W2K, advanced to the third.

(By browsing the Select Folder)

8, in Tool-> Options-> Directories, select, Show directories for: Library files,

Add one: D: /WINDDK/3790.1830/LIB/W2K/I386, advanced to the first.

(By browsing the Select Folder)

9, bringing the entire setup is complete, you can press F7 to compile a .sys files. (Do not press Ctrl + F5, can not produce an executable file)

Six, build tools files into a file that can be compiled VC method

When compiling with build tools, to use a SOURCES file (no extension, only the file name) and a MakeFile file (no extension, only the file name).

Now suppose you have these two files and the corresponding cpp and h files, and can be compiled with the build is successful, then we can use this SOURCES files to be compiled VC6 project file (.dsw and .dsp). Methods as below:

1、开始->Compuware DriverStudio->Develop->DDK sources to vcproj Converter

2, after opening the tool, select File-> Open, find the corresponding SOURCES file.

3. Select Convert-> Convert DDK dir / sources file, a dialog box appears.

4, in the dialogue selection, VC ++ 6 WorkSpace, press OK.

5. At this point, you will find more than two files in the directory .dsw and .dsp SOURCE file is located in the directory if there is a corresponding cpp and h files, then you can use VC6 open the project up, get the same .sys file compiled.

 

If you still can not find the tips SXXX.h, then D: /WINDDK/3790.1830/INC/CRT can be added to it.

Guess you like

Origin www.cnblogs.com/csnd/p/11519929.html