]> asedeno.scripts.mit.edu Git - PuTTY.git/blobdiff - winstuff.h
Joe Yates's memory leak patches.
[PuTTY.git] / winstuff.h
index 4bc90db264bb983f35d70cd9c7253e189fd8bde0..693fd42eb8cb2fe7cdc5d91f6082e4e9074aa51d 100644 (file)
@@ -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"
@@ -23,18 +27,15 @@ struct FontSpec {
     int charset;
 };
 
-struct dlgboxinfo {
-    int result;
-    int flags;
-};
-
+#define BOXFLAGS DLGWINDOWEXTRA
+#define BOXRESULT DLGWINDOWEXTRA + 4
 #define DF_END 0x0001
 
 /*
  * Global variables. Most modules declare these `extern', but
  * window.c will do `#define PUTTY_DO_GLOBALS' before including this
  * module, and so will get them properly defined.
- */
+*/
 #ifndef GLOBAL
 #ifdef PUTTY_DO_GLOBALS
 #define GLOBAL
@@ -70,11 +71,6 @@ typedef HDC Context;
  */
 GLOBAL HWND logbox;
 
-/*
- * Global structure to hold return values from the config box.
- */
-GLOBAL struct dlgboxinfo boxinfo;
-
 /*
  * The all-important instance handle.
  */
@@ -137,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.
  */
@@ -330,6 +343,9 @@ int SaneDialogBox(HINSTANCE hinst,
 
 void SaneEndDialog(HWND hwnd, int ret);
 
+extern OSVERSIONINFO osVersion;
+BOOL init_winver(void);
+
 /*
  * Exports from sizetip.c.
  */