WRTPackageDebug v.1.0

By Giovanni Dicanio

http://msmvps.com/blogs/gdicanio/

2011, October 28th

Command line app to simulate the debug tool used by Matt Merry in his very interesting WinRT BUILD session:

"Windows Runtime internals: understanding "Hello World"

This app is entirely written in native C++11, using exceptions, STL and Win32 Platform SDK (no additional libraries - like ATL - are used).

It is almost a command line wrapper around the COM interface IPackageDebugSettings.

IDE: Microsoft Visual Studio 11 Developer Preview

OS: Windows 8 Developer Preview

Call the app .exe without any command line option to get a complete help.

The following table shows the mapping between IPackageDebugSettings COM interface methods and command line options:

IPackageDebugSettings Method Option Option Shortcut

EnableDebugging /EnableDebug /e DisableDebugging /DisableDebug /d Suspend /Suspend /s Resume /Resume /r TerminateAllProcesses /Terminate /t SetTargetSessionId /SetSessionId /i

WRTPackageDebug v1.0 – by G. Dicanio Pag. 1 The /ListPackages (/l) option can be used to get a list of available WinRT packages; each package can be conveniently identified by its list number instead of full name:

To enable debug mode for the processes of a specified package, the /EnableDebug (/e) option can be used:

WRTPackageDebug v1.0 – by G. Dicanio Pag. 2 The processes of the package can be suspended with the /Suspend (/s) option:

To disable debug mode for the processes of the specified package, the /DisableDebug (/d) option can be used:

WRTPackageDebug v1.0 – by G. Dicanio Pag. 3