Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added Dual Engine API Ref (IE Mode) #2859

Merged
merged 33 commits into from
Jan 19, 2024
Merged
Show file tree
Hide file tree
Changes from 14 commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
8f44d00
Preview Commit
AndrewLakeMSFT Sep 8, 2023
f84e246
Add to toc
AndrewLakeMSFT Oct 9, 2023
b30f538
Update with generated reference documentation.
AndrewLakeMSFT Nov 7, 2023
26fd069
Fixed some spellings and added DualEngineSessionFactory docs
AndrewLakeMSFT Nov 7, 2023
c9e3a32
Fixed reference/toc.yml, added required metadata
AndrewLakeMSFT Nov 7, 2023
92258d5
Fix generated links and alerts
AndrewLakeMSFT Nov 8, 2023
fc4af6b
Merge branch 'main' into user/anlake/DualEngine/v20Docs
mikehoffms Nov 14, 2023
57497d0
Merge branch 'main' into user/anlake/DualEngine/v20Docs
mikehoffms Nov 15, 2023
d2eb5d6
Updated non generate documentation
AndrewLakeMSFT Nov 17, 2023
2a036d8
Fix missing index changes
AndrewLakeMSFT Nov 17, 2023
dcb360f
Fix links and put LAF warning under title
AndrewLakeMSFT Nov 17, 2023
286cf2c
Fix reference index links and access email
AndrewLakeMSFT Nov 17, 2023
bc75239
Fixing reference/index.md links
AndrewLakeMSFT Nov 17, 2023
fbd0c5d
Fix LAF access email on get-started
AndrewLakeMSFT Nov 17, 2023
1649479
adapter-dll, launchIE, get-started
mikehoffms Nov 18, 2023
4039cbd
Regeneration of reference documentation to after addressing issues in…
AndrewLakeMSFT Dec 7, 2023
3841f7d
Writer/Editor pass on the 4 Conceptual topics
mikehoffms Dec 8, 2023
ccf494a
Headings for adapter
mikehoffms Dec 8, 2023
ea797a3
Fix ms.author yaml field
mikehoffms Dec 8, 2023
8b30352
Writer/Editor pass in Ref .md files
mikehoffms Dec 8, 2023
2d7c845
Regenerated reference docs after feedback and refllink fix
AndrewLakeMSFT Dec 10, 2023
dcd0bec
Merge branch 'main' into user/anlake/DualEngine/v20Docs
mikehoffms Dec 22, 2023
a6a9b30
Minor changes while resolving all comments
mikehoffms Dec 22, 2023
093db6a
Demote Params heading from h4 to h6
mikehoffms Dec 22, 2023
aff5aeb
anchor linkfix
mikehoffms Dec 22, 2023
96f0ea2
Regened after addressing editor feedback
AndrewLakeMSFT Dec 28, 2023
d8b7ef2
Merge branch 'main' into user/anlake/DualEngine/v20Docs
mikehoffms Jan 10, 2024
b8a4d06
Merge branch 'main' into user/anlake/DualEngine/v20Docs
mikehoffms Jan 17, 2024
0904b45
Use new YAML fields
mikehoffms Jan 17, 2024
fdfb957
add yaml: ms.subservice: windows-integration
mikehoffms Jan 17, 2024
a134855
Add dualengine.h download link.
AndrewLakeMSFT Jan 18, 2024
0c82483
show filename
mikehoffms Jan 18, 2024
d5d6b36
Merge branch 'main' into user/anlake/DualEngine/v20Docs
mikehoffms Jan 18, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
79 changes: 79 additions & 0 deletions microsoft-edge/dualengine/concepts/adapter-dll.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
---
title: Understanding the DualEngine Adapter DLL
description: Understanding the requirements and uses of DualEngine Adapter DLL.
author: MSEdgeTeam
ms.author: edgededev
ms.topic: conceptual
ms.prod: microsoft-edge
ms.localizationpriority: high
ms.technology: windows-integration
ms.date: 11/06/2023
---

