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 all 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
83 changes: 83 additions & 0 deletions microsoft-edge/dualengine/concepts/adapter-dll.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
---
title: Creating a DualEngine adapter plugin DLL
description: Understanding the requirements and uses of the DualEngine Adapter DLL.
author: MSEdgeTeam
ms.author: msedgedevrel
ms.topic: conceptual
ms.service: microsoft-edge
ms.subservice: windows-integration
ms.localizationpriority: high
ms.date: 11/06/2023
---
# Creating a DualEngine adapter plugin DLL

The DualEngine API can only be used from inside the Internet Explorer process. Therefore, to use the DualEngine API, you must create a plugin DLL that Internet Explorer loads. This DLL hosts your code that uses the DualEngine API, as well as any code that's needed for communicating with your main application; that's why it's referred to as the _adapter_.

To have Internet Explorer successfully load your DLL, do the following.


<!-- ====================================================================== -->
## Unlock the Limited Access Feature

The DualEngine API is a Limited Access Feature (LAF); that is, a feature that needs to be unlocked before it can be used. For more information, see [LimitedAccessFeatures Class](/uwp/api/windows.applicationmodel.limitedaccessfeatures).

The DualEngine API is not a typical LAF, in that `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, and as a plugin DLL, this will always be Internet Explorer. Therefore, to unlock the API, you need to call [DualEngineSessionFactory::TryUnlockFeature](../reference/dualenginesessionfactory.md#tryunlockfeature).

In addition, the identity of your application must be provided to Internet Explorer via a specific resource string that's set in your DLL. You can set the value in your resource file as follows:

```cpp
IDENTITY LIMITEDACCESSFEATURE { L"ExampleApp_6v1kqc8g0gcae" }
```

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


<!-- ====================================================================== -->
## Implement function exports

Your adapter DLL must implement the following function exports:
* `DualEngineInitialize`
* `DualEngineReady`

These exports are called by Internet Explorer when loading your DLL. They provide you with the factory objects for creating DualEngine API objects.

These exports are called from the main thread of the Internet Explorer process, so doing any long-term processing inside the exports will halt Internet Explorer. Therefore, to handle any long-running work, you should create a new thread.


<!-- ------------------------------ -->
#### DualEngineInitialize

```cpp
HRESULT APIENTRY DualEngineInitialize(DualEngineSessionFactory* pSessionFactory, PCWSTR pipeName)
```

###### Parameters

* `pSessionFactory` The factory object to use to access the DualEngine API.
* `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.

This is where you would typically set up communication between the adapter DLL and your host app. The `pipeName` string is provided for this purpose. Despite its name, the `pipeName` string doesn't need to be a pipe name; it's simply a string that's passed to your adapter based on the value of the `-DualEnginePipe` command-line flag that Internet Explorer was launched with, and has no other semantic meaning.

Although the `pSessionFactory` object is provided in this call, it's not valid to call `GetVersionedBrowserSession` yet, because at this point, Internet Explorer isn't ready to create Sessions.


<!-- ------------------------------ -->
#### DualEngineReady

```cpp
HRESULT APIENTRY DualEngineReady()
```

This export is called after Internet Explorer has finished all of its initial setup and the API is ready to use. It's now possible to call `GetVersionedBrowserSession` and get the Session object, assuming a successful call to `TryUnlockFeature` has been made.


<!-- ====================================================================== -->
## Bypass signing the adapter DLL

Internet Explorer has a requirement that for an adapter DLL to be loaded, it must be signed with a trusted signature. For testing and development purposes, this check can be bypassed, by turning on `TestSigning` for the device that you're testing on, as follows:

```cmd
Bcdedit.exe -set TESTSIGNING ON
```
99 changes: 99 additions & 0 deletions microsoft-edge/dualengine/concepts/launching-internet-explorer.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
---
title: Launching Internet Explorer
description: Launching Internet Explorer for DualEngine API Use
author: MSEdgeTeam
ms.author: msedgedevrel
ms.topic: conceptual
ms.service: microsoft-edge
ms.subservice: windows-integration
ms.localizationpriority: high
ms.date: 11/06/2023
---
# Launching Internet Explorer

