ReactOS 0.4.15-dev-5836-g942b022
tnclass.cpp
Go to the documentation of this file.
1
2//Telnet Win32 : an ANSI telnet client.
3//Copyright (C) 1998 Paul Brannan
4//Copyright (C) 1998 I.Ioannou
5//Copyright (C) 1997 Brad Johnson
6//
7//This program is free software; you can redistribute it and/or
8//modify it under the terms of the GNU General Public License
9//as published by the Free Software Foundation; either version 2
10//of the License, or (at your option) any later version.
11//
12//This program is distributed in the hope that it will be useful,
13//but WITHOUT ANY WARRANTY; without even the implied warranty of
14//MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15//GNU General Public License for more details.
16//
17//You should have received a copy of the GNU General Public License
18//along with this program; if not, write to the Free Software
19//Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
20//
21//I.Ioannou
22//roryt@hol.gr
23//
25
27//
28// Module: tnclass.cpp
29//
30// Contents: telnet object definition
31//
32// Product: telnet
33//
34// Revisions: August 30, 1998 Paul Brannan <pbranna@clemson.edu>
35// July 12, 1998 Paul Brannan
36// June 15, 1998 Paul Brannan
37// May 14, 1998 Paul Brannan
38// 5.April.1997 jbj@nounname.com
39// 14.Sept.1996 jbj@nounname.com
40// Version 2.0
41//
43
44#include "precomp.h"
45
46// Mingw32 needs these (Paul Brannan 9/4/98)
47#ifndef ICON_SMALL
48#define ICON_SMALL 0
49#endif
50#ifndef ICON_BIG
51#define ICON_BIG 1
52#endif
53
54// Ioannou Dec. 8, 1998
55#ifdef __BORLANDC__
56#ifndef WM_SETICON
57#define WM_SETICON STM_SETICON
58#endif
59#endif
60
61// DoInit() - performs initialization that is common to both the
62// constructors (Paul Brannan 6/15/98)
65 bConnected = 0;
66 bNetPaused = 1;
67 bNetFinished = 1;
68 bNetFinish = 0;
69 hThread = 0; // Sam Robertson 12/7/98
70 hProcess = 0;
71
72 WSADATA WsaData;
73
74 // Set the title
75 telSetConsoleTitle("No Connection");
76
77 // Change the icon
80
81 if (WSAStartup(MAKEWORD(1, 1), &WsaData)) {
82 DWORD dwLastError = GetLastError();
83 printm(0, FALSE, MSG_ERROR, "WSAStartup()");
84 printm(0, TRUE, dwLastError);
85 bWinsockUp = 0;
86 return;
87 }
88 bWinsockUp = 1;
89
90 // Get keyfile (Paul Brannan 5/12/98)
91 const char *keyfile = ini.get_keyfile();
92
93 // This should be changed later to use the Tnerror routines
94 // This has been done (Paul Brannan 6/5/98)
95 if(LoadKeyMap( keyfile, ini.get_default_config()) != 1)
96 // printf("Error loading keymap.\n");
98}
99
101MapLoader(KeyTrans, Charmap),
103TelHandler(Network, Console, Parser),
104ThreadParams(TelHandler),
105Clipboard(TelnetGetConsoleWindow(), Network),
106Mouse(Clipboard),
107Scroller(Mouse, ini.get_scroll_size()),
108Parser(Console, KeyTrans, Scroller, Network, Charmap) {
109 DoInit();
110}
111
112Telnet::Telnet(const char * szHost1, const char *strPort1):
113MapLoader(KeyTrans, Charmap),
115TelHandler(Network, Console, Parser),
116ThreadParams(TelHandler),
117Clipboard(TelnetGetConsoleWindow(), Network),
118Mouse(Clipboard),
119Scroller(Mouse, ini.get_scroll_size()),
120Parser(Console, KeyTrans, Scroller, Network, Charmap) {
121 DoInit();
122 Open( szHost1, strPort1);
123}
124
126 if (bWinsockUp){
127 if(bConnected) Close();
128 WSACleanup();
129 }
130
131 // Paul Brannan 8/10/98
132 if(iconChange) {
134 }
135
136}
137
138// changed from char * to const char * (Paul Brannan 5/12/98)
139int Telnet::LoadKeyMap(const char * file, const char * name){
140 // printf("Loading %s from %s.\n", name ,file);
142 return MapLoader.Load(file,name);
143}
144
145void Telnet::DisplayKeyMap(){ // display available keymaps
147};
148
149int Telnet::SwitchKeyMap(int to) { // switch to selected keymap
150 int ret = KeyTrans.SwitchTo(to);
151 switch(ret) {
152 case -1: printm(0, FALSE, MSG_KEYNOKEYMAPS); break;
153 case 0: printm(0, FALSE, MSG_KEYBADMAP); break;
154 case 1: printm(0, FALSE, MSG_KEYMAPSWITCHED); break;
155 }
156 return ret;
157};
158
159
160int Telnet::Open(const char *szHost1, const char *strPort1){
161 if (bWinsockUp && !bConnected){
162 telSetConsoleTitle(szHost1);
163
164 strncpy (szHost,szHost1, 127);
165 strncpy(strPort, strPort1, sizeof(strPort));
166
167 // Determine whether to pipe to an executable or use our own sockets
168 // (Paul Brannan March 18, 1999)
169 const char *netpipe;
170 if(*(netpipe=ini.get_netpipe())) {
172 HANDLE hInWrite, hOutRead, hErrRead;
173 if(!CreateHiddenConsoleProcess(netpipe, &pi, &hInWrite,
174 &hOutRead, &hErrRead)) {
176 return TNNOCON;
177 }
178 Network.SetPipe(hOutRead, hInWrite);
179 hProcess = pi.hProcess;
180 } else {
181 Socket = Connect();
182 if (Socket == INVALID_SOCKET) {
184 return TNNOCON;
185 }
188 }
189
190 bNetFinish = 0;
191 bConnected = 1;
198 DWORD idThread;
199
200 // Disable Ctrl-break (PB 5/14/98);
201 // Fixed (Thomas Briggs 8/17/98)
204
205 hThread = CreateThread(0, 0,
207 (LPVOID)&ThreadParams, 0, &idThread);
208 // This helps the display thread a little (Paul Brannan 8/3/98)
210 return Resume();
211 } else if(bWinsockUp && bConnected) {
213 }
214
215 return TNNOCON; // cannot do winsock stuff or already connected
216}
217
218// There seems to be a bug with MSVC's optimization. This turns them off
219// for these two functions.
220// (Paul Brannan 5/14/98)
221#ifdef _MSC_VER
222#pragma optimize("", off)
223#endif
224
225
227 Console.sync();
228 switch(Network.get_net_type()) {
229 case TN_NETSOCKET:
232 break;
233 case TN_NETPIPE:
234 if(hProcess != 0) {
237 hProcess = 0;
238 }
239 break;
240 }
241
242 // Enable Ctrl-break (PB 5/14/98);
243 // Ioannou : this must be FALSE
245
246 if (hThread) CloseHandle(hThread); // Paul Brannan 8/11/98
247 hThread = NULL; // Daniel Straub 11/12/98
248
250 bNetFinish = 1;
251 while (!bNetFinished)
252 Sleep (0); // give up our time slice- this lets our connection thread
253 // finish itself, so we don't hang -crn@ozemail.com.au
254 telSetConsoleTitle("No Connection");
255 bConnected = 0;
256 return 1;
257}
258
260 int i;
261 if (bConnected) {
262 Console.sync();
263 for(;;){
267 if (i) bConnected = 1;
268 else bConnected = 0;
271 while (!bNetPaused)
272 Sleep (0); // give up our time slice- this lets our connection thread
273 // unpause itself, so we don't hang -crn@ozemail.com.au
274 switch (i){
275 case TNNOCON:
276 Close();
277 return TNDONE;
278 case TNPROMPT:
279 return TNPROMPT;
280 case TNSCROLLBACK:
282 break;
283 case TNSPAWN:
284 NewProcess();
285 }
286 }
287 }
288 return TNNOCON;
289}
290
291// Turn optimization back on (Paul Brannan 5/12/98)
292#ifdef _MSC_VER
293#pragma optimize("", on)
294#endif
295
296// The scrollback functions have been moved to TScroll.cpp
297// (Paul Brannan 6/15/98)
299{
300 SOCKET Socket1 = socket(AF_INET, SOCK_STREAM, 0);
301 SOCKADDR_IN SockAddr;
302 SockAddr.sin_family = AF_INET;
303 SockAddr.sin_addr.s_addr = inet_addr(szHost);
304
305 // determine the port correctly -crn@ozemail.com.au 15/12/98
306 SERVENT *sp;
307 sp = getservbyname (strPort, "tcp");
308 if (sp == NULL) {
309 if (isdigit (*(strPort)))
310 SockAddr.sin_port = htons(atoi(strPort));
311 else {
313 return INVALID_SOCKET;
314 }
315 } else
316 SockAddr.sin_port = sp->s_port;
318
319 // Were we given host name?
320 if (SockAddr.sin_addr.s_addr == INADDR_NONE) {
321
322 // Resolve host name to IP address.
324 hostent* pHostEnt = gethostbyname(szHost);
325 if (!pHostEnt)
326 return INVALID_SOCKET;
327 printit("\n");
328
329 SockAddr.sin_addr.s_addr = *(DWORD*)pHostEnt->h_addr;
330 }
331
332 // Print a message telling the user the IP we are connecting to
333 // (Paul Brannan 5/14/98)
334 char ss_b1[4], ss_b2[4], ss_b3[4], ss_b4[4], ss_b5[12];
335 itoa(SockAddr.sin_addr.S_un.S_un_b.s_b1, ss_b1, 10);
336 itoa(SockAddr.sin_addr.S_un.S_un_b.s_b2, ss_b2, 10);
337 itoa(SockAddr.sin_addr.S_un.S_un_b.s_b3, ss_b3, 10);
338 itoa(SockAddr.sin_addr.S_un.S_un_b.s_b4, ss_b4, 10);
339 itoa(ntohs(SockAddr.sin_port), ss_b5, 10);
340 printm(0, FALSE, MSG_TRYING, ss_b1, ss_b2, ss_b3, ss_b4, ss_b5);
341
342 if (connect(Socket1, (sockaddr*)&SockAddr, sizeof(SockAddr)))
343 return INVALID_SOCKET;
344
345 char esc[2];
346 esc [0] = ini.get_escape_key();
347 esc [1] = 0;
348 printm(0, FALSE, MSG_CONNECTED, szHost, esc);
349
350 return Socket1;
351}
352
353void Telnet::telSetConsoleTitle(const char * szHost1)
354{
355 char szTitle[128] = "Telnet - ";
356 strcat(szTitle, szHost1);
358}
359
361 char cmd_line[MAX_PATH*2];
363
364 strcpy(cmd_line, ini.get_startdir());
365 strcat(cmd_line, ini.get_exename()); // Thomas Briggs 12/7/98
366
367 if(!SpawnProcess(cmd_line, &pi)) printm(0, FALSE, MSG_NOSPAWN);
368}
369
371 SOCKADDR_IN SockAddr;
372 int size = sizeof(SOCKADDR_IN);
373 memset(&SockAddr, 0, sizeof(SockAddr));
374 SockAddr.sin_family = AF_INET;
375
376 getsockname(Network.GetSocket(), (sockaddr*)&SockAddr, &size);
377 char ss_b1[4], ss_b2[4], ss_b3[4], ss_b4[4];
378 itoa(SockAddr.sin_addr.S_un.S_un_b.s_b1, ss_b1, 10);
379 itoa(SockAddr.sin_addr.S_un.S_un_b.s_b2, ss_b2, 10);
380 itoa(SockAddr.sin_addr.S_un.S_un_b.s_b3, ss_b3, 10);
381 itoa(SockAddr.sin_addr.S_un.S_un_b.s_b4, ss_b4, 10);
382
383 char addr[40];
384 strcpy(addr, ss_b1);
385 strcat(addr, ".");
386 strcat(addr, ss_b2);
387 strcat(addr, ".");
388 strcat(addr, ss_b3);
389 strcat(addr, ".");
390 strcat(addr, ss_b4);
391 strcat(addr, ":0.0");
392
394}
395
CConsole Console
char * strcat(char *DstString, const char *SrcString)
Definition: utclib.c:568
#define isdigit(c)
Definition: acclib.h:68
char * strcpy(char *DstString, const char *SrcString)
Definition: utclib.c:388
char * strncpy(char *DstString, const char *SrcString, ACPI_SIZE Count)
Definition: utclib.c:427
#define INADDR_NONE
Definition: tcp.c:42
#define MSG_ERRPIPE
Definition: resource.h:26
#define MSG_KEYMAP
Definition: resource.h:16
#define MSG_TRYING
Definition: resource.h:13
#define MSG_ALREADYCONNECTED
Definition: resource.h:28
#define MSG_NOSPAWN
Definition: resource.h:22
#define MSG_CONNECTED
Definition: resource.h:14
#define MSG_KEYBADMAP
Definition: resource.h:49
#define MSG_KEYNOKEYMAPS
Definition: resource.h:47
#define MSG_ERROR
Definition: resource.h:10
#define MSG_NOSERVICE
Definition: resource.h:24
#define MSG_ERRKEYMAP
Definition: resource.h:17
#define MSG_KEYMAPSWITCHED
Definition: resource.h:50
#define MSG_RESOLVING
Definition: resource.h:23
HANDLE WINAPI GetStdHandle(IN DWORD nStdHandle)
Definition: console.c:203
int SwitchTo(int)
Definition: keytrans.cpp:82
const char * get_exename() const
Definition: tnconfig.h:33
char get_escape_key() const
Definition: tnconfig.h:82
bool get_disable_break() const
Definition: tnconfig.h:48
bool get_set_title() const
Definition: tnconfig.h:55
const char * get_default_config() const
Definition: tnconfig.h:39
bool get_control_break_as_c() const
Definition: tnconfig.h:61
const char * get_keyfile() const
Definition: tnconfig.h:34
const char * get_netpipe() const
Definition: tnconfig.h:98
const char * get_startdir() const
Definition: tnconfig.h:32
void sync()
Definition: tconsole.cpp:109
int Load(const char *filename, const char *szKeysetName)
Definition: tmapldr.cpp:466
void Display()
Definition: tmapldr.cpp:741
void SetSocket(SOCKET s)
Definition: tnetwork.cpp:40
void SetLocalAddress(char *buf)
Definition: tnetwork.cpp:88
SOCKET GetSocket()
Definition: tnetwork.h:29
NetworkType get_net_type()
Definition: tnetwork.h:35
void SetPipe(HANDLE pIn, HANDLE pOut)
Definition: tnetwork.cpp:46
void ScrollBack()
Definition: tscroll.cpp:163
NetParams p
Definition: tparams.h:19
bool iconChange
Definition: tnclass.h:63
Telnet()
Definition: tnclass.cpp:100
int SwitchKeyMap(int)
Definition: tnclass.cpp:149
TelThreadParams ThreadParams
Definition: tnclass.h:55
Tnclip Clipboard
Definition: tnclass.h:56
void DoInit()
Definition: tnclass.cpp:63
HWND hConsoleWindow
Definition: tnclass.h:61
int Resume()
Definition: tnclass.cpp:259
volatile int bNetFinished
Definition: tnclass.h:44
int Close()
Definition: tnclass.cpp:226
volatile int bConnected
Definition: tnclass.h:41
void NewProcess()
Definition: tnclass.cpp:360
SOCKET Socket
Definition: tnclass.h:38
LPARAM oldBIcon
Definition: tnclass.h:62
volatile int bNetFinish
Definition: tnclass.h:45
volatile int bWinsockUp
Definition: tnclass.h:42
int LoadKeyMap(const char *file, const char *name)
Definition: tnclass.cpp:139
HANDLE hThread
Definition: tnclass.h:65
void telSetConsoleTitle(const char *szHost)
Definition: tnclass.cpp:353
LPARAM oldSIcon
Definition: tnclass.h:62
SOCKET Connect()
Definition: tnclass.cpp:298
TConsole Console
Definition: tnclass.h:53
~Telnet()
Definition: tnclass.cpp:125
KeyTranslator KeyTrans
Definition: tnclass.h:51
TMouse Mouse
Definition: tnclass.h:57
TMapLoader MapLoader
Definition: tnclass.h:52
int Open(const char *szHost, const char *strPort="23")
Definition: tnclass.cpp:160
HANDLE hProcess
Definition: tnclass.h:66
char strPort[32]
Definition: tnclass.h:39
char szHost[127]
Definition: tnclass.h:40
void SetLocalAddress(SOCKET s)
Definition: tnclass.cpp:370
TNetwork Network
Definition: tnclass.h:49
void DisplayKeyMap()
Definition: tnclass.cpp:145
TScroller Scroller
Definition: tnclass.h:58
volatile int bNetPaused
Definition: tnclass.h:43
@ Network
#define NULL
Definition: types.h:112
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
#define CloseHandle
Definition: compat.h:739
#define MAX_PATH
Definition: compat.h:34
BOOL WINAPI DECLSPEC_HOTPATCH SetConsoleCtrlHandler(PHANDLER_ROUTINE HandlerRoutine, BOOL Add)
Definition: console.c:2109
BOOL WINAPI TerminateProcess(IN HANDLE hProcess, IN UINT uExitCode)
Definition: proc.c:1532
BOOL WINAPI SetThreadPriority(IN HANDLE hThread, IN int nPriority)
Definition: thread.c:700
HANDLE WINAPI DECLSPEC_HOTPATCH CreateThread(IN LPSECURITY_ATTRIBUTES lpThreadAttributes, IN DWORD dwStackSize, IN LPTHREAD_START_ROUTINE lpStartAddress, IN LPVOID lpParameter, IN DWORD dwCreationFlags, OUT LPDWORD lpThreadId)
Definition: thread.c:137
INT WINAPI WSAStartup(IN WORD wVersionRequested, OUT LPWSADATA lpWSAData)
Definition: startup.c:113
#define SOCK_STREAM
Definition: tcpip.h:118
#define AF_INET
Definition: tcpip.h:117
unsigned long DWORD
Definition: ntddk_ex.h:95
PHOSTENT WSAAPI gethostbyname(IN const char FAR *name)
Definition: getxbyxx.c:221
PSERVENT WSAAPI getservbyname(IN const char FAR *name, IN const char FAR *proto)
Definition: getxbyxx.c:500
GLdouble s
Definition: gl.h:2039
GLsizeiptr size
Definition: glext.h:5919
GLenum const GLvoid * addr
Definition: glext.h:9621
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
@ Mouse
Definition: i8042prt.h:116
_Check_return_ int __cdecl atoi(_In_z_ const char *_Str)
_CRTIMP char *__cdecl itoa(_In_ int _Val, _Pre_notnull_ _Post_z_ char *_DstBuf, _In_ int _Radix)
#define inet_addr(cp)
Definition: inet.h:98
#define Open
Definition: syshdrs.h:62
TCHAR szTitle[MAX_LOADSTRING]
Definition: magnifier.c:35
#define htons(x)
Definition: module.h:213
#define ntohs(x)
Definition: module.h:208
static const WCHAR sp[]
Definition: suminfo.c:287
static refpint_t pi[]
Definition: server.c:96
#define closesocket
Definition: ncftp.h:477
#define memset(x, y, z)
Definition: compat.h:39
INT WSAAPI getsockname(IN SOCKET s, OUT LPSOCKADDR name, IN OUT INT FAR *namelen)
Definition: sockctrl.c:213
SOCKET WSAAPI socket(IN INT af, IN INT type, IN INT protocol)
Definition: socklife.c:143
volatile int * bNetPaused
Definition: tparams.h:8
HANDLE hExit
Definition: tparams.h:6
volatile int * bNetFinish
Definition: tparams.h:10
HANDLE hPause
Definition: tparams.h:7
volatile int * bNetFinished
Definition: tparams.h:9
HANDLE hUnPause
Definition: tparams.h:7
Definition: fci.c:127
Definition: name.c:39
struct in_addr sin_addr
Definition: winsock.h:512
short sin_family
Definition: winsock.h:510
u_short sin_port
Definition: winsock.h:511
VOID WINAPI DECLSPEC_HOTPATCH Sleep(IN DWORD dwMilliseconds)
Definition: synch.c:790
BOOL WINAPI DECLSPEC_HOTPATCH SetEvent(IN HANDLE hEvent)
Definition: synch.c:733
BOOL WINAPI DECLSPEC_HOTPATCH ResetEvent(IN HANDLE hEvent)
Definition: synch.c:714
int telProcessConsole(NetParams *pParams, KeyTranslator &KeyTrans, TConsole &Console, TNetwork &Network, TMouse &Mouse, Tnclip &Clipboard, HANDLE hThread)
Definition: tncon.cpp:199
BOOL WINAPI ControlEventHandler(DWORD event)
Definition: tncon.cpp:357
@ TNNOCON
Definition: tncon.h:15
@ TNSCROLLBACK
Definition: tncon.h:17
@ TNPROMPT
Definition: tncon.h:16
@ TNDONE
Definition: tncon.h:19
@ TNSPAWN
Definition: tncon.h:18
TConfig ini
Definition: tnconfig.cpp:45
int printit(const char *it)
Definition: tnerror.cpp:58
int printm(LPTSTR szModule, BOOL fSystem, DWORD dwMessageId,...)
Definition: tnerror.cpp:84
@ TN_NETSOCKET
Definition: tnetwork.h:8
@ TN_NETPIPE
Definition: tnetwork.h:8
bool SetIcon(HWND hConsoleWindow, HANDLE hIcon, LPARAM *pOldBIcon, LPARAM *pOldSIcon, const char *icondir)
Definition: tnmisc.cpp:136
HWND TelnetGetConsoleWindow()
Definition: tnmisc.cpp:115
BOOL CreateHiddenConsoleProcess(LPCTSTR szChildName, PROCESS_INFORMATION *ppi, LPHANDLE phInWrite, LPHANDLE phOutRead, LPHANDLE phErrRead)
Definition: tnmisc.cpp:5
void ResetIcon(HWND hConsoleWindow, LPARAM oldBIcon, LPARAM oldSIcon)
Definition: tnmisc.cpp:179
BOOL SpawnProcess(char *cmd_line, PROCESS_INFORMATION *pi)
Definition: tnmisc.cpp:87
DWORD WINAPI telProcessNetwork(LPVOID lpParameter)
Definition: ttelhndl.cpp:479
#define MAKEWORD(a, b)
Definition: typedefs.h:248
int ret
#define STD_OUTPUT_HANDLE
Definition: winbase.h:268
DWORD WINAPI GetLastError(void)
Definition: except.c:1040
#define CreateEvent
Definition: winbase.h:3619
#define THREAD_PRIORITY_ABOVE_NORMAL
Definition: winbase.h:275
#define SetConsoleTitle
Definition: wincon.h:783
int PASCAL FAR WSACleanup(void)
Definition: startup.c:60
#define INVALID_SOCKET
Definition: winsock.h:332
struct sockaddr_in SOCKADDR_IN
Definition: winsock.h:487
UINT_PTR SOCKET
Definition: winsock.h:47