There are instances where if the user clicks Ctrl+C to close realmon, the session isn't getting disposed.
Repro Steps
Run realmon normally and note the session name by putting a break point here.
Ctrl+C to close the session.
Open up a command line prompt / powershell in admin mode.
logman query -ets to list all the sessions on the machine. Here is where I found the session still exists even after exiting the process.
Eventually, this will result in the following exception:
Unhandled exception. System.Runtime.InteropServices.COMException (0x800705AA): Insufficient system resources exist to complete the requested service. (0x800705AA).
Solution
Subscribe to the Console.CancelKeyPress event and explicitly dispose the session.
There are instances where if the user clicks
Ctrl+C
to close realmon, the session isn't getting disposed.Repro Steps
Ctrl+C
to close the session.logman query -ets
to list all the sessions on the machine. Here is where I found the session still exists even after exiting the process.Eventually, this will result in the following exception:
Unhandled exception. System.Runtime.InteropServices.COMException (0x800705AA): Insufficient system resources exist to complete the requested service. (0x800705AA)
.Solution
Subscribe to the
Console.CancelKeyPress
event and explicitly dispose the session.