Register the Web Filter from the Command Line

After copying the dynamic-link library (DLL) for the Web Response Modifier Web filter sample (Webresponsemodifier.dll) to the Forefront TMG installation folder on a Forefront TMG computer, you need to register the Web filter in the containing array in the stored Forefront TMG configuration. This is accomplished in the hierarchy of Forefront TMG administration COM objects by adding an FPCWebFilter object that will represent the Web filter to the FPCWebFilters collection accessed through the WebFilters property of the FPCExtensions object for the array. To launch this process, enter the following at a command prompt (from the folder where Webresponsemodifier.dll resides):

regsvr32 Webresponsemodifier.dll

This command is carried out by the code in the implementation of the DllRegisterServer function in the Web Response Modifier sample. This function is exported by the DLL by including its name among the names of the functions to be exported in the .def file. The code from the Web Response Modifier Web filter sample is shown as follows:

// DllRegisterServer - Adds entries to the system registry
STDAPI DllRegisterServer(void)
	HRESULT hr = RegisterWebFilter(true);
	return FAILED(hr) ? S_FALSE : S_OK;

The RegisterWebFilter function called in this implementation of DllRegisterServer does the actual work. This function is described in detail in Add the Web Filter to Forefront TMG.

Send comments about this topic to Microsoft

Build date: 11/30/2009

© 2008 Microsoft Corporation. All rights reserved.