Click here to Skip to main content
15,886,137 members
Articles / Programming Languages / C++

System Information Utility

Rate me:
Please Sign up or sign in to vote.
4.95/5 (12 votes)
17 Apr 2001 500.6K   8.6K   107  
Utility to extract system information
#pragma once

#include <string>
using namespace std;

typedef struct tagPROTOCOL_ATTRIB
{
	string Name;			// Name of the Protocol
	short Version;			// Protocol version
	string ProviderID;		// GUID of the Provider
	long CatalogEntryId;	// Unique Catalog Entry ID
	short Protocol;			// Protocol value
	short ByteOrder;		// Network byte order (LITTLEENDIAN, BIGENDIAN)
	long MinSockAddress;	// Min Socket Address
	long MaxSockAddress;	// Max Socket Address
	short AddressFamily;	// Address Family For Protocol
	short SecurityScheme;	// Security Scheme Used By Protocol
} PROTOCOL_ATTRIB;

class __declspec(dllexport) CSocketUtility
{
public:
	CSocketUtility(void);
	virtual ~CSocketUtility(void);
	bool Startup(void);
	bool ShutDown(void);
protected:
	long m_nRefCount;
public:
	bool GetIPAddress(const string& strHost, string& strAddress);
protected:
	// Windows Socket Version Used
	string m_strWSVersion;
	// Highest Version Of Windows Scoket That Can Be Used
	string m_strWSHiVersion;
public:
	bool GetWinSockVersion(string& strWSVersion, string& strWSHiVersion);
	bool GetIPInterfaces(void);
	bool IsInitialized(void);
	// Function enumerates all the availabe transport protocols
	bool EnumProtocols(long &lNumProtocols, PROTOCOL_ATTRIB **pAttributes);
};

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.

License

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


Written By
United States United States
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions