Capturing OutputDebugString information in python

danbrotherston danbrotherston at gmail.com
Thu Oct 18 09:43:45 EDT 2007


<snip>

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,
"DBWIN_BUFFER_READY")
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) ==
win32event.WAIT_TIMEOUT:
   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.





More information about the Python-list mailing list