Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations GregLocock on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

intercepting external process messages

Status
Not open for further replies.

scottydoesntknow

Computer
Jul 20, 2004
14
is there a way to intercept an arbitrary process's messages? I need to develop a QC program that monitors a testing program . that program uses a IEEE488 card to do the work. I need to know unobtrusively if that program is using the IEEE488 card, i could care less what the transmissions are. modifying the test program is out of the question. I have been reading that I might ba able to view the messages that it passes, is this possible with WINAPI calls?
 
Replies continue below

Recommended for you

ok
there seems to be at least two ways to accomplish this,
1) is to install hooks and look for certain messages but the problem with this is how do I find out what the messages are that I'm looking for
2) rip apart the dll that I need to monitor, make a new one with stubs to all the function calls to the real dll, renaming the original, of course. the problem with this is that it is slightly slower, and it might not handle new versions of that dll very well.

has anyone tried something like this, and if so what might be the better approach?

appreciated...
 
Logic analyzer

<nbucska@pcperipherals DOT com> subj: eng-tips
 
I have 250 testing machines, I can't really afford to install a large number of logic analyzers in the lab. It needs to be done in the software somehow across different contexts.
 
SDK:

National Instruments has a feature for 488.2 cards called NI-Spy that monitors API calls. I do not know if it works for other manufactures GPIB cards, but it may be worth looking into. Here is a link, it is mentioned on the 3rd page of the Adobe document.


Good Luck!

Wheels within wheels / In a spiral array
A pattern so grand / And complex
Time after time / We lose sight of the way
Our causes can't see / Their effects.
 
Assuming that the program runs on a PC or compatible:

You could write a memory resident program which intercepts
the communication between the 488 driver and the rest
of the system. You could run this before the test program
and it would record the communication.

I would start with disassembling the 488 device driver.
Your program should patch into this.



<nbucska@pcperipherals DOT com> subj: eng-tips
 
<------------------------------>
National Instruments has a feature for 488.2 cards called NI-Spy that monitors API calls. I do not know if it works for other manufactures GPIB cards, but it may be worth looking into. Here is a link, it is mentioned on the 3rd page of the Adobe document.
<------------------------------>

I have thought about this. I have used NI-SPY to debug my programs in the past. The problem with this is that I can't control the execution of it. It could run in the background and write out to a file that I could monitor, but then I have two processes running along with the test program, some of the older programs are tempermental and I'm afraid that combined with the slowness of the PC's that we are using it might tend to crash the test. I agree that this would be the easiest solution to this... but not an option.
 
nbuckska,
this is exactly what i had in mind. So, you're saying that the function forwarding via a DLL might be the best method for doing this?
By the way, I appreciate all the help on this.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor