Delphi y la WinRT

agosto 23, 2012 Por EliseoGN

Hay un tema que se está propagando rápidamente en la comunidad acerca del uso de WinRT bajo el nuevo sistema operativo de Microsoft y que está próximo a liberarse.

Recupero el tema tal cual se presentó en una de las discusiones que suelen generarse dentro de los foros de Embarcadero y que Allen Bauer Embarcadero Chief Scientist responde a una pregunta directa de Brandon Staggs de la compañia StudyLamp Software LLC

Q.- Brandon Staggs
Is there any indication that Embarcadero wants to support native Metro development using the unmanaged API?

A. – Allen Bauer
Yes. We are very keen on supporting WinRT with native Delphi & C++ code. Right now, the issues surrounding the WinRT space center around the fact that many OS-supplied APIs which are required by anyone implementing their own language RTL are actually off-limits unless you’re the VC++ RTL DLL. You know, little things like RtlUnwind for exception processing and VirtualAlloc (et. al.) for memory management… Any calls to those APIs from your application will automatically disqualify your application from being an «official» WinRT application capable of delivering through the MS app store.

Right now the VC++ RTL DLL is given special dispensation since that is the library that makes the calls to those forbidden APIs and not directly from the user’s app. We’re currently rattling some cages at MS to find out how or if they’re going to allow third-party tools to target WinRT. Until we can get past that, targeting WinRT isn’t actually possible from a deliverable product sense. We are able to build WinRT applications with Delphi that work with a developer certificate, however they all fail the application qualification checks because of the aforementioned (an other) APIs.

Like the APIs I mentioned above, there are lots of changes with WinRT that make targeting it a little more tricky. For instance, you cannot merely open any file, access the registry, and even use the loopback (127.0.0.1) adaptor. LoadLibrary cannot be used to load any arbitrary DLL; you must call LoadPackageLibrary and only on a DLL that is present in the digitally signed appx package. WinRT is a seriously locked down sandbox or «walled-garden» with some extremely high walls.

This is a little known or understood «feature» of Windows 8. I see no press that even talks about this at all. IOW, it’s Windows 8’s «dirty little secret.»

Mi opinión es que MS no podrá sustentar su política restrictiva por mucho tiempo y finalmente tendrá que modificarla y/o ser menos cerrada como sucedió con el tema de su Visual Studio Xpress cuando quiso restringirlo a sólo aplicaciones Metro, Web, Azure y WinPhone. Finalmente tuvo que modificar su proyecto y permitir aplicaciones de escritorio y de linea de comandos, cosa que no les ha de haber gustado mucho.

Mientras tanto, sigamos trabajando con nuestra herramienta preferida, por supuesto, estoy hablando de Delphi 🙂

Seguimos en contacto.