IExtensionValidation::Validate method

Internet Explorer 11 will call this method prior to instantiating an ActiveX control.

Syntax

HRESULT Validate(
  [in]  REFGUID                     extensionGuid,
  [in]  LPWSTR                      extensionModulePath,
  [in]  DWORD                       extensionFileVersionMS,
  [in]  DWORD                       extensionFileVersionLS,
  [in]  IHTMLDocument2              *htmlDocumentTop,
  [in]  IHTMLDocument2              *htmlDocumentSubframe,
  [in]  IHTMLElement                *htmlElement,
  [in]  ExtensionValidationContexts contexts,
  [out] ExtensionValidationResults  *results
);

Parameters

  • extensionGuid [in]
    The REFGUID contains the GUID of the ActiveX control. This parameter is never null.

  • extensionModulePath [in]
    The LPWSTR string that contains the path to the DLL that implements the CoCreate of the ActiveX control. This parameter is never null.

  • extensionFileVersionMS [in]
    The DWORD that contains the most significant integer of the ActiveX control version. This parameter is never null.

  • extensionFileVersionLS [in]
    The DWORD that contains the least significant integer of the ActiveX control version. This parameter is never null.

  • htmlDocumentTop [in]
    The IHTMLDocument2 pointer to the top level document of the web page. This parameter is never null.

  • htmlDocumentSubframe [in]
    The IHTMLDocument2 pointer to the subdocument which contains the ActiveX control markup or the context in which the script that creates the ActiveX control exists. This parameter can be null if the ActiveX control doesn’t exist in a subdocument.

  • htmlElement [in]
    The IHTMLElement pointer to the HTML element that contains the ActiveX control markup. This parameter is null if script creates the ActiveX control.

  • contexts [in]
    The ExtensionValidationContexts structure indicating whether the ActiveX control is present in the markup or has been created directly in script.

  • results [out]
    The ExtensionValidationContexts structure that contains the security products security determination on whether to load the ActiveX control, block the ActiveX control, or block the entire page.

Return value

This method can return one of these values.

Return value Description
S_OK

The security product is able to make a security determination.

S_FALSE

The security product failed to make a security determination.

 

Remarks

IE11 will call the IExtensionValidation::Validate method for the registered security product every time it is about to instantiate an ActiveX control on a web page. Security products will need to implement this method to make the determination whether it is safe or not for IE11 to load an ActiveX control.

Examples

In the following example, a user visits a web page that loads a Silverlight control through script that is run from the top level document. In this example, IE11 will provide the following parameter values in its IExtensionValidation::Validate method call.

> extensionGuid
{dfeaf541-f3e1-4c24-acac-99c30715084a}

> extensionModulePath
c:\Program Files (x86)\Microsoft Silverlight\5.1.20125.0\npctrl.dll

> extensionFileVersionMS
0x50001

> extensionFileVersionLS
0x4e9d0000
  
> htmlDocumentTop
0x14e0eca0

> htmlDocumentSubframe
0x00000000

> htmlElement
0x00000000

> contexts
ExtensionValidationContextDynamic (0n1)

Requirements

Minimum supported client

Windows 7

Minimum supported server

Windows Server 2008 R2

IDL

ExtensionValidation.idl

See also

IExtensionValidation