CoInternetIsFeatureEnabledForUrl Function![]()
Determines whether the specified feature control is enabled for the security zone of the specified URL.
判断指定的安全控制,是否在URL所指定的安全区域可用
Syntax
HRESULT CoInternetIsFeatureEnabledForUrl( INTERNETFEATURELIST FeatureEntry, DWORD dwFlags, LPCWSTR szURL, IInternetSecurityManager *pSecMgr );
Parameters
FeatureEntry
szURL- Specifies a feature control from the INTERNETFEATURELIST enumeration.
dwFlags- [in] Specifies where to get the feature control's value from.
GET_FEATURE_FROM_THREAD
- The current thread.
GET_FEATURE_FROM_PROCESS- The current process.
GET_FEATURE_FROM_REGISTRY- Reserved. Do not use.
GET_FEATURE_FROM_THREAD_LOCALMACHINE- The local machine zone.
GET_FEATURE_FROM_THREAD_INTRANET- The intranet zone.
GET_FEATURE_FROM_THREAD_TRUSTED- The trusted zone.
GET_FEATURE_FROM_THREAD_INTERNET- The Internet zone.
GET_FEATURE_FROM_THREAD_RESTRICTED- The restricted zone.
Specifies a LPCWSTR that contains the URL to check. pSecMgrSpecifies a pointer to the IInternetSecurityManager interface that is used for processing the URL action.
Return Value
Returns one of the following values.
S_OK Indicates that the feature control is enabled. S_FALSE Indicates that the feature control is disabled.
Remarks
The CoInternetIsFeatureEnabledForUrl function was introduced in Internet Explorer 6 for Microsoft Windows XP Service Pack 2 (SP2).
CoInternetIsFeatureEnabledForUrl is the recommended function to use for the FEATURE_ZONE_ELEVATION, FEATURE_MIME_SNIFFING, and FEATURE_WINDOW_RESTRICTIONS feature controls.
The feature controls FEATURE_MIME_SNIFFING, FEATURE_WINDOW_RESTRICTIONS, and FEATURE_ZONE_ELEVATION have associated URL actions, respectively, URLACTION_FEATURE_MIME_SNIFFING, URLACTION_FEATURE_WINDOW_RESTRICTIONS, and URLACTION_FEATURE_ZONE_ELEVATION. The URL policies for these URL actions can be set differently for each security zone. If the specified feature control is not one of these or if szURL is NULL, then this function returns the same result as CoInternetIsFeatureEnabled.
This function uses the IInternetSecurityManager specified by pSecMgr to call the IInternetSecurityManager::ProcessUrlAction method, which determines the URL policy for the URL action in the zone of the specified URL. If the policy is URLPOLICY_ALLOW, then this function returns S_FALSE; otherwise it returns S_OK.
Function Information
Stock Implementation
urlmon.dll
Custom Implementation
No
Header
Urlmon.h
Import library
Urlmon.lib
Minimum availability
Internet Explorer 6.0
Minimum operating systems
Windows XP SP2