Click here to Skip to main content
12,752,835 members (40,149 online)
Click here to Skip to main content


99 bookmarked
Posted 27 Oct 2001

How to write a simple but effective TCP/IP port scanner for Win32

, 27 Oct 2001
An article on how to write a TCP/IP port scanner with a GUI, based on the MFC's property sheet paradigm
	Definizione dei tipi (CRT).
	Luca Piergentili, 27/07/93
#ifndef _TYPEDEF_H
#define _TYPEDEF_H 1

#ifndef _BOOL_TYPE
	#ifdef _WINDOWS
		#include "window.h"
		typedef int BOOL;
		#define TRUE 1
		#define FALSE 0
	#define _BOOL_TYPE 1

	tipi specifici per Win32
#ifndef _WINDOWS
	#ifdef WIN32
		#define VOID
		#define FAR
		#define NEAR
		#define PASCAL
		#define CDECL
		#define VOID			void
		#define FAR			far
		#define NEAR			near
		#define PASCAL			pascal
		#define CDECL			_cdecl

	typedef unsigned char		BYTE;
	typedef unsigned short int	WORD;
	typedef unsigned long		DWORD;
	typedef unsigned int		UINT;
	typedef signed short		HWND;
	typedef signed long			HANDLE;
	#ifdef STRICT
		typedef signed long		LONG;
		#define LONG long
	typedef char NEAR*			PSTR;
	typedef char NEAR*			NPSTR;
	typedef char FAR*			LPSTR;
	typedef const char FAR*		LPCSTR;
	typedef BYTE NEAR*			PBYTE;
	typedef BYTE FAR*			LPBYTE;
	typedef int NEAR*			PINT;
	typedef int FAR*			LPINT;
	typedef WORD NEAR*			PWORD;
	typedef WORD FAR*			LPWORD;
	typedef long NEAR*			PLONG;
	typedef long FAR*			LPLONG;
	typedef DWORD NEAR*			PDWORD;
	typedef DWORD FAR*			LPDWORD;
	typedef void FAR*			LPVOID;

	#define LOBYTE(w)			((BYTE)(w))
	#define HIBYTE(w)			((BYTE)(((UINT)(w) >> 8) & 0xff))
	#define LOWORD(l)			((WORD)(DWORD)(l))
	#define HIWORD(l)			((WORD)((((DWORD)(l)) >> 16) & 0xffff))
	#define MAKELONG(l,h)		((LONG)(((WORD)(l)) | (((DWORD)((WORD)(h))) << 16)))
	#define MAKELP(sel,off)		((void FAR*)MAKELONG((off),(sel)))
	#define SELECTOROF(lp)		HIWORD(lp)
	#define OFFSETOF(lp)		LOWORD(lp)
#endif /* _WINDOWS */

	valori massimi per Win32
#define BYTE_MAX				0xff
#define WORD_MAX				0xffff
#define DWORD_MAX				0xffffffff

	tipo per il puntatore a funzione per le callback

#endif /* _TYPEDEF_H */

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.


This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here


About the Author

Luca Piergentili
Web Developer
Italy Italy
I like C and C++, Acid Jazz, James Brown, gli Spaghetti Aglio e Olio, alla Bolognesa, alla Puttanesca e le Fettuccine alla Matriciana ('Maccaroni' over the world). Of course I like beautiful big tits girls too, my little car, Frank Zappa, the art of Zen, italian coffee and much more...

You may also be interested in...

Permalink | Advertise | Privacy | Terms of Use | Mobile
Web02 | 2.8.170217.1 | Last Updated 28 Oct 2001
Article Copyright 2001 by Luca Piergentili
Everything else Copyright © CodeProject, 1999-2017
Layout: fixed | fluid