mirror of
https://git.tartarus.org/simon/putty.git
synced 2025-07-14 01:27:35 -05:00
The WinSock library is now loaded at run-time, which means we can
attempt to load WS2 and then fall back to WS1 if that fails. This should allow us to use WS2-specific functionality to find out the local system's list of IP addresses, thus fixing winnet-if2lo, while degrading gracefully back to the previous behaviour if that functionality is unavailable. (I haven't yet actually done this; I've just laid the groundwork.) This checkin _may_ cause instability; it seemed fine to me on initial testing, but it's a bit of an upheaval and I wouldn't like to make bets on it just yet. [originally from svn r3502]
This commit is contained in:
21
winstuff.h
21
winstuff.h
@ -5,6 +5,10 @@
|
||||
#ifndef PUTTY_WINSTUFF_H
|
||||
#define PUTTY_WINSTUFF_H
|
||||
|
||||
#ifndef AUTO_WINSOCK
|
||||
#include <winsock2.h>
|
||||
#endif
|
||||
#include <windows.h>
|
||||
#include <stdio.h> /* for FILENAME_MAX */
|
||||
|
||||
#include "tree234.h"
|
||||
@ -129,6 +133,23 @@ GLOBAL void *logctx;
|
||||
#define FILTER_WAVE_FILES ("Wave Files (*.wav)\0*.WAV\0" \
|
||||
"All Files (*.*)\0*\0\0\0")
|
||||
|
||||
/*
|
||||
* winnet.c dynamically loads WinSock 2 or WinSock 1 depending on
|
||||
* what it can get, which means any WinSock routines used outside
|
||||
* that module must be exported from it as function pointers. So
|
||||
* here they are.
|
||||
*/
|
||||
extern int (WINAPI *p_WSAAsyncSelect)
|
||||
(SOCKET s, HWND hWnd, u_int wMsg, long lEvent);
|
||||
extern int (WINAPI *p_WSAEventSelect)
|
||||
(SOCKET s, WSAEVENT hEventObject, long lNetworkEvents);
|
||||
extern int (WINAPI *p_select)
|
||||
(int nfds, fd_set FAR * readfds, fd_set FAR * writefds,
|
||||
fd_set FAR *exceptfds, const struct timeval FAR * timeout);
|
||||
extern int (WINAPI *p_WSAGetLastError)(void);
|
||||
extern int (WINAPI *p_WSAEnumNetworkEvents)
|
||||
(SOCKET s, WSAEVENT hEventObject, LPWSANETWORKEVENTS lpNetworkEvents);
|
||||
|
||||
/*
|
||||
* Exports from winctrls.c.
|
||||
*/
|
||||
|
Reference in New Issue
Block a user