Mailing-List: contact cygwin-help AT sourceware DOT cygnus DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT sources DOT redhat DOT com Delivered-To: mailing list cygwin AT sources DOT redhat DOT com Message-ID: <3B96DA8B.3B50CB67@hszk.bme.hu> Date: Thu, 06 Sep 2001 04:08:11 +0200 From: Nemeth Marton X-Mailer: Mozilla 4.61 [en] (X11; I; Linux 2.4.4 i586) X-Accept-Language: en MIME-Version: 1.0 To: cygwin AT cygwin DOT com Subject: How to build a "function call logger" .dll? Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Hi! I want to build a "function call logger" .dll which could write out each function call with the call parameters to a logfile. Original working of a "program.exe" and "funcs.dll": -------------------- ------------------------- | program.exe | | funcs.dll | | | | | | imports: func_a <==================== exports: func_a | | | | | -------------------- ------------------------- If I want to log what functions the "program.exe" calls I have to make an other "funcs.dll" as a replacement. The original "funcs.dll" can be renamed as "funcs-orig.dll". Now this should work as follows: -------------------- -------------------- ------------------------- | program.exe | | funcs.dll | | funcs-orig.dll | | | | | | | | | | imports: func_a <===== exports: func_a | | imports: func_a <====exports: func_a | | | | | | | | | -------------------- ---------|----------- ------------------------- | \|/ logfile.txt The problem is that in the new source code I have to use 2 func_a: the first one to export to the program.exe and the second one to import from funcs-orig.dll like this: void func_a() { // this is the new exported function // log to logfile.txt func_a(); // this shoud be a call to funcs-orig.dll's func_a() } Is it possible to make something like this? Thanks, NMarci -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Bug reporting: http://cygwin.com/bugs.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/