• Welcome to Valhalla Legends Archive.
 

System/Winsock Functions

Started by Sargera, September 14, 2004, 02:38 PM

Previous topic - Next topic

Sargera

What functions (for Windows NT 5.0+) are there for getting system information such as amount of memory, type of processor, etc.?  Additionally, what functions are there for getting information on a current connection on a socket (Winsock) such as connection uptime, packets sent/received, etc..  I know that some of this information I'd like to get from functions could be done logically with just basic code, but I'd like to know if there are actual functions for getting this information, and information related to it.

Sargera

#1
Hmm, found this: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/sysinfo/base/system_information_functions.asp

But if there are any other functions that you know of, please submit them here.  I still don't see functions for getting the amount of memory on the computer, or what kind of processor the system is running.

UserLoser.

#2
For system information, and things like amount of memory, see: GetSystemInfo, GlobalMemoryStatus. AFAIK, there are no Winsock API functions which keep track of the amount of data sent/received, along with the uptime of the connection.  Also, Depends on what you want to know about the connection, few examples which retrieve information about the connection: if you want to get your local ip, use getsockname(), if you want to get the remote host ip, use getpeername().  Much much more information on here

dxoigmn


K

you can get all sorts of information about the system using WMI, but I've never tried to implement it in C/C++ -- it looks tedious and difficult.

Skywing

Quote from: K on September 14, 2004, 05:33 PM
you can get all sorts of information about the system using WMI, but I've never tried to implement it in C/C++ -- it looks tedious and difficult.

WMI is definitely designed for access from scripting languages (or languages with extensive built-in COM support).

You can usually get whatever WMI can give you from other sources, so in most cases it's a good idea to avoid using WMI from C/C++.

Sargera

What method is used to get the processor brand, model, and speed?

dxoigmn


UserLoser.

Quote from: dxoigmn on September 14, 2004, 11:51 PM

Google told me: http://www.experts-exchange.com/Programming/Programming_Platforms/Win_Prog/Q_20305588.html

Perhaps you should share a suscription login to that website, since it's quite usless and just shows somebody asking a question

K

#9
Quote from: UserLoser. on September 15, 2004, 01:51 PM
Quote from: dxoigmn on September 14, 2004, 11:51 PM

Google told me: http://www.experts-exchange.com/Programming/Programming_Platforms/Win_Prog/Q_20305588.html



Perhaps you should share a suscription login to that website, since it's quite usless and just shows somebody asking a question

Scroll down past the ads.  ::)

dxoigmn


UserLoser.

Quote from: K on September 15, 2004, 02:19 PM
Quote from: UserLoser. on September 15, 2004, 01:51 PM
Quote from: dxoigmn on September 14, 2004, 11:51 PM

Google told me: http://www.experts-exchange.com/Programming/Programming_Platforms/Win_Prog/Q_20305588.html



Perhaps you should share a suscription login to that website, since it's quite usless and just shows somebody asking a question

Scroll down past the ads.  ::)

I went ther twice or so, and didn't  bother to keep scrolling after i saw ads/other stuff, oops.

thetempest

hey,

long time since i've been here.  But this is a program that i've been using for a long time, its like netstat, but it tells you what programs are bound to what ports and what not.

It's called, FPORT, and its by foundstone Inc.  I thought they released the source, but i guess i got them confused with someone else.

Perhaps you can look at the Import Address Table to see what API functions they use, if any.

Just thought i'd let you know,
http://www.foundstone.com/index.htm?subnav=resources/navigation.htm&subcontent=/resources/proddesc/fport.htm