Leaked source code of windows server 2003
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.

41 lines
1.9 KiB

  1. DBMON notes
  2. 10/7/94
  3. The first DWORD of the shared memory buffer contains the process ID of the
  4. client that sent the debug string. DBMON will print the process ID if the
  5. previous line printed was from another process, or if the previous line was
  6. from the same process and ended in a newline.
  7. The shared memory buffer must be 4096 bytes. If it is larger, it won't do any
  8. good. If it is smaller, nothing terrible will happen, but strings larger than
  9. the buffer will not be delivered, and a complaining message will be sent to the
  10. kernel debugger by the client. Why is it this size? Because shared memory
  11. comes in page-sized chunks, so we might as well ask for as much as will be used
  12. on the machines with the smallest pages. On machines with larger pages, the
  13. remainder of the page will be wasted anyway.
  14. Event DBWIN_BUFFER_READY must be an auto-reset event, so that only one client
  15. thread will use the buffer at a time. Using a manual reset event with
  16. PulseEvent will not work.
  17. Event DBWIN_DATA_READY need not be auto-reset, but it is simpler that way.
  18. Allowing multiple copies of DBMON to run might be amusing, put not particularly
  19. useful. As I originally wrote it, the messages were distributed randomly among
  20. the DBMON instances or be garbled. I added a check for ERROR_ALREADY_EXISTS so
  21. it won't run twice. The worst you can do to the client is cause it to print a
  22. message on the kernel debugger, as above.
  23. If DBMON is broken and never calls SetEvent(AckEvent), it will cause a 10
  24. second delay in the client every time OutputDebugString is called, then the
  25. message will be printed on the kernel debugger.
  26. OutputDebugString will force synchronization of client threads when DBMON is
  27. running. Letting the kernel debugger catch the strings will also synchronize
  28. threads, but the timing effects may be different. Caveat emptor.
  29. In a GUI version of DBMON, use MsgWaitForMultipleObjects.