0

I work on developing an Extension for the EDGE browser. The Extension (UWP App) consists of 3 parts:

  1. The Extension itself. (JavaScript code)
  2. The UWP application that is for Native Messaging purposes. (UWP)
  3. The Desktop Bridge app that allows interaction with c++ desktop apps.(C#)

Also, I have a desktop application that is written on C++. Basically the Extension needs to establish communication with my desktop app, and to give an ability for my desktop app to get some info about the web page. My desktop application has tracing abilities, it uses ETW mechanism for tracing. It has a Controller object that is responsible for managing the Tracing Session; it has Provider that provides ability to trace some specific Events, and it has Consumer - an object that is able to display everything that was traced.

The Session has it's own unique name and GUID.

The Provider has it's own GUID.

The Provider registers itself within the session, so that Session accepts events generated by specific Provider.

Now is the question: Is there an ability to use Tracing infrastructure that I already have (written on C++), by the C# application (with EventSource) and by UWP application (using LoggingChannel, LoggingSession etc.)

I did some tries already, but without success.

For UWP application I tried to create LoggingSession by specifying NAME of my trace session, but it doesn't work. My c++ consumer is not being notified about new event happening. I have also tried create LoggingChannel and specifying my Trace Session GUID:

channel = new LoggingChannel(DEFAULT_CHANNEL_NAME, null, new Guid("xxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"));

but it crashes with the exception:

Additional information: Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED))

TylerH
  • 20,799
  • 66
  • 75
  • 101
Andriy
  • 84
  • 1
  • 9
  • 1
    Edge, like all UWP apps, runs in a sandbox. One thing the sandbox strongly enforces is forbidding any process interop. There are no known leaks, "Access is denied" is entirely normal and expected. You'd have to consider writing an extension. – Hans Passant May 29 '18 at 14:17
  • @HansPassant thanks for the comment. So it seems that separating tracing mechanisms is the only possible solution. – Andriy May 29 '18 at 14:23

1 Answers1

0

Please read the documentation here: (https://learn.microsoft.com/en-us/microsoft-edge/extensions/guides/native-messaging#adding-a-desktop-bridge-component) for creating Edge Extensions that use NativeMessaging + Desktop Bridge. The Extension and a runtime component (UWP) has to be packaged in the same package to enable NativeMessaging functionality.

You can try the GitHub sample at https://github.com/MicrosoftEdge/MicrosoftEdge-Extensions-Demos/tree/master/SecureInput to get a hang of this architecture.

WarPro
  • 350
  • 3
  • 5
  • I’m quite confused how your answer relates to my question about Event Tracing. I already have a package with uwp and decktop bridge app in it. It already establishes the communication with my c++ decktop app. – Andriy Jun 11 '18 at 11:12