Debugging Tools for Windows |
One way to activate Logger is to start CDB or WinDbg and attach to a user-mode target application as usual. Then, use the !logexts.logi or !logexts.loge extension command.
This will insert code at the current breakpoint that will jump off to a routine that loads and initializes logexts.dll in the target application process. This is referred to as "injecting Logger into the target application."
There will actually be two instances of logexts.dll running, since this module is both a debugger extension DLL and the program that is injected into the target application. The debugger and target instances of logexts.dll communicate through a shared section of memory that includes the output file handles, current category mask, and a pointer to the log output buffer.
For information about attaching the debugger to the target application, see Attaching to a Running Process (User Mode) or Spawning a New Process (User Mode).
For the full syntax of each extension, see its reference page.
If you disable the text file output, a .txt file of size zero will still be created. This may overwrite a previously-saved text file in the same location.
If a category is disabled, the hooks for all APIs in that category will be removed so that there is no longer any performance overhead. COM hooks are not removed because they cannot be re-enabled at will.
Enabling only certain categories can be useful when you are only interested in a particular type of interaction that the program is having with Windows — for example, file operations. This reduces the log file size and also reduces the effect that Logger has on the execution speed of the process.
Since the buffer memory is managed by the target application, the automatic writing of the buffer to the log files on the disk will not occur if there is an access violation or some other non-recoverable error in the target application. In such cases, you should use this command to manually flush the buffer to the disk, or else the most recently-logged APIs may not appear in the log files.