Feature Enable Flags

The following are the Feature Enable Flags that can be passed as the dwFlags argument for such URLMON functions as CoInternetIsFeatureEnabled and CoInternetSetFeatureEnabled. Despite being numbering as powers of two, these are not big flags. Combinations are unsupported.

Constant Symbolic Names
0x01 GET_FEATURE_FROM_THREAD
SET_FEATURE_ON_THREAD
0x02 GET_FEATURE_FROM_PROCESS
SET_FEATURE_ON_PROCESS
0x04 GET_FEATURE_FROM_REGISTRY
SET_FEATURE_ON_REGISTRY
0x08 GET_FEATURE_FROM_THREAD_LOCALMACHINE
SET_FEATURE_ON_THREAD_LOCALMACHINE
0x10 GET_FEATURE_FROM_THREAD_INTRANET
SET_FEATURE_ON_THREAD_INTRANET
0x20 GET_FEATURE_FROM_THREAD_TRUSTED
SET_FEATURE_ON_THREAD_TRUSTED
0x40 GET_FEATURE_FROM_THREAD_INTERNET
SET_FEATURE_ON_THREAD_INTERNET
0x80 GET_FEATURE_FROM_THREAD_RESTRICTED
SET_FEATURE_ON_THREAD_RESTRICTED

The 0x01 and 0x02 values select a feature’s per-thread and per-process states, respectively. The initial per-process state is loaded from the registry, or is defaulted, when the process first calls CoInternetIsFeatureEnabled or CoInternetSetFeatureEnabled. This also initialises the per-thread state for whichever is the current thread at the time. Otherwise, the initial per-thread state is copied from the per-process state at thread attachment.

Though the 0x04 value is defined symbolically in URLMON.H, it is not supported in the URLMON code. As for any unsupported flag, it causes CoInternetIsFeatureEnabled to return the Internet Explorer default for the feature and it is ignored by CoInternetSetFeatureEnabled.

The per-zone values 0x08 to 0x80 are curiously under-documented by Microsoft. Their implementation is curious, also. Each corresponds to an Internet security zone (in decreasing order of trustworthiness). URLMON maintains a per-zone state for each thread, but there is not a per-zone state for each feature, only for all features. When these values are given as the dwFlags argument to CoInternetIsFeatureEnabled or CoInternetSetFeatureEnabled, the FeatureEntry argument is irrelevant. Presumably, this is an implementation detail and is not to be depended on, but who knows? The per-zone states are initialised with the per-thread states. The initial state is simply whether FEATURE_PROTOCOL_LOCKDOWN is enabled.