Professional Documents
Culture Documents
Core Internals
Mubbasher Mukhtar mubbasher@ymail.com
WinRT Overview
Before we begin we have to understand the paradigm shift for Applications on WinRT
Application means traditionally a dll/component or self contained App In Windows Runtime each Application is a native component. This native component doesnt start of immediately on double click/touch as it usually does on traditionally windows system. Each Application extends the OS and becomes an integral part of the OS experience.
WinRT Overview
Each application is a COM object. We tell the WinRT what this component can do We specify what environment is required to run the component as well. Then anyone within the OS can consume it based on Contracts. WinRT provides a set of contracts that an Application can implement.
Upon Installation of HTML app we register it with the System and this process would at least have two major registration to WinRT
Now you would notice in case of Html App, the Target Platform is _neutral as its not compiled to native code.
It can run on any platform.
PackId\ActivatableClassId\App.wwa This provides a simple Description about the Package Package Description, Name, Icon, and Vendor Now the PackId here is a pointer and indication that the class registration is done with PackId, so if its to be launched, find details in Class registeration.
When we click or touch a tile, we Launch the Server (i.e. wwahost.exe) with security and authorizations provided in Class Registration which were specified in Application Manifest Plus standard sandbox security restrictions
We provide server with arguments i.e.
AppObjectEntryPoint, NavigateTo => default.html
WinRT Components
Class Catalog
Explorer.exe
1
Activation System
Extension Catalog
RPCSS
Service
2
4. Launch Request
Extension Registration
5. Starts
DCOM Launch
WWAHost.exe
1. Gets a list of Launch Extensions 2. On Click, Verifies ExtensionRegistration object. 3. Calls Activate on ExtensionRegistration object.
WWAHost.exe
This process provides a superset of functionality greater than that provided by the Microsoft Internet Explorer browser. Wait a second, how does WWAHost.exe knows about the content of my app?
Its just an OS binary
WWAHost.exe
In abstract view, when WWAHost starts it creates MTA (multithread Apartment)
WWAHost calls COM API, RoGetActivationFactory( CoreApplication, CLSID).
WWAHost.exe
Application Object extract parameters from the command line
Gets the server name Get the CustomAttribure (AppObjectEntryPoint, NavigateTo => default.html)
Now Activation System in Explorer.exe uses standard System contracts and calls Activate on The Application Object within WWAHost.exe Application Object have a reference to IViewProvider that was being passed to it via constrctor by WWAHost
WWAHost.exe
We go through the View creation same way we did with ICoreApplication
We get ICoreApplicationView We load WebInstance inside WWAHost, WebInstance::Load
Application Object (ICoreApplication) send ICoreApplicationView and ICoreWindow to WWAHost for rendering
Application Object calls WebInstance::Load (AppObjectEntryPoint => default.html) Finally Application Object calls WWAHost::Run, to render the Page. Yupiiii and we are done.