# Understanding the DualEngine Adapter DLL
The DualEngine API is an API that can only be used from inside the Internet Explorer process.
As such in order to make use of the API it is necessary to create a plugin DLL that Internet Explorer will load.
mikehoffms marked this conversation as resolved.
Show resolved Hide resolved
This DLL will host your code that uses the DualEngine API as well as presumably any code you need to communicate
mikehoffms marked this conversation as resolved.
Show resolved Hide resolved
with your main application, hence why it is referred to as the adapter.
mikehoffms marked this conversation as resolved.
Show resolved Hide resolved

There are a number of requirements to fulfill to have Internet Explorer successfully load your DLL.

## Limited Access Feature Requirements
The DualEngine API is what is known as a Limited Access Feature (LAF) which are features that need to be unlocked before
mikehoffms marked this conversation as resolved.
Show resolved Hide resolved
they can be used, see [LimitedAccessFeatures Class](/uwp/api/windows.applicationmodel.limitedaccessfeatures) for
mikehoffms marked this conversation as resolved.
Show resolved Hide resolved
more information.

With that said the DualEngine API is not a typical LAF and
`Windows.ApplicationModel.TryUnlockFeature` is not used to unlock the feature. This is
because LAF typically uses the application identity of the calling process to grant access, as a plugin DLL this
mikehoffms marked this conversation as resolved.
Show resolved Hide resolved
will always be Internet Explorer. Therefore to unlock the API you are required to call
[DualEngineSessionFactory::TryUnlockFeature](../reference/dualenginesessionfactory.md#tryunlockfeature).

In addition the identity of you're application is required to be provided to Internet Explorer via a specific
mikehoffms marked this conversation as resolved.
Show resolved Hide resolved
resource string set in your DLL, you can set the value in your resource file like so:
mikehoffms marked this conversation as resolved.
Show resolved Hide resolved
> IDENTITY LIMITEDACCESSFEATURE { L"ExampleApp_6v1kqc8g0gcae" }

Your specific identity string will be provided to you by Microsoft when LAF access is granted.

## Exports
It is required that your adapter DLL implement a number of exports. These exports are called by Internet Explorer
when loading your DLL and provide you with the factory objects for creating DualEngine API objects.

It should be noted that these exports are called from the main thread of Internet Explorer process so doing any
mikehoffms marked this conversation as resolved.
Show resolved Hide resolved
long term processing inside the exports will halt Internet Explorer, as such it is recommended to create a new
mikehoffms marked this conversation as resolved.
Show resolved Hide resolved
thread to handle any long running work.
mikehoffms marked this conversation as resolved.
Show resolved Hide resolved

#### DualEngineInitialize
> HRESULT APIENTRY DualEngineInitialize(DualEngineSessionFactory* pSessionFactory, PCWSTR pipeName)

##### Parameters
* `pSessionFactory` The factory object to use to access the DualEngine API
mikehoffms marked this conversation as resolved.
Show resolved Hide resolved
* `pipeName` A string that was passed in to Internet Explorer via the `-DualEnginePipe` command line flag.

This export is called immediately after Internet Explorer successfully loads the DLL. This is your first chance
to set up anything necessary for your application.

Presumably this is where you would setup communication between the adapter DLL and your host App, the `pipeName`
mikehoffms marked this conversation as resolved.
Show resolved Hide resolved
string is provided for this purpose. Despite it's name this need not be a pipe name, it is simply a string passed
mikehoffms marked this conversation as resolved.
Show resolved Hide resolved
to your adapter based on the value of `-DualEnginePipe` command line flag Internet Explorer was launched with and
mikehoffms marked this conversation as resolved.
Show resolved Hide resolved
has no other semantic meaning.

Also note that while the `pSessionFactory` object is provided in this call it is currently not valid to call
mikehoffms marked this conversation as resolved.
Show resolved Hide resolved
`GetVersionedBrowserSession` here as Internet Explorer is currently not ready to create Sessions.
mikehoffms marked this conversation as resolved.
Show resolved Hide resolved


#### DualEngineReady
> HRESULT APIENTRY DualEngineReady()

This export is called after Internet Explorer has finished all of it's initial setup and the API is ready to use.
mikehoffms marked this conversation as resolved.
Show resolved Hide resolved
It is now possible to call `GetVersionedBrowserSession` and get the Session object assuming a successful call to
mikehoffms marked this conversation as resolved.
Show resolved Hide resolved
`TryUnlockFeature` has been made.

## Signing
Internet Explorer has a requirement that an adapter DLL must be signed by a trusted signature for it to be loaded.

For testing and development purposes this check can be bypassed by turning TestSigning on for the device you're testing on.
mikehoffms marked this conversation as resolved.
Show resolved Hide resolved
This can be done with the following command.
mikehoffms marked this conversation as resolved.
Show resolved Hide resolved
```cmd
Bcdedit.exe -set TESTSIGNING ON
```
87 changes: 87 additions & 0 deletions microsoft-edge/dualengine/concepts/launching-internet-explorer.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
---
title: Launching Internet Explorer
description: Launching Internet Explorer for DualEngine API Use
author: MSEdgeTeam
ms.author: edgededev
ms.topic: conceptual
ms.prod: microsoft-edge
ms.localizationpriority: high
ms.technology: windows-integration
ms.date: 11/06/2023
---

# Launching Internet Explorer
Once you have built your adapter DLL you must launch Internet Explorer such that it is aware that it is being used
mikehoffms marked this conversation as resolved.
Show resolved Hide resolved
for the DualEngine API. This article will go over the steps required to do this.

## Required Command Line Arguments
The following command line arguments are required to be present in order to launch Internet Explorer in the correct
way to use the DualEngine
mikehoffms marked this conversation as resolved.
Show resolved Hide resolved

`-DualEngineAdapter=<full-path-to-adapter-dll>`

Indicates the path to the DualEngine API adapter DLL to load. See [Understanding the DualEngine Adapter DLL](adapter-dll.md)
for information on how to write an adapter DLL.

`-DualEnginePipe=<pipe-string>`

This argument provides a string that is eventually passed to the adapter DLL via the `DualEngineInitialize` export.
This can be used to pass a pipe name to your adapter code in order to bootstrap communication between your adapter
and main application. It should be noted that while this is a required command line parameter, it is only ever used
mikehoffms marked this conversation as resolved.
Show resolved Hide resolved
when passed to your code through `DualEngineInitialize`, therefore despite it's name this need not be a pipe name,
mikehoffms marked this conversation as resolved.
Show resolved Hide resolved
it can be any arbitrary string that you require.
mikehoffms marked this conversation as resolved.
Show resolved Hide resolved

`APPID:<your-app-id>`

This argument provides the Application User Model ID of your application. This ID is used to associated the
Internet Explorer process with your Application for a number of Windows Shell features. See
[Application User Model IDs](/windows/win32/shell/appids) for more information.

## Optional Command Line Arguments
The following command line arguments are optional and adjust Internet Explorer's behavior in regards to the Dual
Engine API.

`-DualEngineVersion=<force_version_number>`

Forces Internet Explorer to instantiate DualEngine objects of the provided version if it can. This will block the
mikehoffms marked this conversation as resolved.
Show resolved Hide resolved
creation of DualEngine objects not matching the provided version number, even if this version of Internet Explorer
supports this version.

## Diagnosing Launch Issues
There are a number of reasons that Internet Explorer may fail when launching. If this occurs before or while loading
your DLL it can be difficult to determine the exact reason and communicate it back to your application. Therefore
mikehoffms marked this conversation as resolved.
Show resolved Hide resolved
if Internet Explorer fails to launch while launching for DualEngine use we have provided a registry value you can
mikehoffms marked this conversation as resolved.
Show resolved Hide resolved
check to get detailed error handling information.

### StartupFailurePoint
`HKCU\SOFTWARE\Microsoft\Internet Explorer\EdgeIntegration\StartupFailurePoint`

Contains a DWORD that indicates the location of the failure in the DualEngine start up path.
mikehoffms marked this conversation as resolved.
Show resolved Hide resolved

The DWORD maps to the following reasons.

| DWORD | Reason |
|:-----:|-----------------------------------------------------------------------------------------------|
| 0 | No failure |
| 1 | Unused |
| 2 | Unused |
| 3 | The version specified by the DualEngineVersion argument was 0 |
mikehoffms marked this conversation as resolved.
Show resolved Hide resolved
| 4 | Failed to canonicalize the path passed in via DualEngineAdapter, see StartupFailureHresult |
| 5 | Unused |
| 6 | Unused |
| 7 | LoadLibrary failed for the provided adapter DLL, see StartupFailureHresult |
mikehoffms marked this conversation as resolved.
Show resolved Hide resolved
mikehoffms marked this conversation as resolved.
Show resolved Hide resolved
| 8 | Could not find DualEngineInitialize in the adapter DLL |
| 9 | The call to DualEngineInitialize failed, see StartupFailureHresult |
| 10 | Failed to set the provided Application User Model ID, see StartupFailureHresult |
| 11 | DLL failed signature check |
| 12 | Unused |
| 13 | DLL did not have IDENTITY LIMITEDACCESSFEATURE resource |


### StartupFailureHresult
`HKCU\Software\Microsoft\Internet Explorer\EdgeIntegration\StartupFailureHresult`

Contains a DWORD that is the failing HRESULT from the StartupFailurePoint if there was one, see above table to
mikehoffms marked this conversation as resolved.
Show resolved Hide resolved
see if a given reason provides one.
mikehoffms marked this conversation as resolved.
Show resolved Hide resolved


43 changes: 43 additions & 0 deletions microsoft-edge/dualengine/get-started.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
---
title: Getting Started with DualEngine API
description: Get started using DualEngine API in your application.
author: MSEdgeTeam
ms.author: edgededev
ms.topic: conceptual
ms.prod: microsoft-edge
ms.localizationpriority: high
ms.technology: windows-integration
ms.date: 11/06/2023
---
# Getting Started with DualEngine API
In this article we will walk you through the steps needed to start using the DualEngine API.

## Step 1 - Receiving Access to the DualEngine LAF
Access to the DualEngine API is controlled via a Limited Access Feature.
To gain access to the feature reach out to [email protected]

Those familiar with LAF should note that the DualEngine LAF is handled somewhat differently than is typical, the
details of which can be found in the [Limited Access Feature Requirements](concepts/adapter-dll.md#limited-access-feature-requirements)

## Step 2 - Download the DualEngine API header
The DualEngine API is a COM interface that we only officially support via C++ and is not part of the normal Windows
SDK. As such we have provided a header that you must include in your adapter DLL project which can be downloaded from
[DualEngine API Header Download]().
AndrewLakeMSFT marked this conversation as resolved.
Show resolved Hide resolved

## Step 3 - Making an adapter DLL
The DualEngine API is accessed by providing a plugin DLL to Internet Explorer at launch. Internet Explorer will
load the DLL on startup and call some exports on the DLL and provide you with the objects you need to access the
API. To learn more about creating your adapter DLL see [Understanding the DualEngine Adapter DLL](concepts/adapter-dll.md)
mikehoffms marked this conversation as resolved.
Show resolved Hide resolved

## Step 4 - Launching Internet Explorer
Finally Internet Explorer must be launched and told where and how to load the adapter you created this can be done
mikehoffms marked this conversation as resolved.
Show resolved Hide resolved
by launching Internet Explorer with the correct command line arguments.
```
C:\Program Files\Internet Explorer\iexplore.exe -DualEngineAdapter=C:\temp\TestApp\TestAdapter.dll -DualEnginePipe=784 APPID:TESTAPP
```
See [Launching Internet Explorer](concepts/launching-internet-explorer.md) for more information on these arguments.


At this point assuming your adapter is properly written, Internet Explorer is now running your adapter code which
can now access the DualEngine API. For details on what functionality is available to you please explore
mikehoffms marked this conversation as resolved.
Show resolved Hide resolved
[DualEngine Win32 C++ Reference](reference/index.md).
42 changes: 42 additions & 0 deletions microsoft-edge/dualengine/index.md
mikehoffms marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
---
title: Introduction to Microsoft DualEngine
description: Host web content in your Win32 apps with the Microsoft DualEngine interface.
author: MSEdgeTeam
ms.author: edgededev
ms.topic: conceptual
ms.prod: microsoft-edge
ms.localizationpriority: high
ms.technology: windows-integration
ms.date: 11/06/2023
---
# Introduction to Microsoft DualEngine API

The Microsoft DualEngine API allows you to embed and control a Internet Explorer within your app.
mikehoffms marked this conversation as resolved.
Show resolved Hide resolved

The DualEngine API differs from similar APIs like the Web Browser Control by providing a browsing experience
mikehoffms marked this conversation as resolved.
Show resolved Hide resolved
equivalent to a normal Internet Explorer tab for increased compatibility with legacy websites. However this
mikehoffms marked this conversation as resolved.
Show resolved Hide resolved
increase in compatibility comes at the cost of increased developer overhead.

To start building with the DualEngine APi, see [Getting Started with DualEngine API](get-started.md)
mikehoffms marked this conversation as resolved.
Show resolved Hide resolved

<!-- ====================================================================== -->
## Supported platforms

The following programming environments are supported:

* Win32 C/C++

DualEngine APIs can be used on the following versions of Windows:

* Windows 11
* Windows 10
* Windows Server 2022


<!-- ====================================================================== -->
## See also

* [Getting Started with DualEngine API](get-started.md)
* [Understanding the DualEngine Adapter DLL](concepts/adapter-dll.md)
* [Launching Internet Explorer](concepts/launching-internet-explorer.md)
* [DualEngine Win32 C++ Reference](reference/index.md).
56 changes: 56 additions & 0 deletions microsoft-edge/dualengine/reference/accelerator.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
---
description: Contains the information representing a keyboard accelerator.
title: DualEngine Win32 C++ ACCELERATOR
author: MSEdgeTeam
ms.author: edgededev
ms.prod: microsoft-edge
ms.date: 11/16/2023
keywords: dual engine, dualengine, iemode, win32 apps, win32, edge, ie mode, edge html, ACCELERATOR
topic_type:
- APIRef
api_name:
- ACCELERATOR
- ACCELERATOR.eventType
- ACCELERATOR.flags
- ACCELERATOR.keyCode
api_type:
- COM
api_location:
- ieframe.dll
---

# struct ACCELERATOR

> [!IMPORTANT]
> The DualEngine API is a limited access feature. Contact [email protected] for more information.

Contains the information representing a keyboard accelerator.

## Summary

Members | Descriptions
--------------------------------|---------------------------------------------
[eventType](#eventtype) | Specifies the type of keyboard event that the accelerator is processed on.
[flags](#flags) | Specifies the modifier keys present in the accelerator keystroke.
[keyCode](#keycode) | Specifies the virtual-key code keystroke.

## Members

#### eventType

Specifies the type of keyboard event that the accelerator is processed on.

> public ACCELERATOREVENTTYPE [eventType](#eventtype)

#### flags

Specifies the modifier keys present in the accelerator keystroke.

> public ACCELERATORFLAGS [flags](#flags)

#### keyCode

Specifies the virtual-key code keystroke.

> public DWORD [keyCode](#keycode)

48 changes: 48 additions & 0 deletions microsoft-edge/dualengine/reference/cryptdatablob.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
---
description: Represents an SSL Certificate.
title: DualEngine Win32 C++ CryptDataBlob
author: MSEdgeTeam
ms.author: edgededev
ms.prod: microsoft-edge
ms.date: 11/16/2023
keywords: dual engine, dualengine, iemode, win32 apps, win32, edge, ie mode, edge html, CryptDataBlob
topic_type:
- APIRef
api_name:
- CryptDataBlob
- CryptDataBlob.cbData
- CryptDataBlob.pbData
api_type:
- COM
api_location:
- ieframe.dll
---

# struct CryptDataBlob

> [!IMPORTANT]
> The DualEngine API is a limited access feature. Contact [email protected] for more information.

Represents an SSL Certificate.

## Summary

Members | Descriptions
--------------------------------|---------------------------------------------
[cbData](#cbdata) | The number of bytes in pbData.
mikehoffms marked this conversation as resolved.
Show resolved Hide resolved
[pbData](#pbdata) | A buffer containing DER encoded X509 certificate string.

## Members

#### cbData

The number of bytes in pbData.
mikehoffms marked this conversation as resolved.
Show resolved Hide resolved

> public DWORD [cbData](#cbdata)

#### pbData

A buffer containing DER encoded X509 certificate string.

> public BYTE * [pbData](#pbdata)

Loading