Windows NT 4.0 source code leak
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

118 lines
4.5 KiB

4 years ago
  1. Application WIN32 Logger
  2. 32 bit version
  3. Copyright(C) 1993-1995 Microsoft Corporation, All Rights Reserved.
  4. What is Logger?
  5. ---------------
  6. Logger is a tool that records the calls an application makes to the Win32 API
  7. as well as callbacks that the Win32 system makes to the application. The
  8. output file produced by Logger is a list of the API called, the parameters
  9. passed to the API and the return value from the API. Logger is also capable
  10. of timing these events and placing this information into the output file.
  11. Getting Ready for Logger
  12. ------------------------
  13. To use logger you will need the following binaries somewhere on your path -
  14. apfcvt.exe, logger32.dll, zser32.dll, zdi32.dll, zdvapi32.dll, zernel32.dll
  15. and zrtdll.dll. For each binary that you are interested in logging run
  16. apfcvt.exe against it. apfcvt.exe will modify the binary to dynamically
  17. link to the z-dlls rather than the actual Win32 dlls. To see how to use
  18. apfcvt.exe run "apfcvt -?" from the cmd line.
  19. Customizing Logger
  20. ------------------
  21. Logger does have some customizable options. The following list is of key
  22. entries in the system win.ini file and are each made under the section name
  23. [logger]. Defaults are specified by braces like this {0} and need not be
  24. entered in win.ini to get the listed functionality.
  25. DbgPort {0} log to the output file
  26. 1 log to the debugger via OutputDebugString
  27. Timing {0} timing OFF
  28. 1 timing ON
  29. Notes {1} record NOTES
  30. 0 do not record NOTES
  31. Note: NOTES are API that logger is not capable of logging the
  32. parameters to so there is a NOTE: line placed in the output file
  33. to record the call to the API.
  34. APIOnly {0} record API and parameters
  35. 1 record ONLY the API - no parameters
  36. LogSync {0} truncate output files when logger started
  37. 1 Do NOT truncate output files when started
  38. TimerTicks {0} Times recorded are elapsed times
  39. 1 Instead of elapsed times record current timer tick
  40. LogFile filename Filename to output logger information to.
  41. {output32.log}
  42. DatFile filename Filename to output extra logger data to.
  43. {output32.dat}
  44. Note: LogFile and DatFile have no effect if LogSync = 1
  45. FlushAfter # of bytes The number of cached bytes at which a flush to disk
  46. is done. Making this number small makes it easier
  47. to catch application problems but will increase run
  48. time.
  49. Alias {0} No aliasing is done
  50. 1 Aliasing on - aliasing will convert many object
  51. handles to a more generic format to facilitate log
  52. comparisons. The format is a mnemonic name, an
  53. underline character and a decimal number signifying
  54. the order the handle was allocated in.
  55. LogObjects 0 Turns off GDI object expansion
  56. 1 Turns on GDI object expansion
  57. Note: LogObjects defaults to the opposite of Timing.
  58. Putting It All Together
  59. -----------------------
  60. After you binaries have been converted with apfcvt and you have placed the
  61. z-dlls and Logger32.dll in your path you create the logger output file by
  62. simply running your application. When you exit your application the record of
  63. your execution will be in the output file. The format of logger lines are -
  64. xx![opt timing][line type]: [api name] [parameters]
  65. where -
  66. xx this is usually a hexadecimal nesting level number. It can
  67. also be "++" to signify an informational line.
  68. [opt timing] this is an 8 digit hexadecimal number representing either
  69. elapsed time since the matching CALL line (see [line type])
  70. or the current timer tick depending on the value of
  71. Logger.TimerTicks in win.ini. This item will only appear
  72. if Logger.Timing=1.
  73. [line type] this tells what this line really is. Possible values are -
  74. APICALL record of an API call
  75. APIRET record of an APICALL returning (matched by level number)
  76. MSGCALL record of a callback to an application WNDPROC
  77. MSGRET record of a callback returning to the caller
  78. ENUMCALL record of a callback to an enumeration procedure
  79. ENUMRET record of a enumeration callback returning to enumerator
  80. HOOKCALL record of a callback to an application HOOKPROC
  81. HOOKRET record of a HOOKPROC returning
  82. [api name] this is the API called if on an APICALL/RET line otherwise
  83. it will be the hexadecimal representation of the address
  84. of the function being called.
  85. [parameters] all parameters are dumped as hexadecimal or strings. Each
  86. parameter is separated from the previous one by a space.
  87. Structures are recorded inside a set of braces.