[Pyrex] Overlapped I/O

Greg Ewing greg at cosc.canterbury.ac.nz
Tue Jun 24 02:56:38 CEST 2003


> I am trying to make a DLL accessible to python using Pyrex, but I've
> run in= to a problem with overlapped I/O.  Do you have any suggestions
> on how to declare the following in Pyrex?

If the problem is because of the nested union/struct, you'll
have to separate them out and give them explicit type names,
e.g.

  cdef extern from "relevantheader.h":

    cdef struct _OffsetStruct:
      DWORD Offset
      DWORD OffsetHigh

    cdef union _OffsetUnion:
      _OffsetStruct off
      PVOID Pointer

    ctypedef struct OVERLAPPED:
      ULONG_PTR Internal
      ULONG_PTR InternalHigh
      _OffsetUnion u
      HANDLE hEvent
 
    ctypedef OVERLAPPED *LPOVERLAPPED

Greg Ewing, Computer Science Dept, +--------------------------------------+
University of Canterbury,	   | A citizen of NewZealandCorp, a	  |
Christchurch, New Zealand	   | wholly-owned subsidiary of USA Inc.  |
greg at cosc.canterbury.ac.nz	   +--------------------------------------+




More information about the Pyrex mailing list