A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2012-November/122894.html below:

[Python-Dev] Handling support for newer OS features at run time

[Python-Dev] Handling support for newer OS features at run time [Python-Dev] Handling support for newer OS features at run timeRichard Oudkerk shibturn at gmail.com
Wed Nov 28 00:14:00 CET 2012
On 27/11/2012 10:49pm, Trent Nelson wrote:
>      Ideally, a Windows binary should make WSAPoll/select.poll()
>      available if running on Vista or above, without impacting
>      the ability to run on XP.

I assume you can do something like

     int WSAAPI (*pWSAPoll)(WSAPOLLFD *, ULONG, INT);
     HINSTANCE hWinsock2 = GetModuleHandle("WS2_32");
     *(FARPROC *)&pWSAPoll = GetProcAddress(hWinsock2, "WSAPoll");
     if (pWSAPoll == NULL)
         ...

to get a function pointer for WSAPoll on versions which support it.

Modules/_winapi.c does something similar to get CancelIoEx.

-- 
Richard

More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4