Управление разрешением записи в виртуальный каталог
HRESULT SetBITSUploadEnabledSetting( LPWSTR pszPath, bool Enable )
{
	HRESULT hr;
	IBITSExtensionSetupFactory* pExtensionSetupFactory = NULL;
	IBITSExtensionSetup* pExtensionSetup = NULL;
	hr = CoCreateInstance( __uuidof(BITSExtensionSetupFactory),NULL,CLSCTX_INPROC_SERVER,__uuidof(IBITSExtensionSetupFactory),(void**)&pExtensionSetupFactory );
	if( SUCCEEDED(hr) )
	{
		hr = pExtensionSetupFactory->GetObject( BSTR(pszPath),&pExtensionSetup );
		if( SUCCEEDED(hr) )
		{
			if( Enable )
			{
				hr = pExtensionSetup->EnableBITSUploads();
			}
			else
			{
				hr = pExtensionSetup->DisableBITSUploads();
			}
			pExtensionSetup->Release();
		}
		pExtensionSetupFactory->Release();
	}
	return hr;
}

Поделитесь материалом с коллегами и друзьями