[python-win32] Re: inb() and outb() with Python Win32 ?
Thomas Heller
theller at python.net
Mon Oct 11 21:35:01 CEST 2004
Tim Roberts <timr at probo.com> writes:
> On Mon, 11 Oct 2004 10:27:44 +0200, Cedric Delfosse
> <cedric.delfosse at linbox.com> wrote:
>
>>do you know if it is possible to do low level port I/O with the win32
>>API ? (same as inb/outb function in C)
>>I found some Python modules around, but I'd prefer to use the Python
>>Win32 bindings.
>>
>
>
> There are no Win32 APIs for doing port I/O. When you call inb() and
> outb() from C, if you have optimizations turned on, they are in-lined
> directly to IN and OUT instructions. If you do not have optimizations
> turned on, they call an assembler routine in the C run-time library.
> A module in C is the best you can do.
Or ctypes:
cdll.msvcrt._inp(...)
cdll.msvcrt._outp
> Are you aware that port I/O in NT/2K/XP requires the help of a kernel
> driver? You can do it directly from a Win32 app in Win 98, but not on
> the NT-derived systems.
True, of course.
Thomas
More information about the Python-win32
mailing list