IBITSExtensionSetup interface (bitscfg.h)
Use the IBITSExtensionSetup interface to enable or disable BITS uploads to a virtual directory.
This interface is an ADSI extension. To get a pointer to this interface, call the ADsGetObject ADSI function as shown in Example Code.
If you use this interface from a setup program that also installs the BITS server, you must call the IBITSExtensionSetupFactory::GetObject method to get a pointer to this interface instead of calling the ADsGetObject function.
Inheritance
The IBITSExtensionSetup interface inherits from the IUnknown interface. IBITSExtensionSetup also has these types of members:
Methods
The IBITSExtensionSetup interface has these methods.
IBITSExtensionSetup::DisableBITSUploads Use the DisableBITSUploads method to disable BITS upload on the virtual directory to which the ADSI object points. This method sets the BITSUploadEnabled IIS extension property. |
IBITSExtensionSetup::EnableBITSUploads Use the EnableBITSUploads method to enable BITS upload on the virtual directory to which the ADSI object points. This method sets the BITSUploadEnabled IIS extension property. |
IBITSExtensionSetup::GetCleanupTask Use the GetCleanupTask method to retrieve an interface pointer to the cleanup task associated with the virtual directory. |
IBITSExtensionSetup::GetCleanupTaskName Use the GetCleanupTaskName method to retrieve the name of the cleanup task associated with the virtual directory. |
Remarks
This interface is registered on the server when you install the BITS server extension.
On Windows Server 2003, use the Windows Components Wizard to install the BITS server extension. From Control Panel, select Add or Remove Programs. Then, select Add/Remove Windows Components to display the Windows Components Wizard. The BITS server extension is a sub-component of Internet Information Services (IIS) which is a sub-component of Web Application Server.
Examples
The following example shows how to use the ADsGetObject function to get a pointer to the IBITSExtensionSetup interface.
//Set the BITSUploadEnabled IIS configuration setting.
//The pszPath parameter contains the path to the directory service.
//For example, "IIS://<machine name>/w3svc/1/<virtual directory>".
//The Enable parameter contains true (enable) or false (disable).
HRESULT SetBITSUploadEnabledSetting(LPWSTR pszPath, bool Enable)
{
HRESULT hr;
IBITSExtensionSetup* pExtensionSetup = NULL;
hr = ADsGetObject(pszPath, __uuidof(IBITSExtensionSetup), &pExtensionSetup);
if (SUCCEEDED(hr))
{
if (Enable)
{
hr = pExtensionSetup->EnableBITSUploads();
}
else
{
hr = pExtensionSetup->DisableBITSUploads();
}
pExtensionSetup->Release();
}
return hr;
}
Requirements
Requirement | Value |
---|---|
Minimum supported client | Windows Vista |
Minimum supported server | Windows Server 2003 |
Target Platform | Windows |
Header | bitscfg.h |
Redistributable | BITS 1.5 on Windows XP |