[python-win32] Handle to a Driver

Tim Roberts timr at probo.com
Mon Apr 4 19:07:44 CEST 2005

Chi Tai wrote:

> Thanks Tim,
> i also tried this, but this call returns the following error:
> "DeviceIoControl() argument 3 must be string or read-only buffer, not 
> int"

Yes, I should have realized.  You need to convert this into a 4-byte string:

    import struct
    handle = struct.pack("<L", ReadEvent.handle )
    ret = DeviceIoControl( hDevice, IOCTL_SET_READ_EVENT,  handle, 0, 
None )

- Tim Roberts, timr at probo.com
  Providenza & Boekelheide, Inc.

More information about the Python-win32 mailing list