Cannot get DEBUGMONITOR to work

Jan 28, 2020
6
0
[ This is a re-port of something I recently sent to the wrong forum ]

Take Command 25.

I've seen previous (very old) posts here regarding the use of DEBUGMONITOR. Apparently some bugs were fixed that prevented the associated command from working. However, I cannot get it to work. Maybe I'm misunderstanding how it's supposed to operate.

I've tried many variations, e.g.:

DEBUGMONITOR FOREVER echo %_outputdebugstring%
DEBUGMONITOR FOREVER echo %_outputdebugstring
DEBUGMONITOR FOREVER echo Hello
DEBUGMONITOR FOREVER start calc
DEBUGMONITOR FOREVER msgbox OK TCC


None of the commands seem to be acted upon when I run a program I know outputs using OutputDebugString (and verified with DebugView). I am running TCC with elevated permissions if that affects anything.

Note that the environment variable _outputdebugstring is seen, as the last emitted string.

What am I doing wrong?

[ Also, the docs for DEBUGMONITOR incorrectly refer to ASSOCIATE in the options section ]
 
May 20, 2008
10,566
78
Syracuse, NY, USA
Rex, did you look into this? For what it's worth ...

I found a sample monitoring program (Ken Zhang, 2007) and built an x64 Release version. It built and worked on Win 10 right out of the box, but only when elevated. That was easy to fix. When opening the "DBWinMutex" mutex, I used SYNCHRONIZE instead of MUTEX_ALL_ACCESS. Now it works unelevated.

I also added outputting the PID. Maybe a future version of DEBUGMONITOR will set a variable for the PID.
 
May 20, 2008
10,566
78
Syracuse, NY, USA
I found a sample monitoring program (Ken Zhang, 2007) and built an x64 Release version. It built and worked on Win 10 right out of the box, but only when elevated. That was easy to fix. When opening the "DBWinMutex" mutex, I used SYNCHRONIZE instead of MUTEX_ALL_ACCESS. Now it works unelevated.
In fact, it seems you don't need the mutex at all. The code I'm using opens it but never uses it for anything. And the app still works when I remove all references to it. I found a second example which (similarly) opened the mutex and never used it. And I found a third example which didn't even mention the mutex.
 
Jan 28, 2020
6
0
Confirmed fixed in version 25.00.28. Thanks!

Incidentally, my first example usage above should have doubled the '%' characters for correct output.

DEBUGMONITOR FOREVER echo %%_outputdebugstring%%