📄 addfiltr.htm
字号:
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=windows-
1252">
<META NAME="Generator" CONTENT="Microsoft Word 97">
<TITLE>Addfilter
</TITLE>
</HEAD>
<BODY LINK="#0000ff">
<FONT FACE="Verdana" SIZE=5><H2>Addfilter
</H2>
</FONT><FONT FACE="Verdana" SIZE=2>
<P><span style="color:#FF0000;font-size:10pt;font-family:Arial">[This is preliminary
documentation and subject to change.]</span></P>
<H3>SUMMARY</H3></FONT><FONT FACE="Verdana" SIZE=2><P>
Addfilter is a command-line application which adds and removes filter drivers for a given drive or volume.
It is intended to demonstrate how to insert a filter driver into the driver stack of a device. The sample
illustrates how to do this by using the SetupDi APIs.
The sample works on the x86 platform. It has only been tested in a 32-bit environment. Since Addfilter
is not a driver, it does not deal with Plug and Play or Power Management.
<p>
No INF file is needed to install this application. <P>
<H3>BUILDING THE SAMPLE</H3></FONT><FONT FACE="Verdana"
SIZE=2><P>
Enter the checked or free build environment. Then,
while in the Addfilter sample directory, type <b>build</b>. A successful build produces
the executable Addfilter.exe.
<H3>RELEASE NOTES</H3></FONT><FONT FACE="Verdana" SIZE=2><P>
1. This initial sample does not check the filter for validity before it is added to the driver
stack. If an invalid filter is added, the specified device may no longer be
accessible.
<P>
<blockquote><B>Important:</B> If you attempt to add a non-existent filter to a boot device and then reboot, the system
may
show the error message INACCESSIBLE_BOOT_DEVICE. If this happens, you will be unable to start the computer.
To fix this, when the boot menu is displayed at startup, go to the Advanced Options screen and select <b>Use Last Known Good Profile</b>.
</blockquote><P>
If you attempt to add a non-existent filter to a normal (non-boot) device (CD drive, floppy drive, etc.), you will need
to go into the Device Manager, uninstall the device, reboot, and re-add the device from Add Hardware.
Also, be careful not to add a filter to a driver with which it is not designed to operate.
Unpredictable results may ensue.
<p>
2. The sample is intended for use with upper filter drivers only.
<p>
3.
When you add a filter to a device, that device needs to be restarted.
Depending
on the device, this may necessitate restarting your computer.
The <b>RestartDevice</b> function (in Addfilter.c) stops the specified device and then restarts it. If the device has been stopped but not restarted, and the
machine is restarted, the reboot will not necessarily restart the device. You will need to call the <b>RestartDevice</b> function to restart
your device.
<p>
4. Since the sample currently enumerates only disk devices, the sample can only operate on devices of this class.
One way in which you could extend this sample code is by adding another command-line argument that handles other device types.
<p>
5.
The sample runs in user mode only.
<p>
<b>Usage:</b>
addfilter [/listdevices] [/device device_name] [/add filter] [/remove filter]
<p>
If the device name is not supplied, settings will apply to all devices.
<p>
If there is no /add or /remove argument, a list of currently installed drivers will be printed.
<H3>CODE TOUR</H3>
<H4>File Manifest</H4>
</FONT><U><PRE>File		Description
</U>
Addfilter.c	the main source file
Addfilter.rc	version resource file
Sources	 needed to build
Makefile	needed to build
</FONT><P ALIGN="CENTER"><A HREF="#top"><FONT FACE="Verdana" SIZE=2>Top of
page</FONT></A><FONT FACE="Verdana" SIZE=2> </P></FONT>
<TABLE CELLSPACING=0 BORDER=0 WIDTH=624>
<TR><TD VALIGN="MIDDLE" BGCOLOR="#00ffff" HEIGHT=2>
<P></TD>
</TR>
</TABLE>
<FONT FACE="MS Sans Serif" SIZE=1><P>© Microsoft Corporation 1999</FONT><FONT
FACE="Verdana" SIZE=2> </P></FONT></BODY>
</HTML>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -