Debugging the AD RMS Samples
Lately I’ve been running the AD RMS sample projects, included with the Windows SDK, and watching the values in the debugger to get a better understanding of each function. I thought perhaps that other developers might find this helpful. I’ll run through this process with one of the AD RMS sample projects (perhaps you don’t even know about these), in a step-by-step manner, so you can do it too.
Before you can run the AD RMS code, you need to set up an AD RMS development environment. You can set up your computer by following the instructions for Setting Up the Pre-Production Development Environment. The AD RMS Step-by-Step Guide is also helpful.
So, assuming that you’ve already set up your AD RMS development environment, you can go ahead and run some code. Navigate to the MachineActivation project on your development computer and open it up in Visual Studio:
C:\Program Files\Microsoft SDKs\Windows\<version>\Samples\Security\ADRMS\MachineActivation
If you have issues when you try to compile the project, you can check out my post concerning that and hopefully it will help you.
Once you get the solution to compile, make sure that you have the configuration settings set to Debug, and add a break point in wmain. You should now be able to Debug and step through the code while watching the local variables.