Capturing OutputDebugString information in python
mail at timgolden.me.uk
Thu Oct 18 15:50:20 CEST 2007
> Wow, more of a response than I expected, thanks very much for the
> research. While not related to the mutex, the problem did appear to
> be permission related. For the record, on windows XP
> import sys
> import mmap
> import win32event
> buffer_ready = win32event.CreateEvent (None, 0, 0,
> data_ready = win32event.CreateEvent (None, 0, 0, "DBWIN_DATA_READY")
> buffer = mmap.mmap (0, 4096, "DBWIN_BUFFER", mmap.ACCESS_WRITE)
> win32event.SetEvent (buffer_ready)
> while win32event.WaitForSingleObject (data_ready, 1000) ==
> print "Timed out"
> print "Was signaled"
> appears to work. Write access appears to be required for the buffer
> (which I can read and get useful data from:
> print buffer.read(4)
> print buffer.read(4092)
> and no security object. I wasn't the one who figured this out, so I'm
> really not sure why it works...but it seems to.
Excellent! Do you mind if I add a solution based on this as a
How-Do-I? to my site  (suitably accredited, of course)?
More information about the Python-list