CoInternetIsFeatureEnabledForUrl function

Determines whether the specified feature control is enabled for the security zone of the specified URL.

Syntax

HRESULT CoInternetIsFeatureEnabledForUrl(
       INTERNETFEATURELIST      FeatureEntry,
  _In_ DWORD                    dwFlags,
       LPCWSTR                  szURL,
       IInternetSecurityManager *pSecMgr
);

Parameters

FeatureEntry

A feature control from the INTERNETFEATURELIST enumeration.

dwFlags [in]

Specifies where to get the feature control value from.

GET_FEATURE_FROM_THREAD (0x00000001)

The current thread.

GET_FEATURE_FROM_PROCESS (0x00000002)

The current process.

GET_FEATURE_FROM_REGISTRY (0x00000004)

Reserved. Do not use.

GET_FEATURE_FROM_THREAD_LOCALMACHINE (0x00000008)

The local machine zone.

GET_FEATURE_FROM_THREAD_INTRANET (0x00000010)

The intranet zone.

GET_FEATURE_FROM_THREAD_TRUSTED (0x00000020)

The trusted zone.

GET_FEATURE_FROM_THREAD_INTERNET (0x00000040)

The Internet zone.

GET_FEATURE_FROM_THREAD_RESTRICTED (0x00000080)

The restricted zone.

szURL

A LPCWSTR that contains the URL to check.

pSecMgr

A pointer to the IInternetSecurityManager interface that is used for processing the URL action.

Return value

Returns one of the following values.

Return code Description
S_OK

The feature control is enabled.

S_FALSE

The feature control is disabled.

 

Remarks

The CoInternetIsFeatureEnabledForUrl function was introduced in Microsoft Internet Explorer 6 for Windows XP Service Pack 2 (SP2).

CoInternetIsFeatureEnabledForUrl is the recommended function to use for the FEATURE_MIME_SNIFFING feature control, the FEATURE_WINDOW_RESTRICTIONS feature control, and the FEATURE_ZONE_ELEVATION feature control. Each feature control has an associated URL action, URLACTION_FEATURE_MIME_SNIFFING, URLACTION_FEATURE_WINDOW_RESTRICTIONS, and URLACTION_FEATURE_ZONE_ELEVATION, respectively. Because the URL policy for each URL action can be set differently for each security zone, this function calls the IInternetSecurityManager::ProcessUrlAction method to determine the URL policy for the URL action in the zone of the specified URL. If the specified feature control is not one of these, or if szURL is NULL, then this function returns the same result as CoInternetIsFeatureEnabled.

If the policy is URLPOLICY_ALLOW, then this function returns S_FALSE; otherwise, it returns S_OK.

Note  Flags of the form GET_FEATURE_FROM_THREAD* (where "*" indicates zero or more characters) should only be used when the Feature entry is either FEATURE_LOCAL_MACHINE_LOCKDOWN or FEATURE_PROTOCOL_LOCKDOWN.

 

Requirements

Minimum supported client

Windows XP with SP2

Minimum supported server

Windows Server 2003

Product

Internet Explorer 6.0

Header

Urlmon.h

Library

Urlmon.lib

DLL

Urlmon.dll