After you've built your adapter DLL, you must launch Internet Explorer such that it is aware that it is being used for the DualEngine API, as follows.


<!-- ====================================================================== -->
## Required command-line arguments

The following command-line arguments must be present in order to launch Internet Explorer in the correct way to use the DualEngine API.


<!-- ------------------------------ -->
#### DualEngineAdapter

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

Indicates the path to the DualEngine API adapter DLL to load. For information on how to write an adapter DLL, see [Creating a DualEngine adapter plugin DLL](adapter-dll.md).


<!-- ------------------------------ -->
#### DualEnginePipe

`-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. Although `DualEnginePipe` is a required command-line parameter, it's only used if it's passed to your code through `DualEngineInitialize`. Therefore, despite its name, this need not be a pipe name; it can be any arbitrary string that you require.


<!-- ------------------------------ -->
#### APPID

`APPID:<your-app-id>`

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


<!-- ====================================================================== -->
## Optional command-line arguments

The following command-line argument is optional, to adjust Internet Explorer's behavior for the Dual Engine API.


<!-- ------------------------------ -->
#### DualEngineVersion

`-DualEngineVersion=<force_version_number>`

Forces Internet Explorer to instantiate DualEngine objects of the provided version, if it can. This will block the creation of DualEngine objects that don't match 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, if Internet Explorer fails to launch while launching it for DualEngine use, get detailed error handling information by checking the `StartupFailurePoint` registry value.


<!-- ------------------------------ -->
#### StartupFailurePoint

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

Contains a DWORD that indicates the location of the failure in the DualEngine startup path.

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. |
| 4 | Failed to canonicalize the path passed in via `DualEngineAdapter`; see the `StartupFailureHresult`. |
| 5 | Unused. |
| 6 | Unused. |
| 7 | `LoadLibrary` failed for the provided adapter DLL; see the `StartupFailureHresult`. |
| 8 | Could not find `DualEngineInitialize` in the adapter DLL. |
| 9 | The call to `DualEngineInitialize` failed; see the `StartupFailureHresult`. |
| 10 | Failed to set the provided Application User Model ID; see the `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's the failing HRESULT from the `StartupFailurePoint`, if there was a `StartupFailureHresult`. To see whether a given reason provides a `StartupFailureHresult`, see the above table.
48 changes: 48 additions & 0 deletions microsoft-edge/dualengine/get-started.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
---
title: Getting started with the DualEngine API
description: Get started using the Microsoft DualEngine API to embed and control an Internet Explorer instance within your app, to provide a browsing experience that's equivalent to a normal Internet Explorer tab, providing increased compatibility with legacy websites.
author: MSEdgeTeam
ms.author: msedgedevrel
ms.topic: conceptual
ms.service: microsoft-edge
ms.subservice: windows-integration
ms.localizationpriority: high
ms.date: 11/17/2023
---
# Getting started with the DualEngine API

This article walks you through the steps to start using the DualEngine API.


<!-- ====================================================================== -->
## Step 1: Get access to the DualEngine Limited Access Feature

Access to the DualEngine API is controlled via a Limited Access Feature (LAF). To gain access to the feature, reach out to dualengineapiaccess@microsoft.com.

