I wonder if there's a way to do the following: I have a structure containing a member which is a pointer to a block of memory allocated by the kernel when I pass the structure to an API function (the structure is a WAVEHDR, the member is the reserved field.)
I can set a data breakpoint on the value of the reserved member - that in itself is not very helpful. What I'd like to do, when the breakpoint is hit, is to dereference the pointer stored in reserved and set a new data breakpoint on the memory pointed to by that pointer. I would like VisualStudio to break when that memory is set to a known value.
I know how to set a breakpoint from a macro, and how to have Visual Studio invoke that macro from a breakpoint when it's hit, but I don't know whether I can pass the pointer value to the macro so that it can set the breakpoint on the right address. The UI doesn't provide a way to do it.
Is there a way for the macro to access information about the running program, and do things like evaluate global variables or other expressions? I could accomplish what I'm trying to do if I had that kind of programmatic access to the running code (during a breakpoint) from the macro.