DDK & WDM learning-hellowdm, WDM driver loading, INF file

Source: Internet
Author: User

1. inf file

WDM drivers can be installed using the INF file.

First, we provide an msdn link on the INF format.

 

The INF example found in the tube in "driver development technology details". The seal number (;) indicates a comment.

 

Hellowdmchapter01.inf

 

 

 

 

; The Win2k DDK documentation contains an excellent INF reference.

 

; --------- Version section ---------------------------------------------------

 

[Version]

Signature = "$ Chicago $"

Provider = renren_device

Driverver = 11/1/2007, 3.0.0.3

 

; If device fits one of the standard classes, use the name and guid here,

; Otherwise create your own device class and guid as this example shows.

 

Class = renrendevice

Classguid = {B988F087-B147-4626-9CC7-D83B7EB9D53A}; generated by guid tool.

 

; Implement_olecreate (<class >>,< external_name>,

0xb988f087, 0xb147, 0x4626, 0x9c, 0xc7, 0xd8, 0x3b, 0x7e, 0xb9, 0xd5, 0x3a );

; {B988F087-B147-4626-9CC7-D83B7EB9D53A}

 

 

; --------- Sourcedisknames and sourcediskfiles section -----------------------

 

; These sections identify source disks and files for installation. They are

; Shown here as an example, but commented out.

 

[Sourcedisksnames]

1 = "hellowdmchapter01", disk1 ,,

 

[Sourcedisksfiles]

Hellowdmchapter01.sys = 1, objchk_win7_x86/i386,

 

; --------- Classinstall/classinstall32 section -------------------------------

 

; Not necessary if using a standard class

 

; 9x Style

[Classinstall]

Addreg = class_addreg

 

; Nt Style

[Classinstall32]

Addreg = class_addreg

 

[Class_addreg]

Hkr, % deviceclassname %

Hkr, icon, "-19"

 

; --------- Destinationdirs section -------------------------------------------

 

[Destinationdirs]

Youmark_files_driver = 10, system32/Drivers

 

; --------- Manufacturer and models sections ----------------------------------

 

[Manufacturer]

% Mfgname % = mfg0

 

[Mfg0]

 

; PCI hardware IDs use the form

; PCI/ven_aaaa & dev_bbbb & subsys_cccccccc & rev_dd

; Change to your own ID

% Devicedesc % = youmark_ddi, PCI/ven_9999 & dev_9999

 

; ---------- Ddinstall sections -----------------------------------------------

; --------- Windows 9x -----------------

 

; Experimentation has shown that ddinstall root names greater than 19 characters

; Cause problems in Windows 98

 

[Youmark_ddi]

Copyfiles = youmark_files_driver

Addreg = youmark_9x_addreg

 

[Youmark_9x_addreg]

Hkr, devloader, * ntkern

Hkr, ntmpdriver, hellowdmchapter01.sys

Hkr, "Parameters", "breakonentry", 0x00010001, 0

 

; --------- Windows NT -----------------

 

[Youmark_ddi.nt]

Copyfiles = youmark_files_driver

Addreg = youmark_nt_addreg

 

[Youmark_ddi.nt.services]

Addservice = hellowdmchapter01, 0x00000002, youmark_addservice

 

[Youmark_addservice]

Displayname = % svcdesc %

Servicetype = 1; service_kernel_driver

Starttype = 3; service_demand_start

Errorcontrol = 1; service_error_normal

Servicebinary = % 10%/system32/Drivers/hellowdmchapter01.sys

 

[Youmark_nt_addreg]

HKLM, "system/CurrentControlSet/services/hellowdmchapter01/parameters ",/

"Breakonentry", 0x00010001, 0

 

; --------- Files (common )-------------

 

[Youmark_files_driver]

Hellowdmchapter01.sys

 

; --------- Strings section ---------------------------------------------------

 

[Strings]

Providername = "Renren ."

Mfgname = "Renren soft"

Devicedesc = "Hello World WDM! "

Deviceclassname = "renren_device"

Svcdesc = "Renren"

 

 

 

 

 

 

2. Registry

 

The content in the INF file will be reflected in the registry.

 

Hardware sub-Key

HKEY_LOCAL_MACHINE/system/CurrentControlSet/Enum/{detailed information about the device property of the device manager}

 

Class subkeys

HKEY_LOCAL_MACHINE/system/CurrentControlSet/control/class/{guid}

 

Service subkey

HKEY_LOCAL_MACHINE/system/CurrentControlSet/services/{driver name}

 

3. Installation Process

Step 1

 

Step 2

 

Step 3

 

Step 4

 

Step 5

Note * install from disk

 

Step 6

 

Step 7

 

Step 8

 

Step 9

Installation Complete

 

Step 10

View in Device Manager

 

Step 11

View attributes

 

4. Provide a compiled Driver (including the INF file, symbol file, and source code)

The Code is the first chapter of the "driver development technology details" CD.

You can use windbg and VMWare for simple debugging exercises.

The usage of windbg is described in the next blog.

 

 

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.