After the example is compiled successfully, a sys file is generated. To load the driver to the system, you must create
INFFile. This step can also be saved because existing examples are used. Right-click
INFFile, select "Install" in the pop-up menu. Note that the starttype parameter in INF can control the method in which the driver is loaded: service_auto_start (2) security mode does not automatically load service_boot_start (0) when the driver is started in system security mode, it will automatically load service_demand_start (3). the driver will not automatically load because it is a test. I use service_demand_start, that is, manually load the driver. The example is the minifilter driver. Therefore, you can use the "fltmc load driver name" in the command prompt line for loading. The corresponding unload is "fltmc unload ". If it is another driver, use "Net start driver name" for loading, and the corresponding uninstall is "net stop driver name ". Note that the driver name is not the file name, but the servicename value of [settings] in INF. When the driver is to be released, you can also use
Createservice &
Startservice API.
INFYou can refer to the example for the file writing method, or use a ready-made change. The following is an excerpt from xiangxiangren of the driver development network.
INFFile. It is easier to change it. Thank you, xiangxiangren.
Simple Method for obtaining file filtering driver to install inf file
Many colleagues directly modify the sfilter. inf file when obtaining the INF file. This modification requires patience, and it is difficult to modify the file by mistake. Some colleagues do not need to modify it. The result is sfilter all over the sky :). I modified the sfilter installation file so that you can easily get your own installation file by modifying the final string list. The filter driver can be used for any file to be statically loaded. The content is as follows:
[Version]
Signature = "$ Windows NT $"
Class = "activitymonitor"; this is determined by the work this filter driver does
Classguid = {b86dff51-a31e-4bac-b3cf-e8cfe75c9fc2}; this value is determined by the class
Provider = % myname %
Driverver = 08/28/2005, 1.0.0.1
Catalogfile = MyCat. CAT; A catalogfile entry is required for a WHQL signature.
; The actual catalog file will be provided by WHQL.
; Catalog file for this sample is not provided for use.
[Destinationdirs]
Defaultdestdir = 12
My. driverfiles = 12; % WINDIR %/system32/Drivers
[Sourcedisksnames]
1 = % mydisk %
[Sourcedisksfiles]
% Mysysfilename % = 1
[Defainstall install]
Optiondesc = % myservicedesc %
Copyfiles = My. driverfiles
[Defainstall install. Services]
Addservice = % myservicename %, my. Service
Addreg = My. addregistry
[Defaultuninstall]
Delfiles = My. driverfiles
Delreg = My. delregistry
[Defaultuninstall. Services]
Delservice = % myservicename %, 0x200
[My. Service]
Displayname = % myservicename %
Description = % myservicedesc %
Servicebinary = % 12%/% mysysfilename %; % WINDIR %/system32/Drivers/jwfvfs. sys
Servicetype = 2; service_file_system_driver
Starttype = 0; service_boot_start
Errorcontrol = 1; service_error_normal
Loadordergroup = "fsfilter activity monitor"; "filter" If install to 2 K.
Addreg = My. addregistry
[My. addregistry]
[My. delregistry]
[My. driverfiles]
% Mysysfilename %
[Strings]
Myname = "Tan Wen"
Myservicedesc = "Tan wen's file system filter ."
Myservicename = "tanwenfsf"
Myregistry = "system/CurrentControlSet/services/tanwenfsf"
Mydisk = "Tan Wen source media"
Mysysfilename = "tanwen. sys"
When modifying, you only need to modify the final string list, which is the developer name, service description, service name, registry location, disk tag, and driver file name. For temporary use, you only need to modify the driver file name.
To add a registry entry, enter the my. addregistry and my. delregistry sections above.
You can only install Windows XP or above. When installing to 2000, you need to change the above "fsfilter activity monitor" to "filter", because there is no category of activity monitor in 2000. In XP, "fsfilter activity monitor" is recommended for ms.