Microsoft Internet Security and Acceleration Server 2000

Saving Configuration Data in the Vendor Parameter Set

Using this procedure, add code to save the filter configuration data in the vendor parameter set.

To save the filter configuration data in the vendor parameter set

  1. Add the following function to store the values in the filter's vendor parameter set:
    HRESULT PutVendorData(FPCLib::IFPCApplicationFilterPtr spiApplicationFilter,
    					const _bstr_t& bsVirusString,
    					const _bstr_t& bsPrefixString,
    					const _bstr_t& bsSMTPIPAddress)
    	HRESULT hr = S_OK;
    	FPCLib::IFPCVendorParametersSetsPtr spIFPCVendorParametersSets;
    	FPCLib::IFPCVendorParametersSetPtr spIFPCVendorParametersSet;
    		spIFPCVendorParametersSets = spiApplicationFilter->VendorParametersSets;
    			spIFPCVendorParametersSet = spIFPCVendorParametersSets->Item(_bstr_t(PARAM_SET_GUID));
    			//Create a new parameter set
    			spIFPCVendorParametersSet = spIFPCVendorParametersSets->Add(_bstr_t(PARAM_SET_GUID),VARIANT_FALSE);
    		spIFPCVendorParametersSet->Value[_bstr_t("VirusString")]   = bsVirusString;
    		spIFPCVendorParametersSet->Value[_bstr_t("PrefixString")]  = bsPrefixString;
    		spIFPCVendorParametersSet->Value[_bstr_t("SMTPIPAddress")] = bsSMTPIPAddress;
    	catch(_com_error& err)
    		return err.Error();
    	return S_OK;
  2. You need to add a function that will call PutVendorData with the values from ISA Management. To implement this function, override the OnApply method of the CSnapInPropertyPageImpl class. This method is called whenever you click the Apply or OK buttons. Add the following code to your class:
    	// This member function is called when the user clicks the OK or the Apply button.
    	virtual BOOL OnApply()
    		HRESULT hr;
    		// _bstr_t bsVirusString, bsPrefixString;
    		char sVirusString[100], sPrefixString[100];
    		::GetWindowTextA (::GetDlgItem (m_hWnd, IDC_VIRUS_STRING),
    							reinterpret_cast <char *> (&sVirusString),
    		::GetWindowTextA (::GetDlgItem (m_hWnd, IDC_PREFIX_STRING),
    							 reinterpret_cast <char *> (&sPrefixString),
    		hr = ::PutVendorData (m_spiApplicationFilter,
    		return TRUE;
  3. Build.