阅读:1365回复:1
请问sfilter.dll是做什么的?
在DDK中的PASSTHRU中,请问sfilter.dll是做什么的?
|
|
|
沙发#
发布于:2004-04-01 13:40
SUMMARY
This sample demonstrates how to write an .inf file and a notify object for installing and configuring an NDIS intermediate driver as a filter. Note that writing a notify object is optional, and is not required for proper installation of a filter. A notify object should only be used if one needs to provide custom property sheet pages or if one needs non-default binding behavior. Note that in almost all cases, the default binding behavior afforded through the .inf is sufficient. The .inf supplied has ample documentation lines that clearly specify the parts of the .inf general to any networking component and the parts that are essential for installing a filter. The notify object code shows how to: Write a basic notify object to configure a filter. Defer registry operations until the "ApplyRegistryChanges" method is called, so that a "Cancel" operation will not result in unnecessary changes to the registry. Receive notifications when other components are added, removed, bound, or unbound. Provide a custom property sheet page that will be used by the Connections UI to configure your component. The sample compiles properly for 64-bit, builds properly with Microsoft? Visual C? 6.0, and supports Plug and Play. BUILDING THE SAMPLE To build the sample, type build. Once built, the sample will produce two binaries: Sfilter.dll and Snetcfg.exe. Sfilter.dll is the sample notify object for filter components, and Snetcfg.exe is a sample executable that shows how to use various INetCfg interfaces. INSTALLING THE SAMPLE Following are installation instructions for the Filter sample through the connection folder. 1. Create a local directory on the machine (for instance, d:\sample). 2. Copy Sfilter.dll, Sfiltern.tlb, Netsf.inf, Netsf_m.inf, Passthru.sys to the directory. 3. Open the connection folder. 4. Raise the properties for a LAN connection, click the Install button, select Service, and click Add. 5. Click Have Disk, and then specify the path to the local directory you just created. 6. Select Sample Filter, and then click OK in the Select Network Service dialog box. Here's an alternate way to install the sample by using Snetcfg.exe as the sample client. To install, type snetcfg -l d:\sample\netsf.inf -c s -i ms_sfilter. To uninstall, type snetcfg -u ms_sfilter KNOWN BUGS In Sfilter, INetCfgPropertyUi::SetContext sets m_guidDevice to GUID_NULL, which is temporary and won't really allow the sample user to store per-adapter information correctly. The components list displayed for the current connection may become empty when installing the filter for the first time. To fix this, close the connection properties (without adding anything else) and then reopen them. New values for the filter sample's parameters are not saved when closing the properties by clicking OK. To fix this problem, the notify object should send a PSM_CHANGED message to the parent property sheet, on the OnInitDialog function of its property page. CODE TOUR File Manifest File Description Filter Directory for the Filter notify object sample Dllmain.cpp File containing implementations of DLL entry point and exports Implinc.cpp File including source code for ATL utilities Netsf.inf Sample Filter .inf file Netsf_m.inf Sample Filter Miniport .inf file Pch.h Pre-compiled header file Netcfg.htm The documentation for the Filter sample Resource.h The resource header Sfilter.cpp Notify object's implementation for the sample filter Sfilter.def Filter sample's def file Sfilter.h The header file for Sfilter.cpp Sfilter.rc The resource file for the filter notify object's sample Sfilter.rgs Script-based registry support for the filter notify object Sfiltern.idl Filter notify object's .idl file Netcfg Directory for the NetCfg sample Idls.idl This file includes Netcfgx.idl Implinc.cpp File including guids definitions for the com stuff used by the Netcfg sample Main.cpp File containing implementations of main and usage functions Pch.h Pre-compiled header file Snetcfg.cpp The actual sample source for Netcfg APIs Snetcfg.h The header file for Sfilter.h Snetcfg.rc The resource file for the Netcfg sample |
|