The DualEngine LAF is handled somewhat atypically; for details, see [Unlock the Limited Access Feature](concepts/adapter-dll.md#unlock-the-limited-access-feature) in _Creating a DualEngine adapter plugin DLL_.


<!-- ====================================================================== -->
## Step 2: Download the DualEngine API header

The DualEngine API is a COM interface that's only officially supported via C++, and is not part of the normal Windows SDK. Therefore, you must [download the DualEngine API header dualengine.h](https://download.microsoft.com/download/c/5/0/c5035487-bd78-4fd0-9cc4-e1c5a3b654b7/dualengine.h), and then include it in your adapter DLL project.


<!-- ====================================================================== -->
## Step 3: Making an adapter DLL

The DualEngine API is accessed by providing a plugin DLL to Internet Explorer at launch. Internet Explorer loads the DLL on startup, calls some exports on the DLL, and provides you with the objects that you need in order to access the API. See [Creating a DualEngine adapter plugin DLL](concepts/adapter-dll.md).


<!-- ====================================================================== -->
## Step 4: Launching Internet Explorer

Finally, Internet Explorer must be launched and told where and how to load the adapter that you created. This can be done by launching Internet Explorer with the correct command-line arguments, as follows:

```
C:\Program Files\Internet Explorer\iexplore.exe -DualEngineAdapter=C:\temp\TestApp\TestAdapter.dll -DualEnginePipe=784 APPID:TESTAPP
```

For more information about these command-line arguments, see [Launching Internet Explorer](concepts/launching-internet-explorer.md).

At this point, Internet Explorer is now running your adapter code, which can now access the DualEngine API. To see what functionality is available, explore [DualEngine Win32 C++ Reference](reference/index.md).
42 changes: 42 additions & 0 deletions microsoft-edge/dualengine/intro.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
---
title: Introduction to the Microsoft DualEngine API
description: Host web content in your Win32 apps with the Microsoft DualEngine interface.
author: MSEdgeTeam
ms.author: msedgedevrel
ms.topic: conceptual
ms.service: microsoft-edge
ms.subservice: windows-integration
ms.localizationpriority: high
ms.date: 11/06/2023
---
# Introduction to the Microsoft DualEngine API

Use the Microsoft DualEngine API to embed and control an Internet Explorer instance within your app. The DualEngine API provides a browsing experience that's equivalent to a normal Internet Explorer tab, to provide increased compatibility with legacy websites.

The DualEngine API differs from similar APIs like the Web Browser Control, and requires distinct development work.

See also:
* [Getting started with the DualEngine API](./get-started.md)


<!-- ====================================================================== -->
## 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 the DualEngine API](./get-started.md)
* [Creating a DualEngine adapter plugin DLL](concepts/adapter-dll.md)
* [Launching Internet Explorer](concepts/launching-internet-explorer.md)
* [DualEngine Win32 C++ Reference](reference/index.md)
58 changes: 58 additions & 0 deletions microsoft-edge/dualengine/reference/accelerator.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
---
title: DualEngine Win32 C++ ACCELERATOR
description: Represents a keyboard accelerator (keyboard shortcut).
author: MSEdgeTeam
ms.author: msedgedevrel
ms.topic: conceptual
ms.service: microsoft-edge
ms.subservice: windows-integration
ms.date: 12/09/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 dualengineapiaccess@microsoft.com for more information.

Represents a keyboard accelerator (keyboard shortcut).

## Summary

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

## Members

#### eventType

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

> public ACCELERATOREVENTTYPE [eventType](#eventtype)

#### flags

The modifier keys present in the accelerator keystroke.

> public ACCELERATORFLAGS [flags](#flags)

#### keyCode

The virtual-key code of the keystroke.

> public DWORD [keyCode](#keycode)

50 changes: 50 additions & 0 deletions microsoft-edge/dualengine/reference/cryptdatablob.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
---
title: DualEngine Win32 C++ CryptDataBlob
description: Represents an SSL Certificate.
author: MSEdgeTeam
ms.author: msedgedevrel
ms.topic: conceptual
ms.service: microsoft-edge
ms.subservice: windows-integration
ms.date: 12/09/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 dualengineapiaccess@microsoft.com for more information.

Represents an SSL Certificate.

## Summary

Members | Descriptions
--------------------------------|---------------------------------------------
[cbData](#cbdata) | The number of bytes in `pbData`.
[pbData](#pbdata) | A buffer containing a DER-encoded X.509 certificate string.

## Members

#### cbData

The number of bytes in `pbData`.

> public DWORD [cbData](#cbdata)

#### pbData

A buffer containing a DER-encoded X.509 certificate string.

> public BYTE * [pbData](#pbdata)

Loading